Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1896383rdh; Tue, 26 Sep 2023 06:51:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPhvfu3r2ZDMlEWaiLWWk+edIJj0sxdMQTMnNYC8ujZkmT1dFdv292Gh/6qPvcWLUNGlJ4 X-Received: by 2002:a05:6358:e49c:b0:143:9b25:c029 with SMTP id by28-20020a056358e49c00b001439b25c029mr15247219rwb.2.1695736299533; Tue, 26 Sep 2023 06:51:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695736299; cv=none; d=google.com; s=arc-20160816; b=TqUO15YcWCq0RVHE728PahFv4DgWVPONATmhicwShJki9RNoYsixbsnNdYll7Iy3Ak bbw+jjLjvt6o43iEVTTucrkhQKXMJhNWYNjFM26on9OnPpLg54AnTSz9/FSydvcHEHpy IlDyjitVx0tlbr2XddEDPQ8zHgWo7PKQ53XGxj87mVUesurMRqYtdInN/OdNsTVHcQS+ zAHIjzrIOzgiWLmpclE++pnnqUdTLbdT+VDFHQvNDfNLNce5p0+57o0Ofb50UlWFwPZe 7GKozPr041X64gxqj6nWerTUSpiT0nSpMP2w9q3cV0R2tNxOFXJx6gmnSqaVbDuxKhsy HkTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=FvRtvXmJTry8a4BWHtgGKCc8KrZpPc/mg2CL1l84pPo=; fh=YFxtJ1xXx2t8gOU3zOKGdBZLQQRAPE7/C3S1y3bq7Yo=; b=LMqg+6+WeJpX2eryb6E4w+/+Z9L1YJ0tp6bzN/HH25+3FCyYxyz8U/uws/hldUbCqb udw8JJTTGiWkZ2GVY0Nr2VyHNTrWwYRGpJnkLzKgxbPsUQh9JGEyyelc16bCrffbm9rX Xvk47WeucQZy/ezHnJ7RPD1FIbA96OdjMuwiXa6zBEacQ3M7B2cwLW0TF54G5P7Clgjb a001guNSCn78FiRndP0DfFIL3uMjIwhATN691Cw8hqo0V6O8wk+jGRWA7mZ1iUlilBLR D8lfugKvMx+IjypDs3dO/k5BzJ2si1vZ18Zi5nyBHOpl2uONtvLbjQMaRB8HDdxrdhEw G64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=VsQiRfTl; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id l191-20020a6388c8000000b0057884435a71si12899100pgd.396.2023.09.26.06.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 06:51:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=VsQiRfTl; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id C6B99808D694; Tue, 26 Sep 2023 02:17:16 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234115AbjIZJRT (ORCPT + 56 others); Tue, 26 Sep 2023 05:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234112AbjIZJRS (ORCPT ); Tue, 26 Sep 2023 05:17:18 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B3EA10A for ; Tue, 26 Sep 2023 02:17:11 -0700 (PDT) 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 38Q6LKTe003193; Tue, 26 Sep 2023 09:17:08 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-type; s=qcppdkim1; bh=FvRtvXmJTry8a4BWHtgGKCc8KrZpPc/mg2CL1l84pPo=; b=VsQiRfTlYC8lBU4B357dHg0PLZpWXVqUfeFp9L8oawXhUP5SLbeUYG3Q/3oxiSrU7C2v 3dlfWwX8As0br6Pu4wCiZB/EnnTpUdxnr69hgSGHWZG2IQbBtJsOiC/9lyM7MXfm92jk VgGvTIo12wF8VOq2muWeowrJp6J11xZOdsq18YTI45V0zJxmKcYgqZFgNWN2thv+X/95 HtZDilyxVneYQqFAeiCrXTl6aIKVudRPJeZq3Ea8KtnZq8+Ux+0GETXmfUp1uRi45Yl0 CAwLH25uXu3u5YEhIpSIoGhvI833yCKCmRix5wg5ygIzDB6kKvsdDIVJ7tFKgpwBot6B Vw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tbbyf27js-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 09:17:08 +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 38Q9H71x030570 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 26 Sep 2023 09:17:07 GMT Received: from adisi-linux.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; Tue, 26 Sep 2023 02:17:05 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH v3 1/3] wifi: cfg80211: send link id in channel_switch ops Date: Tue, 26 Sep 2023 14:46:46 +0530 Message-ID: <20230926091648.17184-2-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230926091648.17184-1-quic_adisi@quicinc.com> References: <20230926091648.17184-1-quic_adisi@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: 8d_TYGyRJbgZW1d2AnL31BKd3etS0yQ_ X-Proofpoint-ORIG-GUID: 8d_TYGyRJbgZW1d2AnL31BKd3etS0yQ_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-26_07,2023-09-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 spamscore=0 clxscore=1015 adultscore=0 mlxlogscore=902 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309260080 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 26 Sep 2023 02:17:16 -0700 (PDT) Currently, during channel switch, no link id information is passed due to which channel switch is carried on deflink always. In order to support channel switch during Multi Link Operation, it is required to pass link id as well. Add changes to pass link id in the channel_switch cfg80211_ops. Signed-off-by: Aditya Kumar Singh --- include/net/cfg80211.h | 3 ++- net/mac80211/cfg.c | 11 ++++++++--- net/mac80211/ibss.c | 2 +- net/mac80211/ieee80211_i.h | 3 ++- net/mac80211/mesh.c | 2 +- net/wireless/nl80211.c | 2 +- net/wireless/rdev-ops.h | 7 ++++--- net/wireless/trace.h | 12 ++++++++---- 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 34c50f7273d1..df0b511b6401 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -4762,7 +4762,8 @@ struct cfg80211_ops { int (*channel_switch)(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_csa_settings *params); + struct cfg80211_csa_settings *params, + unsigned int link_id); int (*set_qos_map)(struct wiphy *wiphy, struct net_device *dev, diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 5bc6b1329465..ac977aaad58e 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3844,7 +3844,8 @@ static void ieee80211_color_change_abort(struct ieee80211_sub_if_data *sdata) static int __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_csa_settings *params) + struct cfg80211_csa_settings *params, + unsigned int link_id) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = sdata->local; @@ -3856,6 +3857,9 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, lockdep_assert_wiphy(local->hw.wiphy); + if (WARN_ON(link_id > IEEE80211_MLD_MAX_NUM_LINKS)) + return -EINVAL; + if (!list_empty(&local->roc_list) || local->scanning) return -EBUSY; @@ -3949,14 +3953,15 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, } int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_csa_settings *params) + struct cfg80211_csa_settings *params, + unsigned int link_id) { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = sdata->local; lockdep_assert_wiphy(local->hw.wiphy); - return __ieee80211_channel_switch(wiphy, dev, params); + return __ieee80211_channel_switch(wiphy, dev, params, link_id); } u64 ieee80211_mgmt_tx_cookie(struct ieee80211_local *local) diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index a7736acadf3c..c72449d0fe1a 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -871,7 +871,7 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata, params.block_tx = !!csa_ie.mode; if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev, - ¶ms)) + ¶ms, 0)) goto disconnect; ieee80211_ibss_csa_mark_radar(sdata); diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 19429f84afc3..da97812119ea 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1947,7 +1947,8 @@ int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy, /* channel switch handling */ void ieee80211_csa_finalize_work(struct wiphy *wiphy, struct wiphy_work *work); int ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_csa_settings *params); + struct cfg80211_csa_settings *params, + unsigned int link_id); /* color change handling */ void ieee80211_color_change_finalize_work(struct wiphy *wiphy, diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index 0d0fbae51b61..7e63ccea6c22 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -1391,7 +1391,7 @@ ieee80211_mesh_process_chnswitch(struct ieee80211_sub_if_data *sdata, ifmsh->csa_role = IEEE80211_MESH_CSA_ROLE_REPEATER; if (ieee80211_channel_switch(sdata->local->hw.wiphy, sdata->dev, - ¶ms) < 0) + ¶ms, 0) < 0) return false; return true; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 87b21c0c0f25..d9212a1431d3 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10240,7 +10240,7 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info) goto free; } - err = rdev_channel_switch(rdev, dev, ¶ms); + err = rdev_channel_switch(rdev, dev, ¶ms, link_id); free: kfree(params.beacon_after.mbssid_ies); diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h index 2214a90cf101..7487164abe29 100644 --- a/net/wireless/rdev-ops.h +++ b/net/wireless/rdev-ops.h @@ -1099,12 +1099,13 @@ static inline void rdev_crit_proto_stop(struct cfg80211_registered_device *rdev, static inline int rdev_channel_switch(struct cfg80211_registered_device *rdev, struct net_device *dev, - struct cfg80211_csa_settings *params) + struct cfg80211_csa_settings *params, + unsigned int link_id) { int ret; - trace_rdev_channel_switch(&rdev->wiphy, dev, params); - ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params); + trace_rdev_channel_switch(&rdev->wiphy, dev, params, link_id); + ret = rdev->ops->channel_switch(&rdev->wiphy, dev, params, link_id); trace_rdev_return_int(&rdev->wiphy, ret); return ret; } diff --git a/net/wireless/trace.h b/net/wireless/trace.h index da2b73951c32..014664f4d255 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h @@ -2311,8 +2311,9 @@ TRACE_EVENT(rdev_crit_proto_stop, TRACE_EVENT(rdev_channel_switch, TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, - struct cfg80211_csa_settings *params), - TP_ARGS(wiphy, netdev, params), + struct cfg80211_csa_settings *params, + unsigned int link_id), + TP_ARGS(wiphy, netdev, params, link_id), TP_STRUCT__entry( WIPHY_ENTRY NETDEV_ENTRY @@ -2322,6 +2323,7 @@ TRACE_EVENT(rdev_channel_switch, __field(u8, count) __dynamic_array(u16, bcn_ofs, params->n_counter_offsets_beacon) __dynamic_array(u16, pres_ofs, params->n_counter_offsets_presp) + __field(unsigned int, link_id) ), TP_fast_assign( WIPHY_ASSIGN; @@ -2339,11 +2341,13 @@ TRACE_EVENT(rdev_channel_switch, memcpy(__get_dynamic_array(pres_ofs), params->counter_offsets_presp, params->n_counter_offsets_presp * sizeof(u16)); + __entry->link_id = link_id; ), TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT - ", block_tx: %d, count: %u, radar_required: %d", + ", block_tx: %d, count: %u, radar_required: %d link_id: %d", WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG, - __entry->block_tx, __entry->count, __entry->radar_required) + __entry->block_tx, __entry->count, __entry->radar_required, + __entry->link_id) ); TRACE_EVENT(rdev_set_qos_map, -- 2.17.1