Message ID | 20221222124221.30894-2-quic_youghand@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp306505wrn; Thu, 22 Dec 2022 04:55:31 -0800 (PST) X-Google-Smtp-Source: AMrXdXt8o/ohzExcMt8S0sn58j+UzOAVZ3/BMhNznUA2cn3pincB4Q/UJ9z1DiLA51wIRS24kkLQ X-Received: by 2002:a17:90a:ea81:b0:225:bae0:90f7 with SMTP id h1-20020a17090aea8100b00225bae090f7mr1040356pjz.20.1671713730993; Thu, 22 Dec 2022 04:55:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671713730; cv=none; d=google.com; s=arc-20160816; b=qF+fAfS2U6xWp0ytX0fXFmlWwU0LTWWP0AGUhQHo8mi/US9kC099wDu9G6l1Qa8eAT cDeWM/VzPUb3CgGxy2yQ90kXmpROD9aeQa8fdx3hQVV2IBKx/DK1I60k+KiHQUeS7oqW 4JYFamuXiIF9gFwRUM8piEHdLa+NaqVvAb5K6kyL5047o02wFHfLA04XmH+X091vYn8N q08PbFVpqKxplbl/hoyf7sb4oB01yonGE7EHapOTQrttzuyB7I5nqemEcYPzyUG4iuor +YMcRRpP0qK2hif5zhTAypNM5WM1Lc+XDVjReaJn5lTHfZTuEVB1JtCfAH+9WLh0253A NsJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4Hkgp5mqnwYGMLAnV4qH/U21gdaKpSgaflWbxhX8fhk=; b=Qi7a+Lyv7dDg9lDO6rCWVXXKOI9ia+59TfiPX8wmLzO0/e/zyp6aXpiKoyf3aUDrLb PM3YHmoIbUP9H4g5K6VJlRozQO0Yvpvu7MWdqy+CLORCGnHaMgDhwrGu21zKaq52DAco L06iStN+MvuZVOB3I4rT++iqgS3VlDK89qgnKn1SPbwLscOhDR8ok2tETa3DkpD1Xluf 8ISf9m5XzyiavLmaTjGO0/PbbfMW3RJSc635xC0jIksOSwW4akQZFfHn9kxvh9IR8mBu l9QNfwR8DIGiTMyNMbJPEjqXXZR4/1elEH8qpOvRoezJ/Pq/t0X22idF0As1KKNJh7N1 Ft3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="E9TS/Zc+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ip10-20020a17090b314a00b00219b3307f5fsi4618407pjb.45.2022.12.22.04.55.17; Thu, 22 Dec 2022 04:55:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="E9TS/Zc+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235638AbiLVMnl (ORCPT <rfc822;pacteraone@gmail.com> + 99 others); Thu, 22 Dec 2022 07:43:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235647AbiLVMng (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 Dec 2022 07:43:36 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6660625E85; Thu, 22 Dec 2022 04:43:34 -0800 (PST) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BMAn5Qn007102; Thu, 22 Dec 2022 12:43:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=4Hkgp5mqnwYGMLAnV4qH/U21gdaKpSgaflWbxhX8fhk=; b=E9TS/Zc+EYzbZIvW1UGJ3hD+eiYb4Y6/421Vab2fbnPIN4NW8WzpSLKzRCdvSaoYqlpG +Z6etqqkBRb/eEnJPHGBNB/SM8NE8yoXhgj24q5oY99EKbUkEPUK7prqumKc5zVXJjNA BayjvO8iFtNcZJMc3SE86oDAJmKkzK7Nb5vQal0l7XP2q8JV+4LmZNUKVsgY326NbgF8 lBFJG/x+h/qcnVHAMKSljQ06Wq+gv1YX+SlooEMDMT23piSYeK0rCBuz+IPKHYlotuWI w2Y48A3BrBjKrlH+B2ofYT65bk1uMArzOZv3X+uAQnZcrBL9KEjMBukOSCaPIzu2ux2v wA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mk83xwvxv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Dec 2022 12:43:18 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 2BMChHq2020906 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Dec 2022 12:43:17 GMT Received: from youghand-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.36; Thu, 22 Dec 2022 04:43:14 -0800 From: Youghandhar Chintala <quic_youghand@quicinc.com> To: <ath10k@lists.infradead.org>, <johannes@sipsolutions.net> CC: <linux-wireless@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <quic_mpubbise@quicinc.com>, Youghandhar Chintala <quic_youghand@quicinc.com> Subject: [PATCH 1/2] wifi: cfg80211: Add beacon hint notifier support Date: Thu, 22 Dec 2022 18:12:20 +0530 Message-ID: <20221222124221.30894-2-quic_youghand@quicinc.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221222124221.30894-1-quic_youghand@quicinc.com> References: <20221222124221.30894-1-quic_youghand@quicinc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: RGea825zRoHe3_Ml7V84IKaS5X6xfbqA X-Proofpoint-GUID: RGea825zRoHe3_Ml7V84IKaS5X6xfbqA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-22_06,2022-12-22_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=999 clxscore=1015 bulkscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 spamscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212220111 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752918897155874541?= X-GMAIL-MSGID: =?utf-8?q?1752918897155874541?= |
Series |
Update the channel list if the change in channel flags
|
|
Commit Message
Youghandhar Chintala
Dec. 22, 2022, 12:42 p.m. UTC
There are connection failures in hidden SSID case when the device is
with default reg domain WW.
For WW reg domain most of the 5 GHz channels are passive. When device
listens to the beacon on that channel, the driver is updating its
channel flag but firmware is not aware of it and firmware is not
sending probes on that channels.
Due to this, we are seeing connection failures when the device is trying
to connect with hidden SSID AP.
In the case of devices using the ath10k driver, it is required to update
the change in channel flags to firmware as well. Therefore, we need a
mechanism to notify the driver from the regulatory core regarding the
channel flag changes.
Adding a beacon hint notifier logic, so that drivers can register
callbacks to get notified whenever there is a change in channel flags.
Signed-off-by: Youghandhar Chintala <quic_youghand@quicinc.com>
---
include/net/cfg80211.h | 2 ++
net/wireless/reg.c | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
Comments
> +++ b/include/net/cfg80211.h > @@ -5386,6 +5386,8 @@ struct wiphy { > void (*reg_notifier)(struct wiphy *wiphy, > struct regulatory_request *request); > > + void (*beacon_hint_notifier)(struct wiphy *wiphy); missing documentation, for sure Also this should probably be in the ops, rather than here? Not sure why reg_notifier is here. > - if (channel_changed) > + if (channel_changed) { > nl80211_send_beacon_hint_event(wiphy, &chan_before, chan); > + if (wiphy->beacon_hint_notifier) > + wiphy->beacon_hint_notifier(wiphy); > + } This also seems excessive if you're not even passing the channel - you call it for every (affected) channel, but you don't tell it anything about the channel? Seems strange. However ... Why is this even needed? You should always get reg_notifier after this anyway? johannes
On 1/18/2023 10:00 PM, Johannes Berg wrote: >> +++ b/include/net/cfg80211.h >> @@ -5386,6 +5386,8 @@ struct wiphy { >> void (*reg_notifier)(struct wiphy *wiphy, >> struct regulatory_request *request); >> >> + void (*beacon_hint_notifier)(struct wiphy *wiphy); > > missing documentation, for sure I will add the missed documentation in next version of patch. > Also this should probably be in the ops, rather than here? Not sure why > reg_notifier is here. I followed reg_notifier implementation. >> - if (channel_changed) >> + if (channel_changed) { >> nl80211_send_beacon_hint_event(wiphy, &chan_before, chan); >> + if (wiphy->beacon_hint_notifier) >> + wiphy->beacon_hint_notifier(wiphy); >> + } > This also seems excessive if you're not even passing the channel - you > call it for every (affected) channel, but you don't tell it anything > about the channel? Seems strange. I will address this in next version of patch. > > > However ... > > Why is this even needed? You should always get reg_notifier after this > anyway? > > johannes Currently when channel flag changed through the beacon hints are not informed to driver. reg_notifier will be triggered for regdomain changes but not for channel flag changes due to beacon hints. Regards, Youghandhar
> > > > Why is this even needed? You should always get reg_notifier after this > > anyway? > > Currently when channel flag changed through the beacon hints are not > informed to driver. > > reg_notifier will be triggered for regdomain changes but not for channel flag changes due to beacon hints. > So maybe triggering reg notifier once would be sufficient, a la Wen's patch that I recently merged? johannes
On 2/15/2023 11:10 PM, Johannes Berg wrote: >>> Why is this even needed? You should always get reg_notifier after this >>> anyway? >> Currently when channel flag changed through the beacon hints are not >> informed to driver. >> >> reg_notifier will be triggered for regdomain changes but not for channel flag changes due to beacon hints. >> > So maybe triggering reg notifier once would be sufficient, a la Wen's > patch that I recently merged? My patch only take effect for this flag, not for all wiphy. if (wiphy->flags & WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER) https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit?id=d99975c4953eb79e389d4630e848435c700e2dfc > > johannes >
On Wed, 2023-02-22 at 08:22 +0800, Wen Gong wrote: > On 2/15/2023 11:10 PM, Johannes Berg wrote: > > > > Why is this even needed? You should always get reg_notifier after this > > > > anyway? > > > Currently when channel flag changed through the beacon hints are not > > > informed to driver. > > > > > > reg_notifier will be triggered for regdomain changes but not for channel flag changes due to beacon hints. > > > > > So maybe triggering reg notifier once would be sufficient, a la Wen's > > patch that I recently merged? > > My patch only take effect for this flag, not for all wiphy. > > if (wiphy->flags & WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER) > > https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit?id=d99975c4953eb79e389d4630e848435c700e2dfc > Oh sure, I meant this patch could do something similar, instead of introducing a new notifier callback. johannes
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 11a370e64143..07b2f2da77d6 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -5386,6 +5386,8 @@ struct wiphy { void (*reg_notifier)(struct wiphy *wiphy, struct regulatory_request *request); + void (*beacon_hint_notifier)(struct wiphy *wiphy); + /* fields below are read-only, assigned by cfg80211 */ const struct ieee80211_regdomain __rcu *regd; diff --git a/net/wireless/reg.c b/net/wireless/reg.c index c3d950d29432..6ea2455d4964 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2219,8 +2219,11 @@ static void handle_reg_beacon(struct wiphy *wiphy, unsigned int chan_idx, channel_changed = true; } - if (channel_changed) + if (channel_changed) { nl80211_send_beacon_hint_event(wiphy, &chan_before, chan); + if (wiphy->beacon_hint_notifier) + wiphy->beacon_hint_notifier(wiphy); + } } /*