From patchwork Mon Mar 18 16:53:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595614 X-Patchwork-Delegate: johannes@sipsolutions.net 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 B64C754BCB for ; Mon, 18 Mar 2024 16:53:44 +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=1710780826; cv=none; b=OGbj/JE0gro6/fnh3iRKJmTaIkp94Zfsbno4v4MdqRATJ8nmqxgzvog+8lkL0z+JyIOmGZlfnUKQpWYInONU2P2XaZYcomDI73O7HS2ZsIrzm08mkgMcsaLvDDqa7w0M8JM6j0ARCSK92uQMEWaxRMCN5p+LiH0eblKBPCZykkE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780826; c=relaxed/simple; bh=LC7KSzX8Asy1IJyThL538uB12yz1fIdl+eE35n42N6U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kWE1DTySeHwqmaF/YRj59CCc6TAajCsnFR+gCkzi5/1JaHw8D4F4nSmd7UpenrO40v0wYf18ysY6C+ghu+96WyXIKlHVoVCEwEwYv7BYStiubVRt0jjJA6iAA4l0uIY0rRA14Z1Lf1Cu0DdXtndoMllwYuWhu3ulCctaevBL4mQ= 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=kxdi2Mw6; 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="kxdi2Mw6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780825; x=1742316825; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=LC7KSzX8Asy1IJyThL538uB12yz1fIdl+eE35n42N6U=; b=kxdi2Mw6gjswgR6dJ4JyWQ8T2Dy+RbNP6jiRjKL1e1h4I9Ul4UVWaIox zHDOh2kAs1VaffB8GClnLnZZweB+AEAAFwNnxo+BCJvN28DiH1AmRs/5F PLiysEsfbVxJzJuo0NbbvhL1JlnShN2fRheUZt455eQ7sTzSBCxG677JJ eAdEsSQ8SWcJ1OIS2jaf+wMCmx8SYF9FAtIuWBLRIH0spB3JnobI21Op8 71UhTXwRDPyQ03GobnWMlen/C6rqu19jIbJVL7j+peXr19GFrDb4S8EQZ M6y6WBOzGH/e0w0F4+nzrI87tx1nc28jxb0uBVhv87MflJv8zC/qZUWh3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819368" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819368" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909729" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:44 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 01/15] wifi: ieee80211: check for NULL in ieee80211_mle_size_ok() Date: Mon, 18 Mar 2024 18:53:17 +0200 Message-Id: <20240318184907.4d983653cb8d.Ic3ea99b60c61ac2f7d38cb9fd202a03c97a05601@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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 For simplicity, we may want to pass a NULL element, and while we should then pass also a zero length, just be a bit more careful here. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- include/linux/ieee80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 3385a2cc5b09..a99f048404b8 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -5166,7 +5166,7 @@ static inline bool ieee80211_mle_size_ok(const u8 *data, size_t len) bool check_common_len = false; u16 control; - if (len < fixed) + if (!data || len < fixed) return false; control = le16_to_cpu(mle->control); From patchwork Mon Mar 18 16:53:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595615 X-Patchwork-Delegate: johannes@sipsolutions.net 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 5241754BF1 for ; Mon, 18 Mar 2024 16:53:47 +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=1710780829; cv=none; b=BP1jUlWCK5e013rJRBkFKIWFiN60DCwrY/bWo8eD/YF5n8yCcQn2yClaJ96Ed76NrPy0rI7jrP42rsnRFOx5fROq+SBWirgs8Ts0l4uNOxI0ppHn6U2/ipi/tyeyiUwPZ0a04R9SZ4s2k349KvxzRkwy3kLNXacfOHCKa4eHsq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780829; c=relaxed/simple; bh=3onFUZnNbcOkZTNuoeKtcvPha8NsDXZipwSyWwvwFT8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kGcFyqHLeSDiLz+/+AhInPYAkVTcRWszsv6yOqpq+rCfV1+B1Pz4vy5PAtZOwi7TlL+iFDTbWaLeRB6YyZaKk0zkbRh4WbL7qKCgEv7mckdtFKKob4iRrDqF6IcQ4m2WwGnuhGWGTYnErTUTrQLrlQZ0nw9YVDF4z6/prww473U= 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=JPTaVT6N; 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="JPTaVT6N" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780827; x=1742316827; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3onFUZnNbcOkZTNuoeKtcvPha8NsDXZipwSyWwvwFT8=; b=JPTaVT6NkB/ExBaqJZ4Qj9ho64sIxC6jMI+sMqHjm756ImFfmAY+hMr5 uQHKgEshg8JJ7vWgO1mCM9kHeYETJCbDgyj9y9iRFm8TokRKRbRJllfRu 3TId2+E6XeI56zYUpjT10QyLS6dyUHpiIZnbnv1g2FI4yn3yeidLFV9SM YywYLf5oaJ4Wnr6jVXBuhJiL4k1B3YiCfmX9nePXWtuRrFRn5V3nSk1AV mthpqYih72PKAW9In5f/iay7sxd0qCb5h0kAH/UMktz9SSR+mxL1Rehk1 Z+dHcCy2hA3NX7y1jdqwqnql6/eYkZgi5dacegv14xCKVfHzsmgpZSgoP g==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819372" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819372" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909746" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:46 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Ilan Peer Subject: [PATCH 02/15] wifi: ieee80211: fix ieee80211_mle_basic_sta_prof_size_ok() Date: Mon, 18 Mar 2024 18:53:18 +0200 Message-Id: <20240318184907.00bb0b20ed60.I8c41dd6fc14c4b187ab901dea15ade73c79fb98c@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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 there was a possibility of an MLE basic STA profile without subelements, we might reject it because we account for the one octet for sta_info_len twice (it's part of itself, and in the fixed portion). Like in ieee80211_mle_reconf_sta_prof_size_ok, subtract 1 to adjust that. When reading the elements we did take this into account, and since there are always elements, this never really mattered. Fixes: 7b6f08771bf6 ("wifi: ieee80211: Support validating ML station profile length") Signed-off-by: Johannes Berg Reviewed-by: Ilan Peer Signed-off-by: Miri Korenblit --- include/linux/ieee80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index a99f048404b8..4fd9735bb75e 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -5302,7 +5302,7 @@ static inline bool ieee80211_mle_basic_sta_prof_size_ok(const u8 *data, info_len += 1; return prof->sta_info_len >= info_len && - fixed + prof->sta_info_len <= len; + fixed + prof->sta_info_len - 1 <= len; } /** From patchwork Mon Mar 18 16:53:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595616 X-Patchwork-Delegate: johannes@sipsolutions.net 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 D6D6554F89 for ; Mon, 18 Mar 2024 16:53:49 +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=1710780831; cv=none; b=cjw8ux3RKSNpXevNj3PePmvvIGwNdEwftZ7JOaUAiduGkIi94e815AyRxXPphsjmGJE9sXFrfKadFCa/3o7Ri54JSZCUOBSHnI0+Ht3HPtgpnOC3HuVrgG5aIJ/7s8ZOD5PWzaNd7XMttDmAT4GWJ0a1vzpYwa56VTl7eEt4GLI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780831; c=relaxed/simple; bh=DSFVFhEr2+mbVFAVWO4MV0D9SQo/onwUSVw3aRWeXC0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JCweEe0ZtqD3lwi1K7kU+R8Hm1EOwcmo1gvRL0wOORZhrN7CReAbXTJXSYXmCjHO/08weKjEJf1HvvqM+oLaY+oNcyfkPY1PPx8GdHZAtYBiP/yHcpz5xkSNaDfOpUEpeqIVQc50c8ayAN4kubnQ87AZGfgfX8ul/UnvEfeLPjE= 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=YpUSFK2F; 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="YpUSFK2F" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780830; x=1742316830; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DSFVFhEr2+mbVFAVWO4MV0D9SQo/onwUSVw3aRWeXC0=; b=YpUSFK2FZtRGxTFvX7+gMvET9eF4XCfBz7QU9Cshw/zMorssCeopO8rJ NwhiQMgGkpBKhJaDOpDtVduFJ0+0ydsFb2A1LBDQS0MW+r2SqPWf9c74U xk6BRG0iwwcEjyOnU+LHBp/UfU3VToD3s0+Sqdbeq2pkNEx2ynisFinH6 WJDZHpwITbj4u3/6F1y08DvOPzjd7gMFEzRizyqXk9FXvLI9WSIDj4n1h 5BNDlOYUdJvATdBBqJ3TBAGBg4ggTy/AXCSn/9q0tOs/jzUE00LDLw1i6 LCjDIOuGag22iJ7NOHbcStEB8ohxYee99d50FQhyEJrudouCs8l/344Fu Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819385" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819385" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909772" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:49 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 03/15] wifi: mac80211_hwsim: move skip_beacons to be per link Date: Mon, 18 Mar 2024 18:53:19 +0200 Message-Id: <20240318184907.8b6691bd70eb.If8a28b893d277254906601065e4aaefa704b6fcb@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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 Initially, we were only using this for non-MLO, but it could also be useful for MLO, and if we move it to per-link and the vif isn't an MLD, it'll be put in the same place (by mac80211) anyway. Move it to be per link. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/virtual/mac80211_hwsim.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index b55fe320633c..450913cf6583 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -216,7 +216,7 @@ static const struct ieee80211_regdomain *hwsim_world_regdom_custom[] = { struct hwsim_vif_priv { u32 magic; - u32 skip_beacons; + u32 skip_beacons[IEEE80211_MLD_MAX_NUM_LINKS]; u8 bssid[ETH_ALEN]; bool assoc; bool bcn_en; @@ -2133,13 +2133,16 @@ static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw, } #ifdef CONFIG_MAC80211_DEBUGFS -static void mac80211_hwsim_vif_add_debugfs(struct ieee80211_hw *hw, - struct ieee80211_vif *vif) +static void +mac80211_hwsim_link_add_debugfs(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct ieee80211_bss_conf *link_conf, + struct dentry *dir) { struct hwsim_vif_priv *vp = (void *)vif->drv_priv; - debugfs_create_u32("skip_beacons", 0600, vif->debugfs_dir, - &vp->skip_beacons); + debugfs_create_u32("skip_beacons", 0600, dir, + &vp->skip_beacons[link_conf->link_id]); } #endif @@ -2214,8 +2217,8 @@ static void __mac80211_hwsim_beacon_tx(struct ieee80211_bss_conf *link_conf, /* TODO: get MCS */ int bitrate = 100; - if (vp->skip_beacons) { - vp->skip_beacons--; + if (vp->skip_beacons[link_conf->link_id]) { + vp->skip_beacons[link_conf->link_id]--; dev_kfree_skb(skb); return; } @@ -3922,7 +3925,7 @@ static int hwsim_pmsr_report_nl(struct sk_buff *msg, struct genl_info *info) #ifdef CONFIG_MAC80211_DEBUGFS #define HWSIM_DEBUGFS_OPS \ - .vif_add_debugfs = mac80211_hwsim_vif_add_debugfs, + .link_add_debugfs = mac80211_hwsim_link_add_debugfs, #else #define HWSIM_DEBUGFS_OPS #endif From patchwork Mon Mar 18 16:53:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595617 X-Patchwork-Delegate: johannes@sipsolutions.net 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 EF57054FA4 for ; Mon, 18 Mar 2024 16:53:51 +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=1710780833; cv=none; b=cHO0UqQWb7khDgR78azW9FJcbE8j6HqOaokqYNaiHQiWFVC2jRBnYpImDb+Pp4ZpGb6c5nPDqFxgUmJxoY2jhBoWUJ/szZVi9N+WIPeIfiq83klIaQ0WgZSeztyvijhv7texh/qOqgEIUhkheLLR4Fwgf9pIYwPFXo0uG1Kh7X4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780833; c=relaxed/simple; bh=2+XOSAA3/2dmu4rimYG5Vy0Jx+I0tooRv+/7+e9me3g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Fd6Nva86lKafamgvDDM4yfgtM6VBpH4AOfPON79Xa5n3KW5uI6uY3p1qVnGmTx+JZkKiFwPfFhEbrSG19tIYVnFr99Gm89s6sCnMVfNCl3JrhJCoPWxxHhd+9SIsmMDTuDyZfZtYvE3P+ocuaO/dhQLpj6/uCBprfBy5zg7XueM= 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=CquGZVEx; 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="CquGZVEx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780832; x=1742316832; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2+XOSAA3/2dmu4rimYG5Vy0Jx+I0tooRv+/7+e9me3g=; b=CquGZVEx7MZQJulFm9RCsi0hiCBNWF47Sqyw3DyNHNJOTS6ICW/QqPp3 bgEwDX7713PT+deoXCt2E7wx6+GUNtmtT2roiIzv/C+Ut7O8Bx6p96fSf J+vhwXN61L16RlWfsE3ZDLBTWb/SL3LjlW88jL0YcvmYtwH8rt8TVoipZ iLOQQ9z2Ff83XuCMnnjg83YtAkEia3Mu+ipdNlDHINopdsIM0QOF9UH3i WuIcsyvhUdfgo1uFEojl2M/yrpRq8ao2yHNuJXNJmPY+80pCAZe9fI30E diqjvyyhb80t1LD4CywrqPt+82OE+NP5APA3gBKgNG+Ajtud7l/J4W9Na Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819388" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819388" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909782" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:51 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 04/15] wifi: mac80211: clarify the dormant/suspended links docs Date: Mon, 18 Mar 2024 18:53:20 +0200 Message-Id: <20240318184907.a5b24595b1a2.I92dd7d177b25df189b842d3bcddb1f2b13b1de13@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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 Since I keep getting confused about this and asking about it, update the documentation. In the future, especially when we add more reasons for a link to be disabled, we should add a per-link 'disable state' bitmap instead of maintaining all these bitmaps with subset logic, to indicate each of the different states separately. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- include/net/mac80211.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 353488ab94a2..47fa73a62f8a 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1921,10 +1921,12 @@ enum ieee80211_neg_ttlm_res { * @active_links: The bitmap of active links, or 0 for non-MLO. * The driver shouldn't change this directly, but use the * API calls meant for that purpose. - * @dormant_links: bitmap of valid but disabled links, or 0 for non-MLO. - * Must be a subset of valid_links. + * @dormant_links: subset of the valid links that are disabled/suspended + * due to advertised or negotiated TTLM respectively. + * 0 for non-MLO. * @suspended_links: subset of dormant_links representing links that are - * suspended. + * suspended due to negotiated TTLM, and could be activated in the + * future by tearing down the TTLM negotiation. * 0 for non-MLO. * @neg_ttlm: negotiated TID to link mapping info. * see &struct ieee80211_neg_ttlm. From patchwork Mon Mar 18 16:53:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595618 X-Patchwork-Delegate: johannes@sipsolutions.net 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 814E75576C for ; Mon, 18 Mar 2024 16:53:54 +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=1710780836; cv=none; b=kbNduYc+IsxOdmjzm7D0CfM2oBlFs35NpHIQIfTR0MeAcduo+WtEdEyXnq69dR8iVK0JFGuHpm39fcqHBTajXdJVyKH+v9foS+0d25HzGFlnktEF32qtHFrbkYV6c5BoOSrihCY6PTBcTE4QCJML3xEH8zqmr00DypmUVBiuvI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780836; c=relaxed/simple; bh=L03e1PnEyC7If33Ek/e3BuquoNhxptWVv1cs2SQj260=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=APYuEZPJsick/se0aO/RkEiTyxyn9iBOP1qj//x7X/RdG8PUNzw1GXloug2NdJgbkxQqi0cf7x900dH7tUqCInt5jbPA+rd3dYxhH//uAlkIXByGsqSRZUcodQlRgt8dEEfqlYmmmFHOLDXlhLfX+Em1t/Qzg8IPRn/ZTErVnzQ= 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=T/rPQ2JQ; 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="T/rPQ2JQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780835; x=1742316835; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=L03e1PnEyC7If33Ek/e3BuquoNhxptWVv1cs2SQj260=; b=T/rPQ2JQqzOvhHtP/ccxR0Kh6eDzlsnWgKkbGj5gQy48vSo0jkD0at2O Hxct+bWtG343rlIpU9J+CBubLTrfgZYrzqTHFM3WzOilswrFkZbr1iF4r TpRWjUyGr+m4UOX0ApC7SlznuesAYbOTrHnke2/CIXaxfCCWWeCMuC8ZD bl+GU6FPIx2XyywJbRbQbV8gYxF1PG503/MQw6puSSzcOL7wKf/Zcx4oN 8dvI2s5qkMBBj7eRbynNx7MDAeUFmsWCudBhZ1mOzHnoTLW+3oOlWb2XJ 1JM87ZIDc2hb6qzd05Ieqrf7DkmyMhpfo1HOLsX2XwpYx42ll1kTINnKr w==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819395" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819395" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909816" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:53 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ayala Beker , Ilan Peer Subject: [PATCH 05/15] wifi: mac80211: fix BSS_CHANGED_MLD_TTLM description Date: Mon, 18 Mar 2024 18:53:21 +0200 Message-Id: <20240318184907.52b893a70758.I2dcb322b389441f33605fb952450cc2724eb9efd@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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: Ayala Beker BSS_CHANGED_MLD_TTLM purpose is to let the driver know that negotiated TTLM was updated and as a result MLD suspended links status was change. Fix the description to better reflect it. Signed-off-by: Ayala Beker Reviewed-by: Ilan Peer Signed-off-by: Miri Korenblit --- include/net/mac80211.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 47fa73a62f8a..757ec33882c2 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -361,7 +361,7 @@ struct ieee80211_vif_chanctx_switch { * @BSS_CHANGED_UNSOL_BCAST_PROBE_RESP: Unsolicited broadcast probe response * status changed. * @BSS_CHANGED_MLD_VALID_LINKS: MLD valid links status changed. - * @BSS_CHANGED_MLD_TTLM: TID to link mapping was changed + * @BSS_CHANGED_MLD_TTLM: negotiated TID to link mapping was changed */ enum ieee80211_bss_change { BSS_CHANGED_ASSOC = 1<<0, From patchwork Mon Mar 18 16:53:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595619 X-Patchwork-Delegate: johannes@sipsolutions.net 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 7FCA655784 for ; Mon, 18 Mar 2024 16:53:57 +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=1710780839; cv=none; b=c0AScjeTeLszNPzob3hdSMASAPDAnSJV7rrDyIMTcNHUu/OgNIam+m8cFsveb97I7dF0lDUZ7efkJbGGi9Ul5Qt/yEGDfO7EmjATfPOR4QBatnmc2vyM2P8oenFT7ms/NIQFuQxRvwd+99+aVy5YRzNpHAN+jACUF4NlpvCPrD8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780839; c=relaxed/simple; bh=871JndVF66Ox22Baul085PLG5nnkJMtkTPaXhoL7zDA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HTCJZdymGEvpLwiIs49kGPB4SZGOGDKQNXuQ9gSW4no9EYOvANUv8jrnSpD8ki2EdO+kuG+S+nr32yxON4NRjqEv1MR53Orb4CfMYO4ChexTZjY+cE9GLEAkylVbqLEgTmFpP65CU+ifc88qCsM7EVu2orysYrFdBAeXjBatJcY= 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=F6xSIRuw; 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="F6xSIRuw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780838; x=1742316838; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=871JndVF66Ox22Baul085PLG5nnkJMtkTPaXhoL7zDA=; b=F6xSIRuwkCLO4zACZ+duUm6VJmkpzovHBSO/Bgkfcynkbqnny/Pl332i +ksTXQGm0edWJls4z6bIMv3w+BSLcGDTm8Tf+nA/NKeipIv/oaSMb1oHq kjXkMq1678BY2J+vLBFLhoePAwO+DlD83iXmtarnZkQgEXcr02aZzcWOo FK3pQTp+hnk5xT/bokXiUUKe1DbbpC6bxK8GNqq/8FrPr2rzLQbZXP5s/ 3LACxC5Ztq8WC5llqRjlVqY3pHFPZB55p6aRnaJK+YH6f+EC3eAnHOCwj /u8XrC2EOXF5GllN2ZMAlwbopdOJmN71I46Y6N52on3XVOTULV+/ZZzl4 w==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819406" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819406" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909831" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:55 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ayala Beker , Johannes Berg , Ilan Peer Subject: [PATCH 06/15] wifi: mac80211: correctly set active links upon TTLM Date: Mon, 18 Mar 2024 18:53:22 +0200 Message-Id: <20240318184907.acddbbf39584.Ide858f95248fcb3e483c97fcaa14b0cd4e964b10@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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: Ayala Beker Fix ieee80211_ttlm_set_links() to not set all active links, but instead let the driver know that valid links status changed and select the active links properly. Fixes: 8f500fbc6c65 ("wifi: mac80211: process and save negotiated TID to Link mapping request") Signed-off-by: Ayala Beker Reviewed-by: Johannes Berg Reviewed-by: Ilan Peer Signed-off-by: Miri Korenblit --- net/mac80211/mlme.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 47a2cba8313f..30cba84e7053 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -5874,6 +5874,15 @@ static int ieee80211_ttlm_set_links(struct ieee80211_sub_if_data *sdata, } if (sdata->vif.active_links != active_links) { + /* usable links are affected when active_links are changed, + * so notify the driver about the status change + */ + changed |= BSS_CHANGED_MLD_VALID_LINKS; + active_links &= sdata->vif.active_links; + if (!active_links) + active_links = + BIT(__ffs(sdata->vif.valid_links & + ~dormant_links)); ret = ieee80211_set_active_links(&sdata->vif, active_links); if (ret) { sdata_info(sdata, "Failed to set TTLM active links\n"); @@ -5888,7 +5897,6 @@ static int ieee80211_ttlm_set_links(struct ieee80211_sub_if_data *sdata, goto out; } - changed |= BSS_CHANGED_MLD_VALID_LINKS; sdata->vif.suspended_links = suspended_links; if (sdata->vif.suspended_links) changed |= BSS_CHANGED_MLD_TTLM; From patchwork Mon Mar 18 16:53:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595620 X-Patchwork-Delegate: johannes@sipsolutions.net 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 834405576C for ; Mon, 18 Mar 2024 16:53:59 +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=1710780841; cv=none; b=lAfZcnuDXY5bpYKa3SPB1TfBXEnjN3mQgUnmNkVOghFNXO7fnsJnL2w/CWjeRdYT5mgv46dIXc2JPl5pNY4dVBp6lIieGWI0BZ/rc7/gkMLySklK0hKZF48NuwfgX6gFl4pce/D6wFTChO1AlRIscdWJ7lfAHdq4QcqBETaazdk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780841; c=relaxed/simple; bh=4gXm7BW4Fbc4rYY7vho4sV9pl/TYnLmrxMwIeoQJY40=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Q3Y7++/F8E8JwDwtogQ1S1WMypp1Ty3NhnvA0qM7G4XQS1womHx4v/fqe88Wy6dFfQyTwOIZffYVfh4615wctan0W/1F75MKp106uyZETfgxBOYAwg0HYOW5LpwQQdOUxicfX9w/LB46yN4lHIbV/iwSMde5+D6eidwB0O4Zb+A= 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=TE7jXflu; 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="TE7jXflu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780840; x=1742316840; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4gXm7BW4Fbc4rYY7vho4sV9pl/TYnLmrxMwIeoQJY40=; b=TE7jXfluvCl4ousx9djxneLvPXxlk88qSIXnwvcP5HjZF/iTlsV+fefB mT4wrI9hnJhzfu2uPKQ/2nLMH73W94cf5tz0g8jIedaT90GP/bC3xeWax q3C8cskAhvlGqFLPYOkvVCOVU+QL6Z7s1KFZFYNKTEDbwJAPpiKXvYz3m Qc70fp+XMDBMrH2eM8GJpBtD3pDcpNFjNaIB4r/xpZg3iosxXX+17UQ+I 846vKdyIfZwDM8AO9gzbIobtbqUGxzcs4zlb5FOMqFvUxtgp9iuh2lT5O u5lO5sfcbjapK2ZxRtK5YcMXl4iYigDeg0jExSlvubhjvG8tlDuj95usO g==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819413" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819413" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909847" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:53:58 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Anjaneyulu Subject: [PATCH 07/15] wifi: mac80211: handle indoor AFC/LPI AP on assoc success Date: Mon, 18 Mar 2024 18:53:23 +0200 Message-Id: <20240318184907.89c25dae34ff.Ifd8b2983f400623ac03dc032fc9a20025c9ca365@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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: Anjaneyulu Update power_type in bss_conf based on Indoor AFC and LPI power types received in HE 6 GHz operation element on assoc success. Signed-off-by: Anjaneyulu Signed-off-by: Miri Korenblit --- include/linux/ieee80211.h | 8 +++++--- net/mac80211/mlme.c | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4fd9735bb75e..7f9b829dcb1e 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h @@ -2742,9 +2742,11 @@ static inline bool ieee80211_he_capa_size_ok(const u8 *data, u8 len) #define IEEE80211_HE_OPERATION_PARTIAL_BSS_COLOR 0x40000000 #define IEEE80211_HE_OPERATION_BSS_COLOR_DISABLED 0x80000000 -#define IEEE80211_6GHZ_CTRL_REG_LPI_AP 0 -#define IEEE80211_6GHZ_CTRL_REG_SP_AP 1 -#define IEEE80211_6GHZ_CTRL_REG_VLP_AP 2 +#define IEEE80211_6GHZ_CTRL_REG_LPI_AP 0 +#define IEEE80211_6GHZ_CTRL_REG_SP_AP 1 +#define IEEE80211_6GHZ_CTRL_REG_VLP_AP 2 +#define IEEE80211_6GHZ_CTRL_REG_INDOOR_LPI_AP 3 +#define IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP 4 /** * struct ieee80211_he_6ghz_oper - HE 6 GHz operation Information field diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 30cba84e7053..a0f9fdc8b0d3 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4429,9 +4429,11 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link, switch (u8_get_bits(he_6ghz_oper->control, IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO)) { case IEEE80211_6GHZ_CTRL_REG_LPI_AP: + case IEEE80211_6GHZ_CTRL_REG_INDOOR_LPI_AP: bss_conf->power_type = IEEE80211_REG_LPI_AP; break; case IEEE80211_6GHZ_CTRL_REG_SP_AP: + case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP: bss_conf->power_type = IEEE80211_REG_SP_AP; break; case IEEE80211_6GHZ_CTRL_REG_VLP_AP: From patchwork Mon Mar 18 16:53:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595621 X-Patchwork-Delegate: johannes@sipsolutions.net 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 06D2C55C06 for ; Mon, 18 Mar 2024 16:54:01 +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=1710780843; cv=none; b=Q7NDX2kUCjXXzyPXwfLebvs/hqjG9VlUyX+P/XPtMvjrWCiZsEEfXM+mPhndNaBabT8Nnwxys3OslaIvaGx1CaMbRxWnu3ceuJeNODYIWQtBS0DVzXr6ZfJBQZZt/ojBDRSRGI9bPEGUvBKcoNulkBPdbMCbOi0Gco2uduVl9ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780843; c=relaxed/simple; bh=6fLWjM6GV1ndCKdjsQVlUtUxMeWVQxlH7pwnSZ6u8Z8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=uX/zt1H6mUZk60cwv59bMjirPWE5Nzfn5A3tTlLiYNU/88x5sHDfc5zM2TKDfodRwYZidNEDmMLvGKfUKaK0NP1Xyozxl4X0PmWAKkqIg25Td0L+NFOyqg2bERv/VOBDIbMVS0Dc0cez/zN/W2ePev8+DJhXOL4sNQ87hfCLZPY= 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=R20yC2bW; 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="R20yC2bW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780842; x=1742316842; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6fLWjM6GV1ndCKdjsQVlUtUxMeWVQxlH7pwnSZ6u8Z8=; b=R20yC2bWReV3BsAk1Clqx+O83kqhKNEZfw30fTVUrRxsDFjKZk04clhA 6FzxImWlnCEa/5/nq1HvCzhJRqhrNxI6etSpRh16Og1yr+zQ65M8/UK/L SuIYguOoi2ZtrJ9ijPC+mwNoT6z9dG+AG8b5vB4tfsEuBc7F7Fz4ihXNT wyggzJwqJ6N5YYBeGBwHYOknJ2eAnJTmOgxgvMh+o4233fjcqlOxI+wv7 xbxvAH2pIPLaZYs+3UwIBytXZuOJBzDMKJlbktWY7ICzih11F8e6G75+M 2v+RU4P1FvqzZ8YgBUH76vKVHLGWso/g6R2COH9aRWQBifaZK4H3iKQp3 g==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819423" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819423" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909863" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:00 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Anjaneyulu Subject: [PATCH 08/15] wifi: cfg80211: handle indoor AFC/LPI AP in probe response and beacon Date: Mon, 18 Mar 2024 18:53:24 +0200 Message-Id: <20240318184907.091cfaaa5f45.I23cfa1104a16fd4eb9751b3d0d7b158db4ff3ecd@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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: Anjaneyulu Mark Indoor LPI and Indoor AFC power types as valid based on channel flags. While on it, added default case. Signed-off-by: Anjaneyulu Signed-off-by: Miri Korenblit --- net/wireless/scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 5a5dd3ce497f..b55ffe73e1ef 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2140,11 +2140,15 @@ static bool cfg80211_6ghz_power_type_valid(const u8 *ie, size_t ielen, switch (u8_get_bits(he_6ghz_oper->control, IEEE80211_HE_6GHZ_OPER_CTRL_REG_INFO)) { case IEEE80211_6GHZ_CTRL_REG_LPI_AP: + case IEEE80211_6GHZ_CTRL_REG_INDOOR_LPI_AP: return true; case IEEE80211_6GHZ_CTRL_REG_SP_AP: + case IEEE80211_6GHZ_CTRL_REG_INDOOR_SP_AP: return !(flags & IEEE80211_CHAN_NO_6GHZ_AFC_CLIENT); case IEEE80211_6GHZ_CTRL_REG_VLP_AP: return !(flags & IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT); + default: + return false; } } return false; From patchwork Mon Mar 18 16:53:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595622 X-Patchwork-Delegate: johannes@sipsolutions.net 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 87C7355C0E for ; Mon, 18 Mar 2024 16:54:03 +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=1710780845; cv=none; b=Z9JzrqYOkIz3NsRXm505tijopEA6zVPXaMNn6jK/rWjNcItdziZjb+v8OsGYxuydISNH4KsrIHLms78/RK/DLAtmrsrGUY8E7BsvqO8xsozhhu52iR3OEPjglWPTqMZd1N6K2AL2vAt3gBn4go1fg9QDafnm46ybOe4XPZuzYQ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780845; c=relaxed/simple; bh=8bxRgKWQCw7G1LGrnS70T9/FjAGC/eSYiARXWPDFYQ0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iTmJv62zS7eGzDNK5AXFmnfRZjIv8+jfhyfzcCxG6cpQy6jPr4P0UZ+ycFaehxfMhD681izCXc4lD8AhuprtHe/CB0rZdcbn8wROAJyI2WeDN+ZHyeUSkDE8z6gLsikVwTpP7mZFMo+yZSmFVSp1nnmUTgmQN8UcEVtRxbQUM8Q= 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=lCRjXvVh; 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="lCRjXvVh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780844; x=1742316844; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8bxRgKWQCw7G1LGrnS70T9/FjAGC/eSYiARXWPDFYQ0=; b=lCRjXvVhnBxj2JSA8WC6iFpKmUyh8HKSRPfOMrTV0idSWvNx16AGOgO1 TENGWi6UF3zOqmrlA67Y7D32KCiTmJHo0TZxa/VedC4CmbYDURUl+GTti 0Bk9WGYe76GSTP/nUnd3scRt7dPdbTVbJuwQG3U0ZJtKUy+uV35XyoKF1 hhOz0woGJviAzNtLB8VckM5Dr1lna2zvdGm3EJrgVt3/yB8df9f49rapX RYaTvf5wSQ7bMNEqkrFi+B7paQ6R7laeEppNeznPN1aWrjmghR4SynISA CyOz9c9NcJgvPzm+GsoAyfz0iwod1SLi+Yy1EPYQzJZq/mXhGNMD0QIyf g==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819428" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819428" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909877" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:03 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 09/15] wifi: mac80211: add flag to disallow puncturing in 5 GHz Date: Mon, 18 Mar 2024 18:53:25 +0200 Message-Id: <20240318184907.49759510da7d.I12c5a61f0be512e0c4e574c2f794ef4b37ecaf6b@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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 Some devices may not be capable of handling puncturing in 5 GHz only (vs. the current flag that just removes puncturing support completely). Add a flag to support such devices: check and then downgrade the channel width if needed. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- include/net/mac80211.h | 3 +++ net/mac80211/debugfs.c | 1 + net/mac80211/mlme.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 757ec33882c2..88bb781f33f6 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2779,6 +2779,8 @@ struct ieee80211_txq { * * @IEEE80211_HW_DISALLOW_PUNCTURING: HW requires disabling puncturing in EHT * and connecting with a lower bandwidth instead + * @IEEE80211_HW_DISALLOW_PUNCTURING_5GHZ: HW requires disabling puncturing in + * EHT in 5 GHz and connecting with a lower bandwidth instead * * @IEEE80211_HW_HANDLES_QUIET_CSA: HW/driver handles quieting for CSA, so * no need to stop queues. This really should be set by a driver that @@ -2843,6 +2845,7 @@ enum ieee80211_hw_flags { IEEE80211_HW_DETECTS_COLOR_COLLISION, IEEE80211_HW_MLO_MCAST_MULTI_LINK_TX, IEEE80211_HW_DISALLOW_PUNCTURING, + IEEE80211_HW_DISALLOW_PUNCTURING_5GHZ, IEEE80211_HW_HANDLES_QUIET_CSA, /* keep last, obviously */ diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c index 2f68e92a7404..98310188f330 100644 --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c @@ -498,6 +498,7 @@ static const char *hw_flag_names[] = { FLAG(DETECTS_COLOR_COLLISION), FLAG(MLO_MCAST_MULTI_LINK_TX), FLAG(DISALLOW_PUNCTURING), + FLAG(DISALLOW_PUNCTURING_5GHZ), FLAG(HANDLES_QUIET_CSA), #undef FLAG }; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a0f9fdc8b0d3..958ff328a6c1 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -599,6 +599,10 @@ static bool ieee80211_chandef_usable(struct ieee80211_sub_if_data *sdata, ieee80211_hw_check(&sdata->local->hw, DISALLOW_PUNCTURING)) return false; + if (chandef->punctured && chandef->chan->band == NL80211_BAND_5GHZ && + ieee80211_hw_check(&sdata->local->hw, DISALLOW_PUNCTURING_5GHZ)) + return false; + return true; } From patchwork Mon Mar 18 16:53:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595623 X-Patchwork-Delegate: johannes@sipsolutions.net 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 4825655C0E for ; Mon, 18 Mar 2024 16:54:06 +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=1710780847; cv=none; b=O9WCXzt2ur5PekKwvMBc8H+g2TXeo40QlBVdYfS+nTtwjtbtQ3G1Ew1ShUrWExIykAdQpP7ioht/Hh+Pjn0KMzNjfHomHx1KckLqMQddGb/xU2RGdbECEHsksmyj5rK1iv7kyLAyfdw81fye27VzbiXT+UaFkB5GoavOz6i+ljk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780847; c=relaxed/simple; bh=9mKzi/KlUctikmemDUwh4CbXuzghf8ptUFFFioOwJ+o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jj/s8rr5GOWIa9zg2UUwtD9oXsPmnJ2zFpoR9p54XKwYu1UVEw/wD9hFr19nA3UgBo1TR1msxx5ISqeMcW5orbvx+ouSKNjVWSXeODzph4XwEM0SL2WJS4/GZ5CciBVOGNNKGt2qmDHOHhYUqkj6/7SDdBSrERGehU5QdhcgAVQ= 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=hX7rCKvZ; 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="hX7rCKvZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780846; x=1742316846; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9mKzi/KlUctikmemDUwh4CbXuzghf8ptUFFFioOwJ+o=; b=hX7rCKvZSCED0JMSerD9tH/MEzf/Fj1KlKrwrSpFrn4NpUZUi4TjT0Vi 9RsYssQ8g+YMg/oeJo3b0Z9T9gxuQ2XidYpz1L6h1WTazspau7QVCR2ET e0/+KOUBuVdSEjgQAOqSZpf52lOFrGyY3brlnd3EwrUYq+TToHUHotI6p PzreorfxPB/1qJgM/7uUn9UDBShavAf45M4uEvY8rbbuXh5jZlTxfaCIF R47IZYZWkeFy40NIk0Zn1MruqRrU+O186ahDuaF5SMh1zXf7zuFfVt1e2 mVdUlErdgvwdDtBRKVc/k05LWLnF5NPbJRKVLT0Ev+QRW2/jJ9JfWHyRL g==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819432" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819432" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909888" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:05 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 10/15] wifi: mac80211: parse puncturing bitmap in 6 GHz Date: Mon, 18 Mar 2024 18:53:26 +0200 Message-Id: <20240318184907.e74b88ee45af.Id0dca4624127fa8f8e8aba1dcf9890b6327a3795@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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 In ieee80211_chandef_he_6ghz_oper(), the HE/EHT information for the 6 GHz channel is parsed, but ieee80211_chandef_eht_oper() calls must be paired with extracting the puncturing bitmap. Fix this. Fixes: b82730bf57b5 ("wifi: cfg80211/mac80211: move puncturing into chandef") Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index a237cbcf7b49..a5d5e05688b4 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -3136,6 +3136,8 @@ bool ieee80211_chandef_he_6ghz_oper(struct ieee80211_local *local, } else { ieee80211_chandef_eht_oper((const void *)eht_oper->optional, &he_chandef); + he_chandef.punctured = + ieee80211_eht_oper_dis_subchan_bitmap(eht_oper); } if (!cfg80211_chandef_valid(&he_chandef)) From patchwork Mon Mar 18 16:53:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595624 X-Patchwork-Delegate: johannes@sipsolutions.net 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 A009055E46 for ; Mon, 18 Mar 2024 16:54:08 +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=1710780850; cv=none; b=QE9P15XHSZJ6kGVtqCeLdfxj3KwqgfVilVe99EpLy0vxBH8Bgds3aoy5ypMmltwKJk/UhDKGiBCuWSUH/B4xen01MCkvGSpCVMFMX17EXKTaub/dARSm6BWCqzO7NG7jQqQCmqAenARA6vU7Ls1LzvPhAwtfKEOU0dwxTxEy5IE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780850; c=relaxed/simple; bh=owzzHfbqDK43sOQ5GBzl1Ibk1JRPSdXnbt6uyc15iOg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Y+WklSCJiu8Ob3MwOKJI8zAslrQETM3KDH3Cch37B33bJ0FVAwuKpRJUkO7ueSnOFGCbcDv3bnwQBAUYO65UsJpS9mf/roHPXdBtjw9VLCIwNEagpV8jEVe4p1y5NG00gDlsc4oCEb+a1RyvxUQN4qQbksJmkREOaY20JzW0QYg= 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=iSxrJXIZ; 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="iSxrJXIZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780849; x=1742316849; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=owzzHfbqDK43sOQ5GBzl1Ibk1JRPSdXnbt6uyc15iOg=; b=iSxrJXIZ3fNmZj4qzSFiFIZNyTRD4cIFAGZHS0HC4XPqChktbXZbQtQr k0sW1PJ6E+ACtZDayxtuSqMNICtkanqeFRyO6cJiaOTRbAPxO+9CdtA1q GQvvdNxLb7Q2DMHqHHKaaEuXd8hWf1kvRLu6W3IWk8xVv4Vg//2Jpoud9 cK5ETgNprZJlz+sJ8kfsBvmJholw3qdrP77RW2JSlV6sGpYbQjF4xlyTs EEhA7xkYfiPB09dKG92EKSb7FuktYENiqQ7QCakwh/CTDkxkXQbaZZsW1 1F/57BtW4ibE1dZ2WXrtli2wis2V/+P2gj8PTiDJlA6UnpPBTEXsxuonb Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819443" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819443" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909905" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:07 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Johannes Berg Subject: [PATCH 11/15] wifi: mac80211: improve association error reporting slightly Date: Mon, 18 Mar 2024 18:53:27 +0200 Message-Id: <20240318184907.695faa9be279.I71b11a8d66a9cae4c27e242a47d1d92922609b03@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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: Benjamin Berg There is no reason to check the request flags for each of the links, so pull that out of the loop. Also, within the loop we can set the per-link error everywhere. Signed-off-by: Benjamin Berg Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/mlme.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 958ff328a6c1..2434023317e9 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -8214,6 +8214,14 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, if (req->ap_mld_addr) { uapsd_supported = true; + if (req->flags & (ASSOC_REQ_DISABLE_HT | + ASSOC_REQ_DISABLE_VHT | + ASSOC_REQ_DISABLE_HE | + ASSOC_REQ_DISABLE_EHT)) { + err = -EINVAL; + goto err_free; + } + for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) { struct ieee80211_supported_band *sband; struct cfg80211_bss *link_cbss = req->links[i].bss; @@ -8226,19 +8234,13 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, if (!bss->wmm_used) { err = -EINVAL; - goto err_free; - } - - if (req->flags & (ASSOC_REQ_DISABLE_HT | - ASSOC_REQ_DISABLE_VHT | - ASSOC_REQ_DISABLE_HE | - ASSOC_REQ_DISABLE_EHT)) { - err = -EINVAL; + req->links[i].error = err; goto err_free; } if (link_cbss->channel->band == NL80211_BAND_S1GHZ) { err = -EINVAL; + req->links[i].error = err; goto err_free; } From patchwork Mon Mar 18 16:53:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595625 X-Patchwork-Delegate: johannes@sipsolutions.net 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 12E7855E5F for ; Mon, 18 Mar 2024 16:54:10 +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=1710780852; cv=none; b=Cyqlf7xy1SBXGwaCjRM8/YyU7XaYqU3qtF//AlEGG5JJlI9YP3NSNbtNDquNAYlVOD3rPG2KyhKwXbajFRIROBk+6jgtMsPfZx87aVi7chI4rOVW9p/e9Ptn1vJnt8QB+d/QWldPDmVA9k6um8+7J/B2moAF/68DMRyW+3INzFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780852; c=relaxed/simple; bh=Pi7hUuORqtdkvAdIYbr2eOr7xAenqmjs+iF3qobsm/0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GmyzdoaWKC5ZQKv2mlWpaMhjAtvER6TNQ1OrjhVkR1LWncHkOyC7euLPdNcuYUc13CRsUV0+8i6zyJJda4e768T0E1IECqFLM8Lze3De4ttDL7VSJ4Is21B5kvq77h5tkzSOtK467JK8L8yYlEUuL5MuIqy/9D0l6/wpccrQH4o= 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=oEqi6Dyw; 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="oEqi6Dyw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780851; x=1742316851; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pi7hUuORqtdkvAdIYbr2eOr7xAenqmjs+iF3qobsm/0=; b=oEqi6Dyw+n+Qwv6pBjNekpZPcDoH39GS4sWkcrRmC/RJ0jh2QeuKTa+g B4mavoBmiPF7uui382v5CbklfQ/jshLcTzlXswjdEBIJrrLUour7BE+wq 4eH/+qnqvmxhRiUDuMwNLsIVreJ4a0Dfof18uN3uqhhht4N3BnSf7BSHk FBFE/0gnRRpIp3NLLgRhPiS3pF4h2v01E4rSLZH+AR5baTVivgUiR8p3X cd+rzWY+QMz9PHVQrEseBR2SWC3X3/BcVLAqze68w89DOC4AZLhLKGEW/ pJOcJTGMkIk60e35TsFH/HLmRjltTv091/g6z3CrjRQhtuSHhGcm+bRKG g==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819465" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819465" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909927" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:09 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Johannes Berg Subject: [PATCH 12/15] wifi: cfg80211: check BSSID Index against MaxBSSID Date: Mon, 18 Mar 2024 18:53:28 +0200 Message-Id: <20240318184907.a7574d415adc.I02f40c2920a9f602898190679cc27d0c8ee2c67d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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: Benjamin Berg Add a verification that the BSSID Index does not exceed the maximum number of BSSIDs in the Multiple-BSSID set. Signed-off-by: Benjamin Berg Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/wireless/scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index b55ffe73e1ef..8ac2d19d8ede 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2447,7 +2447,8 @@ cfg80211_parse_mbssid_data(struct wiphy *wiphy, profile, profile_len); if (!mbssid_index_ie || mbssid_index_ie[1] < 1 || mbssid_index_ie[2] == 0 || - mbssid_index_ie[2] > 46) { + mbssid_index_ie[2] > 46 || + mbssid_index_ie[2] >= (1 << elem->data[0])) { /* No valid Multiple BSSID-Index element */ continue; } From patchwork Mon Mar 18 16:53:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595626 X-Patchwork-Delegate: johannes@sipsolutions.net 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 8B66A55E70 for ; Mon, 18 Mar 2024 16:54:13 +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=1710780855; cv=none; b=W90zKlzI19VqLI17QQWb2JVk9ix6QmFIROv9YqOASIdXI06AFm4uukPKJJTET9tK9PNP+1872S1zvIOZDc+Hbc4HKREymt/RWC7npYQ2Ce3c9JP8MFKQ8f4Uu2orPPFPI5K+z3ejgBLmMA5Ju7udeRte+facLq1gfjJxIcZyYHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780855; c=relaxed/simple; bh=QTa63NQ0zE7Z0Q+ifkgcf6VTYvZKceKkkNTpXkbhnrg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jo/5u5DXp/dL19O/qYN2Y5gag4Xm76/C05WOdP/1nMfLWCwS+jJDkDjBsavZTG1LgwT1R+dWXLzx6smHJS4pmIV5vPr82l46aqsGhNZMbpFOWQh2ynNYi/Kg+zUMzJdFkfK3o40LvhoeeDRguI6b6cOVSrZ4VD8iMRhx4vtDVKg= 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=iF/tcWf6; 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="iF/tcWf6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780854; x=1742316854; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QTa63NQ0zE7Z0Q+ifkgcf6VTYvZKceKkkNTpXkbhnrg=; b=iF/tcWf6mRZBwPrhvzLFsgBAl8CAYydW+g/VMBFbRMo4Kmvms9dPCMSu PV62gihkPR3fipm0khDcyWXW+0DiPLtbV+mXsJNy0dgUIwYUmW4dIxJrv IuM4uBOaptojGeJSbhDD1caTLzRDQGzEwcjxn6nntKidmSojuA9mAG19G KP5/mZubIvcUNTq45JUDLN3vkZE2XfhQXWikX0QQ10h+6JTLXS0cU604b LY951gMcDGMFdAGx4LhXDbRGePrayvRroQzKwzF7//uX5YjHi3xAQSd9J StPOMmpfmsAnFuwvnZfW2RQlpmMvbF2i/3fS+7b0ZbTd3vWBefxCo99ot A==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819473" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819473" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909939" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:12 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Johannes Berg Subject: [PATCH 13/15] wifi: cfg80211: ignore non-TX BSSs in per-STA profile Date: Mon, 18 Mar 2024 18:53:29 +0200 Message-Id: <20240318184907.6a0babed655a.Iad447fea417c63f683da793556b97c31d07a4aab@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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: Benjamin Berg If a non-TX BSS is included in a per-STA profile, then we cannot set transmitted_bss for it. Even worse, if we do things properly we should be configuring both bssid_index and max_bssid_indicator correctly. We do not actually have both pieces of information (and, some APs currently do not include either). So, ignore any per-STA profile where the RNR says that the BSS is not transmitted. Also fix transmitted_bss to never be set for per-STA profiles. This fixes issues where mac80211 was setting the reference BSSID to an incorrect value. Fixes: 2481b5da9c6b ("wifi: cfg80211: handle BSS data contained in ML probe responses") Signed-off-by: Benjamin Berg Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/wireless/scan.c | 47 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 8ac2d19d8ede..127853877a0a 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -2211,12 +2211,16 @@ cfg80211_inform_single_bss_data(struct wiphy *wiphy, tmp.pub.use_for = data->use_for; tmp.pub.cannot_use_reasons = data->cannot_use_reasons; - if (data->bss_source != BSS_SOURCE_DIRECT) { + switch (data->bss_source) { + case BSS_SOURCE_MBSSID: tmp.pub.transmitted_bss = data->source_bss; + fallthrough; + case BSS_SOURCE_STA_PROFILE: ts = bss_from_pub(data->source_bss)->ts; tmp.pub.bssid_index = data->bssid_index; tmp.pub.max_bssid_indicator = data->max_bssid_indicator; - } else { + break; + case BSS_SOURCE_DIRECT: ts = jiffies; if (channel->band == NL80211_BAND_60GHZ) { @@ -2231,6 +2235,7 @@ cfg80211_inform_single_bss_data(struct wiphy *wiphy, regulatory_hint_found_beacon(wiphy, channel, gfp); } + break; } /* @@ -2660,6 +2665,7 @@ struct tbtt_info_iter_data { u8 param_ch_count; u32 use_for; u8 mld_id, link_id; + bool non_tx; }; static enum cfg80211_rnr_iter_ret @@ -2670,14 +2676,20 @@ cfg802121_mld_ap_rnr_iter(void *_data, u8 type, const struct ieee80211_rnr_mld_params *mld_params; struct tbtt_info_iter_data *data = _data; u8 link_id; + bool non_tx = false; if (type == IEEE80211_TBTT_INFO_TYPE_TBTT && tbtt_info_len >= offsetofend(struct ieee80211_tbtt_info_ge_11, - mld_params)) - mld_params = (void *)(tbtt_info + - offsetof(struct ieee80211_tbtt_info_ge_11, - mld_params)); - else if (type == IEEE80211_TBTT_INFO_TYPE_MLD && + mld_params)) { + const struct ieee80211_tbtt_info_ge_11 *tbtt_info_ge_11 = + (void *)tbtt_info; + + non_tx = (tbtt_info_ge_11->bss_params & + (IEEE80211_RNR_TBTT_PARAMS_MULTI_BSSID | + IEEE80211_RNR_TBTT_PARAMS_TRANSMITTED_BSSID)) == + IEEE80211_RNR_TBTT_PARAMS_MULTI_BSSID; + mld_params = &tbtt_info_ge_11->mld_params; + } else if (type == IEEE80211_TBTT_INFO_TYPE_MLD && tbtt_info_len >= sizeof(struct ieee80211_rnr_mld_params)) mld_params = (void *)tbtt_info; else @@ -2696,6 +2708,7 @@ cfg802121_mld_ap_rnr_iter(void *_data, u8 type, data->param_ch_count = le16_get_bits(mld_params->params, IEEE80211_RNR_MLD_PARAMS_BSS_CHANGE_COUNT); + data->non_tx = non_tx; if (type == IEEE80211_TBTT_INFO_TYPE_TBTT) data->use_for = NL80211_BSS_USE_FOR_ALL; @@ -2707,7 +2720,7 @@ cfg802121_mld_ap_rnr_iter(void *_data, u8 type, static u8 cfg80211_rnr_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id, const struct ieee80211_neighbor_ap_info **ap_info, - u8 *param_ch_count) + u8 *param_ch_count, bool *non_tx) { struct tbtt_info_iter_data data = { .mld_id = mld_id, @@ -2718,6 +2731,7 @@ cfg80211_rnr_info_for_mld_ap(const u8 *ie, size_t ielen, u8 mld_id, u8 link_id, *ap_info = data.ap_info; *param_ch_count = data.param_ch_count; + *non_tx = data.non_tx; return data.use_for; } @@ -2897,6 +2911,7 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, ssize_t profile_len; u8 param_ch_count; u8 link_id, use_for; + bool non_tx; if (!ieee80211_mle_basic_sta_prof_size_ok((u8 *)mle->sta_prof[i], mle->sta_prof_len[i])) @@ -2942,10 +2957,24 @@ cfg80211_parse_ml_elem_sta_data(struct wiphy *wiphy, tx_data->ielen, mld_id, link_id, &ap_info, - ¶m_ch_count); + ¶m_ch_count, + &non_tx); if (!use_for) continue; + /* + * As of 802.11be_D5.0, the specification does not give us any + * way of discovering both the MaxBSSID and the Multiple-BSSID + * Index. It does seem like the Multiple-BSSID Index element + * may be provided, but section 9.4.2.45 explicitly forbids + * including a Multiple-BSSID Element (in this case without any + * subelements). + * Without both pieces of information we cannot calculate the + * reference BSSID, so simply ignore the BSS. + */ + if (non_tx) + continue; + /* We could sanity check the BSSID is included */ if (!ieee80211_operating_class_to_band(ap_info->op_class, From patchwork Mon Mar 18 16:53:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595627 X-Patchwork-Delegate: johannes@sipsolutions.net 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 81FC555E77 for ; Mon, 18 Mar 2024 16:54:15 +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=1710780857; cv=none; b=JdHjKhVpn3HWDyDMtQb+DVUUHAQVN1jHOSkHKuPP9GDTLizVnMjXe7/U8mpV6Iqmrx6mijvDOC8ZfuHfRoQz7HxTjCoPKt0zhgKsxD5auHD3VsUPwODaQ0kZ1FdMRVjjNOOSc5t3kzoxt9RMc+6Rx1jJBGvArSDtcb7En6h0Bso= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780857; c=relaxed/simple; bh=y/ECBVb8eLLCzg5a3fwN3z8CRdKZ0eQJi/uGZAFFxTc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Nzbj9TSxFAPHmdc4P8ZPtn5TZMhTBEqcIX3rwb74sL0DbCJ5VBArSEAU+HfmgHHxCDQS0N1qxx8RfkMY+rub6uOzyoYwvyvkMp0WJG8onax9ytzKZxlcSfFdq75u3nD30IAXFSMnZztWI+NyuMS7dcTwep8NZKqAgGEdCyn2x3g= 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=X1Yh8ISl; 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="X1Yh8ISl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780856; x=1742316856; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=y/ECBVb8eLLCzg5a3fwN3z8CRdKZ0eQJi/uGZAFFxTc=; b=X1Yh8ISlUK/AFBUcn9Yh1FXAqB3G6lIHssdoPP25dH7uPcdr71Sa5xnK amWVifMUq6ySIijlUZSryCZN/pCBt9JCNsOWZA669dWMPSSvo0V+rGk/p FxA4Qr4R5U/vwc9pw6Kb0HuEiipwpMOt4/jZVqCocSTfGf+NSkvoXOdxk 3iYoL1UJCqXKRONoatdDnjpxy8KhlUIgVxivSPMC8vViBejc5TS1cbmhy Vye0I0yvYIPK7ZHJSc5dImhus61Hotl1W6RTBc1gqejzbbMkmfun/Uupo IM5rnqtpqg8pv13iiu8OM5YhUfD0Jz3g6oQutHdeTERJD42BRdPXpRjfk w==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819482" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819482" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909946" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:14 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 14/15] wifi: mac80211: fix prep_connection error path Date: Mon, 18 Mar 2024 18:53:30 +0200 Message-Id: <20240318184907.2780c1f08c3d.I033c9b15483933088f32a2c0789612a33dd33d82@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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 prep_channel fails in prep_connection, the code releases the deflink's chanctx, which is wrong since we may be using a different link. It's already wrong to even do that always though, since we might still have the station. Remove it only if prep_channel succeeded and later updates fail. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- net/mac80211/mlme.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 2434023317e9..082fe2bf14fd 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -7666,7 +7666,7 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, sdata_info(sdata, "failed to insert STA entry for the AP (error %d)\n", err); - goto out_err; + goto out_release_chan; } } else WARN_ON_ONCE(!ether_addr_equal(link->u.mgd.bssid, cbss->bssid)); @@ -7677,8 +7677,9 @@ static int ieee80211_prep_connection(struct ieee80211_sub_if_data *sdata, return 0; +out_release_chan: + ieee80211_link_release_channel(link); out_err: - ieee80211_link_release_channel(&sdata->deflink); ieee80211_vif_set_links(sdata, 0, 0); return err; } From patchwork Mon Mar 18 16:53:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13595628 X-Patchwork-Delegate: johannes@sipsolutions.net 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 018B556453 for ; Mon, 18 Mar 2024 16:54:17 +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=1710780859; cv=none; b=BXJZjqOzQSKki7vS1OIyu3kJfwbcwkfcu4WIbB9HAjYFK83P4EN4Z+CgSLylZmSxiNK7Z0cxIY1n+jHkw6MNk0GQju3bo4XB5c54bn+h3ku/UAI4E1UNqDlGAI9/qYSbe00pQRm1xWfA+rU02m61NsjdfrmwFf/tOnsjUU8pQLQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710780859; c=relaxed/simple; bh=9Jf+1w8MpZIEe+sqnFfRIhhm8N0KbGuEhK+k7yoIgF8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lutCbIAaCYdiXtUBqfYosZHVqldFVGXnZWQuokL2cpyt8d/oLNhzzg6nGzBKYTs55p1XNspGRTglMEtuNzavjJ3ZhbTgupsfEWmo4Y7AyxDXe7guQTN6iAln7zObVLteESWBDmdszrKweDxs3B/r+BVvMiVh8Y/eFE6TkeefbX4= 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=kivnIe/q; 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="kivnIe/q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710780858; x=1742316858; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9Jf+1w8MpZIEe+sqnFfRIhhm8N0KbGuEhK+k7yoIgF8=; b=kivnIe/qMSLlD0iSsOnRL8Eg/7fta31gmCl9aDPBUZKchra/4Ev6hEZL ozJiw/k3vfE+O5HIpFj+FsGozhJhFNjXEMRRH7Gc18Xu9gmw95zmHIxvK iAvRExwmmrsja/OrGyVKLb79IA+w7p5WjVwXWIBUkOTnJqLPq5LYU9UCX NgAEr83BmAEw12xAKSXsArLxd2DADXqVs68gHaZ1aXdLh1S3uT8/kJPHi 2p92lb8y6g5jDaqMrX7trek6IDGfNudddRCaOBEGC7V+F1VwgImAwShxq RvxJDJ37OMGJqd5tGK68rMQsF0TMxru4SnJEoX8ol4w81xLzeSfFLnC15 w==; X-IronPort-AV: E=McAfee;i="6600,9927,11017"; a="5819496" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5819496" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13909960" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by orviesa006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 09:54:17 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ayala Beker , Johannes Berg Subject: [PATCH 15/15] wifi: mac80211: add support for tearing down negotiated TTLM Date: Mon, 18 Mar 2024 18:53:31 +0200 Message-Id: <20240318184907.d480cbf46fcf.Idedad472469d2c27dd2a088cf80a13a1e1cf9b78@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240318165331.3170594-1-miriam.rachel.korenblit@intel.com> References: <20240318165331.3170594-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: Ayala Beker In order to activate a link that is currently inactive due to a negotiated TTLM request, need to first tear down the negotiated TTLM request. Add support for sending TTLM teardown request and update the links state accordingly. Signed-off-by: Ayala Beker Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- include/net/mac80211.h | 9 ++++++ net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/mlme.c | 58 ++++++++++++++++++++++++++++++++++++++ net/mac80211/status.c | 22 ++++++++++++++- 4 files changed, 90 insertions(+), 1 deletion(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 88bb781f33f6..f57c29de3a91 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -7591,6 +7591,15 @@ int ieee80211_set_active_links(struct ieee80211_vif *vif, u16 active_links); void ieee80211_set_active_links_async(struct ieee80211_vif *vif, u16 active_links); +/** + * ieee80211_send_teardown_neg_ttlm - tear down a negotiated TTLM request + * @vif: the interface on which the tear down request should be sent. + * + * This function can be used to tear down a previously accepted negotiated + * TTLM request. + */ +void ieee80211_send_teardown_neg_ttlm(struct ieee80211_vif *vif); + /* for older drivers - let's not document these ... */ int ieee80211_emulate_add_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *ctx); diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index b6fead612b66..925e875f9b96 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -89,6 +89,7 @@ enum ieee80211_status_data { IEEE80211_STATUS_TYPE_MASK = 0x00f, IEEE80211_STATUS_TYPE_INVALID = 0, IEEE80211_STATUS_TYPE_SMPS = 1, + IEEE80211_STATUS_TYPE_NEG_TTLM = 2, IEEE80211_STATUS_SUBDATA_MASK = 0xff0, }; @@ -595,6 +596,7 @@ struct ieee80211_if_managed { /* TID-to-link mapping support */ struct wiphy_delayed_work ttlm_work; struct ieee80211_adv_ttlm_info ttlm_info; + struct wiphy_work teardown_ttlm_work; /* dialog token enumerator for neg TTLM request */ u8 dialog_token_alloc; diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 082fe2bf14fd..cd4b54e02653 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -6798,6 +6798,60 @@ void ieee80211_process_neg_ttlm_res(struct ieee80211_sub_if_data *sdata, __ieee80211_disconnect(sdata); } +static void ieee80211_teardown_ttlm_work(struct wiphy *wiphy, + struct wiphy_work *work) +{ + u16 new_dormant_links; + struct ieee80211_sub_if_data *sdata = + container_of(work, struct ieee80211_sub_if_data, + u.mgd.neg_ttlm_timeout_work.work); + + if (!sdata->vif.neg_ttlm.valid) + return; + + memset(&sdata->vif.neg_ttlm, 0, sizeof(sdata->vif.neg_ttlm)); + new_dormant_links = + sdata->vif.dormant_links & ~sdata->vif.suspended_links; + sdata->vif.suspended_links = 0; + ieee80211_vif_set_links(sdata, sdata->vif.valid_links, + new_dormant_links); + ieee80211_vif_cfg_change_notify(sdata, BSS_CHANGED_MLD_TTLM | + BSS_CHANGED_MLD_VALID_LINKS); +} + +void ieee80211_send_teardown_neg_ttlm(struct ieee80211_vif *vif) +{ + struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); + struct ieee80211_local *local = sdata->local; + struct ieee80211_mgmt *mgmt; + struct sk_buff *skb; + int frame_len = offsetofend(struct ieee80211_mgmt, + u.action.u.ttlm_tear_down); + struct ieee80211_tx_info *info; + + skb = dev_alloc_skb(local->hw.extra_tx_headroom + frame_len); + if (!skb) + return; + + skb_reserve(skb, local->hw.extra_tx_headroom); + mgmt = skb_put_zero(skb, frame_len); + mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | + IEEE80211_STYPE_ACTION); + memcpy(mgmt->da, sdata->vif.cfg.ap_addr, ETH_ALEN); + memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); + memcpy(mgmt->bssid, sdata->vif.cfg.ap_addr, ETH_ALEN); + + mgmt->u.action.category = WLAN_CATEGORY_PROTECTED_EHT; + mgmt->u.action.u.ttlm_tear_down.action_code = + WLAN_PROTECTED_EHT_ACTION_TTLM_TEARDOWN; + + info = IEEE80211_SKB_CB(skb); + info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; + info->status_data = IEEE80211_STATUS_TYPE_NEG_TTLM; + ieee80211_tx_skb(sdata, skb); +} +EXPORT_SYMBOL(ieee80211_send_teardown_neg_ttlm); + void ieee80211_sta_rx_queued_ext(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) { @@ -7429,6 +7483,8 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata) ieee80211_tid_to_link_map_work); wiphy_delayed_work_init(&ifmgd->neg_ttlm_timeout_work, ieee80211_neg_ttlm_timeout_work); + wiphy_work_init(&ifmgd->teardown_ttlm_work, + ieee80211_teardown_ttlm_work); ifmgd->flags = 0; ifmgd->powersave = sdata->wdev.ps; @@ -8618,6 +8674,8 @@ void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata) &ifmgd->beacon_connection_loss_work); wiphy_work_cancel(sdata->local->hw.wiphy, &ifmgd->csa_connection_drop_work); + wiphy_work_cancel(sdata->local->hw.wiphy, + &ifmgd->teardown_ttlm_work); wiphy_delayed_work_cancel(sdata->local->hw.wiphy, &ifmgd->tdls_peer_del_work); wiphy_delayed_work_cancel(sdata->local->hw.wiphy, diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 1708b33cdc5e..dd8f857a1fbc 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -5,7 +5,7 @@ * Copyright 2006-2007 Jiri Benc * Copyright 2008-2010 Johannes Berg * Copyright 2013-2014 Intel Mobile Communications GmbH - * Copyright 2021-2023 Intel Corporation + * Copyright 2021-2024 Intel Corporation */ #include @@ -696,6 +696,23 @@ static void ieee80211_handle_smps_status(struct ieee80211_sub_if_data *sdata, wiphy_work_queue(sdata->local->hw.wiphy, &link->u.mgd.recalc_smps); } +static void +ieee80211_handle_teardown_ttlm_status(struct ieee80211_sub_if_data *sdata, + bool acked) +{ + if (!sdata || !ieee80211_sdata_running(sdata)) + return; + + if (!acked) + return; + + if (sdata->vif.type != NL80211_IFTYPE_STATION) + return; + + wiphy_work_queue(sdata->local->hw.wiphy, + &sdata->u.mgd.teardown_ttlm_work); +} + static void ieee80211_report_used_skb(struct ieee80211_local *local, struct sk_buff *skb, bool dropped, ktime_t ack_hwtstamp) @@ -773,6 +790,9 @@ static void ieee80211_report_used_skb(struct ieee80211_local *local, ieee80211_handle_smps_status(sdata, acked, info->status_data); break; + case IEEE80211_STATUS_TYPE_NEG_TTLM: + ieee80211_handle_teardown_ttlm_status(sdata, acked); + break; } rcu_read_unlock(); }