From patchwork Thu Sep 8 14:44:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Veerendranath Jakkam X-Patchwork-Id: 1675688 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=no3UcF74; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=bNGp2ID9; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MNj0v2qK3z1ynD for ; Fri, 9 Sep 2022 00:58:07 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Agoa2B318VGL8lqqQ82xMnytBtU0HAORs5YUBZ7dHpw=; b=no3UcF74u443go I3sNtqfPa4E/3giJsJNAQKfr2dAiZHKq7Iv3nJnXmbdhNNOWWhmdwa4BEBAZE0KAcMO1McumS+Igi s7RV0THECRmRYeLNZ6/dA0427cNsv98iRxd0sTFAB+AKihloJsRpDFEJ8gVBuSCEqfweZwznWGvP4 M0NvQJux1B1Jx5SntHs6OZ39zJ2Ficnpkt/7JjMj6yTFo49inyHE1PsTdY9pZIdXPAgph2aqSFkRW om3sJKU9s17O7C2JeSKRThEDIlYBcksYUIubUMAQDlrD1WLp1nKM9rNEJzPvjGktQVW2uoo41DGRq RM+WJMNQwO+Iz+c8XpbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWIxq-004yDZ-4U; Thu, 08 Sep 2022 14:57:10 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWIm7-004qg2-2j for hostap@lists.infradead.org; Thu, 08 Sep 2022 14:45:04 +0000 Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 288DxiAn000402 for ; Thu, 8 Sep 2022 14:45:02 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=OWh0Cdi2J7MZ22Jb5F+kFU+4ZL6PpRGO32LvhVxNWWY=; b=bNGp2ID9OIH5Ph7KGDY4jPmXKv9SjXqTbS+p4hFgwCIPJjt6j9VuNpCPsgCezTVtrafV roPTpg5ewG1HHJHvg17iJz/9a/rEScBK6aB0EP7sETIczUIj6mqSzrvEgCz2+lJ8/JBM 4i+x4FDaR5gs3qj/xS8gWGoDeWokCnpBG/W4FgzKqZhVXu8Q/vYlbu8H7wPDUD6dxt36 rvEHo82XqtptKhTvZBTBQ9hfSAKuzFPQcnTCI5DGd2YONJdSS0DHEbEm6ySeEMhnkEwm L5EhHdcTTn7EyXgVkkdqKRJNOz5DvgBJ6QIUBthXheRNwgbt/Cdgx7xUTYFzjicy+5Ke uw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3jf1swt6xc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 08 Sep 2022 14:45:02 +0000 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 288Ej1f5004966 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 8 Sep 2022 14:45:01 GMT Received: from cnss-mw-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.986.29; Thu, 8 Sep 2022 07:44:59 -0700 From: Veerendranath Jakkam To: CC: Subject: [PATCH v2 16/17] MLD STA: Add support to indicate per link channel switch Date: Thu, 8 Sep 2022 20:14:22 +0530 Message-ID: <20220908144423.2222859-17-quic_vjakkam@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220908144423.2222859-1-quic_vjakkam@quicinc.com> References: <20220908144423.2222859-1-quic_vjakkam@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: _DVxC4PgtRYcHqLP8AWrkHmx6EiM5Ktr X-Proofpoint-ORIG-GUID: _DVxC4PgtRYcHqLP8AWrkHmx6EiM5Ktr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-08_10,2022-09-08_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 bulkscore=0 impostorscore=0 adultscore=0 priorityscore=1501 mlxscore=0 spamscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209080053 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220908_074503_304050_C6C998B0 X-CRM114-Status: GOOD ( 24.43 ) X-Spam-Score: -0.9 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Parse link id info from channel switch events and indicate the info to control interface using new per link channel switch events. If channel switch happens on the link which used during association b [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [205.220.180.131 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Parse link id info from channel switch events and indicate the info to control interface using new per link channel switch events. If channel switch happens on the link which used during association both legacy and new per-link channel switch events will be reported. Signed-off-by: Veerendranath Jakkam --- src/common/wpa_ctrl.h | 9 ++++++++ src/drivers/driver.h | 20 ++++++++++++++++++ src/drivers/driver_common.c | 2 ++ src/drivers/driver_nl80211_event.c | 32 +++++++++++++++++++++++----- wpa_supplicant/events.c | 34 ++++++++++++++++++++++++++++++ 5 files changed, 92 insertions(+), 5 deletions(-) diff --git a/src/common/wpa_ctrl.h b/src/common/wpa_ctrl.h index 343508424..ba54da544 100644 --- a/src/common/wpa_ctrl.h +++ b/src/common/wpa_ctrl.h @@ -92,6 +92,15 @@ extern "C" { #define WPA_EVENT_CHANNEL_SWITCH_STARTED "CTRL-EVENT-STARTED-CHANNEL-SWITCH " /** Channel switch (followed by freq= and other channel parameters) */ #define WPA_EVENT_CHANNEL_SWITCH "CTRL-EVENT-CHANNEL-SWITCH " +/** MLO link channel switch started (followed by freq= and other channel + * parameters) + */ +#define WPA_EVENT_LINK_CHANNEL_SWITCH_STARTED \ + "CTRL-EVENT-STARTED-LINK-CHANNEL-SWITCH " +/** MLO link channel switch (followed by freq= and other channel + * parameters) + */ +#define WPA_EVENT_LINK_CHANNEL_SWITCH "CTRL-EVENT-LINK-CHANNEL-SWITCH " /** SAE authentication failed due to unknown password identifier */ #define WPA_EVENT_SAE_UNKNOWN_PASSWORD_IDENTIFIER \ "CTRL-EVENT-SAE-UNKNOWN-PASSWORD-IDENTIFIER " diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 525c7763d..b182d24cb 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -5428,6 +5428,24 @@ enum wpa_event_type { * PASN authentication and secure ranging context for multiple peers. */ EVENT_PASN_AUTH, + + /** + * EVENT_LINK_CH_SWITCH - MLD AP link decided to switch channels + * + * Described in wpa_event_data.ch_switch + * + */ + EVENT_LINK_CH_SWITCH, + + /** + * EVENT_LINK_CH_SWITCH_STARTED - MLD AP link started to switch channels + * + * This is a pre-switch event indicating the shortly following switch + * of operating channels. + * + * Described in wpa_event_data.ch_switch + */ + EVENT_LINK_CH_SWITCH_STARTED, }; @@ -6143,6 +6161,7 @@ union wpa_event_data { * @ch_width: Channel width * @cf1: Center frequency 1 * @cf2: Center frequency 2 + * @link_id: link ID of the MLO link */ struct ch_switch { int freq; @@ -6151,6 +6170,7 @@ union wpa_event_data { enum chan_width ch_width; int cf1; int cf2; + int link_id; } ch_switch; /** diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c index 93b35a6d3..0ac0aa6de 100644 --- a/src/drivers/driver_common.c +++ b/src/drivers/driver_common.c @@ -96,6 +96,8 @@ const char * event_to_string(enum wpa_event_type event) E2S(CCA_ABORTED_NOTIFY); E2S(CCA_NOTIFY); E2S(PASN_AUTH); + E2S(LINK_CH_SWITCH); + E2S(LINK_CH_SWITCH_STARTED); } return "UNKNOWN"; diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index 00ef51413..c4cffe051 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -780,10 +780,10 @@ static int calculate_chan_offset(int width, int freq, int cf1, int cf2) static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv, - struct nlattr *ifindex, struct nlattr *freq, - struct nlattr *type, struct nlattr *bw, - struct nlattr *cf1, struct nlattr *cf2, - int finished) + struct nlattr *ifindex, struct nlattr *link, + struct nlattr *freq, struct nlattr *type, + struct nlattr *bw, struct nlattr *cf1, + struct nlattr *cf2, int finished) { struct i802_bss *bss; union wpa_event_data data; @@ -847,7 +847,27 @@ static void mlme_event_ch_switch(struct wpa_driver_nl80211_data *drv, if (finished) bss->freq = data.ch_switch.freq; - drv->assoc_freq = data.ch_switch.freq; + + if (link) { + u8 link_id = nla_get_u8(link); + + if (drv->sta_mlo_info.valid_links & BIT(link_id)) { + data.ch_switch.link_id = link_id; + drv->sta_mlo_info.links[link_id].freq = + data.ch_switch.freq; + wpa_supplicant_event(bss->ctx, + finished ? + EVENT_LINK_CH_SWITCH : + EVENT_LINK_CH_SWITCH_STARTED, &data); + } + + if (link_id == drv->mlo_assoc_link_id) + drv->assoc_freq = data.ch_switch.freq; + else + return; + } else { + drv->assoc_freq = data.ch_switch.freq; + } wpa_supplicant_event(bss->ctx, finished ? EVENT_CH_SWITCH : EVENT_CH_SWITCH_STARTED, &data); @@ -3301,6 +3321,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, case NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: mlme_event_ch_switch(drv, tb[NL80211_ATTR_IFINDEX], + tb[NL80211_ATTR_MLO_LINK_ID], tb[NL80211_ATTR_WIPHY_FREQ], tb[NL80211_ATTR_WIPHY_CHANNEL_TYPE], tb[NL80211_ATTR_CHANNEL_WIDTH], @@ -3311,6 +3332,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, case NL80211_CMD_CH_SWITCH_NOTIFY: mlme_event_ch_switch(drv, tb[NL80211_ATTR_IFINDEX], + tb[NL80211_ATTR_MLO_LINK_ID], tb[NL80211_ATTR_WIPHY_FREQ], tb[NL80211_ATTR_WIPHY_CHANNEL_TYPE], tb[NL80211_ATTR_CHANNEL_WIDTH], diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index fc662a770..f94662007 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -5369,6 +5369,40 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event, break; #endif /* CONFIG_AP */ + case EVENT_LINK_CH_SWITCH_STARTED: + case EVENT_LINK_CH_SWITCH: + if (!data || !wpa_s->current_ssid || + !(wpa_s->valid_links & BIT(data->ch_switch.link_id))) + break; + + wpa_msg(wpa_s, MSG_INFO, + "%sfreq=%d link_id=%d ht_enabled=%d ch_offset=%d ch_width=%s cf1=%d cf2=%d", + event == EVENT_LINK_CH_SWITCH ? + WPA_EVENT_LINK_CHANNEL_SWITCH : + WPA_EVENT_LINK_CHANNEL_SWITCH_STARTED, + data->ch_switch.freq, + data->ch_switch.link_id, + data->ch_switch.ht_enabled, + data->ch_switch.ch_offset, + channel_width_to_string(data->ch_switch.ch_width), + data->ch_switch.cf1, + data->ch_switch.cf2); + if (event == EVENT_LINK_CH_SWITCH_STARTED) + break; + + wpa_s->links[data->ch_switch.link_id].freq = + data->ch_switch.freq; + if (wpa_s->links[data->ch_switch.link_id].bss && + wpa_s->links[data->ch_switch.link_id].bss->freq != + data->ch_switch.freq) { + wpa_s->links[data->ch_switch.link_id].bss->freq = + data->ch_switch.freq; + notify_bss_changes( + wpa_s, WPA_BSS_FREQ_CHANGED_FLAG, + wpa_s->links[data->ch_switch.link_id].bss); + } + + break; case EVENT_CH_SWITCH_STARTED: case EVENT_CH_SWITCH: if (!data || !wpa_s->current_ssid)