From patchwork Fri Jun 21 05:34: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: 1950534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=pz/wHlfa; 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=DJc0AHff; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W55g02k9kz20X4 for ; Fri, 21 Jun 2024 15:35:38 +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=oHd4L5/OVGSqhLsc564rmOodWB6lXHDuu18OpHfZhMY=; b=pz/wHlfajhPtLS 0uGpZd0+Ir0iCwFlRUGU8dtd/kurQX0pgTrferScOhRZyYHWVaDAhr93biZO8crJgY8vzamBiGrm4 u6bnkOz2wZfH0Tl2GvfMSuXTx1c4c1VDMYoe85ogepOvgYHBQfU1X82LuAsndA13Ur1HLi0I0yc/N 56l0+lvxuMLRpYFfz2NY3ihMIamVe6bQNzZtecYAXkvnoNUPlmC+rDM/Bk72+dYOYgGH0tJuar+ql hYJ4UDjTNE8spEcYm1N+s0mORY6YMu4qO/vnC7EUZGuXUzs+KgrPKWmeeZ4+ZyHRGWnV5nRRXgVyK /Y+IgCsZ0M95e6t7oRKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKWvQ-00000007mkW-162i; Fri, 21 Jun 2024 05:35:04 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKWvM-00000007mj6-36lR for hostap@lists.infradead.org; Fri, 21 Jun 2024 05:35:02 +0000 Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45KHBSv5020012 for ; Fri, 21 Jun 2024 05:34:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 9//Mfv6RCeXG/SxCF6OETRVc9/QlSI/gtvIrG7jIk2E=; b=DJc0AHff9xiHg2rF awwXSwVlvTvEFzlSDEyKh9Cg92gEjftJxOPSMLa40vKS953n0vHtRbXSb1PhKgpe Nc48uUFlljssKkKMPAeApa3Ry5g5qJUy+ZT+pVSKYYQEYYQMGIEeAFMlkD321PCw RkegTKN0y9cxBiKf0xghO8b0dCxJ65EiG4gGL7sg2vhsdqvQZlepPr47MoIoeK4Y wem+ftTpLM9FplLnmXjx/+Scb+QZSY34CwywoVxBC10r8W7X+yif1uTOwOBKPJcj l8tzzgR06tCFAnsOrU7NdKSLsdAYi/zhbeoE6amIloMrNUXwYG4HldCIGkkw6NRr CCGkPQ== Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yvrkw9dcm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 21 Jun 2024 05:34:59 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA03.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45L5Ywwc011462 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 21 Jun 2024 05:34:58 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; Thu, 20 Jun 2024 22:34:56 -0700 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH v2 1/2] nl80211: fix scan request and its related events handling with MLO Date: Fri, 21 Jun 2024 11:04:38 +0530 Message-ID: <20240621053439.379657-2-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621053439.379657-1-quic_adisi@quicinc.com> References: <20240621053439.379657-1-quic_adisi@quicinc.com> MIME-Version: 1.0 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: GA8XxXQVeL3l16WI70KO0jxYzFUpnMGt X-Proofpoint-ORIG-GUID: GA8XxXQVeL3l16WI70KO0jxYzFUpnMGt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-20_12,2024-06-20_04,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 phishscore=0 clxscore=1015 malwarescore=0 spamscore=0 suspectscore=0 bulkscore=0 mlxscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210039 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240620_223500_944034_7D29A503 X-CRM114-Status: GOOD ( 27.51 ) X-Spam-Score: -0.2 (/) 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: Currently, whenever a scan is started, it uses drv's first BSS only whether it is AP or STA interface. However with MLO AP related changes, same drv could be used by other BSSes as well which needs sc [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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.0 T_SCC_BODY_TEXT_LINE No description available. 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 Currently, whenever a scan is started, it uses drv's first BSS only whether it is AP or STA interface. However with MLO AP related changes, same drv could be used by other BSSes as well which needs scanning. Hence, the current logic will not work since scan needs to be handled on non-first BSS as well. Add changes to move the logic of always using drv's first BSS during scan events to using BSS on which the event arrived. Also, for ML AP operation, even though BSS is same, link BSS also needs to be identified. Hence add a back pointer in BSS struct which would be used to point to the link BSS which requested scan on that BSS. This will help in routing the scan events to appropriate BSS ctx. Signed-off-by: Aditya Kumar Singh --- src/drivers/driver_nl80211.c | 23 ++++++++++-- src/drivers/driver_nl80211.h | 4 ++- src/drivers/driver_nl80211_event.c | 56 +++++++++++++++++++++--------- src/drivers/driver_nl80211_scan.c | 37 ++++++++++++++++---- 4 files changed, 94 insertions(+), 26 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 9cd416ce8b73..6541fbfe1dc3 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3177,7 +3177,7 @@ static void wpa_driver_nl80211_deinit(struct i802_bss *bss) eloop_cancel_timeout(wpa_driver_nl80211_send_rfkill, drv, drv->ctx); rfkill_deinit(drv->rfkill); - eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx); + eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, bss->ctx); if (!drv->start_iface_up) (void) i802_set_iface_flags(bss, 0); @@ -4195,6 +4195,23 @@ struct i802_link * nl80211_get_link(struct i802_bss *bss, s8 link_id) } +u8 nl80211_get_link_id_from_link(struct i802_bss *bss, + struct i802_link *link) +{ + u8 link_id; + + if (link == bss->flink) + return 0; + + for_each_link(bss->valid_links, link_id) { + if (&bss->links[link_id] == link) + return link_id; + } + + return 0; +} + + static void nl80211_link_set_freq(struct i802_bss *bss, s8 link_id, int freq) { struct i802_link *link = nl80211_get_link(bss, link_id); @@ -10237,6 +10254,8 @@ static int wpa_driver_nl80211_get_survey(void *priv, unsigned int freq) int err; union wpa_event_data data; struct survey_results *survey_results; + void *ctx = (bss->scan_link && bss->scan_link->ctx) ? + bss->scan_link->ctx : bss->ctx; os_memset(&data, 0, sizeof(data)); survey_results = &data.survey_results; @@ -10259,7 +10278,7 @@ static int wpa_driver_nl80211_get_survey(void *priv, unsigned int freq) if (err) wpa_printf(MSG_ERROR, "nl80211: Failed to process survey data"); else - wpa_supplicant_event(drv->ctx, EVENT_SURVEY, &data); + wpa_supplicant_event(ctx, EVENT_SURVEY, &data); clean_survey_results(survey_results); return err; diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h index 618746e67722..898a6d5b973b 100644 --- a/src/drivers/driver_nl80211.h +++ b/src/drivers/driver_nl80211.h @@ -67,7 +67,7 @@ struct i802_bss { u16 valid_links; struct i802_link links[MAX_NUM_MLD_LINKS]; - struct i802_link *flink; + struct i802_link *flink, *scan_link; int ifindex; int br_ifindex; @@ -352,6 +352,8 @@ const char * nl80211_iftype_str(enum nl80211_iftype mode); void nl80211_restore_ap_mode(struct i802_bss *bss); struct i802_link * nl80211_get_link(struct i802_bss *bss, s8 link_id); +u8 nl80211_get_link_id_from_link(struct i802_bss *bss, + struct i802_link *link); static inline bool nl80211_link_valid(u16 links, s8 link_id) { diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index e8ddb6337d0a..bd17376324cd 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -1965,9 +1965,10 @@ static void mlme_event_dh_event(struct wpa_driver_nl80211_data *drv, } -static void send_scan_event(struct wpa_driver_nl80211_data *drv, int aborted, +static void send_scan_event(struct i802_bss *bss, int aborted, struct nlattr *tb[], int external_scan) { + struct wpa_driver_nl80211_data *drv = bss->drv; union wpa_event_data event; struct nlattr *nl; int rem; @@ -1975,6 +1976,8 @@ static void send_scan_event(struct wpa_driver_nl80211_data *drv, int aborted, #define MAX_REPORT_FREQS 110 int freqs[MAX_REPORT_FREQS]; int num_freqs = 0; + struct i802_link *mld_link; + void *ctx = bss->ctx; if (!external_scan && drv->scan_for_auth) { drv->scan_for_auth = 0; @@ -2038,7 +2041,28 @@ static void send_scan_event(struct wpa_driver_nl80211_data *drv, int aborted, ETH_ALEN); } - wpa_supplicant_event(drv->ctx, EVENT_SCAN_RESULTS, &event); + /* need to pass to correct link ctx during AP operation */ + if (is_ap_interface(drv->nlmode)) { + mld_link = bss->scan_link; + if (!mld_link) { + wpa_printf(MSG_DEBUG, + "nl80211: Scan event on unknown link"); + goto process_scan_event; + } + + if (mld_link->ctx) { + u8 link_id = nl80211_get_link_id_from_link(bss, + mld_link); + + wpa_printf(MSG_DEBUG, + "nl80211: Scan event for link_id %d", + link_id); + ctx = mld_link->ctx; + } + } + +process_scan_event: + wpa_supplicant_event(ctx, EVENT_SCAN_RESULTS, &event); } @@ -3055,7 +3079,7 @@ static void qca_nl80211_scan_done_event(struct wpa_driver_nl80211_data *drv, drv->scan_state = SCAN_ABORTED; eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, - drv->ctx); + drv->first_bss->ctx); drv->vendor_scan_cookie = 0; drv->last_scan_cmd = 0; } @@ -3880,7 +3904,7 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, switch (cmd) { case NL80211_CMD_TRIGGER_SCAN: - wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Scan trigger"); + wpa_dbg(bss->ctx, MSG_DEBUG, "nl80211: Scan trigger"); drv->scan_state = SCAN_STARTED; if (drv->scan_for_auth) { /* @@ -3892,40 +3916,40 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, wpa_printf(MSG_DEBUG, "nl80211: Do not indicate scan-start event due to internal scan_for_auth"); break; } - wpa_supplicant_event(drv->ctx, EVENT_SCAN_STARTED, NULL); + wpa_supplicant_event(bss->ctx, EVENT_SCAN_STARTED, NULL); break; case NL80211_CMD_START_SCHED_SCAN: - wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Sched scan started"); + wpa_dbg(bss->ctx, MSG_DEBUG, "nl80211: Sched scan started"); drv->scan_state = SCHED_SCAN_STARTED; break; case NL80211_CMD_SCHED_SCAN_STOPPED: - wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Sched scan stopped"); + wpa_dbg(bss->ctx, MSG_DEBUG, "nl80211: Sched scan stopped"); drv->scan_state = SCHED_SCAN_STOPPED; - wpa_supplicant_event(drv->ctx, EVENT_SCHED_SCAN_STOPPED, NULL); + wpa_supplicant_event(bss->ctx, EVENT_SCHED_SCAN_STOPPED, NULL); break; case NL80211_CMD_NEW_SCAN_RESULTS: - wpa_dbg(drv->ctx, MSG_DEBUG, + wpa_dbg(bss->ctx, MSG_DEBUG, "nl80211: New scan results available"); if (drv->last_scan_cmd != NL80211_CMD_VENDOR) drv->scan_state = SCAN_COMPLETED; drv->scan_complete_events = 1; if (drv->last_scan_cmd == NL80211_CMD_TRIGGER_SCAN) { eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, - drv, drv->ctx); + drv, bss->ctx); drv->last_scan_cmd = 0; } else { external_scan_event = 1; } - send_scan_event(drv, 0, tb, external_scan_event); + send_scan_event(bss, 0, tb, external_scan_event); break; case NL80211_CMD_SCHED_SCAN_RESULTS: - wpa_dbg(drv->ctx, MSG_DEBUG, + wpa_dbg(bss->ctx, MSG_DEBUG, "nl80211: New sched scan results available"); drv->scan_state = SCHED_SCAN_RESULTS; - send_scan_event(drv, 0, tb, 0); + send_scan_event(bss, 0, tb, 0); break; case NL80211_CMD_SCAN_ABORTED: - wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: Scan aborted"); + wpa_dbg(bss->ctx, MSG_DEBUG, "nl80211: Scan aborted"); if (drv->last_scan_cmd != NL80211_CMD_VENDOR) drv->scan_state = SCAN_ABORTED; if (drv->last_scan_cmd == NL80211_CMD_TRIGGER_SCAN) { @@ -3934,12 +3958,12 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, * order not to make wpa_supplicant stop its scanning. */ eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, - drv, drv->ctx); + drv, bss->ctx); drv->last_scan_cmd = 0; } else { external_scan_event = 1; } - send_scan_event(drv, 1, tb, external_scan_event); + send_scan_event(bss, 1, tb, external_scan_event); break; case NL80211_CMD_AUTHENTICATE: case NL80211_CMD_ASSOCIATE: diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c index 1eb4374052e5..14cb324d0331 100644 --- a/src/drivers/driver_nl80211_scan.c +++ b/src/drivers/driver_nl80211_scan.c @@ -153,6 +153,7 @@ fail: void wpa_driver_nl80211_scan_timeout(void *eloop_ctx, void *timeout_ctx) { struct wpa_driver_nl80211_data *drv = eloop_ctx; + struct i802_bss *bss; wpa_printf(MSG_DEBUG, "nl80211: Scan timeout - try to abort it"); #ifdef CONFIG_DRIVER_NL80211_QCA @@ -160,14 +161,27 @@ void wpa_driver_nl80211_scan_timeout(void *eloop_ctx, void *timeout_ctx) nl80211_abort_vendor_scan(drv, drv->vendor_scan_cookie) == 0) return; #endif /* CONFIG_DRIVER_NL80211_QCA */ + + for (bss = drv->first_bss; bss; bss = bss->next) { + if (bss->scan_link) + break; + } + + if (!bss) { + wpa_printf(MSG_DEBUG, "nl80211: Failed to find scan bss"); + return; + } + if (!drv->vendor_scan_cookie && - nl80211_abort_scan(drv->first_bss) == 0) + nl80211_abort_scan(bss) == 0) { + bss->scan_link = NULL; return; + } wpa_printf(MSG_DEBUG, "nl80211: Failed to abort scan"); if (drv->ap_scan_as_station != NL80211_IFTYPE_UNSPECIFIED) - nl80211_restore_ap_mode(drv->first_bss); + nl80211_restore_ap_mode(bss); wpa_printf(MSG_DEBUG, "nl80211: Try to get scan results"); wpa_supplicant_event(timeout_ctx, EVENT_SCAN_RESULTS, NULL); @@ -347,7 +361,7 @@ int wpa_driver_nl80211_scan(struct i802_bss *bss, int ret = -1, timeout; struct nl_msg *msg = NULL; - wpa_dbg(drv->ctx, MSG_DEBUG, "nl80211: scan request"); + wpa_dbg(bss->ctx, MSG_DEBUG, "nl80211: scan request"); drv->scan_for_auth = 0; if (TEST_FAIL()) @@ -440,11 +454,20 @@ int wpa_driver_nl80211_scan(struct i802_bss *bss, } wpa_printf(MSG_DEBUG, "Scan requested (ret=%d) - scan timeout %d " "seconds", ret, timeout); - eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx); + eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, bss->ctx); eloop_register_timeout(timeout, 0, wpa_driver_nl80211_scan_timeout, - drv, drv->ctx); + drv, bss->ctx); drv->last_scan_cmd = NL80211_CMD_TRIGGER_SCAN; + bss->scan_link = bss->flink; + if (is_ap_interface(drv->nlmode) && + nl80211_link_valid(bss->valid_links, params->link_id)) { + wpa_dbg(bss->ctx, MSG_DEBUG, + "nl80211: Scan requested for link %d", + params->link_id); + bss->scan_link = nl80211_get_link(bss, params->link_id); + } + fail: nlmsg_free(msg); return ret; @@ -1299,9 +1322,9 @@ int wpa_driver_nl80211_vendor_scan(struct i802_bss *bss, wpa_printf(MSG_DEBUG, "nl80211: Vendor scan requested (ret=%d) - scan timeout 30 seconds, scan cookie:0x%llx", ret, (long long unsigned int) cookie); - eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx); + eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, bss->ctx); eloop_register_timeout(30, 0, wpa_driver_nl80211_scan_timeout, - drv, drv->ctx); + drv, bss->ctx); drv->last_scan_cmd = NL80211_CMD_VENDOR; fail: From patchwork Fri Jun 21 05:34: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: 1950536 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=eN9abc9k; 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=Gt2vKQtq; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W55g032jcz20Zv for ; Fri, 21 Jun 2024 15:35:38 +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=xVMAasGK6wDRJYSYKFRORoKc4X9KFAx5sZlOS17VYlE=; b=eN9abc9k229Ygm e68tnRLunYH9cMPUJY4fvxMA5emA7NK8zB/15L+c3cyXhVt6vpX1WmBd3ZLvmLsw8OxLokIzzFbbp y3dDzk5b5bFbFh5XnJmE3L0tWQ2/iV5MNCoAk9hsBfyKeA5rTlp4qqWMZyvIJysx2UWY9RA+xuJNA QpT6OWqZuCC7ZqHP+Cud6jr1TUE8A02BElpmpf+TrzhInn+Xie+0toFHEEob0youerPuk/iJwKnGD zHS8LfoXIHq8ePe3k8TslQ8ol0O1K9PuOChEx+zGqD1Ybj/g6dYRaN9ac35V3xjJIMeY03M7C0F61 jzozZOehUdn5mYA7iMYg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKWvS-00000007mkm-1jqg; Fri, 21 Jun 2024 05:35:06 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKWvO-00000007mjc-1AUQ for hostap@lists.infradead.org; Fri, 21 Jun 2024 05:35:03 +0000 Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 45L5Tvgx000786 for ; Fri, 21 Jun 2024 05:35:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= WrjnZ/qPfTi+iA+QVL/+W1Z6wWO1t+4a8CXfB9ll/f8=; b=Gt2vKQtqpiXPLZJa NQQUI6Px/KdtvM0UIY0bNe9Ke0DnzN9qSxC3dJfMoYthDjkdtPpAacGU9IVXkwyn Vxika4ZqCHJMe45k4IjucsC2OsCtaeXq/LqVYdAFRr9DN1LOI7aWD9hf0YF6gI36 GyRcu1EJqnJfLYJUdypxQ2vDdaP6rxOZvEP68uAqqODbyUfBfwlrnhK/OGUzyVan rORzEN+LDW53V95ROjKDlsQjb0OjmOSAaSMUs+G91UbHKCs6OAWNhAfTbCIh9iqQ ed/C0I2sfyuEjX+hP+R0bLAqSjRQcE6aSGf23Z7LtKWK9g38qjP4L21PEDRbt3HW +uRQrw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3yw3d480by-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 21 Jun 2024 05:35:01 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 45L5Z0lG016716 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 21 Jun 2024 05:35:00 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; Thu, 20 Jun 2024 22:34:58 -0700 From: Aditya Kumar Singh To: CC: Aditya Kumar Singh Subject: [PATCH v2 2/2] nl80211: fix simultaneous scanning failure in case of MLO Date: Fri, 21 Jun 2024 11:04:39 +0530 Message-ID: <20240621053439.379657-3-quic_adisi@quicinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621053439.379657-1-quic_adisi@quicinc.com> References: <20240621053439.379657-1-quic_adisi@quicinc.com> MIME-Version: 1.0 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: j2pi9Chl03gMvV1x0eFdLnVGV0ScE6WG X-Proofpoint-ORIG-GUID: j2pi9Chl03gMvV1x0eFdLnVGV0ScE6WG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-06-20_12,2024-06-20_04,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 mlxscore=0 adultscore=0 mlxlogscore=999 spamscore=0 impostorscore=0 phishscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2406140001 definitions=main-2406210039 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240620_223502_621523_B3440872 X-CRM114-Status: GOOD ( 17.22 ) X-Spam-Score: -0.2 (/) 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: Currently only 1 scan can be performed on per phy level at a time in driver. Due to this, if via other underlying phy, a scan request is sent, kernel returns -EBUSY. And then hostapd would try to set [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -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.0 T_SCC_BODY_TEXT_LINE No description available. 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 Currently only 1 scan can be performed on per phy level at a time in driver. Due to this, if via other underlying phy, a scan request is sent, kernel returns -EBUSY. And then hostapd would try to set the interface in station mode if it was originally in AP mode and retry sending a scan request. However, this behaviour is expected in case of multi link operation and hence there is no need to switch the mode as such. Hence, add logic to not change the NL mode if kernel returns -EBUSY during multi link AP operation. The caller can accordingly decide and if needed, it can re-schedule a scan request after some time. Signed-off-by: Aditya Kumar Singh --- src/drivers/driver_nl80211_scan.c | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c index 14cb324d0331..7d4efed5ca6e 100644 --- a/src/drivers/driver_nl80211_scan.c +++ b/src/drivers/driver_nl80211_scan.c @@ -418,6 +418,40 @@ int wpa_driver_nl80211_scan(struct i802_bss *bss, if (drv->hostapd && is_ap_interface(drv->nlmode)) { enum nl80211_iftype old_mode = drv->nlmode; +#ifdef CONFIG_IEEE80211BE + /* For Multi Link BSS, retry scan if any other links + * are busy scanning + */ + if (ret == -EBUSY && + nl80211_link_valid(bss->valid_links, params->link_id)) { + struct i802_bss *link_bss; + u8 link_id; + + wpa_printf(MSG_DEBUG, + "nl80211: Scan trigger on Multi Link BSS failed (requested link=%d on interface %s)", + params->link_id, bss->ifname); + + for (link_bss = drv->first_bss; link_bss; + link_bss = link_bss->next) + if (link_bss->scan_link) + break; + + if (!link_bss) { + wpa_printf(MSG_DEBUG, + "nl80211: BSS information already running scan not available"); + goto fail; + } + + link_id = + nl80211_get_link_id_from_link(link_bss, + link_bss->scan_link); + wpa_printf(MSG_DEBUG, + "nl80211: Scan already running on interface %s link %d", + link_bss->ifname, link_id); + goto fail; + } +#endif /* CONFIG_IEEE80211BE */ + /* * mac80211 does not allow scan requests in AP mode, so * try to do this in station mode.