From patchwork Mon Jan 30 07:22:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 649155 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58FB3C54EAA for ; Mon, 30 Jan 2023 07:23:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235729AbjA3HXE (ORCPT ); Mon, 30 Jan 2023 02:23:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235344AbjA3HXC (ORCPT ); Mon, 30 Jan 2023 02:23:02 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 931BDA273 for ; Sun, 29 Jan 2023 23:23:00 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30U6Mdcl025052; Mon, 30 Jan 2023 07:22:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=xe4JgqezyCqlnAKXYnQ9U0me5UtVI1igGmLNrKo14yw=; b=GE4CFV0VQehTqBs+HOxvU+JXuP6L9I419gs+FphHoYX7jgwqWssCH9U3qgNYsgkGJf5q 4oLNT5PNMj2OtYuQvv4HJXVujzGlDRy+ZPwaJX7kcflvm+FfM7r9k0dWPO/WEAf6cyQI rPhwWPeUm+jNMIj6vkx4FfYztokUstnQhtWlVrEjDce/2u7VPNj4Dngyq9qxanP5xfSg VLFdDhfnJVD1kXeN0nYeNv3Nr2kUxpmxsuEZN2pKH+5mNa7r9lTPGpSGKMKwrKVV6y14 xmZmQV0VpDOGcKbj14OaoK1lUQy07kthvWSxvU0ToVfl0cyRytyxyqs66x7n99JKXCZN Bg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ncuxajxut-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:52 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30U7Mp5P026111 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:51 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 29 Jan 2023 23:22:50 -0800 From: Aloka Dixit To: , CC: Aloka Dixit , Muna Sinada Subject: [PATCH v3 1/6] wifi: nl80211: configure puncturing bitmap in NL80211_CMD_START_AP Date: Sun, 29 Jan 2023 23:22:34 -0800 Message-ID: <20230130072239.26345-2-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130072239.26345-1-quic_alokad@quicinc.com> References: <20230130072239.26345-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: smGXN-T0N54GC4Q3ARO-fD8xuH15mmxd X-Proofpoint-GUID: smGXN-T0N54GC4Q3ARO-fD8xuH15mmxd X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-30_05,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 malwarescore=0 bulkscore=0 clxscore=1015 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301300070 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Add a new attribute NL80211_ATTR_PUNCT_BITMAP to receive a puncturing bitmap from the userspace. Each bit corresponds to a 20 MHz channel in the operating bandwidth, lowest bit for the lowest frequency. Bit set to 1 indicates that the channel is punctured. Signed-off-by: Aloka Dixit Signed-off-by: Muna Sinada --- v3: Validation and storing the bitmap moved to MAC80211. v2: Puncturing bitmap added to struct cfg80211_chan_def and validated in CFG80211. include/net/cfg80211.h | 5 +++++ include/uapi/linux/nl80211.h | 13 +++++++++++++ net/wireless/nl80211.c | 21 +++++++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 54a77d906b2d..c25a558d50ea 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1316,6 +1316,10 @@ struct cfg80211_unsol_bcast_probe_resp { * @fils_discovery: FILS discovery transmission parameters * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters * @mbssid_config: AP settings for multiple bssid + * @punct_bitmap: Preamble puncturing bitmap. Each bit represents a 20 MHz + * channel, lowest bit corresponding to the lowest frequency. Bit set + * to 1 indicates that the channel is punctured. Higher 16 bits are + * reserved. */ struct cfg80211_ap_settings { struct cfg80211_chan_def chandef; @@ -1350,6 +1354,7 @@ struct cfg80211_ap_settings { struct cfg80211_fils_discovery fils_discovery; struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp; struct cfg80211_mbssid_config mbssid_config; + u32 punct_bitmap; }; /** diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 8ecb0fbee721..b029a5b30c52 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h @@ -2752,6 +2752,12 @@ enum nl80211_commands { * the incoming frame RX timestamp. * @NL80211_ATTR_TD_BITMAP: Transition Disable bitmap, for subsequent * (re)associations. + * + * @NL80211_ATTR_PUNCT_BITMAP: (u32) Preamble puncturing bitmap, lowest + * bit corresponds to the lowest 20 MHz channel. Each bit set to 1 + * indicates that the sub-channel is punctured. Higher 16 bits are + * reserved. + * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use @@ -3281,6 +3287,8 @@ enum nl80211_attrs { NL80211_ATTR_RX_HW_TIMESTAMP, NL80211_ATTR_TD_BITMAP, + NL80211_ATTR_PUNCT_BITMAP, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, @@ -6296,6 +6304,9 @@ enum nl80211_feature_flags { * might apply, e.g. no scans in progress, no offchannel operations * in progress, and no active connections. * + * @NL80211_EXT_FEATURE_EHT_PUNCTURING: Driver supports preamble puncturing in + * EHT. + * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. */ @@ -6365,6 +6376,8 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_RADAR_BACKGROUND, NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE, + NL80211_EXT_FEATURE_EHT_PUNCTURING, + /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 64cf6110ce9d..351c4cc5ec92 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -805,6 +805,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { [NL80211_ATTR_MLD_ADDR] = NLA_POLICY_EXACT_LEN(ETH_ALEN), [NL80211_ATTR_MLO_SUPPORT] = { .type = NLA_FLAG }, [NL80211_ATTR_MAX_NUM_AKM_SUITES] = { .type = NLA_REJECT }, + [NL80211_ATTR_PUNCT_BITMAP] = { .type = NLA_U32 }, }; /* policy for the key attributes */ @@ -3173,6 +3174,19 @@ static bool nl80211_can_set_dev_channel(struct wireless_dev *wdev) wdev->iftype == NL80211_IFTYPE_P2P_GO; } +static int nl80211_parse_punct_bitmap(struct cfg80211_registered_device *rdev, + struct genl_info *info, + u32 *bitmap) +{ + if (!bitmap || + !wiphy_ext_feature_isset(&rdev->wiphy, + NL80211_EXT_FEATURE_EHT_PUNCTURING)) + return -EINVAL; + + *bitmap = nla_get_u32(info->attrs[NL80211_ATTR_PUNCT_BITMAP]) & 0xFFFF; + return 0; +} + int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, struct genl_info *info, struct cfg80211_chan_def *chandef) @@ -5918,6 +5932,13 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info) goto out; } + if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) { + err = nl80211_parse_punct_bitmap(rdev, info, + ¶ms->punct_bitmap); + if (err) + goto out; + } + if (!cfg80211_reg_can_beacon_relax(&rdev->wiphy, ¶ms->chandef, wdev->iftype)) { err = -EINVAL; From patchwork Mon Jan 30 07:22:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 648918 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2304C636CC for ; Mon, 30 Jan 2023 07:23:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235810AbjA3HXG (ORCPT ); Mon, 30 Jan 2023 02:23:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235680AbjA3HXD (ORCPT ); Mon, 30 Jan 2023 02:23:03 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C638211EAC for ; Sun, 29 Jan 2023 23:23:01 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30U6ikpL020865; Mon, 30 Jan 2023 07:22:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=PlmJ6sdt3ghCjo7V1Ly2TmH4/Sm7O4zGNIr5SDKRBAQ=; b=p4Li4EL170uqzyMqtUGokozBD8hyWJMLdCIIzP3t0TQc4tmP/66DQzPBlu5rrUT9aWld cPAjH0v5O2x0RohwugFKVvp6mHPLpV49CrX5wE/k8WtL9zeYzw5Q3eR5tAtasn13RrwQ rOOhWLCrrlcyFxCaM61wJ42lyTHDKFtUBuki8qCNTR0edxd0Mjpan9YNk7BWbcz4P8Qj 4UMnJmEmRBgcdsI8uqmh1Z9e4/uU0I3jCpk4o6CwlzuX5RkEVFpxH2XhPxYJIGesLu0L IIG7Mw4IhU5dyRirm5waAgKBqMkisncKN6Nyq1zE0OfHwlPj6HMI6wuh3C0xOeHd1rYS TQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ncuxajxuu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:52 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30U7MpjC010477 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:51 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 29 Jan 2023 23:22:51 -0800 From: Aloka Dixit To: , CC: Aloka Dixit , Muna Sinada Subject: [PATCH v3 2/6] wifi: mac80211: validate and configure puncturing bitmap in start_ap() Date: Sun, 29 Jan 2023 23:22:35 -0800 Message-ID: <20230130072239.26345-3-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130072239.26345-1-quic_alokad@quicinc.com> References: <20230130072239.26345-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: zB0i95sk0VIGsUO6bfo5nUME3_jBRdIc X-Proofpoint-GUID: zB0i95sk0VIGsUO6bfo5nUME3_jBRdIc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-30_05,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 malwarescore=0 bulkscore=0 clxscore=1015 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxlogscore=650 impostorscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301300070 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org - Make puncturing bitmap 32 bit to match NL80211 interface. - Export ieee80211_valid_disable_subchannel_bitmap() and use it to validate the puncturing bitmap in AP mode. - Modify 'change' in ieee80211_start_ap() from u32 to u64 to support BSS_CHANGED_EHT_PUNCTURING. - Configure the bitmap in link_conf and notify the driver. Signed-off-by: Aloka Dixit Signed-off-by: Muna Sinada --- v3: This patch depends on following, https://patchwork.kernel.org/project/linux-wireless/patch/20230127123930.4fbc74582331.I3547481d49f958389f59dfeba3fcc75e72b0aa6e@changeid/ include/net/mac80211.h | 2 +- net/mac80211/cfg.c | 10 +++++++++- net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/mlme.c | 10 +++++----- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 54ffc0cc2918..b1c17c7ac044 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -738,7 +738,7 @@ struct ieee80211_bss_conf { u8 tx_pwr_env_num; u8 pwr_reduction; bool eht_support; - u16 eht_puncturing; + u32 eht_puncturing; bool csa_active; bool mu_mimo_owner; diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 24b8648cfafa..185e218e8668 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1220,7 +1220,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, struct ieee80211_local *local = sdata->local; struct beacon_data *old; struct ieee80211_sub_if_data *vlan; - u32 changed = BSS_CHANGED_BEACON_INT | + u64 changed = BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON_ENABLED | BSS_CHANGED_BEACON | BSS_CHANGED_P2P_PS | @@ -1296,6 +1296,14 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, IEEE80211_HE_PHY_CAP2_UL_MU_FULL_MU_MIMO; } + if (params->eht_cap) { + if (!ieee80211_valid_disable_subchannel_bitmap( + ¶ms->punct_bitmap, + params->chandef.width)) + return -EINVAL; + link_conf->eht_puncturing = params->punct_bitmap; + changed |= BSS_CHANGED_EHT_PUNCTURING; + } if (sdata->vif.type == NL80211_IFTYPE_AP && params->mbssid_config.tx_wdev) { err = ieee80211_set_ap_mbssid_options(sdata, diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index e833d472ff72..6fd14a3930d6 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -2566,4 +2566,6 @@ ieee80211_eht_cap_ie_to_sta_eht_cap(struct ieee80211_sub_if_data *sdata, const struct ieee80211_eht_cap_elem *eht_cap_ie_elem, u8 eht_cap_len, struct link_sta_info *link_sta); +bool ieee80211_valid_disable_subchannel_bitmap(u32 *bitmap, + enum nl80211_chan_width bw); #endif /* IEEE80211_I_H */ diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index a14a5ea2bffd..50efd5980387 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -119,8 +119,8 @@ static const struct ieee80211_per_bw_puncturing_values per_bw_puncturing[] = { IEEE80211_PER_BW_VALID_PUNCTURING_VALUES(320) }; -static bool ieee80211_valid_disable_subchannel_bitmap(u16 *bitmap, - enum nl80211_chan_width bw) +bool ieee80211_valid_disable_subchannel_bitmap(u32 *bitmap, + enum nl80211_chan_width bw) { u32 idx, i; @@ -206,7 +206,7 @@ ieee80211_handle_puncturing_bitmap(struct ieee80211_link_data *link, ieee80211_extract_dis_subch_bmap(eht_oper, chandef, bitmap); - if (ieee80211_valid_disable_subchannel_bitmap(&bitmap, + if (ieee80211_valid_disable_subchannel_bitmap((u32 *)&bitmap, chandef->width)) break; link->u.mgd.conn_flags |= @@ -5638,7 +5638,7 @@ static bool ieee80211_config_puncturing(struct ieee80211_link_data *link, extracted == link->conf->eht_puncturing) return true; - if (!ieee80211_valid_disable_subchannel_bitmap(&bitmap, + if (!ieee80211_valid_disable_subchannel_bitmap((u32 *)&bitmap, link->conf->chandef.width)) { link_info(link, "Got an invalid disable subchannel bitmap from AP %pM: bitmap = 0x%x, bw = 0x%x. disconnect\n", @@ -7132,7 +7132,7 @@ ieee80211_setup_assoc_link(struct ieee80211_sub_if_data *sdata, u16 bitmap; bitmap = get_unaligned_le16(disable_subchannel_bitmap); - if (ieee80211_valid_disable_subchannel_bitmap(&bitmap, + if (ieee80211_valid_disable_subchannel_bitmap((u32 *)&bitmap, link->conf->chandef.width)) ieee80211_handle_puncturing_bitmap(link, eht_oper, From patchwork Mon Jan 30 07:22:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 648920 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E31FC54EED for ; Mon, 30 Jan 2023 07:23:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235643AbjA3HXD (ORCPT ); Mon, 30 Jan 2023 02:23:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjA3HXC (ORCPT ); Mon, 30 Jan 2023 02:23:02 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06182EB65 for ; Sun, 29 Jan 2023 23:22:59 -0800 (PST) Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30U7205n023169; Mon, 30 Jan 2023 07:22:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=ZzB6z+OzCHpblfZxtSDFGZdU4J1iOadjsxWl2svHmFM=; b=Gyeb13k4HjkMY4z/5Ms3hDBHfSYZzTVneh5pKDT17Wl44ZxAq/wuo8mWPmQs2DLb7iJj XHL0RWUCfAzPfMnA+l4+22UcphxmyKC0FJsiIhUFT+Z5aWboTmtBIAKVDcXuk0mtNm+Y yaMWBMAfHTlbxExwmiDWc+immcGhx17j+DKdBqV+pjOZkzoPL02XU57l8OqtMQ3GoXRk cHW0c7tMx/6xHnVegpBwmvmGGACdZUrapyAVqWSp1QwKsXVjFnAuoE+LFa2FyMhmYPhB 5P+EI9sGCvZ5RS5n7BTNPCyZP9P1/bU/iz3W9/IR9NQAhO2wVFApBJ/DAq83FjURdIKa rQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ncv3fb6p6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:53 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30U7Mq65008655 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:52 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 29 Jan 2023 23:22:51 -0800 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v3 3/6] wifi: nl80211: configure puncturing in NL80211_CMD_CHANNEL_SWITCH Date: Sun, 29 Jan 2023 23:22:36 -0800 Message-ID: <20230130072239.26345-4-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130072239.26345-1-quic_alokad@quicinc.com> References: <20230130072239.26345-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: gpQVyqwk1qh0W4n6rX1rfFyIeNftExXP X-Proofpoint-ORIG-GUID: gpQVyqwk1qh0W4n6rX1rfFyIeNftExXP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-30_05,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301300070 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Retrieve the puncturing bitmap during channel switch operation and store it in struct cfg80211_csa_settings. Signed-off-by: Aloka Dixit --- include/net/cfg80211.h | 5 +++++ net/mac80211/cfg.c | 5 ++--- net/wireless/nl80211.c | 7 +++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index c25a558d50ea..7714a44d312e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1372,6 +1372,10 @@ struct cfg80211_ap_settings { * @radar_required: whether radar detection is required on the new channel * @block_tx: whether transmissions should be blocked while changing * @count: number of beacons until switch + * @punct_bitmap: Preamble puncturing bitmap. Each bit represents a 20 MHz + * channel with lowest bit corresponding to the lowest frequency. Bit set + * to 1 indicates that the channel is punctured. Higher 16 bits are + * currently unused. */ struct cfg80211_csa_settings { struct cfg80211_chan_def chandef; @@ -1384,6 +1388,7 @@ struct cfg80211_csa_settings { bool radar_required; bool block_tx; u8 count; + u32 punct_bitmap; }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 185e218e8668..87aab0ba9353 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1297,9 +1297,8 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev, } if (params->eht_cap) { - if (!ieee80211_valid_disable_subchannel_bitmap( - ¶ms->punct_bitmap, - params->chandef.width)) + if (!ieee80211_valid_disable_subchannel_bitmap(¶ms->punct_bitmap, + params->chandef.width)) return -EINVAL; link_conf->eht_puncturing = params->punct_bitmap; changed |= BSS_CHANGED_EHT_PUNCTURING; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 351c4cc5ec92..efe841ba8865 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10078,6 +10078,13 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info) if (info->attrs[NL80211_ATTR_CH_SWITCH_BLOCK_TX]) params.block_tx = true; + if (info->attrs[NL80211_ATTR_PUNCT_BITMAP]) { + err = nl80211_parse_punct_bitmap(rdev, info, + ¶ms.punct_bitmap); + if (err) + goto free; + } + wdev_lock(wdev); err = rdev_channel_switch(rdev, dev, ¶ms); wdev_unlock(wdev); From patchwork Mon Jan 30 07:22:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 648919 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BDB9C636CB for ; Mon, 30 Jan 2023 07:23:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235791AbjA3HXE (ORCPT ); Mon, 30 Jan 2023 02:23:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235384AbjA3HXD (ORCPT ); Mon, 30 Jan 2023 02:23:03 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CB6C11E89 for ; Sun, 29 Jan 2023 23:23:00 -0800 (PST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30U701b5019150; Mon, 30 Jan 2023 07:22:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=91nwmMgLOMNoljViMsb2pk2FpMO7qbeOyTWe2FsfO0c=; b=eoGuDv1N5IYas5B861lawUH2/mwg2b7kfa+CDsQKIjBkbSaSsSRw9182LyeB/wh/mBJW kiD1GFocSqlvTYfYMgF3nGYpDrZ2rPBCwcuvWUYDEKhxOwha1KUNEVZFlA4qjlV63mct yrYPi7O24BIfkmV40n9cett2q6z/TG/FiM3ia/SME3iVwHeQ2n3bXbxBGiJOer0MTKIU ZojerYnCQd1u84+kDURYs1A1HZmbdNPyCSGqY5Ek8VTEyUNKNpgxx/ewngLBtAhS1Thg 7kDBuirAX/262barc73/+CU9g6mqyVoKzHFtPWPKp3MRdTZaDdY5CT03UThau1UuYt4h UQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ncvfpaurg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:53 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30U7MqRf014986 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:52 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 29 Jan 2023 23:22:52 -0800 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v3 4/6] wifi: mac80211: configure puncturing bitmap in channel_switch() Date: Sun, 29 Jan 2023 23:22:37 -0800 Message-ID: <20230130072239.26345-5-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130072239.26345-1-quic_alokad@quicinc.com> References: <20230130072239.26345-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: lT9zngIbdAekLPgxF4qx8JYeYV9ekK35 X-Proofpoint-ORIG-GUID: lT9zngIbdAekLPgxF4qx8JYeYV9ekK35 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-30_05,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 phishscore=0 mlxlogscore=801 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301300070 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Validate and set the puncturing bitmap in bss_conf for new channel. Signed-off-by: Aloka Dixit --- include/net/mac80211.h | 3 +++ net/mac80211/cfg.c | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b1c17c7ac044..87db6055d331 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -645,6 +645,7 @@ struct ieee80211_fils_discovery { * @csa_active: marks whether a channel switch is going on. Internally it is * write-protected by sdata_lock and local->mtx so holding either is fine * for read access. + * @csa_punct_bitmap: new pucturing bitmap for channel switch * @mu_mimo_owner: indicates interface owns MU-MIMO capability * @chanctx_conf: The channel context this interface is assigned to, or %NULL * when it is not assigned. This pointer is RCU-protected due to the TX @@ -741,6 +742,8 @@ struct ieee80211_bss_conf { u32 eht_puncturing; bool csa_active; + u32 csa_punct_bitmap; + bool mu_mimo_owner; struct ieee80211_chanctx_conf __rcu *chanctx_conf; diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 87aab0ba9353..8a1cb2f083f5 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3553,6 +3553,12 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata) lockdep_assert_held(&local->mtx); lockdep_assert_held(&local->chanctx_mtx); + if (sdata->vif.bss_conf.eht_puncturing != sdata->vif.bss_conf.csa_punct_bitmap) { + sdata->vif.bss_conf.eht_puncturing = + sdata->vif.bss_conf.csa_punct_bitmap; + changed |= BSS_CHANGED_EHT_PUNCTURING; + } + /* * using reservation isn't immediate as it may be deferred until later * with multi-vif. once reservation is complete it will re-schedule the @@ -3856,9 +3862,16 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, goto out; } + if (params->punct_bitmap && + (!sdata->vif.bss_conf.eht_support || + !ieee80211_valid_disable_subchannel_bitmap(¶ms->punct_bitmap, + params->chandef.width))) + goto out; + sdata->deflink.csa_chandef = params->chandef; sdata->deflink.csa_block_tx = params->block_tx; sdata->vif.bss_conf.csa_active = true; + sdata->vif.bss_conf.csa_punct_bitmap = params->punct_bitmap; if (sdata->deflink.csa_block_tx) ieee80211_stop_vif_queues(local, sdata, From patchwork Mon Jan 30 07:22:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 648917 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30B4AC636CB for ; Mon, 30 Jan 2023 07:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235813AbjA3HXI (ORCPT ); Mon, 30 Jan 2023 02:23:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235344AbjA3HXE (ORCPT ); Mon, 30 Jan 2023 02:23:04 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B675E11EA4 for ; Sun, 29 Jan 2023 23:23:01 -0800 (PST) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30U5EbDd011214; Mon, 30 Jan 2023 07:22:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=syMCfit2w+FC5eycC3E8a1r4DJunZ5yZfaDTjB1kQUM=; b=bx20HRm3wqkqZTwN+4hoqVKe68BKr5HMOLzBEU8nGewX3yhI2dOKsVshrdJ7vq9VJElc xWG442Mzf1zIlYBEpUtsWfMjJzerK8NyuYvF9HlbQoygl+OFHbrgHrptqf14VkWKvt3X o4sUR3HV46IgeX6T5QfcadAJYcyOr4FswWOCuKRsH7kMgFuiNdwgxnRMRQLL+7KsAEBk jC9+N6UUq1KJD8Fer/9lBrqc5jsQRN0sdCNudruN1E0Oh2qYoRpRrWlCAXK/KgSo5CY6 xLZ99VB26N0LXvt4wk/hrkH06GhR9NxBGkfkxVS+1GFwfxyXc97KmYerrEGEQZkLV0n5 vQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ncs2x3e7h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:53 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30U7MqTo008853 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:53 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 29 Jan 2023 23:22:52 -0800 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v3 5/6] wifi: cfg80211: add puncturing bitmap in channel switch notifications Date: Sun, 29 Jan 2023 23:22:38 -0800 Message-ID: <20230130072239.26345-6-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130072239.26345-1-quic_alokad@quicinc.com> References: <20230130072239.26345-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: qJZwXmN5N0NdWAf-WR1pdZzGjA6WitUs X-Proofpoint-GUID: qJZwXmN5N0NdWAf-WR1pdZzGjA6WitUs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-30_05,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 mlxlogscore=999 impostorscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301300070 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Modify channel switch notify functions and corresponding trace functions to include the new puncturing bitmap. Signed-off-by: Aloka Dixit --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 2 +- drivers/net/wireless/marvell/mwifiex/11h.c | 2 +- include/net/cfg80211.h | 6 ++++-- net/mac80211/cfg.c | 6 ++++-- net/mac80211/mlme.c | 4 ++-- net/wireless/nl80211.c | 10 +++++---- net/wireless/trace.h | 24 ++++++++++++++-------- 7 files changed, 34 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index a20e0aeae284..0c2b8b1a10d5 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -1119,7 +1119,7 @@ void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT); mutex_lock(&vif->wdev.mtx); - cfg80211_ch_switch_notify(vif->ndev, &chandef, 0); + cfg80211_ch_switch_notify(vif->ndev, &chandef, 0, 0); mutex_unlock(&vif->wdev.mtx); } diff --git a/drivers/net/wireless/marvell/mwifiex/11h.c b/drivers/net/wireless/marvell/mwifiex/11h.c index 6a9d7bc1f41e..b0c40a776a2e 100644 --- a/drivers/net/wireless/marvell/mwifiex/11h.c +++ b/drivers/net/wireless/marvell/mwifiex/11h.c @@ -292,6 +292,6 @@ void mwifiex_dfs_chan_sw_work_queue(struct work_struct *work) mwifiex_dbg(priv->adapter, MSG, "indicating channel switch completion to kernel\n"); mutex_lock(&priv->wdev.mtx); - cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef, 0); + cfg80211_ch_switch_notify(priv->netdev, &priv->dfs_chandef, 0, 0); mutex_unlock(&priv->wdev.mtx); } diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7714a44d312e..1ac5befc3cc8 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -8282,13 +8282,14 @@ bool cfg80211_reg_can_beacon_relax(struct wiphy *wiphy, * @dev: the device which switched channels * @chandef: the new channel definition * @link_id: the link ID for MLO, must be 0 for non-MLO + * @punct_bitmap: the new puncturing bitmap * * Caller must acquire wdev_lock, therefore must only be called from sleepable * driver context! */ void cfg80211_ch_switch_notify(struct net_device *dev, struct cfg80211_chan_def *chandef, - unsigned int link_id); + unsigned int link_id, u32 punct_bitmap); /* * cfg80211_ch_switch_started_notify - notify channel switch start @@ -8297,6 +8298,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev, * @link_id: the link ID for MLO, must be 0 for non-MLO * @count: the number of TBTTs until the channel switch happens * @quiet: whether or not immediate quiet was requested by the AP + * @punct_bitmap: the future puncturing bitmap * * Inform the userspace about the channel switch that has just * started, so that it can take appropriate actions (eg. starting @@ -8305,7 +8307,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev, void cfg80211_ch_switch_started_notify(struct net_device *dev, struct cfg80211_chan_def *chandef, unsigned int link_id, u8 count, - bool quiet); + bool quiet, u32 punct_bitmap); /** * ieee80211_operating_class_to_band - convert operating class to band diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8a1cb2f083f5..1c40586b3d98 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3600,7 +3600,8 @@ static int __ieee80211_csa_finalize(struct ieee80211_sub_if_data *sdata) if (err) return err; - cfg80211_ch_switch_notify(sdata->dev, &sdata->deflink.csa_chandef, 0); + cfg80211_ch_switch_notify(sdata->dev, &sdata->deflink.csa_chandef, 0, + sdata->vif.bss_conf.eht_puncturing); return 0; } @@ -3879,7 +3880,8 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, cfg80211_ch_switch_started_notify(sdata->dev, &sdata->deflink.csa_chandef, 0, - params->count, params->block_tx); + params->count, params->block_tx, + sdata->vif.bss_conf.csa_punct_bitmap); if (changed) { ieee80211_link_info_change_notify(sdata, &sdata->deflink, diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 50efd5980387..e14799799dd4 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1839,7 +1839,7 @@ static void ieee80211_chswitch_post_beacon(struct ieee80211_link_data *link) return; } - cfg80211_ch_switch_notify(sdata->dev, &link->reserved_chandef, 0); + cfg80211_ch_switch_notify(sdata->dev, &link->reserved_chandef, 0, 0); } void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success) @@ -2049,7 +2049,7 @@ ieee80211_sta_process_chanswitch(struct ieee80211_link_data *link, mutex_unlock(&local->mtx); cfg80211_ch_switch_started_notify(sdata->dev, &csa_ie.chandef, 0, - csa_ie.count, csa_ie.mode); + csa_ie.count, csa_ie.mode, 0); if (local->ops->channel_switch) { /* use driver's channel switch callback */ diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index efe841ba8865..55daddb0e6ad 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -19030,7 +19030,7 @@ static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev, void cfg80211_ch_switch_notify(struct net_device *dev, struct cfg80211_chan_def *chandef, - unsigned int link_id) + unsigned int link_id, u32 punct_bitmap) { struct wireless_dev *wdev = dev->ieee80211_ptr; struct wiphy *wiphy = wdev->wiphy; @@ -19039,7 +19039,7 @@ void cfg80211_ch_switch_notify(struct net_device *dev, ASSERT_WDEV_LOCK(wdev); WARN_INVALID_LINK_ID(wdev, link_id); - trace_cfg80211_ch_switch_notify(dev, chandef, link_id); + trace_cfg80211_ch_switch_notify(dev, chandef, link_id, punct_bitmap); switch (wdev->iftype) { case NL80211_IFTYPE_STATION: @@ -19074,7 +19074,7 @@ EXPORT_SYMBOL(cfg80211_ch_switch_notify); void cfg80211_ch_switch_started_notify(struct net_device *dev, struct cfg80211_chan_def *chandef, unsigned int link_id, u8 count, - bool quiet) + bool quiet, u32 punct_bitmap) { struct wireless_dev *wdev = dev->ieee80211_ptr; struct wiphy *wiphy = wdev->wiphy; @@ -19083,7 +19083,9 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev, ASSERT_WDEV_LOCK(wdev); WARN_INVALID_LINK_ID(wdev, link_id); - trace_cfg80211_ch_switch_started_notify(dev, chandef, link_id); + trace_cfg80211_ch_switch_started_notify(dev, chandef, link_id, + punct_bitmap); + nl80211_ch_switch_notify(rdev, dev, link_id, chandef, GFP_KERNEL, NL80211_CMD_CH_SWITCH_STARTED_NOTIFY, diff --git a/net/wireless/trace.h b/net/wireless/trace.h index a405c3edbc47..e9db666e5a4e 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h @@ -3245,39 +3245,47 @@ TRACE_EVENT(cfg80211_chandef_dfs_required, TRACE_EVENT(cfg80211_ch_switch_notify, TP_PROTO(struct net_device *netdev, struct cfg80211_chan_def *chandef, - unsigned int link_id), - TP_ARGS(netdev, chandef, link_id), + unsigned int link_id, + u32 punct_bitmap), + TP_ARGS(netdev, chandef, link_id, punct_bitmap), TP_STRUCT__entry( NETDEV_ENTRY CHAN_DEF_ENTRY __field(unsigned int, link_id) + __field(u32, punct_bitmap) ), TP_fast_assign( NETDEV_ASSIGN; CHAN_DEF_ASSIGN(chandef); __entry->link_id = link_id; + __entry->punct_bitmap = punct_bitmap; ), - TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d", - NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id) + TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d, punct_bitmap:%u", + NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id, + __entry->punct_bitmap) ); TRACE_EVENT(cfg80211_ch_switch_started_notify, TP_PROTO(struct net_device *netdev, struct cfg80211_chan_def *chandef, - unsigned int link_id), - TP_ARGS(netdev, chandef, link_id), + unsigned int link_id, + u32 punct_bitmap), + TP_ARGS(netdev, chandef, link_id, punct_bitmap), TP_STRUCT__entry( NETDEV_ENTRY CHAN_DEF_ENTRY __field(unsigned int, link_id) + __field(u32, punct_bitmap) ), TP_fast_assign( NETDEV_ASSIGN; CHAN_DEF_ASSIGN(chandef); __entry->link_id = link_id; + __entry->punct_bitmap = punct_bitmap; ), - TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d", - NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id) + TP_printk(NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT ", link:%d, punct_bitmap:%u", + NETDEV_PR_ARG, CHAN_DEF_PR_ARG, __entry->link_id, + __entry->punct_bitmap) ); TRACE_EVENT(cfg80211_radar_event, From patchwork Mon Jan 30 07:22:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aloka Dixit X-Patchwork-Id: 649153 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E4E2C636D0 for ; Mon, 30 Jan 2023 07:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235811AbjA3HXH (ORCPT ); Mon, 30 Jan 2023 02:23:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235734AbjA3HXE (ORCPT ); Mon, 30 Jan 2023 02:23:04 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB371EB65 for ; Sun, 29 Jan 2023 23:23:02 -0800 (PST) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30U5R2GX012346; Mon, 30 Jan 2023 07:22:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=bKTblokCGoYjixOwCXgpQa5tnihfrqA+kGfvd4N2gcY=; b=gmvlBTk8WhFAZChfEa5Q0ordY0OI7EFm+imliXYuSRIYvvSHxTgEf/p1H7yGb1iM2qkm 7iaiMgfBBv0/BneCFq6hhMZipJuE2rAsaWuiLtAt/k+Wn4rgYTaHbETy58aBU45W7GQu SmvacqUq9scXRm9jOnY59/4Gj90AqlhWcqT1VDGNUorSFUqm8kkLNYjj/OssC5TI9nNV QYQimWhCMz2ajk0XVA0YNNUjPVgMqcl7hBgeUaPPGJqaa9N1TJv5WWUS3vb+KRkg2ycG GBRHzC8eOfEza2TQNeH9UpvlbeyUq1okDz4ZFf+bGxqENgRSqpgdpUBMrS4mtczntEQm cg== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3ncu1tu8gn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:54 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30U7Mrrj014994 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 30 Jan 2023 07:22:53 GMT Received: from alokad-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 29 Jan 2023 23:22:52 -0800 From: Aloka Dixit To: , CC: Aloka Dixit Subject: [PATCH v3 6/6] wifi: nl80211: add puncturing bitmap in channel switch events Date: Sun, 29 Jan 2023 23:22:39 -0800 Message-ID: <20230130072239.26345-7-quic_alokad@quicinc.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230130072239.26345-1-quic_alokad@quicinc.com> References: <20230130072239.26345-1-quic_alokad@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 98hL9NlcMvDgUfU00aI6XkBg15vTjkYB X-Proofpoint-ORIG-GUID: 98hL9NlcMvDgUfU00aI6XkBg15vTjkYB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-30_05,2023-01-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 spamscore=0 bulkscore=0 phishscore=0 mlxscore=0 mlxlogscore=999 impostorscore=0 suspectscore=0 clxscore=1015 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301300070 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Include the puncturing bitmap in channel switch (started/finished) notifications to userspace. Signed-off-by: Aloka Dixit --- net/wireless/nl80211.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 55daddb0e6ad..4d415e04f5a3 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -18984,7 +18984,7 @@ static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev, struct cfg80211_chan_def *chandef, gfp_t gfp, enum nl80211_commands notif, - u8 count, bool quiet) + u8 count, bool quiet, u32 punct_bitmap) { struct wireless_dev *wdev = netdev->ieee80211_ptr; struct sk_buff *msg; @@ -19018,6 +19018,9 @@ static void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev, goto nla_put_failure; } + if (nla_put_u32(msg, NL80211_ATTR_PUNCT_BITMAP, punct_bitmap)) + goto nla_put_failure; + genlmsg_end(msg, hdr); genlmsg_multicast_netns(&nl80211_fam, wiphy_net(&rdev->wiphy), msg, 0, @@ -19067,7 +19070,8 @@ void cfg80211_ch_switch_notify(struct net_device *dev, cfg80211_sched_dfs_chan_update(rdev); nl80211_ch_switch_notify(rdev, dev, link_id, chandef, GFP_KERNEL, - NL80211_CMD_CH_SWITCH_NOTIFY, 0, false); + NL80211_CMD_CH_SWITCH_NOTIFY, 0, false, + punct_bitmap); } EXPORT_SYMBOL(cfg80211_ch_switch_notify); @@ -19089,7 +19093,7 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev, nl80211_ch_switch_notify(rdev, dev, link_id, chandef, GFP_KERNEL, NL80211_CMD_CH_SWITCH_STARTED_NOTIFY, - count, quiet); + count, quiet, punct_bitmap); } EXPORT_SYMBOL(cfg80211_ch_switch_started_notify);