Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp716087lqt; Tue, 19 Mar 2024 01:12:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVO4qS+aDWKFeaGjxKb/Z+xF3o1exrOX1EhmLpBSEpQ3Kt/i2sRh3AhAaNU7oyR6qXbJaYDiOc0Z4Oe9Pi7XEGv3VmymQNmxvqzHpvUNQ== X-Google-Smtp-Source: AGHT+IG3q7/RByPpGF9lSwn3UkJ3WIom2NCdjsxmkVV5qQinv9looO+D3v7YcK4zfpod80JmdP4t X-Received: by 2002:a05:6870:2315:b0:221:5c49:5d02 with SMTP id w21-20020a056870231500b002215c495d02mr13896513oao.51.1710835943019; Tue, 19 Mar 2024 01:12:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710835942; cv=pass; d=google.com; s=arc-20160816; b=0MGjJnvNbEmF9eZjjHIu9EjAI/d9K7xGxGm3kQBUslC+Y+MXp3SlXue28cyPz5T8BR yyZPL1iNvdS2eaLnSPg7KXPU9CBvwJauiTJwF7S95uS8pCXu2Qp2bSewVe62WbyouICZ H+7tF+qmBy0JbDrWkUVPURuLqEtWZTou9QWaZ4/SRrMGYvLnwGekNKBnTBIk+zX2Jf3z vNQWAcE6iAOXqq5PdbaXVGGSsXV54CQENSm59G6c+DVJ+ZZ0eCmiKvZNSh9x5Dhfj1sD abYuFrTSr/l4MF2wJFkHLLBSfdVPiRsAP+OsRtOkZf4XdEnv4UU1OjDvnduVqFX1pfMX ogoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=12Yk9NUVZULBnT3CUj2dd87Iq5RU3+k40GQsCCF2+IA=; fh=g+3Y9uv4pDRPkMKV6d1r8xi8IY9qiW75WcU571FAbLY=; b=xuMSyVvljWz+j4Rc84NtFlFDGbjvjktK3w8mC9/tjeEk91OCg74I2xe4gzX5COzKTh INFgrp3b45bkq/TXU0INyl5O+i4MeA7f4A+INJ465NeyAN7FQ4e/loEF+3jfypPfC81w 1cLGi2Le0Y327HxvTuHzcHDS1GsdA5gTh1Sfh+m1KvXsWHWuQtqDSoWymB16oZ+rV40j WDwm/MVU1RmWLWI3XehTnuWWcfjbBbyDflH4zaOtIqFkJK8ZFJdOmPPLHcTkaL754cug SVn0FvK/4MSSAvXXdOm+Q/oUILHcgcirNrG+Uxa/9wCzN3AZ3HPBRwmHNd/hDRtpgT28 VK7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="GVttem/y"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-4882-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4882-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 204-20020a6300d5000000b005d549553c07si9526271pga.598.2024.03.19.01.12.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 01:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4882-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="GVttem/y"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-4882-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4882-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A3C8F282E5A for ; Tue, 19 Mar 2024 08:12:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2AF4065190; Tue, 19 Mar 2024 08:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GVttem/y" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 512D253814 for ; Tue, 19 Mar 2024 08:10:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710835847; cv=none; b=TtFmySVa7V8FYK/HHRWqRr+08E7arxk9f1pfR4q1QoUC1TAGlzfK/M6yX0DV/Ly6phaWVCKndMQr8BqOd9Rk4THtZ/RpraZsVVsnDbSg3bPIFmfSIeNk/H7VyMBsPNE9cyHJaQYrjbHynB3nLlVrYppSnugLFgH8PwqMhyB0Q8Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710835847; c=relaxed/simple; bh=pozbJHoxw9jFIbXWHkfN9Y1LgMzeAdYghmwfzLemInE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ano1o9bvHiQdErbN+rWGclXxFythceYFvGte5H+GkTimTIIOFJ4nCONntS16KXhXYtwYIumc3yZwK0+7whx+9VY3Qk+25yoJOZzc1Z0CcUpXO9HH1fNoWuoS+qCN94fb/jIb3sk7hfUoRiONCNk/6iJfRQlcWMkCyVXZfYFbBJ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GVttem/y; arc=none smtp.client-ip=198.175.65.17 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710835844; x=1742371844; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pozbJHoxw9jFIbXWHkfN9Y1LgMzeAdYghmwfzLemInE=; b=GVttem/yxeMW4uWisrl9jpQ8c49fHHhrR91EpOu3UUQKwu7LjHPeEwT0 HupVClwMc2VUtb0j8cyOaI14ydtqv1PmOsE3DihD5J9oLyDgmX49QJpKP VdrFm6KBWoDV9m++he/91RjLXSyZDShlYSWu9tKSYd/BWSMep99jO5Tj0 BDNXzKug6814bC4H4YCmX/QFOq87B9zccwQBVWPIAv4ouhnN3wwOddz9z bkI6WowDU/tsmKRGMwdLOgMsX1bdbvqrAAGCAMqWUVmUFfFipOhwo0uT/ M5oeOiqXqVN6oC181lQr40FqcxFnAqlJyIC/aKvvaaf2fVMgc4ajL/hIg A==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5810519" X-IronPort-AV: E=Sophos;i="6.07,136,1708416000"; d="scan'208";a="5810519" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 01:10:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,136,1708416000"; d="scan'208";a="18447564" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 01:10:42 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ilan Peer Subject: [PATCH 02/15] wifi: iwlwifi: mvm: Add debugfs entry for triggering internal MLO scan Date: Tue, 19 Mar 2024 10:10:14 +0200 Message-Id: <20240319100755.3dd3e8c42c27.I9434dc641b837601c72f10684fbfad2c0fb31a99@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240319081027.3853611-1-miriam.rachel.korenblit@intel.com> References: <20240319081027.3853611-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Content-Transfer-Encoding: 8bit From: Ilan Peer Signed-off-by: Ilan Peer Signed-off-by: Miri Korenblit --- .../wireless/intel/iwlwifi/mvm/debugfs-vif.c | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c index ea5488721977..3d272b3bed4e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c @@ -692,6 +692,60 @@ static ssize_t iwl_dbgfs_quota_min_read(struct file *file, return simple_read_from_buffer(user_buf, count, ppos, buf, len); } +static ssize_t iwl_dbgfs_int_mlo_scan_write(struct ieee80211_vif *vif, + char *buf, size_t count, + loff_t *ppos) +{ + struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); + struct iwl_mvm *mvm = mvmvif->mvm; + u32 action; + int ret; + + if (!vif->cfg.assoc || !ieee80211_vif_is_mld(vif)) + return -EINVAL; + + if (kstrtou32(buf, 0, &action)) + return -EINVAL; + + mutex_lock(&mvm->mutex); + + if (!action) { + ret = iwl_mvm_scan_stop(mvm, IWL_MVM_SCAN_INT_MLO, false); + } else if (action == 1) { + struct ieee80211_channel *channels[IEEE80211_MLD_MAX_NUM_LINKS]; + unsigned long usable_links = ieee80211_vif_usable_links(vif); + size_t n_channels = 0; + u8 link_id; + + rcu_read_lock(); + + for_each_set_bit(link_id, &usable_links, + IEEE80211_MLD_MAX_NUM_LINKS) { + struct ieee80211_bss_conf *link_conf = + rcu_dereference(vif->link_conf[link_id]); + + if (WARN_ON_ONCE(!link_conf)) + continue; + + channels[n_channels++] = link_conf->chanreq.oper.chan; + } + + rcu_read_unlock(); + + if (n_channels) + ret = iwl_mvm_int_mlo_scan_start(mvm, vif, channels, + n_channels); + else + ret = -EINVAL; + } else { + ret = -EINVAL; + } + + mutex_unlock(&mvm->mutex); + + return ret ?: count; +} + #define MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz) \ _MVM_DEBUGFS_WRITE_FILE_OPS(name, bufsz, struct ieee80211_vif) #define MVM_DEBUGFS_READ_WRITE_FILE_OPS(name, bufsz) \ @@ -711,6 +765,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(uapsd_misbehaving, 20); MVM_DEBUGFS_READ_WRITE_FILE_OPS(rx_phyinfo, 10); MVM_DEBUGFS_READ_WRITE_FILE_OPS(quota_min, 32); MVM_DEBUGFS_READ_FILE_OPS(os_device_timediff); +MVM_DEBUGFS_WRITE_FILE_OPS(int_mlo_scan, 32); void iwl_mvm_vif_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { @@ -738,6 +793,7 @@ void iwl_mvm_vif_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif) MVM_DEBUGFS_ADD_FILE_VIF(rx_phyinfo, mvmvif->dbgfs_dir, 0600); MVM_DEBUGFS_ADD_FILE_VIF(quota_min, mvmvif->dbgfs_dir, 0600); MVM_DEBUGFS_ADD_FILE_VIF(os_device_timediff, mvmvif->dbgfs_dir, 0400); + MVM_DEBUGFS_ADD_FILE_VIF(int_mlo_scan, mvmvif->dbgfs_dir, 0200); if (vif->type == NL80211_IFTYPE_STATION && !vif->p2p && mvmvif == mvm->bf_allowed_vif) -- 2.34.1