From patchwork Wed Sep 6 10:34:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 13375504 X-Patchwork-Delegate: johannes@sipsolutions.net 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 5457EEB8FB7 for ; Wed, 6 Sep 2023 10:35:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239182AbjIFKf1 (ORCPT ); Wed, 6 Sep 2023 06:35:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbjIFKf0 (ORCPT ); Wed, 6 Sep 2023 06:35:26 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 966FACF2 for ; Wed, 6 Sep 2023 03:35:22 -0700 (PDT) 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 386AGIeR017626; Wed, 6 Sep 2023 10:35:16 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=tWqkHgvc+q2bKIrJYk4xfod6IIugjpP/FP0d9unZd0s=; b=m3P9UJuA8+09BfaKHbDUmgiZNAMDRtYVYTupQUcOpU6vDQfN4445LA0lomkB4BHR/YKr aocVc2XgZMnlmIPcsG2SFGYFicZ+H85VecchwCJPhXRT34kycTv+zZpT6l9gahRk7gMw 6M0i2tgOCsfAnJF70Uvo5P8qdhBLHNyTPBElk5c/6LsfrSrBq8grO/I6gt2jvx/14hH5 uWz8ER8vnP+EQuq2BqmRlBd1vgzx+8FXhC3ELSC2bxb1NWTR/zEGwFsPXsjG0PP+8NzY YRO7Ow7T607x9Hz4B+mstHUgYmhU5SWF2VznOi4r7ZBC5Q80tt7SN6FpmgTmU1vyDTyt Zw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3sxqha03ds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Sep 2023 10:35:16 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 386AZFja029315 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Sep 2023 10:35:15 GMT Received: from wgong-HP3-Z230-SFF-Workstation.qca.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Wed, 6 Sep 2023 03:35:14 -0700 From: Wen Gong To: , CC: , Subject: [PATCH 1/3] wifi: mac80211: add support to allow driver to generate local link address for station Date: Wed, 6 Sep 2023 06:34:56 -0400 Message-ID: <20230906103458.24092-2-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230906103458.24092-1-quic_wgong@quicinc.com> References: <20230906103458.24092-1-quic_wgong@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: UO2qx8LCKC0N939BOm_w9FxsWLbwS8l3 X-Proofpoint-GUID: UO2qx8LCKC0N939BOm_w9FxsWLbwS8l3 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-06_03,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 bulkscore=0 impostorscore=0 adultscore=0 phishscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 mlxscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309060089 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently the local link address of all links is random generated by eth_random_addr() in mac80211 while connecting to a MLO AP for station mode. The MAC address of link is not passed from NL command. The 1st link address is generated while authenticate with AP, the other links' addresses are generated after assoc success with AP. It is not convenient for some driver, reason is, for station mode, the interface with its mac address is already created in driver after wlan load, it is used for hw scan and non-MLO connection. When connecting to MLO AP, driver reuse the interface as the 1st link of MLO. If the mac address of the 1st link changed to a new value, then driver need to change the mac address and do many synchronous operation with firmware. Thus the operation become complex. After MLO disconnect, driver need to restore the old mac address, it is also another complex operation. The hw scan maybe happen through the MLO connection/disconnection. And the hw scan uses the 1st link address while MLO connected and uses the interface address while MLO is disconnected, this leads hw scan complex. Hence add this interface to allow driver to generate the address of each link while MLO connection. Then driver could provide the same mac address for the 1st link, thus hw scan/NON-MLO connection/1st link of MLO will use the same mac address, then operation become easy. Signed-off-by: Wen Gong --- include/net/mac80211.h | 7 +++++++ net/mac80211/driver-ops.h | 21 +++++++++++++++++++++ net/mac80211/mlme.c | 24 ++++++++++++++++++------ net/mac80211/trace.h | 27 +++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 6 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 3a8a2d2c58c3..c7f92a3db359 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3746,6 +3746,11 @@ struct ieee80211_prep_tx_info { * non-MLO connections. * The callback can sleep. * + * @generate_link_addr: Generate mac address of link. + * This callback is optional. Returns zero if mac address is generated successfully + * for the link. + * This callback can sleep. + * * @prepare_multicast: Prepare for multicast filter configuration. * This callback is optional, and its return value is passed * to configure_filter(). This callback must be atomic. @@ -4298,6 +4303,8 @@ struct ieee80211_ops { struct ieee80211_bss_conf *info, u64 changed); + int (*generate_link_addr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + unsigned int link_id, u8 *link_local_addr); int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *link_conf); void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index c4505593ba7a..da164d4ca9a1 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -962,6 +962,27 @@ int drv_switch_vif_chanctx(struct ieee80211_local *local, struct ieee80211_vif_chanctx_switch *vifs, int n_vifs, enum ieee80211_chanctx_switch_mode mode); +static inline int drv_generate_link_addr(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + unsigned int link_id, u8 *link_local_addr) +{ + int ret = -EOPNOTSUPP; + + might_sleep(); + + if (!check_sdata_in_driver(sdata)) + return -EIO; + + if (local->ops->generate_link_addr) { + ret = local->ops->generate_link_addr(&local->hw, &sdata->vif, + link_id, link_local_addr); + trace_drv_generate_link_addr(local, sdata, link_local_addr, link_id); + } + + trace_drv_return_int(local, ret); + return ret; +} + static inline int drv_start_ap(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, struct ieee80211_bss_conf *link_conf) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index f93eb38ae0b8..1679d5011fb6 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -6852,6 +6852,7 @@ void ieee80211_mgd_setup_link(struct ieee80211_link_data *link) struct ieee80211_sub_if_data *sdata = link->sdata; struct ieee80211_local *local = sdata->local; unsigned int link_id = link->link_id; + int ret; link->u.mgd.p2p_noa_index = -1; link->u.mgd.conn_flags = 0; @@ -6867,11 +6868,15 @@ void ieee80211_mgd_setup_link(struct ieee80211_link_data *link) wiphy_delayed_work_init(&link->u.mgd.chswitch_work, ieee80211_chswitch_work); - if (sdata->u.mgd.assoc_data) + if (sdata->u.mgd.assoc_data) { ether_addr_copy(link->conf->addr, sdata->u.mgd.assoc_data->link[link_id].addr); - else if (!is_valid_ether_addr(link->conf->addr)) - eth_random_addr(link->conf->addr); + } else if (!is_valid_ether_addr(link->conf->addr)) { + ret = drv_generate_link_addr(sdata->local, sdata, + link_id, link->conf->addr); + if (ret) + eth_random_addr(link->conf->addr); + } } /* scan finished notification */ @@ -7448,11 +7453,18 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, if (!req->links[i].bss) continue; link = sdata_dereference(sdata->link[i], sdata); - if (link) + if (link) { ether_addr_copy(assoc_data->link[i].addr, link->conf->addr); - else - eth_random_addr(assoc_data->link[i].addr); + } else { + u8 *link_addr = assoc_data->link[i].addr; + int ret; + + ret = drv_generate_link_addr(sdata->local, sdata, + i, link_addr); + if (ret) + eth_random_addr(link_addr); + } } } else { memcpy(assoc_data->link[0].addr, sdata->vif.addr, ETH_ALEN); diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index b8c53b4a710b..b140a4e70df9 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -727,6 +727,33 @@ TRACE_EVENT(drv_sw_scan_start, LOCAL_PR_ARG, VIF_PR_ARG, __entry->mac_addr) ); +TRACE_EVENT(drv_generate_link_addr, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + const u8 *mac_addr, + unsigned int link_id), + + TP_ARGS(local, sdata, mac_addr, link_id), + + TP_STRUCT__entry( + LOCAL_ENTRY + VIF_ENTRY + __array(char, mac_addr, ETH_ALEN) + __field(unsigned int, link_id) + ), + + TP_fast_assign( + LOCAL_ASSIGN; + VIF_ASSIGN; + memcpy(__entry->mac_addr, mac_addr, ETH_ALEN); + __entry->link_id = link_id; + ), + + TP_printk(LOCAL_PR_FMT ", " VIF_PR_FMT ", link addr: %pM link id: %#x", + LOCAL_PR_ARG, VIF_PR_ARG, __entry->mac_addr, + __entry->link_id) +); + DEFINE_EVENT(local_sdata_evt, drv_sw_scan_complete, TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata), From patchwork Wed Sep 6 10:34:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 13375506 X-Patchwork-Delegate: johannes@sipsolutions.net 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 0C9FDEB8FA5 for ; Wed, 6 Sep 2023 10:35:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239194AbjIFKfe (ORCPT ); Wed, 6 Sep 2023 06:35:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239187AbjIFKfd (ORCPT ); Wed, 6 Sep 2023 06:35:33 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6580DE46 for ; Wed, 6 Sep 2023 03:35:28 -0700 (PDT) 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 3866PSDN013431; Wed, 6 Sep 2023 10:35:18 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=YkB2L4G87iH9yWpuecD2xjyl/8M69B8XT3qHm1P/E1I=; b=ZGhNwRRfQTZALlVQ1PMw7tVmflbRsFGXNErynWamNgDRjXk1yQUGtyed0U1P26h9uWeP 6W3dDumDPyOy3IzDcLSABNlKcqwoEeqy7x2F654eWVzqtA1xGSqshqvd4KqijQLWhCi8 PamA1XGypYLHaEdePElieG5H6dK7LQWDUdghzpkVqJ+HL8BHBAun7lj/rCsUnqfZQo7K cDHSVGxrJTm2utprNsWrkCJZe8F0qPY6xsk2MKCk2VC2nWfKrrzd3OeG/ibvw6T3++FE P0hoKA9hDONghSMACXNp0sIvdYzDutdN2OouBg7pU3ne05fjdo+JLYbPWDEjm/yGHm4+ fQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3sxgmc18n6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Sep 2023 10:35:17 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 386AZH9u025070 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Sep 2023 10:35:17 GMT Received: from wgong-HP3-Z230-SFF-Workstation.qca.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Wed, 6 Sep 2023 03:35:15 -0700 From: Wen Gong To: , CC: , Subject: [PATCH 2/3] wifi: mac80211: add support to allow driver to set active link while connection for station Date: Wed, 6 Sep 2023 06:34:57 -0400 Message-ID: <20230906103458.24092-3-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230906103458.24092-1-quic_wgong@quicinc.com> References: <20230906103458.24092-1-quic_wgong@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: FBQQ4vld9KHsFLX0AYk5kAiMf8PY8vcI X-Proofpoint-ORIG-GUID: FBQQ4vld9KHsFLX0AYk5kAiMf8PY8vcI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-06_03,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 mlxscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309060089 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There are 2 fields valid_links and active_links in struct ieee80211_vif of mac80211. For station mode, valid_links is always include the bitmap of active_links. valid_links stores the bitmap of links which is created in mac80211, and mac80211 only indicate the info of links which is existed in active_links to driver. Finally, the active_links is the bitmap of links which station can interactive with MLO AP it is connected to. Currently the active links is always only contain the primary link, primary link means the link used by the latest exchange of successful (Re)Association Request/Response frames. Then it will always have only one link in driver after connected. Hence add this ops in struct ieee80211_ops to allow driver to determine the active links bit map dynamically while connecting to MLO AP. Signed-off-by: Wen Gong --- include/net/mac80211.h | 10 ++++++++++ net/mac80211/driver-ops.h | 21 +++++++++++++++++++++ net/mac80211/link.c | 8 ++++++++ net/mac80211/trace.h | 23 +++++++++++++++++++++++ 4 files changed, 62 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index c7f92a3db359..c50f1a99ccd5 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3732,6 +3732,14 @@ struct ieee80211_prep_tx_info { * Note: this callback is called if @vif_cfg_changed or @link_info_changed * are not implemented. * + * @calculate_active_links: Prepare for bit maps of links to active. + * This callback is optional. The @new_links parameter is all links bit map + * that mac80211 has capability to activate. Returns non-zero if driver handled + * the @new_links, and the returned non-zero value is the bit map of the links + * that driver allows to active. The bitmap of returned non-zero value may be + * a subset of the @new_links. Return zero if driver not handled this. + * This callback can sleep. + * * @vif_cfg_changed: Handler for configuration requests related to interface * (MLD) parameters from &struct ieee80211_vif_cfg that vary during the * lifetime of the interface (e.g. assoc status, IP addresses, etc.) @@ -4295,6 +4303,8 @@ struct ieee80211_ops { struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, u64 changed); + u16 (*calculate_active_links)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + u16 new_links); void (*vif_cfg_changed)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u64 changed); diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index da164d4ca9a1..d2a8bf5341b5 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -950,6 +950,27 @@ static inline void drv_verify_link_exists(struct ieee80211_sub_if_data *sdata, sdata_assert_lock(sdata); } +static inline u16 drv_calculate_active_links(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + u16 new_links) +{ + u16 active_links = 0; + + might_sleep(); + + if (!check_sdata_in_driver(sdata)) + return active_links; + + trace_drv_calculate_active_links(local, sdata, new_links); + if (local->ops->calculate_active_links) + active_links = local->ops->calculate_active_links(&local->hw, + &sdata->vif, + new_links); + + trace_drv_return_int(local, active_links); + return active_links; +} + int drv_assign_vif_chanctx(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, struct ieee80211_bss_conf *link_conf, diff --git a/net/mac80211/link.c b/net/mac80211/link.c index 6148208b320e..7ce229a64a7b 100644 --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -146,6 +146,7 @@ static void ieee80211_set_vif_links_bitmaps(struct ieee80211_sub_if_data *sdata, { sdata->vif.valid_links = valid_links; sdata->vif.dormant_links = dormant_links; + u16 active_links; if (!valid_links || WARN((~valid_links & dormant_links) || @@ -166,6 +167,13 @@ static void ieee80211_set_vif_links_bitmaps(struct ieee80211_sub_if_data *sdata, WARN_ON(dormant_links); break; case NL80211_IFTYPE_STATION: + active_links = drv_calculate_active_links(sdata->local, sdata, + valid_links & ~dormant_links); + if (active_links) { + sdata->vif.active_links = active_links; + break; + } + if (sdata->vif.active_links) break; sdata->vif.active_links = valid_links & ~dormant_links; diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index b140a4e70df9..eb458c236101 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -652,6 +652,29 @@ TRACE_EVENT(drv_set_key, ) ); +TRACE_EVENT(drv_calculate_active_links, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + u16 new_links), + + TP_ARGS(local, sdata, new_links), + + TP_STRUCT__entry( + LOCAL_ENTRY + VIF_ENTRY + __field(unsigned int, new_links) + ), + + TP_fast_assign( + LOCAL_ASSIGN; + VIF_ASSIGN; + __entry->new_links = new_links; + ), + + TP_printk(LOCAL_PR_FMT ", " VIF_PR_FMT ", new_links: %u", + LOCAL_PR_ARG, VIF_PR_ARG, __entry->new_links) +); + TRACE_EVENT(drv_update_tkip_key, TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, From patchwork Wed Sep 6 10:34:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wen Gong X-Patchwork-Id: 13375505 X-Patchwork-Delegate: johannes@sipsolutions.net 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 C215BEB8FAF for ; Wed, 6 Sep 2023 10:35:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239192AbjIFKfd (ORCPT ); Wed, 6 Sep 2023 06:35:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbjIFKfd (ORCPT ); Wed, 6 Sep 2023 06:35:33 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52234CE2 for ; Wed, 6 Sep 2023 03:35:28 -0700 (PDT) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3869QqhP007229; Wed, 6 Sep 2023 10:35:19 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=DjRVxvL85VlD/zWd0EAa8JCvkD/VGvroPecUIbNfsQk=; b=oQ6OxqSsWp9eUqn7CluGGp/pqfe38u9l5VMdzXa2hk0rWpuj+1G9fBoWz3Oc7K/BksQm Fzvt/vnm0kXMyWyu7vS1gfAnVQbQZR7QUDrZ2F/PldsfBlB+6XA/L1GjH+VLckUdPKhY JvYvElingEXLlXx/mtowpZiKirkoHohj0iOv8Ds2+Y5y3RJ1WsuyTneeDfqgWSIY4Ihp r5hBcGg3hXo5JUri2TntxZECfns+v+9IJFYY/1pwtsGcGHxKm1k8r/C5CmddYj5Pmxg/ JbizxfS4mB97jggc1XiWdc8YSGBncvDduXhCDYf8ZGWIHJK7D77Aj6xVxO48UnqO5Eus og== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3sxpt008ak-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 06 Sep 2023 10:35:19 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 386AZI2t030288 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 6 Sep 2023 10:35:18 GMT Received: from wgong-HP3-Z230-SFF-Workstation.qca.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Wed, 6 Sep 2023 03:35:17 -0700 From: Wen Gong To: , CC: , Subject: [PATCH 3/3] wifi: mac80211: update link RX NSS by ieee80211_sta_set_rx_nss() in ieee80211_assoc_config_link() Date: Wed, 6 Sep 2023 06:34:58 -0400 Message-ID: <20230906103458.24092-4-quic_wgong@quicinc.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230906103458.24092-1-quic_wgong@quicinc.com> References: <20230906103458.24092-1-quic_wgong@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: dMAxWrup3Rz-CVJIFjk8lwBVIWq9YpAL X-Proofpoint-GUID: dMAxWrup3Rz-CVJIFjk8lwBVIWq9YpAL X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-09-06_03,2023-09-05_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 spamscore=0 mlxscore=0 phishscore=0 impostorscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309060089 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Currently for MLO connection, only deflink's rx_nss is set to correct value. The others links' rx_nss of struct ieee80211_link_sta is value 0 in ieee80211_set_associated(), because they are not pass into ieee80211_sta_set_rx_nss() in mac80211 except the deflink in rate_control_rate_init(). This leads driver get NSS = 0 for other links. Add the ieee80211_sta_set_rx_nss() in ieee80211_assoc_config_link(), then the other links' rx_nss will be set to the correct value. Signed-off-by: Wen Gong --- net/mac80211/mlme.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 1679d5011fb6..0a2fb660fa00 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -4354,6 +4354,8 @@ static bool ieee80211_assoc_config_link(struct ieee80211_link_data *link, bss_conf->assoc_capability = capab_info; ret = true; + + ieee80211_sta_set_rx_nss(link_sta); out: kfree(elems); kfree(bss_ies);