From patchwork Thu Dec 22 12:05:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youghandhar Chintala X-Patchwork-Id: 35735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp293405wrn; Thu, 22 Dec 2022 04:23:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXsFrPpikXzwbEnuAZLLCpZXa0L6nVOTSJ1uQce2LMBwRsecfGpgZnDD42DS7W2zy0FqYB8S X-Received: by 2002:a05:6402:538f:b0:47c:4479:d60d with SMTP id ew15-20020a056402538f00b0047c4479d60dmr4618513edb.20.1671711835318; Thu, 22 Dec 2022 04:23:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671711835; cv=none; d=google.com; s=arc-20160816; b=GCAiGAmFS2mrTzXkuo0ix07ORnxKgprmfKOTBuc6S5BviVYnwwdmMds1HEuEFOJ63f wHMm3tTKGnuB3lnRGtpi+25GPu2QNE2mtaPZHAVFDC6CVvBWORsSSXZ8X+GNJLJ7Gipw k8IZ2gNlt8MyhYw7e+7wXjmoBpW14yR3qc7kqnQbHEu1eEfuepsRvJMAwTw5E75c0pC2 kgtCTqSwpIceurCOd7aZnkZjP6Kfg1FjgNTQIjXL7LBLIkZhm2zKvxav9RugVRL5AJLx h94AYDruU3FH5ZEgDoMfrLeB9nn1N3csQ9oinL7q4wUGV9qo+yvS8KPXYNz1HcSnq/s9 r2Qw== 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=lOTy/l9J13NJPv0DstczUtEhVykZjQm2aeUlyM8XlbNBof13TfZjWqrivYL+ZFpm4W W3aECUbQrCqA8NO+S5GgFyEJobopAYkHl4b2Eca/GuqF0wH48fM2bixmlo70L0DZB7gk AiNcKlzKZ0nZvRN+0lXGC/frmGLmDKW+xk0UxrtBEgXwOoikpl+CP10VbM4x0h2h1N+w Ok6x+LRsK7SImVMUcY5zUAJFkyvMyaBXGDZJs7+Bq+S+STQ9JX0KEhX4MKtVwEH7hyCn RvWAKoET9CidlcBUm7ejpEwqy0TxF/bc2hdgekbxQ37z9aKccv/bIgP6TnfsQhqT/2lj bQSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=i4AIf7Ln; 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 p3-20020a056402154300b0047d9b95bc63si531355edx.182.2022.12.22.04.23.31; Thu, 22 Dec 2022 04:23:55 -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=i4AIf7Ln; 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 S235573AbiLVMNT (ORCPT + 99 others); Thu, 22 Dec 2022 07:13:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235923AbiLVMMs (ORCPT ); Thu, 22 Dec 2022 07:12:48 -0500 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B9062A257; Thu, 22 Dec 2022 04:06:06 -0800 (PST) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BMBgKKG029667; Thu, 22 Dec 2022 12:06:01 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=i4AIf7Ln2nUYREgWb1El9wsi1MN42tqFZ6mfIoZ57dOXx3N30GdWjXW0BfhiirMUBJ2N /Z8WTxpRedYe2oQAmvb3dvrUvKJ4R4te4Bb4CMeOyRvo7wAZJ07WXTWJx4kWi3X1MdiQ D3G6A6JGcxlOc0dnujBs/S1002FSJrMtl+xEnvNZKlcZgjitVkyWuIhYsf156jQTDmEN deRukSTObphB65g6LcJTG6SAvIeuDMhulZv+UznJljv8L6L2QfNOYpviY4Vy2D5B7Jua //En4WxpRyHMUtY4K3mglVvooFdZ7kSGrXA5lkzkPFn8r50PzurdLGNLr5oXTmZyNpTj qw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mm5r2j2w0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Dec 2022 12:06:01 +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 2BMC60oa001475 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Dec 2022 12:06:00 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:05:57 -0800 From: Youghandhar Chintala To: , CC: , , , Youghandhar Chintala Subject: [PATCH 1/2] wifi: cfg80211: Add beacon hint notifier support Date: Thu, 22 Dec 2022 17:35:28 +0530 Message-ID: <20221222120529.31436-2-quic_youghand@quicinc.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221222120529.31436-1-quic_youghand@quicinc.com> References: <20221222120529.31436-1-quic_youghand@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: x-quFhhuAkG9eYOoadHmqgUEGsV82GBY X-Proofpoint-ORIG-GUID: x-quFhhuAkG9eYOoadHmqgUEGsV82GBY 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 lowpriorityscore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 impostorscore=0 spamscore=0 clxscore=1015 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212220105 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752916909631061481?= X-GMAIL-MSGID: =?utf-8?q?1752916909631061481?= 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 --- include/net/cfg80211.h | 2 ++ net/wireless/reg.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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); + } } /* From patchwork Thu Dec 22 12:05:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youghandhar Chintala X-Patchwork-Id: 35736 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp293415wrn; Thu, 22 Dec 2022 04:24:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXt+eth6vE3qynBm7jgD8v6mwA5S5S3pIjTG1Ok8tR8lmfkNN3OWwGyBM58gBvMa2fDetSmg X-Received: by 2002:a17:906:99c7:b0:7b5:860d:7039 with SMTP id s7-20020a17090699c700b007b5860d7039mr4838857ejn.10.1671711840045; Thu, 22 Dec 2022 04:24:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671711840; cv=none; d=google.com; s=arc-20160816; b=q2T/sPRfvSxy+hnHUCtp7UgJFc0F2XxdppkIDTE3BvGSfMsEwUvi+0/rZG577o/Pw3 LlBOGvHPBdZ9hzUjAGZEEq0j8hVGejHWpwiZ/1GZkNJ2SGLOoll/xiqn/giaitwm2pe3 KK6qW40+aplHaOdqPmUVQhZOcd1U9aM4nXuzerCZs0lAv9L7Naxbjit1gXhml9f+1QS7 uw69JLlniFXYezVfIBLMlc6UnNy9W+gKxNIJNVj3V/LNkwAG9X4uhf8zx616nPynZha7 y+1kCUgFovHFxZerP+ffPqFRsl7vbo8gTgZcsHmJp12kI+Z3fWi0rdrY6tVe1zwZdIWk SljA== 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=n4u0QORlDQIiNmr9PqyeFNaeaGjlinS5DG6hnZGlICQ=; b=fLgB6e0+0PHmdH5YcDhxTfcy4XIGHco9IvTTofZmQ1Mh4EB94MoFsapCvs1NS1XsaF CpVfz3AOUnqdmMrd2rm2tmRIIkk18JVtSYubQA+OrFMwIFU34A0G0RGqWBCXz6RtA7na Am1lYLhtjAcG2pLyMIeXVumzZ2jaOCJ4FIdjV6RuMYzzoXTONjU8brMzeanBB4O0MOdf b1RYAdSWsxHqJ+HOeGVNZmZa+4NvXz0iCX9ipXtpQWC045+qam10xD62UqR5ojyabT43 em6d/8cH2TX5T6aYNfpC5AFww1mMcEn5u0cWDOkghO66Mi9qDzqmgoc3Sq5B40GS8kmz 91TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=eEAPNm33; 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 gs16-20020a1709072d1000b007c4f6c37193si392263ejc.223.2022.12.22.04.23.36; Thu, 22 Dec 2022 04:24:00 -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=eEAPNm33; 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 S231221AbiLVMN1 (ORCPT + 99 others); Thu, 22 Dec 2022 07:13:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235394AbiLVMMt (ORCPT ); Thu, 22 Dec 2022 07:12:49 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13E2E2A27E; Thu, 22 Dec 2022 04:06:18 -0800 (PST) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BMAoOV2013981; Thu, 22 Dec 2022 12:06: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=n4u0QORlDQIiNmr9PqyeFNaeaGjlinS5DG6hnZGlICQ=; b=eEAPNm33s+13Sy7SuupqM/ka9iXknVVA5j7nDpPKbdLp+60H8rbuSA4QbvokRFiTQRLB pWujB5a5hEimviQ4CduFNoPOn70D/LxswyaGji04f3pk5M0AcepKaoZMxKLANsB0jQ1V TJBmJN96Hi9/cr9LbyUifkOwmGJxIGNTp/hlVU26cpFO4LcbDcmc51p8kINlZk5ezBLJ kXT4y0VNyM6VNyAWMP7Ttx2B9zBODBZNrFHHYoiw2QtBbqSIYIyCMtz8Qt7QlgKKtgz/ EC3YvMtbzDder8VH6MRETYfdTjUSl5zwOEX5tu44RPVHNLhjRP9pFQYjIK98zfA4C6yH WQ== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3mm0wfjp3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Dec 2022 12:06:12 +0000 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 2BMC65Ja014927 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Dec 2022 12:06:05 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:06:03 -0800 From: Youghandhar Chintala To: , CC: , , , Youghandhar Chintala Subject: [PATCH 2/2] wifi: ath10k: update the channel list if change in channel flags. Date: Thu, 22 Dec 2022 17:35:29 +0530 Message-ID: <20221222120529.31436-3-quic_youghand@quicinc.com> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221222120529.31436-1-quic_youghand@quicinc.com> References: <20221222120529.31436-1-quic_youghand@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-ORIG-GUID: 6eceeX7tJ1UoDQyTdVscLpQr71FnTlQZ X-Proofpoint-GUID: 6eceeX7tJ1UoDQyTdVscLpQr71FnTlQZ 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_05,2022-12-22_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 clxscore=1015 spamscore=0 suspectscore=0 phishscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 mlxscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212220105 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752916914295723803?= X-GMAIL-MSGID: =?utf-8?q?1752916914295723803?= 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 a device is trying to connect with hidden SSID AP. Register beacon hint notifier to the regulatory core so that driver get notified when there is a change in channel flags. Driver's notifier callback will send the updated flags to the firmware. Tested-on: WCN3990 hw1.0 SNOC WLAN.HL.3.2.2.c10-00754-QCAHLSWMTPL-1 Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00174 Signed-off-by: Youghandhar Chintala --- drivers/net/wireless/ath/ath10k/mac.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index ec8d5b29bc72..91a957295456 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3534,6 +3534,15 @@ static void ath10k_mac_update_channel_list(struct ath10k *ar, } } +static void ath10k_mac_beacon_notifier(struct wiphy *wiphy) +{ + struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy); + struct ath10k *ar = hw->priv; + + if (ath10k_update_channel_list(ar)) + ath10k_warn(ar, "failed to update channel list\n"); +} + static void ath10k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request) { @@ -10286,6 +10295,8 @@ int ath10k_mac_register(struct ath10k *ar) goto err_unregister; } + ar->hw->wiphy->beacon_hint_notifier = ath10k_mac_beacon_notifier; + return 0; err_unregister: