From patchwork Tue Feb 6 14:54:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 770601 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 678D412FF7C for ; Tue, 6 Feb 2024 14:54:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231268; cv=none; b=G9p/RWblNmDulY3KMAxcBjfYnj+N2IiL3nQcuSAMi6JgeiPfg74uOke6yDlW7Jsn5C5t7rKZYAVJM3je53t44DClqtNhG0jpaWa1Jw6QPnRMj4/6ZHLym0Hmu7ilN7G1Xd+GlPxF7Wsc6uJ5zLs5hTmB5rpd1egzsMwx3jN3Cfo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231268; c=relaxed/simple; bh=YhjBnTOz2cys/RE0TKMvtTeQDcrMLdICNmFhoY6w5UU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hrWccvJVHpmqVJBruv13cT72O8qmQXMoEPSzS7fyJNrMMGJUdPDLDC56180zlOSmLl99Quxwkvs2CTLDzHhDEZXNxG7HBsTFmacHYUrA5qYBSfOOBB6t3n9cAfH29uvWNjJbHCuWZDLZVU44I5jklhcMLKt/eo7HjBXtrBUzkaE= 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=VGbi8QRK; arc=none smtp.client-ip=192.198.163.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VGbi8QRK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707231266; x=1738767266; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YhjBnTOz2cys/RE0TKMvtTeQDcrMLdICNmFhoY6w5UU=; b=VGbi8QRKO9/iB+6aH8/1hxeoFP7pCoUvLPC0mxJ++JkP9poT5VMtD2mG d8UauV4pv8MnPz4p9etC7MS/i/TmIEHpyogKLPHJi9C6E03xsLdEkI2Y5 6o06e/T9GhosEYlvvV26WPgNP6fGMqaXKOA1XAuYAzwtXa/zivsg3eaDE tDTLRu42YJ6A1iAMgzg3Lfa5EW74ZDVHuPEbHn9pPFrjOZyXd/rs0LvA4 PO9C1C3YQyCWGa/27j7Ayf0JUTtOYMoOkQ/otSsYBNqAPBHaCgmxO8GRW M+hOm/mtDGBSct/mmwwTTRuUSVUfgKPSvQVQ6cMLIR9P9U61tcsqnxXEh g==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="917784" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="917784" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="824197907" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="824197907" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:24 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Andrei Otcheretianski Subject: [PATCH 1/8] wifi: mac80211_hwsim: Add 160MHz bw range to regdom_custom_04 Date: Tue, 6 Feb 2024 16:54:04 +0200 Message-Id: <20240206164849.1b9955e511f0.I5e5315e3a047db3677bfb5ead003a3a4f7d29b13@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206145411.3217588-1-miriam.rachel.korenblit@intel.com> References: <20240206145411.3217588-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 From: Andrei Otcheretianski This allows testing 160MHz channels with DFS concurrent. While at it, remove the TODO for adding a module param to enable NL80211_EXT_FEATURE_DFS_CONCURRENT. This is not really needed as mac80211_hwsim still needs to be loaded with custom regdom. Signed-off-by: Andrei Otcheretianski Signed-off-by: Miri Korenblit --- drivers/net/wireless/virtual/mac80211_hwsim.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index a06a462d38f0..3f7cb3568477 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -196,8 +196,11 @@ static const struct ieee80211_regdomain hwsim_world_regdom_custom_04 = { .reg_rules = { REG_RULE(2412 - 10, 2462 + 10, 40, 0, 20, 0), REG_RULE(2484 - 10, 2484 + 10, 40, 0, 20, 0), - REG_RULE(5150 - 10, 5240 + 10, 80, 0, 30, 0), + REG_RULE(5150 - 10, 5240 + 10, 80, 0, 30, NL80211_RRF_AUTO_BW), REG_RULE(5260 - 10, 5320 + 10, 80, 0, 30, + NL80211_RRF_DFS_CONCURRENT | NL80211_RRF_DFS | + NL80211_RRF_AUTO_BW), + REG_RULE(5500 - 10, 5720 + 10, 160, 0, 30, NL80211_RRF_DFS_CONCURRENT | NL80211_RRF_DFS), REG_RULE(5745 - 10, 5825 + 10, 80, 0, 30, 0), REG_RULE(5855 - 10, 5925 + 10, 80, 0, 33, 0), @@ -5386,7 +5389,6 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, schedule_timeout_interruptible(1); } - /* TODO: Add param */ wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_DFS_CONCURRENT); From patchwork Tue Feb 6 14:54:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 771286 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 89FD812FF7C for ; Tue, 6 Feb 2024 14:54:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231271; cv=none; b=PlpON+EYovonjb7YGzDA1TDc0yJtI0usg1T+4fo7LD3B5228yDNq5yL40QBEeqlZ7EeTeOcVeib/w6LmsCXe5xPOddWaxHJJ6QU7kyMLx3XFFWQ+F5iDun0T1u41JKd48ubcRLKig+E2TWYtxyB3EoprvCzFHSJvqoShGwZYH/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231271; c=relaxed/simple; bh=nBl41JxENQJfGp9n30Fw1Axl5NlHvCX5DRAMj+8gtD8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=DhVzDhILKGhM+rrXblPIWBP7E6ARcXBiNq61X7jzGJNFxmAtgCvJFHch3B5G+ZoBCLekLOYbcQD6N64Cs52NmGbOlCewHRjsv0rtJABqKIlxys+XobCMJ2913kSWoPupsU8P4bypiUgb3M4F6SnzUR1vdW5nK8cU9KOAJd7PYGg= 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=Uzltr2QI; arc=none smtp.client-ip=192.198.163.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Uzltr2QI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707231270; x=1738767270; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nBl41JxENQJfGp9n30Fw1Axl5NlHvCX5DRAMj+8gtD8=; b=Uzltr2QIX8Q0vpSNOvEOpvRckhBo+QbBYtCHbheMlxdf5s5Jagpl1VLq uRxPmtkqQG3E5EwHCZE9Ol9lIqIr/S3PBzGUQiRlCSpDhFU7PK8QzTakc hiiCo4dbJsOSmWN0z9UB7DQ5NZOOJ5cQtkFk4mI/4mT55ZZYJsziqnVXV /MB3o4Nztj1pIq6AItAES4sPa1FtSkEWJxrI/hntUVtFBcuQ1XJe8F7YR HYRKkU1E3cwbHHtqzUkGyAggx4mWJ+25i/y7YpoF2s2HDqT/8S2jBXQFM SSNHDCOhfJhFc+iC+VgDwqys5AoYkmRSYIV1Iqo6teeN5W818X2EzLlfU g==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="917791" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="917791" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="824197914" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="824197914" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:27 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Amosi Subject: [PATCH 2/8] wifi: mac80211: remove unnecessary chanreq compat check Date: Tue, 6 Feb 2024 16:54:05 +0200 Message-Id: <20240206164849.388898af2e66.I5b0c802f5164e94bff661900177956d6954f9a2d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206145411.3217588-1-miriam.rachel.korenblit@intel.com> References: <20240206145411.3217588-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 From: Daniel Amosi This conditions can never be true, because if it was true (either before or inside the loop) the code is already checking this. Signed-off-by: Daniel Amosi Signed-off-by: Miri Korenblit --- net/mac80211/chan.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/mac80211/chan.c b/net/mac80211/chan.c index ef4c2cebc080..f7ddfa329258 100644 --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c @@ -829,9 +829,6 @@ void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, } rcu_read_unlock(); - if (!compat) - return; - ieee80211_change_chanctx(local, ctx, ctx, compat); } From patchwork Tue Feb 6 14:54:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 770600 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 86B0813398A for ; Tue, 6 Feb 2024 14:54:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231273; cv=none; b=JvGewjuuKn1FMnPW9AS6NtcfdAHeFnEWh+yA3FiiIl2twiwGmyanfgCf0ZlagwjOMqR8Z0t1LQTctz6snC1uuBdFGyAGMoMbVUGWggtsu+n+Uh/SeFLczw/Ma9smkQN0OWnt9dzIvYNA6jugHSWQkuwmnrHc1DpB0v/VuAu0KKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231273; c=relaxed/simple; bh=4zBNbH9i4EHXb1cicpYj7BDPwRPkMoTNhD6B4zrRAe4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y27rJWO1kSZ4I2wBsbdBlq1vDxdzKlj03y2Bf+vsT787ID5dxuFFCUyjSCAQ0uUOnU9/lns8txR+rxLOkdsoRfHvtmEvWfkDIcb1oOHn5WhvsC/vQrk0eOIGyQgFr9Zp1pTdeEXSDsd6L6Jhtijm5EbpJjFCE/3mph2tzRQLTwU= 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=VkAxDUEr; arc=none smtp.client-ip=192.198.163.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VkAxDUEr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707231272; x=1738767272; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4zBNbH9i4EHXb1cicpYj7BDPwRPkMoTNhD6B4zrRAe4=; b=VkAxDUErUkDW3N8Im0fgXOHKPbctafze8La3i10UvH9gipiN6UJNqVMK 4f/Lt8/pqhYIHVQjEKw3vbt1so6Hjeq+jUHvSeGcXMfP1eazwf3QOl94k RzenAWhVy4mVoxR8Gk8cjiHiHw3N93hiMB+ytyuVAqhHRXoz8Us4HPeFd ZXh6vkiQDsdMmrrXl6HkRAK8dPNdYAMV2whOeiJvI+/mlyFBj0Xu899LQ nevNaqofC9pv1eRc88Ca+nnwoAkGmzH+ZoKu/Mfbbod/K6Je91h7NpvIY oEkVWjLkLNjKvaYx0ULjEsqobr8b4658csvqJOa0T1aDoQ/B6QShnhhjl w==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="917795" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="917795" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="824197922" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="824197922" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:29 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 3/8] wifi: mac80211: make associated BSS pointer visible to the driver Date: Tue, 6 Feb 2024 16:54:06 +0200 Message-Id: <20240206164849.6fe9782b87b4.Ifbffef638f07ca7f5c2b27f40d2cf2942d21de0b@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206145411.3217588-1-miriam.rachel.korenblit@intel.com> References: <20240206145411.3217588-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 Some drivers need the data in it, so move it to the link conf, which is exposed to the driver. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- include/net/mac80211.h | 3 +++ net/mac80211/mlme.c | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 8d6ae22c09bf..9c6ffdc248f0 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -539,6 +539,8 @@ struct ieee80211_fils_discovery { * to that BSS) that can change during the lifetime of the BSS. * * @vif: reference to owning VIF + * @bss: the cfg80211 bss descriptor. Valid only for a station, and only + * when associated. * @addr: (link) address used locally * @link_id: link ID, or 0 for non-MLO * @htc_trig_based_pkt_ext: default PE in 4us units, if BSS supports HE @@ -684,6 +686,7 @@ struct ieee80211_fils_discovery { */ struct ieee80211_bss_conf { struct ieee80211_vif *vif; + struct cfg80211_bss *bss; const u8 *bssid; unsigned int link_id; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index cc9a8eaffa6b..0a03b5bb2c5a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1857,7 +1857,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link, struct ieee80211_sub_if_data *sdata = link->sdata; struct ieee80211_local *local = sdata->local; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; - struct cfg80211_bss *cbss = link->u.mgd.bss; + struct cfg80211_bss *cbss = link->conf->bss; struct ieee80211_chanctx_conf *conf; struct ieee80211_chanctx *chanctx; enum nl80211_band current_band; @@ -2769,7 +2769,7 @@ static u64 ieee80211_link_set_associated(struct ieee80211_link_data *link, ieee80211_check_rate_mask(link); - link->u.mgd.bss = cbss; + link->conf->bss = cbss; memcpy(link->u.mgd.bssid, cbss->bssid, ETH_ALEN); if (sdata->vif.p2p || @@ -2917,7 +2917,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, ifmgd->associated = false; /* other links will be destroyed */ - sdata->deflink.u.mgd.bss = NULL; + sdata->deflink.conf->bss = NULL; netif_carrier_off(sdata->dev); @@ -3245,7 +3245,7 @@ static void ieee80211_mgd_probe_ap_send(struct ieee80211_sub_if_data *sdata) ieee80211_mlme_send_probe_req(sdata, sdata->vif.addr, dst, sdata->vif.cfg.ssid, sdata->vif.cfg.ssid_len, - sdata->deflink.u.mgd.bss->channel); + sdata->deflink.conf->bss->channel); } ifmgd->probe_timeout = jiffies + msecs_to_jiffies(probe_wait_ms); @@ -3328,7 +3328,7 @@ struct sk_buff *ieee80211_ap_probereq_get(struct ieee80211_hw *hw, return NULL; if (ifmgd->associated) - cbss = sdata->deflink.u.mgd.bss; + cbss = sdata->deflink.conf->bss; else if (ifmgd->auth_data) cbss = ifmgd->auth_data->bss; else if (ifmgd->assoc_data && ifmgd->assoc_data->link[0].bss) @@ -3407,8 +3407,8 @@ static void __ieee80211_disconnect(struct ieee80211_sub_if_data *sdata) link = sdata_dereference(sdata->link[link_id], sdata); if (!link) continue; - cfg80211_unlink_bss(local->hw.wiphy, link->u.mgd.bss); - link->u.mgd.bss = NULL; + cfg80211_unlink_bss(local->hw.wiphy, link->conf->bss); + link->conf->bss = NULL; } } @@ -6246,7 +6246,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link, } if (!ifmgd->associated || - !ieee80211_rx_our_beacon(bssid, link->u.mgd.bss)) + !ieee80211_rx_our_beacon(bssid, link->conf->bss)) return; bssid = link->u.mgd.bssid; @@ -6273,7 +6273,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_link_data *link, */ if (!ieee80211_is_s1g_beacon(hdr->frame_control)) ncrc = crc32_be(0, (void *)&mgmt->u.beacon.beacon_int, 4); - parse_params.bss = link->u.mgd.bss; + parse_params.bss = link->conf->bss; parse_params.filter = care_about_ies; parse_params.crc = ncrc; elems = ieee802_11_parse_elems_full(&parse_params); From patchwork Tue Feb 6 14:54:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 771285 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 2C4CD13398A for ; Tue, 6 Feb 2024 14:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231277; cv=none; b=oTt3pQDqLHmkIwp93/AHKsUe+Tluwpp4TdkT0x3W5bVXAKbE+ET5+vGphp/O6hkF1f2vEy5hhElyVeAWR3B1ESZivrB7ELbQaIZlRzaCih8unPFO+1cDBmetynxfbonoLfb5AdBBy869U9j6+ssVseoXwnyWCRSR6Jiyem/Y7JY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231277; c=relaxed/simple; bh=zJWBTDzaEx8JJySRXW5+9wEbode44+aZ8DUhyjcktQ4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aSqxWZRp1CuZPSLJ8YgaPZTxBV2zZ8QwNYGf1ClIjIAK4/RfCjjQVx1K8yXA2miMy2T+Jn+ThMNar9+DRbjrC5AXUEh9Q4yp6sq1Q2iBo1Y01l2eeILTeucew2CstRJNvCBhlF8nB1kMfx5Za0nD9r/UpjU/e1yDJ6As9irik+4= 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=hflc+Ate; arc=none smtp.client-ip=192.198.163.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hflc+Ate" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707231275; x=1738767275; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zJWBTDzaEx8JJySRXW5+9wEbode44+aZ8DUhyjcktQ4=; b=hflc+Aten/6WXD/KIYooIzbWthn5MefroJBN4n3h+ubGGIbtnVwVCrHe n1B3krGv+0eKCeguTPNMMOGHoaY5nsnXOo7tOii/4bUGCbHucsFw3ZBZ2 LPA69xs49fkN0AsVrTuZEQmGWaA44exR4pbd0cnhzIDG8xiCSAxIqqew4 L0nzh29ofLscDdwn7SIk4xRtfDVt50SYMnnBfsDGKiw6QOT38wqySnUXD 3Wh4aUlEq9F62IYCs1eX8J+ZhMfEL85weOvPhUfaBWboIQoBz3V2HBS+a G/GNwdePgb2N8Aep2NHekoiWA+CxUw7TPtwz5ITwVjNYN0ZaYb5G4mYjv A==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="917811" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="917811" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="824197930" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="824197930" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:32 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 4/8] wifi: cfg80211: rename UHB to 6 GHz Date: Tue, 6 Feb 2024 16:54:07 +0200 Message-Id: <20240206164849.c9cfb9400839.I153db3b951934a1d84409c17fbe1f1d1782543fa@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206145411.3217588-1-miriam.rachel.korenblit@intel.com> References: <20240206145411.3217588-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 From: Johannes Berg UHB stands for "Ultra High Band", but this term doesn't really exist in the spec. Rename all occurrences to "6 GHz", but keep a few defines for userspace API compatibility. Signed-off-by: Johannes Berg --- include/net/cfg80211.h | 10 +++++----- include/uapi/linux/nl80211.h | 31 ++++++++++++++++++++----------- net/wireless/nl80211.c | 8 ++++---- net/wireless/reg.c | 10 +++++----- net/wireless/scan.c | 8 ++++---- 5 files changed, 38 insertions(+), 29 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 51b9e6fa12f8..bac3d75ccded 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -118,9 +118,9 @@ struct wiphy; * restrictions. * @IEEE80211_CHAN_NO_EHT: EHT operation is not permitted on this channel. * @IEEE80211_CHAN_DFS_CONCURRENT: See %NL80211_RRF_DFS_CONCURRENT - * @IEEE80211_CHAN_NO_UHB_VLP_CLIENT: Client connection with VLP AP + * @IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT: Client connection with VLP AP * not permitted using this channel - * @IEEE80211_CHAN_NO_UHB_AFC_CLIENT: Client connection with AFC AP + * @IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT: Client connection with AFC AP * not permitted using this channel */ enum ieee80211_channel_flags { @@ -146,8 +146,8 @@ enum ieee80211_channel_flags { IEEE80211_CHAN_NO_320MHZ = 1<<19, IEEE80211_CHAN_NO_EHT = 1<<20, IEEE80211_CHAN_DFS_CONCURRENT = 1<<21, - IEEE80211_CHAN_NO_UHB_VLP_CLIENT= 1<<22, - IEEE80211_CHAN_NO_UHB_AFC_CLIENT= 1<<23, + IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT = 1<<22, + IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT = 1<<23, }; #define IEEE80211_CHAN_NO_HT40 \ @@ -4913,7 +4913,7 @@ struct cfg80211_ops { * enum wiphy_flags - wiphy capability flags * * @WIPHY_FLAG_SPLIT_SCAN_6GHZ: if set to true, the scan request will be split - * into two, first for legacy bands and second for UHB. + * into two, first for legacy bands and second for 6 GHz. * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this * wiphy at all * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 853ac538a686..2af018dfef39 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -11,7 +11,7 @@ * Copyright 2008 Jouni Malinen * Copyright 2008 Colin McCabe * Copyright 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -4268,9 +4268,9 @@ enum nl80211_wmm_rule { * allowed for peer-to-peer or adhoc communication under the control * of a DFS master which operates on the same channel (FCC-594280 D01 * Section B.3). Should be used together with %NL80211_RRF_DFS only. - * @NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT: Client connection to VLP AP + * @NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP * not allowed using this channel - * @NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT: Client connection to AFC AP + * @NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP * not allowed using this channel * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number * currently defined @@ -4312,8 +4312,8 @@ enum nl80211_frequency_attr { NL80211_FREQUENCY_ATTR_NO_EHT, NL80211_FREQUENCY_ATTR_PSD, NL80211_FREQUENCY_ATTR_DFS_CONCURRENT, - NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT, - NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT, + NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT, + NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT, /* keep last */ __NL80211_FREQUENCY_ATTR_AFTER_LAST, @@ -4326,6 +4326,10 @@ enum nl80211_frequency_attr { #define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR #define NL80211_FREQUENCY_ATTR_GO_CONCURRENT \ NL80211_FREQUENCY_ATTR_IR_CONCURRENT +#define NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT \ + NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT +#define NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT \ + NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT /** * enum nl80211_bitrate_attr - bitrate attributes @@ -4516,8 +4520,8 @@ enum nl80211_sched_scan_match_attr { peer-to-peer or adhoc communication under the control of a DFS master which operates on the same channel (FCC-594280 D01 Section B.3). Should be used together with %NL80211_RRF_DFS only. - * @NL80211_RRF_NO_UHB_VLP_CLIENT: Client connection to VLP AP not allowed - * @NL80211_RRF_NO_UHB_AFC_CLIENT: Client connection to AFC AP not allowed + * @NL80211_RRF_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP not allowed + * @NL80211_RRF_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP not allowed */ enum nl80211_reg_rule_flags { NL80211_RRF_NO_OFDM = 1<<0, @@ -4540,8 +4544,8 @@ enum nl80211_reg_rule_flags { NL80211_RRF_NO_EHT = 1<<19, NL80211_RRF_PSD = 1<<20, NL80211_RRF_DFS_CONCURRENT = 1<<21, - NL80211_RRF_NO_UHB_VLP_CLIENT = 1<<22, - NL80211_RRF_NO_UHB_AFC_CLIENT = 1<<23, + NL80211_RRF_NO_6GHZ_VLP_CLIENT = 1<<22, + NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1<<23, }; #define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR @@ -4550,6 +4554,8 @@ enum nl80211_reg_rule_flags { #define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\ NL80211_RRF_NO_HT40PLUS) #define NL80211_RRF_GO_CONCURRENT NL80211_RRF_IR_CONCURRENT +#define NL80211_RRF_NO_UHB_VLP_CLIENT NL80211_RRF_NO_6GHZ_VLP_CLIENT +#define NL80211_RRF_NO_UHB_AFC_CLIENT NL80211_RRF_NO_6GHZ_AFC_CLIENT /* For backport compatibility with older userspace */ #define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS) @@ -5097,14 +5103,17 @@ enum nl80211_bss_use_for { * BSS isn't possible * @NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY: NSTR nonprimary links aren't * supported by the device, and this BSS entry represents one. - * @NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH: STA is not supporting + * @NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH: STA is not supporting * the AP power type (SP, VLP, AP) that the AP uses. */ enum nl80211_bss_cannot_use_reasons { NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 1 << 0, - NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH = 1 << 1, + NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH = 1 << 1, }; +#define NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH \ + NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH + /** * enum nl80211_bss - netlink attributes for a BSS * diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 68c20409eca6..24d3b01cd000 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -1198,11 +1198,11 @@ static int nl80211_msg_put_channel(struct sk_buff *msg, struct wiphy *wiphy, if ((chan->flags & IEEE80211_CHAN_DFS_CONCURRENT) && nla_put_flag(msg, NL80211_FREQUENCY_ATTR_DFS_CONCURRENT)) goto nla_put_failure; - if ((chan->flags & IEEE80211_CHAN_NO_UHB_VLP_CLIENT) && - nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT)) + if ((chan->flags & IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT) && + nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT)) goto nla_put_failure; - if ((chan->flags & IEEE80211_CHAN_NO_UHB_AFC_CLIENT) && - nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT)) + if ((chan->flags & IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT) && + nla_put_flag(msg, NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT)) goto nla_put_failure; } diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 2741b626919a..50cadbad485f 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -5,7 +5,7 @@ * Copyright 2008-2011 Luis R. Rodriguez * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2017 Intel Deutschland GmbH - * Copyright (C) 2018 - 2023 Intel Corporation + * Copyright (C) 2018 - 2024 Intel Corporation * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1595,10 +1595,10 @@ static u32 map_regdom_flags(u32 rd_flags) channel_flags |= IEEE80211_CHAN_NO_EHT; if (rd_flags & NL80211_RRF_DFS_CONCURRENT) channel_flags |= IEEE80211_CHAN_DFS_CONCURRENT; - if (rd_flags & NL80211_RRF_NO_UHB_VLP_CLIENT) - channel_flags |= IEEE80211_CHAN_NO_UHB_VLP_CLIENT; - if (rd_flags & NL80211_RRF_NO_UHB_AFC_CLIENT) - channel_flags |= IEEE80211_CHAN_NO_UHB_AFC_CLIENT; + if (rd_flags & NL80211_RRF_NO_6GHZ_VLP_CLIENT) + channel_flags |= IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT; + if (rd_flags & NL80211_RRF_NO_6GHZ_AFC_CLIENT) + channel_flags |= IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT; if (rd_flags & NL80211_RRF_PSD) channel_flags |= IEEE80211_CHAN_PSD; return channel_flags; diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 6dd9df347771..663e19678d93 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -5,7 +5,7 @@ * Copyright 2008 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright 2016 Intel Deutschland GmbH - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation */ #include #include @@ -2984,9 +2984,9 @@ static bool cfg80211_uhb_power_type_valid(const u8 *ie, case IEEE80211_6GHZ_CTRL_REG_LPI_AP: return true; case IEEE80211_6GHZ_CTRL_REG_SP_AP: - return !(flags & IEEE80211_CHAN_NO_UHB_AFC_CLIENT); + return !(flags & IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT); case IEEE80211_6GHZ_CTRL_REG_VLP_AP: - return !(flags & IEEE80211_CHAN_NO_UHB_VLP_CLIENT); + return !(flags & IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT); } } return false; @@ -3055,7 +3055,7 @@ cfg80211_inform_single_bss_frame_data(struct wiphy *wiphy, data->restrict_use = 1; data->use_for = 0; data->cannot_use_reasons = - NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH; + NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH; } if (ext) { From patchwork Tue Feb 6 14:54:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 770599 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 23FC91339A1 for ; Tue, 6 Feb 2024 14:54:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231278; cv=none; b=VLXiBPYlWAFAnZU1hmqq9dbHfs4wc39A+0/cutxYQwqF8FcF1E5nT/Xygt8mdLDQDON52GxoRdOhTmb+7TUIVyRK4mqWPDl6OHEy/Fb6SEuzIo1HWz6gYDljkd1Q82HQlRZBsE0KXwGMjJfFX7mIU+Q5WKYHLIEStbGCZHkZWtQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231278; c=relaxed/simple; bh=a+uU5nMmXeYr2uno2PcybugAcB3ZlMj3ftTW3hpzoGs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=poZUKyhzlR0VComVAT8g8L+MEu0vJQBPHmxV2YV4Yvx/61E0O4GV5v/pQsHs/dOmj9Ca/hmkQw5PJq1wAy+ToxmXodM3zrAJdgzacJfFRbh30AenEczGWUGtNMw9xu8FrLvAffUT9rveeo3rw/huDvGgUdfzQenFLatgd7P4+UI= 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=SG6ESC3s; arc=none smtp.client-ip=192.198.163.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SG6ESC3s" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707231277; x=1738767277; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a+uU5nMmXeYr2uno2PcybugAcB3ZlMj3ftTW3hpzoGs=; b=SG6ESC3sgx7HxGizV1Hiw7vFO/LPIilIRp5dafKcGdUTChyc8BtQYJuD gSADzgvXuM4b+ON9H8RiQYpSAfu8O060OW+fNSt3douUoLzoWi6oUMw75 zFH6G0UjDHo2eYZ7E6WwOFgan3+IOXJQrwPkEY0//d19xpX/HZ98zoJVJ bg0aps5beX/77uLbupNbkUkNEgKupR43mim7o9nXxgWJwbiPDabKTqe75 M9sisVwuYb68J1IH0lQyBtH6LGaZlR81mAOaeLtnVpSL3omJw/qbobHSU VrvloUMjtW1miovJDvpDminodTa7YV6a4qfKsio0G16rn/XHok7zWqkeK Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="917820" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="917820" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="824197944" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="824197944" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:35 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 5/8] wifi: cfg80211: optionally support monitor on disabled channels Date: Tue, 6 Feb 2024 16:54:08 +0200 Message-Id: <20240206164849.87fad3a21a09.I9116b2fdc2e2c9fd59a9273a64db7fcb41fc0328@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206145411.3217588-1-miriam.rachel.korenblit@intel.com> References: <20240206145411.3217588-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 From: Johannes Berg If the hardware supports a disabled channel, it may in some cases be possible to use monitor mode (without any transmit) on it when it's otherwise disabled. Add a new channel flag IEEE80211_CHAN_CAN_MONITOR that makes it possible for a driver to indicate such a thing. Make it per channel so drivers could have a choice with it, perhaps it's only possible on some channels, perhaps some channels are not supported at all, but still there and marked disabled. In _nl80211_parse_chandef() simplify the code and check only for an unknown channel, _cfg80211_chandef_usable() will later check for IEEE80211_CHAN_DISABLED anyway. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- include/net/cfg80211.h | 4 ++++ include/uapi/linux/nl80211.h | 4 ++++ net/wireless/chan.c | 26 +++++++++++++++++++------- net/wireless/core.h | 5 ++++- net/wireless/nl80211.c | 27 ++++++++++++++++++--------- 5 files changed, 49 insertions(+), 17 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index bac3d75ccded..69e50bc2aa43 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -122,6 +122,9 @@ struct wiphy; * not permitted using this channel * @IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT: Client connection with AFC AP * not permitted using this channel + * @IEEE80211_CHAN_CAN_MONITOR: This channel can be used for monitor + * mode even in the presence of other (regulatory) restrictions, + * even if it is otherwise disabled. */ enum ieee80211_channel_flags { IEEE80211_CHAN_DISABLED = 1<<0, @@ -148,6 +151,7 @@ enum ieee80211_channel_flags { IEEE80211_CHAN_DFS_CONCURRENT = 1<<21, IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT = 1<<22, IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT = 1<<23, + IEEE80211_CHAN_CAN_MONITOR = 1<<24, }; #define IEEE80211_CHAN_NO_HT40 \ diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 2af018dfef39..0cac86d090c8 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -4272,6 +4272,9 @@ enum nl80211_wmm_rule { * not allowed using this channel * @NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP * not allowed using this channel + * @NL80211_FREQUENCY_ATTR_CAN_MONITOR: This channel can be used in monitor + * mode despite other (regulatory) restrictions, even if the channel is + * otherwise completely disabled. * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number * currently defined * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use @@ -4314,6 +4317,7 @@ enum nl80211_frequency_attr { NL80211_FREQUENCY_ATTR_DFS_CONCURRENT, NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT, NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT, + NL80211_FREQUENCY_ATTR_CAN_MONITOR, /* keep last */ __NL80211_FREQUENCY_ATTR_AFTER_LAST, diff --git a/net/wireless/chan.c b/net/wireless/chan.c index ceb9174c5c3d..1839a4827fce 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -1047,7 +1047,7 @@ EXPORT_SYMBOL(cfg80211_chandef_dfs_cac_time); static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy, u32 center_freq, u32 bandwidth, - u32 prohibited_flags) + u32 prohibited_flags, bool monitor) { struct ieee80211_channel *c; u32 freq, start_freq, end_freq; @@ -1057,7 +1057,11 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy, for (freq = start_freq; freq <= end_freq; freq += MHZ_TO_KHZ(20)) { c = ieee80211_get_channel_khz(wiphy, freq); - if (!c || c->flags & prohibited_flags) + if (!c) + return false; + if (monitor && c->flags & IEEE80211_CHAN_CAN_MONITOR) + continue; + if (c->flags & prohibited_flags) return false; } @@ -1117,9 +1121,9 @@ static bool cfg80211_edmg_usable(struct wiphy *wiphy, u8 edmg_channels, return true; } -bool cfg80211_chandef_usable(struct wiphy *wiphy, - const struct cfg80211_chan_def *chandef, - u32 prohibited_flags) +bool _cfg80211_chandef_usable(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef, + u32 prohibited_flags, bool monitor) { struct ieee80211_sta_ht_cap *ht_cap; struct ieee80211_sta_vht_cap *vht_cap; @@ -1281,14 +1285,22 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy, if (!cfg80211_secondary_chans_ok(wiphy, ieee80211_chandef_to_khz(chandef), - width, prohibited_flags)) + width, prohibited_flags, monitor)) return false; if (!chandef->center_freq2) return true; return cfg80211_secondary_chans_ok(wiphy, MHZ_TO_KHZ(chandef->center_freq2), - width, prohibited_flags); + width, prohibited_flags, monitor); +} + +bool cfg80211_chandef_usable(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef, + u32 prohibited_flags) +{ + return _cfg80211_chandef_usable(wiphy, chandef, prohibited_flags, + false); } EXPORT_SYMBOL(cfg80211_chandef_usable); diff --git a/net/wireless/core.h b/net/wireless/core.h index debf63e6c61f..118f2f619828 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h @@ -3,7 +3,7 @@ * Wireless configuration interface internals. * * Copyright 2006-2010 Johannes Berg - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation */ #ifndef __NET_WIRELESS_CORE_H #define __NET_WIRELESS_CORE_H @@ -492,6 +492,9 @@ bool cfg80211_is_sub_chan(struct cfg80211_chan_def *chandef, bool cfg80211_wdev_on_sub_chan(struct wireless_dev *wdev, struct ieee80211_channel *chan, bool primary_only); +bool _cfg80211_chandef_usable(struct wiphy *wiphy, + const struct cfg80211_chan_def *chandef, + u32 prohibited_flags, bool monitor); static inline unsigned int elapsed_jiffies_msecs(unsigned long start) { diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 24d3b01cd000..40b4405d15bd 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -3233,9 +3233,9 @@ static int nl80211_parse_punct_bitmap(struct cfg80211_registered_device *rdev, return 0; } -int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, - struct genl_info *info, - struct cfg80211_chan_def *chandef) +static int _nl80211_parse_chandef(struct cfg80211_registered_device *rdev, + struct genl_info *info, bool monitor, + struct cfg80211_chan_def *chandef) { struct netlink_ext_ack *extack = info->extack; struct nlattr **attrs = info->attrs; @@ -3260,10 +3260,9 @@ int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, chandef->freq1_offset = control_freq % 1000; chandef->center_freq2 = 0; - /* Primary channel not allowed */ - if (!chandef->chan || chandef->chan->flags & IEEE80211_CHAN_DISABLED) { + if (!chandef->chan) { NL_SET_ERR_MSG_ATTR(extack, attrs[NL80211_ATTR_WIPHY_FREQ], - "Channel is disabled"); + "Unknown channel"); return -EINVAL; } @@ -3345,8 +3344,9 @@ int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, return -EINVAL; } - if (!cfg80211_chandef_usable(&rdev->wiphy, chandef, - IEEE80211_CHAN_DISABLED)) { + if (!_cfg80211_chandef_usable(&rdev->wiphy, chandef, + IEEE80211_CHAN_DISABLED, + monitor)) { NL_SET_ERR_MSG(extack, "(extension) channel is disabled"); return -EINVAL; } @@ -3361,6 +3361,13 @@ int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, return 0; } +int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, + struct genl_info *info, + struct cfg80211_chan_def *chandef) +{ + return _nl80211_parse_chandef(rdev, info, false, chandef); +} + static int __nl80211_set_channel(struct cfg80211_registered_device *rdev, struct net_device *dev, struct genl_info *info, @@ -3385,7 +3392,9 @@ static int __nl80211_set_channel(struct cfg80211_registered_device *rdev, link_id = 0; } - result = nl80211_parse_chandef(rdev, info, &chandef); + result = _nl80211_parse_chandef(rdev, info, + iftype == NL80211_IFTYPE_MONITOR, + &chandef); if (result) return result; From patchwork Tue Feb 6 14:54:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 771284 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 18BAB13473F for ; Tue, 6 Feb 2024 14:54:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231280; cv=none; b=rqC+CC8Xmc+GtoJPTMuh0TgPxFogWKX6TaKLXbb1EoOxS7qdwbOi5mz7Js8P+P4PhMHwutjJ0FfXVh0qy8/cMkU34wGTKMvNB0r0wp8tTMxC0J91uyLvijDNvDdZPlTQSPRJLAHT3Q6cC2tZxTAvcal6raMpiGD8OBjhWXm89s0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231280; c=relaxed/simple; bh=mx3bXq841Ulj/a1gi+PsJ3DUTCk1V3xyn6I3ZUYNDwk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=U9JU+WHLPKy3XJu2lFEjgJoS0Z/K8fqiQUDO6HWuKEkIfBQxEQmyB170xa3fl5XrJHGTcs2nbs0reVyLZex7YcqIsovR0BLtwXylIdJG+rTnWS2bT2nPTjrjEan/ND4Ag0GQl1ulOjgwi0KO9jmgNNRSuL15W31JEbKiNVJHSa4= 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=OPq+nhSg; arc=none smtp.client-ip=192.198.163.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="OPq+nhSg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707231279; x=1738767279; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mx3bXq841Ulj/a1gi+PsJ3DUTCk1V3xyn6I3ZUYNDwk=; b=OPq+nhSgVbD+q6r3opVKRvjr4ZmOjVc4r9y1UFNqbVl8ddKc5tFGsGOT i1C0/+QdCaxl2AuiFrG5OFyyq/+6md9HBYJXlNrFG7pkRnSbqls8fmaBo xhrC4+COfFhzGpKGNFO/qvbmls0UKFWOnaTTddzDx2iTgPsnIi8IDO76a eu8J/tl6WeQOGtDD9ETVRnx4rEk1+41+PwMCJbXlYllb4cm0QfOvtK2Uu 71tMPUS1xqDa3n1J+YdPoNPinO9AnqEZ+sxCk6BB4mKqSG0UFX7zKj+5I WKVaoQxiepRERaO9mUgeuaVC8w74z8i7i4RKB3T8zh2aSy0D1byFfZVP3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="917827" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="917827" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="824197958" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="824197958" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:37 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 6/8] wifi: mac80211: drop injection on disabled-chan monitor Date: Tue, 6 Feb 2024 16:54:09 +0200 Message-Id: <20240206164849.9c03dcf67dbe.Ib86a851c274c440908c663f6dd774b79bfc3965d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206145411.3217588-1-miriam.rachel.korenblit@intel.com> References: <20240206145411.3217588-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 From: Johannes Berg If the driver uses the new IEEE80211_CHAN_CAN_MONITOR, we may monitor on channels that are, e.g. via regulatory, otherwise considered disabled. However, we really shouldn't transmit on them, so prevent that. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/tx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 68a48abc7287..02ef09edb9e4 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -5,7 +5,7 @@ * Copyright 2006-2007 Jiri Benc * Copyright 2007 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation * * Transmit and frame generation functions. */ @@ -2398,6 +2398,14 @@ netdev_tx_t ieee80211_monitor_start_xmit(struct sk_buff *skb, else goto fail_rcu; + /* + * If driver/HW supports IEEE80211_CHAN_CAN_MONITOR we still + * shouldn't transmit on disabled channels. + */ + if (!cfg80211_chandef_usable(local->hw.wiphy, chandef, + IEEE80211_CHAN_DISABLED)) + goto fail_rcu; + /* * Frame injection is not allowed if beaconing is not allowed * or if we need radar detection. Beaconing is usually not allowed when From patchwork Tue Feb 6 14:54:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 770598 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 A8EB213474E for ; Tue, 6 Feb 2024 14:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231283; cv=none; b=ia/lp9w2Wnly4J+lOBImpKsMsXM/eoHT4cnX1xV0TSQQdUjgq/cJvNYlBXEJQRzKXn5QRLdzacVmY5HhC0stHGxgd5BjEu1z+M1BozZdKyXFlLWpJBYi16/VdjOGDmbGbeHyGwdytGcSRidI2p/pze7xQA7Z7cLwZ90TnRzY5z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231283; c=relaxed/simple; bh=MVBfkWYChY6wIF3NbaqebONg6Bf5AJ9iBScXBDJEfTE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e2H8893xxHnVgtxuQgBZURN/YDOFtIqvkvRxlfi/0nYzVv3xZK4z1rU+7aXrt7Rwfm0xlftrIhHPAJsDR6lSKRVztT4Keaq8eTdAdAYsn80XGwVeyCzjTOmtE3YiUcU8X8JgrrCUhoAISb4yNLAKVNfw9w5kHMbaMbQwVEiurFg= 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=aEMEKWRP; arc=none smtp.client-ip=192.198.163.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="aEMEKWRP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707231282; x=1738767282; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MVBfkWYChY6wIF3NbaqebONg6Bf5AJ9iBScXBDJEfTE=; b=aEMEKWRPpX+F+cMXxjZggekusMdSpkBJjnmhFxfFG13ZUI+lgFQxBEzT kM06jygfoofAdNBymOa+six4GB+QBbjCCW0mUuuk8HBFjZmMFXsslwqwJ Hzh9sdwUyWBeT5WXW7PkhHq5c1ePKeHdFq+hlexbHRJs1SqYW7RvGfwwD 06vJBH0931JgovRWFBehz/S6xJOA+jsgRs/JUdo8ZN/kfZr+oE+VHv/1T PY1iHkRTAzzY11e8o/wsCGpArqxFYNoQTywqzP6OVWweG1wZiwfz8pMEs wZnpqQg71I+5UAK0kkJb/Bis2xi9alqXRgMZIsQwFk4aKThGwb9zBwcpw A==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="917831" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="917831" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="824197961" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="824197961" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:39 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Shaul Triebitz Subject: [PATCH 7/8] wifi: nl80211: add WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC Date: Tue, 6 Feb 2024 16:54:10 +0200 Message-Id: <20240206164849.8dc9ad531a17.I7f8e926adf927f762e11aaa3458f6354665c7fc5@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206145411.3217588-1-miriam.rachel.korenblit@intel.com> References: <20240206145411.3217588-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 From: Shaul Triebitz Add a report reason for waking up due to an uprotected deauth/disassoc in MFP. If setting wowlan to wake on disconnection, and an unprotected deatuh/disassoc arrived (in MFP), some drivers might want to report UNPROTECTED_DEAUTH_DISASSOC (and not DISASSOC). Add support for that. Signed-off-by: Shaul Triebitz Signed-off-by: Miri Korenblit --- include/uapi/linux/nl80211.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 0cac86d090c8..88af476bb8ff 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -5756,6 +5756,8 @@ struct nl80211_pattern_support { * %NL80211_ATTR_SCAN_FREQUENCIES contains more than one * frequency, it means that the match occurred in more than one * channel. + * @NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC: For wakeup reporting only. + * Wake up happened due to unprotected deauth or disassoc frame in MFP. * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number * @@ -5783,6 +5785,7 @@ enum nl80211_wowlan_triggers { NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS, NL80211_WOWLAN_TRIG_NET_DETECT, NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS, + NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC, /* keep last */ NUM_NL80211_WOWLAN_TRIG, From patchwork Tue Feb 6 14:54:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 771283 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (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 8431013474B for ; Tue, 6 Feb 2024 14:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231285; cv=none; b=T6ZO8scrdITtDZHwutnveNNMSHvNW3S/AUEJ17QSn44yckbc4DAsNQ6p9dxbCcMcHnD50YY8mdNMnEjENDCuRs/W2foj8C9h40v+MBfuuM/tWJZym3tDE61SAkajRkgTB+RwlxqHNNjBCWND0pSJMjcpIOVEwiKp5yaka0PJ/wM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231285; c=relaxed/simple; bh=6O1y6Qmi/IMLrZ21sKCvCQMcOzC2jHDEHub++mAi2xc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=llNyTEjouhgmJbqyzaeEMhUujydJPk3p4gWjP/l6sTwyf5RbM5zqQ9+sReNoKmKoKgqLZBmM452Ru+Mli+Js6oG1gmZyx89URA4XqDaZHbLTGRl+qFb2sdes2bAFx2T97Wdq/NsB1Z7Pw9Y5BjZK9BqSEDHLYp7qZQ2HaNvKTKE= 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=RQf5SZOH; arc=none smtp.client-ip=192.198.163.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RQf5SZOH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1707231284; x=1738767284; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6O1y6Qmi/IMLrZ21sKCvCQMcOzC2jHDEHub++mAi2xc=; b=RQf5SZOHkj3AGoWn2YDl0YRcnpi3y17zKzgpigBPBeUXheEbpzt6GTpp CYgU05xhPWq3r2a609GfuIbD8Rcy8DZZjBCNM4rjrTNFOBM2ldZnhrwBp j5CBWJTGFA3l6fZApfu+zABHEWb5bgTGJNAzXp4uwhcmZI6j1fteM7yJN CjdcSr4bpJXw0HWxieB1ZxEU5AFI2RGPiDUnK2v66UEGCbIrwGo0BPJC2 68auhmykRkpXJO8LaSuMg/K0oQN9eM/p2iKzbv0Y2WtYF1AWVEEsAM/Ii N3r1dJ/+hsuc415Uh7XvphGW2dUu+igRvLMM2/eLSDWxaKYVN3XyIrILF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="917836" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="917836" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10975"; a="824197967" X-IronPort-AV: E=Sophos;i="6.05,247,1701158400"; d="scan'208";a="824197967" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2024 06:54:41 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Shaul Triebitz Subject: [PATCH 8/8] wifi: cfg80211: report unprotected deauth/disassoc in wowlan Date: Tue, 6 Feb 2024 16:54:11 +0200 Message-Id: <20240206164849.a3d739850d03.I8f52a21c4f36d1af1f8068bed79e2f9cbf8289ef@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240206145411.3217588-1-miriam.rachel.korenblit@intel.com> References: <20240206145411.3217588-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 From: Shaul Triebitz Add to cfg80211_wowlan_wakeup another wakeup reason - unprot_deauth_disassoc. To be set to true if the woke up was due to an unprotected deauth or disassoc frame in MFP. In that case, propegate WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC. Signed-off-by: Shaul Triebitz Signed-off-by: Miri Korenblit --- include/net/cfg80211.h | 5 ++++- net/wireless/nl80211.c | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 69e50bc2aa43..e154218ebc39 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -3590,12 +3590,15 @@ struct cfg80211_wowlan_nd_info { * @tcp_connlost: TCP connection lost or failed to establish * @tcp_nomoretokens: TCP data ran out of tokens * @net_detect: if not %NULL, woke up because of net detect + * @unprot_deauth_disassoc: woke up due to unprotected deauth or + * disassoc frame (in MFP). */ struct cfg80211_wowlan_wakeup { bool disconnect, magic_pkt, gtk_rekey_failure, eap_identity_req, four_way_handshake, rfkill_release, packet_80211, - tcp_match, tcp_connlost, tcp_nomoretokens; + tcp_match, tcp_connlost, tcp_nomoretokens, + unprot_deauth_disassoc; s32 pattern_idx; u32 packet_present_len, packet_len; const void *packet; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 40b4405d15bd..358dae67924d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -19852,6 +19852,11 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS)) goto free_msg; + if (wakeup->unprot_deauth_disassoc && + nla_put_flag(msg, + NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC)) + goto free_msg; + if (wakeup->packet) { u32 pkt_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211; u32 len_attr = NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN;