From patchwork Tue Apr 16 04:59:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 789776 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 39515381C4 for ; Tue, 16 Apr 2024 05:00:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243619; cv=none; b=BbPBV8g0dzuX/FHnaOddwh0Q3rv+oIC5gcOInDKH6DQ+5I3I4rR+PxoegmCF2knqybP8s9kpwQqcUZkyL3Q9e1l1fPwVFkvKD4YpCqiWGgkdvEAuOUU1kFz5HEUEHEVEabChPt6L4IOLvYwAtCwmdNylUYbk5LMU6WbatSklYes= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243619; c=relaxed/simple; bh=rTZcYv4qs+rIYMCy26E79qFvv7coOO4lv/ldOKvKvjk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bqOcQkrrUE/idXwRIqIQwa4+uouioFfqPEOs+cgKuOIeCM1b7i+Y5kp/38uz2fU+Zm9gcQ+ZsOH1iiQr8FEm4mPidYf4VPymQWeGd+UbMcIsZJJQ5lcfUizeScUjQulKiQTO9hoZtB99ftN+RjQCEE3uapQoIacEaCR/vQPe968= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=g5olfTvD; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="g5olfTvD" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43G0SpuM027426; Tue, 16 Apr 2024 05:00:04 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=Eggx1Omwg5XkPBCknvyvg9fDz91sqH79N/bczjdg8Ag=; b=g5 olfTvDTizfeKw3s/aEA6wgKVG+nNVwmXeqwipgAzYjlWJostI8qFK2B6azVcn2bN Miu+APQiOzNXF/GOPf2yaAa0UPt138mVshx8CBuAb4xUYXpL+q+LfLn7AtGlbbam rNVw6AeVNiWW5NCeibnae0pfxVOBkTf0Od/xNiUXoVpUpcYw9mQrUqQ0ACk2MbAc ZibJSyy+K4GkGiATVbc3PmE2Y0dBDM6/7yXgbHex3W6TlOxPIWDFGVVFTq+68HrQ mda5Dg1w+pr3NNNyqafTL22OrgER29TqjqeJOq3SiB8oLOHZpLnQTw5aJk5sVb2y pzKU1/7/X1LGnL32jEEQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xh5jx9q5s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:04 +0000 (GMT) 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 43G5037H021687 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:03 GMT Received: from hu-adisi-blr.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.1544.9; Mon, 15 Apr 2024 22:00:01 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 1/7] wifi: cfg80211: send link id in color_change ops Date: Tue, 16 Apr 2024 10:29:37 +0530 Message-ID: <20240416045943.576656-2-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416045943.576656-1-quic_adisi@quicinc.com> References: <20240416045943.576656-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: TYEB3njHuLiIIeMVhklAAYI4WBkmVzrs X-Proofpoint-ORIG-GUID: TYEB3njHuLiIIeMVhklAAYI4WBkmVzrs X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_02,2024-04-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 suspectscore=0 adultscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404160028 Currently, during color change, no link id information is passed down. In order to support color change during Multi Link Operation, it is required to pass link id as well. Add changes to pass link id in the color_change cfg80211_ops. Signed-off-by: Aditya Kumar Singh --- include/net/cfg80211.h | 3 +++ net/wireless/nl80211.c | 4 +++- net/wireless/trace.h | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1e09329acc42..0e2b3e0c8541 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -1575,6 +1575,8 @@ struct cfg80211_csa_settings { * @beacon_next: beacon data to be used after the color change * @count: number of beacons until the color change * @color: the color used after the change + * @link_id: defines the link on which color change is expected during MLO. + * 0 in case of non-MLO. */ struct cfg80211_color_change_settings { struct cfg80211_beacon_data beacon_color_change; @@ -1583,6 +1585,7 @@ struct cfg80211_color_change_settings { struct cfg80211_beacon_data beacon_next; u8 count; u8 color; + u8 link_id; }; /** diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index b4edba6b0b7b..a9d01cd16196 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -16029,6 +16029,7 @@ static int nl80211_color_change(struct sk_buff *skb, struct genl_info *info) params.counter_offset_presp = offset; } + params.link_id = nl80211_link_id(info->attrs); err = rdev_color_change(rdev, dev, ¶ms); out: @@ -17431,7 +17432,8 @@ static const struct genl_small_ops nl80211_small_ops[] = { .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP, .doit = nl80211_color_change, .flags = GENL_UNS_ADMIN_PERM, - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP), + .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP | + NL80211_FLAG_MLO_VALID_LINK_ID), }, { .cmd = NL80211_CMD_SET_FILS_AAD, diff --git a/net/wireless/trace.h b/net/wireless/trace.h index cbbf347c6b2e..db4d9f567ad0 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h @@ -2842,6 +2842,7 @@ TRACE_EVENT(rdev_color_change, __field(u8, count) __field(u16, bcn_ofs) __field(u16, pres_ofs) + __field(u8, link_id) ), TP_fast_assign( WIPHY_ASSIGN; @@ -2849,11 +2850,12 @@ TRACE_EVENT(rdev_color_change, __entry->count = params->count; __entry->bcn_ofs = params->counter_offset_beacon; __entry->pres_ofs = params->counter_offset_presp; + __entry->link_id = params->link_id; ), TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT - ", count: %u", + ", count: %u, link_id: %d", WIPHY_PR_ARG, NETDEV_PR_ARG, - __entry->count) + __entry->count, __entry->link_id) ); TRACE_EVENT(rdev_set_radar_background, From patchwork Tue Apr 16 04:59:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 789775 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 48A03381C4 for ; Tue, 16 Apr 2024 05:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243622; cv=none; b=HP0iBwEnPsJOg7+kyjU2/ay8oUs2QzoRSdjnF6Wv7JItRc7xTCPexf8kJZ6E9EcejvieWYUyhyj8ahXNpFhGyjWu53qQTnrj7rJT8/7ygIpv/NWuWqPlW8uasLBFmsowJtXTI5LafsEgFajc4ffDocnuMZ6IWIdlo5tDXFIua68= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243622; c=relaxed/simple; bh=ARCEpyTKwNusidjFgTbo9qCFIL+PgYCDKbwzjcXRbpc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=E+2nod1SycwXtBZ3QnSjhwEVayxK02CtExHGfHOII9q9+5BfqPG+m9CJLzDD5kRo/7TkbbcIdCW9yrCPkRkAzTwwB3CDOGRa3lC8piWP3j0luM6rtqm3BEnfjfjqyC/YzKI0QdjT0RWgWvyZ4bee8l0STcWpFCII9umlHtR8wMw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=fLSSFUuj; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="fLSSFUuj" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43G0JVjF013032; Tue, 16 Apr 2024 05:00:06 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=s7iIYvvnKXHiJrWm2gjWYcROak8g4Au6XlYAbH5HxcU=; b=fL SSFUuj9BZykt/lfdDiXKQrYHCt79EPZ3o5WMg6+S26zgaTF/BXrGmrHT1s/L0hWJ 4Fwu9sMsXTZoYJNsun5wwrdiKtCoG69ppXD7ljZzuTRdQSvmiJz5LgG/58LINOef Sj0u4twFRyvDcADhT0uLbNvrEv33Co7EaTAtfW4VoZsYIhPQTC12O34YaZSl7V4M 2D/6n0A0mAGL+9dNCu5Sp2T+7AyNo07UoaRG/h3bAw7s8DArG6SjGEhYUOINU3BY pvMkjLSOFbnpW4UlFEkJBANNlKLVPYyN8COysRQf0vJMNu5hIxPcY8cWq/Heuxk7 lPkrbGUwRj0+M2LkMJvA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xhbburtn1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:06 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43G505RL025239 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:05 GMT Received: from hu-adisi-blr.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.1544.9; Mon, 15 Apr 2024 22:00:03 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 2/7] wifi: cfg80211: notify link ID in bss_color_notify Date: Tue, 16 Apr 2024 10:29:38 +0530 Message-ID: <20240416045943.576656-3-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416045943.576656-1-quic_adisi@quicinc.com> References: <20240416045943.576656-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: a2AyBPAirMqC-rkFI9RRfEVA8EnXtl82 X-Proofpoint-GUID: a2AyBPAirMqC-rkFI9RRfEVA8EnXtl82 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_02,2024-04-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxscore=0 adultscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404160028 Add changes to send link ID as well in bss color notify during MLO. Userspace application can make use of this to take necessary actions. For now, pass 0 as link ID. Appropriate link ID will be passed in a subsequent change. Signed-off-by: Aditya Kumar Singh --- include/net/cfg80211.h | 26 +++++++++++++++++--------- net/mac80211/cfg.c | 11 ++++++----- net/wireless/nl80211.c | 6 +++++- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0e2b3e0c8541..e0f488eb15d1 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -9389,60 +9389,68 @@ void cfg80211_bss_flush(struct wiphy *wiphy); * @cmd: the actual event we want to notify * @count: the number of TBTTs until the color change happens * @color_bitmap: representations of the colors that the local BSS is aware of + * @link_id: valid link_id in case of MLO or 0 for non-MLO. */ int cfg80211_bss_color_notify(struct net_device *dev, enum nl80211_commands cmd, u8 count, - u64 color_bitmap); + u64 color_bitmap, u8 link_id); /** * cfg80211_obss_color_collision_notify - notify about bss color collision * @dev: network device * @color_bitmap: representations of the colors that the local BSS is aware of + * @link_id: valid link_id in case of MLO or 0 for non-MLO. */ static inline int cfg80211_obss_color_collision_notify(struct net_device *dev, - u64 color_bitmap) + u64 color_bitmap, + u8 link_id) { return cfg80211_bss_color_notify(dev, NL80211_CMD_OBSS_COLOR_COLLISION, - 0, color_bitmap); + 0, color_bitmap, link_id); } /** * cfg80211_color_change_started_notify - notify color change start * @dev: the device on which the color is switched * @count: the number of TBTTs until the color change happens + * @link_id: valid link_id in case of MLO or 0 for non-MLO. * * Inform the userspace about the color change that has started. */ static inline int cfg80211_color_change_started_notify(struct net_device *dev, - u8 count) + u8 count, u8 link_id) { return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_STARTED, - count, 0); + count, 0, link_id); } /** * cfg80211_color_change_aborted_notify - notify color change abort * @dev: the device on which the color is switched + * @link_id: valid link_id in case of MLO or 0 for non-MLO. * * Inform the userspace about the color change that has aborted. */ -static inline int cfg80211_color_change_aborted_notify(struct net_device *dev) +static inline int cfg80211_color_change_aborted_notify(struct net_device *dev, + u8 link_id) { return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_ABORTED, - 0, 0); + 0, 0, link_id); } /** * cfg80211_color_change_notify - notify color change completion * @dev: the device on which the color was switched + * @link_id: valid link_id in case of MLO or 0 for non-MLO. * * Inform the userspace about the color change that has completed. */ -static inline int cfg80211_color_change_notify(struct net_device *dev) +static inline int cfg80211_color_change_notify(struct net_device *dev, + u8 link_id) { return cfg80211_bss_color_notify(dev, NL80211_CMD_COLOR_CHANGE_COMPLETED, - 0, 0); + 0, 0, link_id); } /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index f67c1d021812..f9374ce04c93 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3920,7 +3920,7 @@ static void ieee80211_color_change_abort(struct ieee80211_sub_if_data *sdata) ieee80211_free_next_beacon(&sdata->deflink); - cfg80211_color_change_aborted_notify(sdata->dev); + cfg80211_color_change_aborted_notify(sdata->dev, 0); } static int @@ -4768,14 +4768,14 @@ static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata) err = ieee80211_set_after_color_change_beacon(sdata, &changed); if (err) { - cfg80211_color_change_aborted_notify(sdata->dev); + cfg80211_color_change_aborted_notify(sdata->dev, 0); return err; } ieee80211_color_change_bss_config_notify(sdata, sdata->vif.bss_conf.color_change_color, 1, changed); - cfg80211_color_change_notify(sdata->dev); + cfg80211_color_change_notify(sdata->dev, 0); return 0; } @@ -4808,7 +4808,8 @@ void ieee80211_color_collision_detection_work(struct work_struct *work) color_collision_detect_work); struct ieee80211_sub_if_data *sdata = link->sdata; - cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap); + cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap, + link->link_id); } void ieee80211_color_change_finish(struct ieee80211_vif *vif) @@ -4872,7 +4873,7 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev, sdata->vif.bss_conf.color_change_active = true; sdata->vif.bss_conf.color_change_color = params->color; - cfg80211_color_change_started_notify(sdata->dev, params->count); + cfg80211_color_change_started_notify(sdata->dev, params->count, 0); if (changed) ieee80211_color_change_bss_config_notify(sdata, 0, 0, changed); diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index a9d01cd16196..8013796f2afe 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -19455,7 +19455,7 @@ EXPORT_SYMBOL(cfg80211_ch_switch_started_notify); int cfg80211_bss_color_notify(struct net_device *dev, enum nl80211_commands cmd, u8 count, - u64 color_bitmap) + u64 color_bitmap, u8 link_id) { struct wireless_dev *wdev = dev->ieee80211_ptr; struct wiphy *wiphy = wdev->wiphy; @@ -19478,6 +19478,10 @@ int cfg80211_bss_color_notify(struct net_device *dev, if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex)) goto nla_put_failure; + if (wdev->valid_links && + nla_put_u8(msg, NL80211_ATTR_MLO_LINK_ID, link_id)) + goto nla_put_failure; + if (cmd == NL80211_CMD_COLOR_CHANGE_STARTED && nla_put_u32(msg, NL80211_ATTR_COLOR_CHANGE_COUNT, count)) goto nla_put_failure; From patchwork Tue Apr 16 04:59:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 790503 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 48A3A39ADB for ; Tue, 16 Apr 2024 05:00:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243622; cv=none; b=d024AgrIM78iBDCDu8gcaVetFWIjEno0u7veDqAIjvy/To1d46S8FttO3Ey+FZF+n+QdkZD2JBtVTnlJDBuZHHGfiXp9fnulEuxtPo3dEOdbPREYQcEfFYDZ20XfwCh+SYlvdEQqYRqxat+R5D7jFKlPXGypVbwF9XAH7ZOvWH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243622; c=relaxed/simple; bh=uaQ3c8m+/A946TpD0YK6/MczE7fphtvTQIhyYcJg+KE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qRN+uWjQedI5FpFWOzGYse5HJJQiAr3c0rVuz2VD8rOeoubWiMhMMuhrB7Hpw5Ppfrg2Mjno41WJexT0xhNNr3whELRVTZVQfHVm6DQ+lCa4dDQ+9uW1zr64coBs1V43PA168kfSWw4bwux+iL5dqJhVfkG/IsLvwBApyGlFVFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=GIS0eXG2; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="GIS0eXG2" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43G01Nsw004728; Tue, 16 Apr 2024 05:00: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-transfer-encoding:content-type; s= qcppdkim1; bh=jT3Xv5Vc7uQ7izAgX+FvIryOPSI/RZA5PZRWEzBBOXI=; b=GI S0eXG2yMy4SEAovvnfkZII2rMcM1obzm4ByTVOTjZorE327chwyoItyeEeEv+TeQ 0WP47jNDK5XvzdS7jS3ojOh4LviHlvr9YeA7bNKv0Z2Bnl5qzTwuEk6l3hQ80Em2 t4TjjkjYofuctQckZVRHtdWlnZbNuykHp3REd9PkCht16FexhGNUuRCxK7Xo4wI4 XPUTp69qo6ImqZ2tDVLCOjOCKAMa+WrAujwhBjRwnsCD2P/zIXWLHVaThbzWZi0E t3aFWuWXiRakYld3kNnD19z5/+QsGJm3P2k0amgYie7EuMkTFYoEJnq3IjzSos2P WIMWr9QXXoj2GhUI+NRg== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xhbburtn3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:07 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43G5075l025571 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:07 GMT Received: from hu-adisi-blr.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.1544.9; Mon, 15 Apr 2024 22:00:05 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 3/7] wifi: mac80211: handle set color_change/after_color_change beacon on per link basis Date: Tue, 16 Apr 2024 10:29:39 +0530 Message-ID: <20240416045943.576656-4-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416045943.576656-1-quic_adisi@quicinc.com> References: <20240416045943.576656-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: qOPNt8TwBiug3pr7yCgIz4HTNVJbIjnr X-Proofpoint-GUID: qOPNt8TwBiug3pr7yCgIz4HTNVJbIjnr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_02,2024-04-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxscore=0 adultscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404160028 In order to support color change with MLO, there is a need to handle the functions ieee80211_set_color_change_beacon() and ieee80211_set_after_color_change_beacon() on a per link basis. Implement this by making the function argument accept the link data instead of the sdata. Currently, deflink would only be passed. Proper link data will be passed in a subsequent change. Signed-off-by: Aditya Kumar Singh --- net/mac80211/cfg.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index f9374ce04c93..6e64c0740c81 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4662,20 +4662,22 @@ static int ieee80211_set_sar_specs(struct wiphy *wiphy, } static int -ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata, +ieee80211_set_after_color_change_beacon(struct ieee80211_link_data *link, u64 *changed) { + struct ieee80211_sub_if_data *sdata = link->sdata; + switch (sdata->vif.type) { case NL80211_IFTYPE_AP: { int ret; - if (!sdata->deflink.u.ap.next_beacon) + if (!link->u.ap.next_beacon) return -EINVAL; - ret = ieee80211_assign_beacon(sdata, &sdata->deflink, - sdata->deflink.u.ap.next_beacon, + ret = ieee80211_assign_beacon(sdata, link, + link->u.ap.next_beacon, NULL, NULL, changed); - ieee80211_free_next_beacon(&sdata->deflink); + ieee80211_free_next_beacon(link); if (ret < 0) return ret; @@ -4691,18 +4693,19 @@ ieee80211_set_after_color_change_beacon(struct ieee80211_sub_if_data *sdata, } static int -ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata, +ieee80211_set_color_change_beacon(struct ieee80211_link_data *link, struct cfg80211_color_change_settings *params, u64 *changed) { + struct ieee80211_sub_if_data *sdata = link->sdata; struct ieee80211_color_change_settings color_change = {}; int err; switch (sdata->vif.type) { case NL80211_IFTYPE_AP: - sdata->deflink.u.ap.next_beacon = + link->u.ap.next_beacon = cfg80211_beacon_dup(¶ms->beacon_next); - if (!sdata->deflink.u.ap.next_beacon) + if (!link->u.ap.next_beacon) return -ENOMEM; if (params->count <= 1) @@ -4714,11 +4717,11 @@ ieee80211_set_color_change_beacon(struct ieee80211_sub_if_data *sdata, params->counter_offset_presp; color_change.count = params->count; - err = ieee80211_assign_beacon(sdata, &sdata->deflink, + err = ieee80211_assign_beacon(sdata, link, ¶ms->beacon_color_change, NULL, &color_change, changed); if (err < 0) { - ieee80211_free_next_beacon(&sdata->deflink); + ieee80211_free_next_beacon(link); return err; } break; @@ -4766,7 +4769,7 @@ static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata) sdata->vif.bss_conf.color_change_active = false; - err = ieee80211_set_after_color_change_beacon(sdata, &changed); + err = ieee80211_set_after_color_change_beacon(&sdata->deflink, &changed); if (err) { cfg80211_color_change_aborted_notify(sdata->dev, 0); return err; @@ -4866,7 +4869,7 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev, goto out; } - err = ieee80211_set_color_change_beacon(sdata, params, &changed); + err = ieee80211_set_color_change_beacon(&sdata->deflink, params, &changed); if (err) goto out; From patchwork Tue Apr 16 04:59:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 790501 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 B28AA3A1AC for ; Tue, 16 Apr 2024 05:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243625; cv=none; b=TRHiLuqJ8YiowuQr6SNF2qTxb7nzNLPzQn8+YZm5v6GcfPBbMwV1W2dICFjIemPh6BgRvoKRuCTxRxVfxuBgaSBUu1Rpaal36cS/teWnGUMZqTAyF7m+vi+CHMrK+OB/MSif2j+UakQqqb7q8VLnQvki3znbd+e/LAJ4D+aVx88= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243625; c=relaxed/simple; bh=sn0C49qWEPziUiP09q7lhC5Vlg3tMRsyvBG4QlBa8Sk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ee4FnIxZB6A/CNEuvm+2iPFYbax6lrurALa2bhKyGDvgqqlHOxHOC20U1uenCeopCmqYTH3Yy9sG9ucGZPqIgKMWSk+YNGRBG0C0pu0xDjQeNzkrTahn8aV8aSYJGsQHTSOey3ITEp0hBI6ECiJMdZvB1ZXs6CTdnXRWDmrfv64= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=gbfITn88; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="gbfITn88" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43G4FNS4030882; Tue, 16 Apr 2024 05:00:10 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=eDepNZ/gxlFiWL+HFoSAn7znI/oGXpIjU5ZoVtBBpGs=; b=gb fITn888rhlq0IzBoIWAnJxTTZoZ2kKkYhUop7CBM0u37SPGbdlX0lf5nTiv/2qHd QP53F5JmEEWgx2FyQcLV+8lnmFIHDTRrGl5n3mbgQtuE6yw/ULitxp6T0zojdaox u+8/8AbpVTSK5r66z76w43NtNCfITHDzDDZ8j/mZZd1YxQKPsaB8samRwZ4q9DeA 2/Y5WvPjZ/hnk93y2sFzIqGKDAVCwhfkcuif04wGGdDgUk8DC+HNDTTg0Eg75Wse cuQG242IhCVSKB0rv2V2+LQn9a0YAR+/VxcWUHGYQ55zh5h9pnqC/1eINQXmdgbp Q4QLunAVGSvn2kFQ7z3g== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xhj4mr2g4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:10 +0000 (GMT) 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 43G508Gq011903 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:09 GMT Received: from hu-adisi-blr.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.1544.9; Mon, 15 Apr 2024 22:00:07 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 4/7] wifi: mac80211: handle color_change_abort and bss_config_notify on per link Date: Tue, 16 Apr 2024 10:29:40 +0530 Message-ID: <20240416045943.576656-5-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416045943.576656-1-quic_adisi@quicinc.com> References: <20240416045943.576656-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: rtyQ0KG9kD_NhGwphcNmfklLC0PflPHu X-Proofpoint-ORIG-GUID: rtyQ0KG9kD_NhGwphcNmfklLC0PflPHu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_02,2024-04-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 bulkscore=0 adultscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 mlxscore=0 clxscore=1015 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404160028 With MLO, there is a requirement to handle functions ieee80211_color_change_abort() and ieee80211_color_change_bss_config_notify() on a per link basis. Currently, deflink would only be passed. Proper link data will be passed in a subsequent change. Signed-off-by: Aditya Kumar Singh --- net/mac80211/cfg.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 6e64c0740c81..13cf4c0f3030 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3914,13 +3914,13 @@ static int ieee80211_set_csa_beacon(struct ieee80211_link_data *link_data, return 0; } -static void ieee80211_color_change_abort(struct ieee80211_sub_if_data *sdata) +static void ieee80211_color_change_abort(struct ieee80211_link_data *link) { - sdata->vif.bss_conf.color_change_active = false; + link->conf->color_change_active = false; - ieee80211_free_next_beacon(&sdata->deflink); + ieee80211_free_next_beacon(link); - cfg80211_color_change_aborted_notify(sdata->dev, 0); + cfg80211_color_change_aborted_notify(link->sdata->dev, link->link_id); } static int @@ -4004,7 +4004,7 @@ __ieee80211_channel_switch(struct wiphy *wiphy, struct net_device *dev, /* if there is a color change in progress, abort it */ if (link_conf->color_change_active) - ieee80211_color_change_abort(sdata); + ieee80211_color_change_abort(link_data); err = ieee80211_set_csa_beacon(link_data, params, &changed); if (err) { @@ -4733,16 +4733,18 @@ ieee80211_set_color_change_beacon(struct ieee80211_link_data *link, } static void -ieee80211_color_change_bss_config_notify(struct ieee80211_sub_if_data *sdata, +ieee80211_color_change_bss_config_notify(struct ieee80211_link_data *link, u8 color, int enable, u64 changed) { + struct ieee80211_sub_if_data *sdata = link->sdata; + lockdep_assert_wiphy(sdata->local->hw.wiphy); - sdata->vif.bss_conf.he_bss_color.color = color; - sdata->vif.bss_conf.he_bss_color.enabled = enable; + link->conf->he_bss_color.color = color; + link->conf->he_bss_color.enabled = enable; changed |= BSS_CHANGED_HE_BSS_COLOR; - ieee80211_link_info_change_notify(sdata, &sdata->deflink, changed); + ieee80211_link_info_change_notify(sdata, link, changed); if (!sdata->vif.bss_conf.nontransmitted && sdata->vif.mbssid_tx_vif) { struct ieee80211_sub_if_data *child; @@ -4775,7 +4777,7 @@ static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata) return err; } - ieee80211_color_change_bss_config_notify(sdata, + ieee80211_color_change_bss_config_notify(&sdata->deflink, sdata->vif.bss_conf.color_change_color, 1, changed); cfg80211_color_change_notify(sdata->dev, 0); @@ -4879,7 +4881,7 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev, cfg80211_color_change_started_notify(sdata->dev, params->count, 0); if (changed) - ieee80211_color_change_bss_config_notify(sdata, 0, 0, changed); + ieee80211_color_change_bss_config_notify(&sdata->deflink, 0, 0, changed); else /* if the beacon didn't change, we can finalize immediately */ ieee80211_color_change_finalize(sdata); From patchwork Tue Apr 16 04:59:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 789773 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 8001E3B293 for ; Tue, 16 Apr 2024 05:00:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243626; cv=none; b=EyvoOxyON44CU2Iot+RE+QeOLs9wsY9uqrS268z08kE/+C3tS2+YLIn38yezuTFDcxf+A+y/4be2h79RPCxsuWbIOY/Ona319FqB92PR0Oqdqilxnxo4vP62whMBbIs27d9723VeCs5HUlljipNK1y5bl53MIYZ5Ux2GIvPWyBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243626; c=relaxed/simple; bh=K6pw06ngeyDVDDKNhUua2YUq+pcqYC+Mx1IOqlyR8Is=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BNSTfjlErrj8qX5XgW0Oerb1LbHaAhSF/27pyGqx8YUHM6+1a9IolIg5W5C6oyE4532E82RPNCxCIVR0+dV8qUx1y8/2d2a6FBEXD16LHhb/YOita3RUIsoXug6nStOs04styKGHxykHnEXWyosN8YzoJzuDt/QWQkLhFaGqaBw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=kLnZ2/y5; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="kLnZ2/y5" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43G3v7aP021630; Tue, 16 Apr 2024 05:00:12 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=cjk/WZ3IP6Scep2akuQhco/LxnmKGQ2WeRzCegkRVIQ=; b=kL nZ2/y514qLg4ez8lrI3f1WyWSX/KDrvCmmgNT/h3/Gzi3elI78paUo6AEukzgHmm R37LqGt3e8xGtWwgNv65JFbp7vhqKmywjWxwAWSqyf5mMkruwZh1Pco5mVXMjb8J J+RHmn35EaD+sRxocus/Mdbe3gtV9pNvw43tA1Bfp1Cw6YJAtNAwrcKzcedenGao 7nQQgD55nxwShnznI1qh13oaVdSPNV2m9GyULpjSWdIsl4d5kyrQHgRB9NfsRBq5 SUxY6pY9rQRd3fMn/pn1y4KnIvcbvMjyBZ3o/VOZdtD10UZJt3k6bEe1CDqLf7BJ PAOvO2oZ3lhYHZLMvEkA== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xha2m8yxu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:11 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43G50BDS000362 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:11 GMT Received: from hu-adisi-blr.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.1544.9; Mon, 15 Apr 2024 22:00:09 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 5/7] wifi: mac80211: start and finalize color change on link basis Date: Tue, 16 Apr 2024 10:29:41 +0530 Message-ID: <20240416045943.576656-6-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416045943.576656-1-quic_adisi@quicinc.com> References: <20240416045943.576656-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 44iIqARBw7Vnf6qKK4RXY64z5rcsXhbJ X-Proofpoint-ORIG-GUID: 44iIqARBw7Vnf6qKK4RXY64z5rcsXhbJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_02,2024-04-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 lowpriorityscore=0 suspectscore=0 priorityscore=1501 spamscore=0 adultscore=0 malwarescore=0 clxscore=1015 phishscore=0 mlxscore=0 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404160028 Add changes to start a color change as well as finalize it on link basis in order to support switching color with MLO as well. Signed-off-by: Aditya Kumar Singh --- net/mac80211/cfg.c | 55 +++++++++++++++++++++++++++++----------------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 13cf4c0f3030..fcba6d28ea36 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4761,26 +4761,27 @@ ieee80211_color_change_bss_config_notify(struct ieee80211_link_data *link, } } -static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata) +static int ieee80211_color_change_finalize(struct ieee80211_link_data *link) { + struct ieee80211_sub_if_data *sdata = link->sdata; struct ieee80211_local *local = sdata->local; u64 changed = 0; int err; lockdep_assert_wiphy(local->hw.wiphy); - sdata->vif.bss_conf.color_change_active = false; + link->conf->color_change_active = false; - err = ieee80211_set_after_color_change_beacon(&sdata->deflink, &changed); + err = ieee80211_set_after_color_change_beacon(link, &changed); if (err) { - cfg80211_color_change_aborted_notify(sdata->dev, 0); + cfg80211_color_change_aborted_notify(sdata->dev, link->link_id); return err; } - ieee80211_color_change_bss_config_notify(&sdata->deflink, - sdata->vif.bss_conf.color_change_color, + ieee80211_color_change_bss_config_notify(link, + link->conf->color_change_color, 1, changed); - cfg80211_color_change_notify(sdata->dev, 0); + cfg80211_color_change_notify(sdata->dev, link->link_id); return 0; } @@ -4788,21 +4789,23 @@ static int ieee80211_color_change_finalize(struct ieee80211_sub_if_data *sdata) void ieee80211_color_change_finalize_work(struct wiphy *wiphy, struct wiphy_work *work) { - struct ieee80211_sub_if_data *sdata = - container_of(work, struct ieee80211_sub_if_data, - deflink.color_change_finalize_work); + struct ieee80211_link_data *link = + container_of(work, struct ieee80211_link_data, + color_change_finalize_work); + struct ieee80211_sub_if_data *sdata = link->sdata; + struct ieee80211_bss_conf *link_conf = link->conf; struct ieee80211_local *local = sdata->local; lockdep_assert_wiphy(local->hw.wiphy); /* AP might have been stopped while waiting for the lock. */ - if (!sdata->vif.bss_conf.color_change_active) + if (!link_conf->color_change_active) return; if (!ieee80211_sdata_running(sdata)) return; - ieee80211_color_change_finalize(sdata); + ieee80211_color_change_finalize(link); } void ieee80211_color_collision_detection_work(struct work_struct *work) @@ -4855,36 +4858,48 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev, { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = sdata->local; + struct ieee80211_bss_conf *link_conf; + struct ieee80211_link_data *link; + u8 link_id = params->link_id; u64 changed = 0; int err; lockdep_assert_wiphy(local->hw.wiphy); - if (sdata->vif.bss_conf.nontransmitted) + if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS)) + return -EINVAL; + + link = wiphy_dereference(wiphy, sdata->link[link_id]); + if (!link) + return -ENOLINK; + + link_conf = link->conf; + + if (link_conf->nontransmitted) return -EINVAL; /* don't allow another color change if one is already active or if csa * is active */ - if (sdata->vif.bss_conf.color_change_active || sdata->vif.bss_conf.csa_active) { + if (link_conf->color_change_active || link_conf->csa_active) { err = -EBUSY; goto out; } - err = ieee80211_set_color_change_beacon(&sdata->deflink, params, &changed); + err = ieee80211_set_color_change_beacon(link, params, &changed); if (err) goto out; - sdata->vif.bss_conf.color_change_active = true; - sdata->vif.bss_conf.color_change_color = params->color; + link_conf->color_change_active = true; + link_conf->color_change_color = params->color; - cfg80211_color_change_started_notify(sdata->dev, params->count, 0); + cfg80211_color_change_started_notify(sdata->dev, params->count, link_id); if (changed) - ieee80211_color_change_bss_config_notify(&sdata->deflink, 0, 0, changed); + ieee80211_color_change_bss_config_notify(link, 0, 0, changed); else /* if the beacon didn't change, we can finalize immediately */ - ieee80211_color_change_finalize(sdata); + ieee80211_color_change_finalize(link); out: From patchwork Tue Apr 16 04:59:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 790502 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 E29BF3839D for ; Tue, 16 Apr 2024 05:00:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243624; cv=none; b=QPa6+mEEIWTnDrEWxA3zd3oR7kk4ZwBpzUjvWzbdvnDh3xwxRovjLLULFxf0elp4SecMvkRcXVTWyUT+m2CJwTO9xW/uRHEHQQdaeeFVtIllJ+WSp1FLOHE+xTvavFJPTD46R5o4C6vjzdB1TNhWTqKD0Lppf7kkH0gQsmzCdr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243624; c=relaxed/simple; bh=T3siPaHYfAJAnMDULOIyViw5MqCb9DFB/92xb+UGgPA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZSTV3xdEAmedLguK0WvUHm849nLu/IgqTLu3MICICtydVaI4Qsm06zecl6kLSJKA+n3RfFlmcsqlnpBTdAaRVYCuInxvxJNUJCG6h61byQrK91LauuWlkT1PGC5gm/SYanqCf8JR5PwH84Tt5oNlLsGTB3n8x0HW64F4JY8S4Os= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=TSjgKGYL; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="TSjgKGYL" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43G2FWrj031887; Tue, 16 Apr 2024 05:00:14 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=AGpAkcuwbU8DK4OYdf1TBbxfwS9h075hrUKnuLy3KMU=; b=TS jgKGYLywvzwWPu9MA6KD+SO3Ifl9v+vyjL8DRIRn6nma6dXy60jOHqQw/VeyVibU gGPM+C7m0BmnLX/2mHFdTnuNK5J+kGNhYFPf4e8zsnlQ1LoCRtBsDeOYPMbl1U1D Sk7sfMSITR3gWvIcnmwvUs1xf4UuyECkllLCGGwO/rMVWvYO8UFAa4OjE5MXu8yQ XiYPhgRlB/HydIex6IHvtGkxquQ8kSW5JDk4cKzRCpBFOoBeD3JwtsRTCk7p7VhT a+5Wy7bFTZQCOzlsPLYJfy0+rg39XnnWCbb7C75iFtmC7NE1G2TY4EghH/MPlakN iTp2d4Y4OysNEmgxXeZw== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xh8v5h58s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:13 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 43G50DCW000401 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:13 GMT Received: from hu-adisi-blr.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.1544.9; Mon, 15 Apr 2024 22:00:11 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 6/7] wifi: mac80211: add support to call color_change and OBSS collision on a link Date: Tue, 16 Apr 2024 10:29:42 +0530 Message-ID: <20240416045943.576656-7-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416045943.576656-1-quic_adisi@quicinc.com> References: <20240416045943.576656-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: Ii-XIcrHoNibJ3hiLV3jYObYbpHaCQAU X-Proofpoint-ORIG-GUID: Ii-XIcrHoNibJ3hiLV3jYObYbpHaCQAU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_02,2024-04-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 mlxscore=0 clxscore=1015 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404160028 Currently ieee80211_color_change_finish() function finalizes color change by scheduling a finalizing worker using the deflink. Similarly, function ieee80211_obss_color_collision_notify() notifies the mac80211 about color collision on deflink. With MLO, there is a need to do it on a given link basis. Pass link ID of the link on which color change needs to be finalized or OBSS color collision is detected. Signed-off-by: Aditya Kumar Singh --- drivers/net/wireless/ath/ath11k/mac.c | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 3 +- .../net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +- .../net/wireless/mediatek/mt76/mt7996/mcu.c | 2 +- include/net/mac80211.h | 6 ++- net/mac80211/cfg.c | 37 ++++++++++++++++--- net/mac80211/rx.c | 7 ++-- 7 files changed, 45 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index c32be587000d..40c3ba6c445b 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -1659,7 +1659,7 @@ void ath11k_mac_bcn_tx_event(struct ath11k_vif *arvif) if (vif->bss_conf.color_change_active && ieee80211_beacon_cntdwn_is_complete(vif, 0)) { arvif->bcca_zero_sent = true; - ieee80211_color_change_finish(vif); + ieee80211_color_change_finish(vif, 0); return; } diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index c74aa3f95658..3761dfce1f64 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -4064,7 +4064,8 @@ ath11k_wmi_obss_color_collision_event(struct ath11k_base *ab, struct sk_buff *sk switch (ev->evt_type) { case WMI_BSS_COLOR_COLLISION_DETECTION: - ieee80211_obss_color_collision_notify(arvif->vif, ev->obss_color_bitmap); + ieee80211_obss_color_collision_notify(arvif->vif, ev->obss_color_bitmap, + 0); ath11k_dbg(ab, ATH11K_DBG_WMI, "OBSS color collision detected vdev:%d, event:%d, bitmap:%08llx\n", ev->vdev_id, ev->evt_type, ev->obss_color_bitmap); diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index d90f98c50039..6442e3e5d45b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -331,7 +331,7 @@ mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) if (!vif->bss_conf.color_change_active || vif->type == NL80211_IFTYPE_STATION) return; - ieee80211_color_change_finish(vif); + ieee80211_color_change_finish(vif, 0); } static void diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c index b44abe2acc81..163b822a477c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c @@ -418,7 +418,7 @@ mt7996_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif) if (!vif->bss_conf.color_change_active || vif->type == NL80211_IFTYPE_STATION) return; - ieee80211_color_change_finish(vif); + ieee80211_color_change_finish(vif, 0); } static void diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 41f135a793ab..6be62cc2caf6 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -5612,12 +5612,13 @@ bool ieee80211_beacon_cntdwn_is_complete(struct ieee80211_vif *vif, /** * ieee80211_color_change_finish - notify mac80211 about color change * @vif: &struct ieee80211_vif pointer from the add_interface callback. + * @link_id: valid link_id during MLO or 0 for non-MLO * * After a color change announcement was scheduled and the counter in this * announcement hits 1, this function must be called by the driver to * notify mac80211 that the color can be changed */ -void ieee80211_color_change_finish(struct ieee80211_vif *vif); +void ieee80211_color_change_finish(struct ieee80211_vif *vif, u8 link_id); /** * ieee80211_proberesp_get - retrieve a Probe Response template @@ -7530,6 +7531,7 @@ ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, /** * ieee80211_obss_color_collision_notify - notify userland about a BSS color * collision. + * @link_id: valid link_id during MLO or 0 for non-MLO * * @vif: &struct ieee80211_vif pointer from the add_interface callback. * @color_bitmap: a 64 bit bitmap representing the colors that the local BSS is @@ -7537,7 +7539,7 @@ ieee80211_get_unsol_bcast_probe_resp_tmpl(struct ieee80211_hw *hw, */ void ieee80211_obss_color_collision_notify(struct ieee80211_vif *vif, - u64 color_bitmap); + u64 color_bitmap, u8 link_id); /** * ieee80211_is_tx_data - check if frame is a data frame diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index fcba6d28ea36..d654b1900252 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -4820,23 +4820,48 @@ void ieee80211_color_collision_detection_work(struct work_struct *work) link->link_id); } -void ieee80211_color_change_finish(struct ieee80211_vif *vif) +void ieee80211_color_change_finish(struct ieee80211_vif *vif, u8 link_id) { struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); + struct ieee80211_link_data *link; + + if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS)) + return; + + rcu_read_lock(); + + link = rcu_dereference(sdata->link[link_id]); + if (WARN_ON(!link)) { + rcu_read_unlock(); + return; + } wiphy_work_queue(sdata->local->hw.wiphy, - &sdata->deflink.color_change_finalize_work); + &link->color_change_finalize_work); + + rcu_read_unlock(); } EXPORT_SYMBOL_GPL(ieee80211_color_change_finish); void ieee80211_obss_color_collision_notify(struct ieee80211_vif *vif, - u64 color_bitmap) + u64 color_bitmap, u8 link_id) { struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); - struct ieee80211_link_data *link = &sdata->deflink; + struct ieee80211_link_data *link; - if (sdata->vif.bss_conf.color_change_active || sdata->vif.bss_conf.csa_active) + if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS)) + return; + + rcu_read_lock(); + + link = rcu_dereference(sdata->link[link_id]); + if (WARN_ON(!link)) { + rcu_read_unlock(); + return; + } + + if (link->conf->color_change_active || link->conf->csa_active) return; if (delayed_work_pending(&link->color_collision_detect_work)) @@ -4849,6 +4874,8 @@ ieee80211_obss_color_collision_notify(struct ieee80211_vif *vif, ieee80211_queue_delayed_work(&sdata->local->hw, &link->color_collision_detect_work, msecs_to_jiffies(500)); + + rcu_read_unlock(); } EXPORT_SYMBOL_GPL(ieee80211_obss_color_collision_notify); diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 4b4cbd8bf35d..e2b561a9a751 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -3361,7 +3361,7 @@ ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx) if (ieee80211_hw_check(&rx->local->hw, DETECTS_COLOR_COLLISION)) return; - if (rx->sdata->vif.bss_conf.csa_active) + if (rx->link->conf->csa_active) return; baselen = mgmt->u.beacon.variable - rx->skb->data; @@ -3373,7 +3373,7 @@ ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx) rx->skb->len - baselen); if (ie && ie->datalen >= sizeof(struct ieee80211_he_operation) && ie->datalen >= ieee80211_he_oper_size(ie->data + 1)) { - struct ieee80211_bss_conf *bss_conf = &rx->sdata->vif.bss_conf; + struct ieee80211_bss_conf *bss_conf = rx->link->conf; const struct ieee80211_he_operation *he_oper; u8 color; @@ -3386,7 +3386,8 @@ ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx) IEEE80211_HE_OPERATION_BSS_COLOR_MASK); if (color == bss_conf->he_bss_color.color) ieee80211_obss_color_collision_notify(&rx->sdata->vif, - BIT_ULL(color)); + BIT_ULL(color), + bss_conf->link_id); } } From patchwork Tue Apr 16 04:59:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Kumar Singh X-Patchwork-Id: 789774 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 86DDA39FDA for ; Tue, 16 Apr 2024 05:00:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243624; cv=none; b=TvK6ZGjJfNR/JRXCu+MxcL8nULwDrNdSMpRRqpRmOZO6HOjS1ve6lZLimPmQk4H/DsS7npeIyVGrasblm51r7CGD6Ej6+af8iNqTqqq2FsJJl+vucYTFPv3M7hHY0BEnNawo0j98/yoNVu6mDzOzESS7yXdrVrDmvEZ5vzfs4YE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713243624; c=relaxed/simple; bh=UwAjjjZWj++YCBYjDviX0/SCOuyW069AAvJC2T1HFSM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kauBQewbicfiBSyGCNVS2H0C2RO/Auei5B9OYty/Dwr/fDPcf6xEt2brjNHq1ns6ZtYQhEspxRLL3b/l3XEfe11utWxn8W6eQaBtmzPtA/ZU2o1ey8ngA3xhSx+gJD3nOSP6by1cYmFZgqYO3N5AlNYM+WNCyjfoK9FIKnhcWDM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=ntYKBp09; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="ntYKBp09" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 43G2wSKW015615; Tue, 16 Apr 2024 05:00: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=x+GV2XwqztwxE2ZCwmqbxE6izqUdCwRrWrcNWuj/RO4=; b=nt YKBp09T1L6pOHqBW8O0jxGWqDT+8x40N1sG7AlzHPo4dSqRKxllFL5mTSli4SBSH QBay3M7wlKLi4UPM12o64xLUAqLHzMc48xD/rTQkfATWPgtbY7ScoExqan22n9dO gJ1Eol0dIXXjcRic95jnk27hHOPb3nJ+hqD3KPwivuxMdTE7tsiqqQu1JXooLf0L A4Bu+H4XF99j8ZM6oAW1LmvV23T8Wu/IeFHwPkJmGJ9i9qAhw0WaFtzdmPmwM/Yq SQnEDp4REDMD7T9kOYb36vSCSorSgE7FQkOXqvF88kelk63mma71JFlWCSZ8aeas WuAfEnH6AG9jSQO3bfFA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xhbg88tau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:16 +0000 (GMT) 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 43G50Fim012427 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 16 Apr 2024 05:00:15 GMT Received: from hu-adisi-blr.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.1544.9; Mon, 15 Apr 2024 22:00:13 -0700 From: Aditya Kumar Singh To: CC: , Aditya Kumar Singh Subject: [PATCH 7/7] wifi: mac80211_hwsim: add support for BSS color Date: Tue, 16 Apr 2024 10:29:43 +0530 Message-ID: <20240416045943.576656-8-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416045943.576656-1-quic_adisi@quicinc.com> References: <20240416045943.576656-1-quic_adisi@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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: 6rBSRsX-GtDXw7K4Dqc3nsRHbRQtvsfj X-Proofpoint-ORIG-GUID: 6rBSRsX-GtDXw7K4Dqc3nsRHbRQtvsfj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-16_02,2024-04-15_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 malwarescore=0 spamscore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2404160028 Advertise support for BSS color and then once the countdown reaches 0, call color change finish. Signed-off-by: Aditya Kumar Singh --- drivers/net/wireless/virtual/mac80211_hwsim.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/virtual/mac80211_hwsim.c b/drivers/net/wireless/virtual/mac80211_hwsim.c index 4399eb1d9f46..2298e89fb7b6 100644 --- a/drivers/net/wireless/virtual/mac80211_hwsim.c +++ b/drivers/net/wireless/virtual/mac80211_hwsim.c @@ -2313,6 +2313,10 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, if (link_conf->csa_active && ieee80211_beacon_cntdwn_is_complete(vif, link_id)) ieee80211_csa_finish(vif, link_id); + + if (link_conf->color_change_active && + ieee80211_beacon_cntdwn_is_complete(vif, link_id)) + ieee80211_color_change_finish(vif, link_id); } static enum hrtimer_restart @@ -5323,6 +5327,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT); + wiphy_ext_feature_set(hw->wiphy, + NL80211_EXT_FEATURE_BSS_COLOR); hw->wiphy->interface_modes = param->iftypes;