Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20143292rwd; Wed, 28 Jun 2023 21:01:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7hi3INYJgGBAp3ZRQLroxovFrXWSzr51M5pSY4gMIE5Lxu6n0zlqxG/Gs6GthgChDoagZ1 X-Received: by 2002:a17:90a:1a03:b0:262:c2fa:b077 with SMTP id 3-20020a17090a1a0300b00262c2fab077mr14085708pjk.18.1688011290107; Wed, 28 Jun 2023 21:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688011290; cv=none; d=google.com; s=arc-20160816; b=cjp/Ti99qERcDaQ9N7CNB4u79qMiA07WTDrOLiNVzPgZbs69X2Qg0PIWbA6lpK26yz moh6eo/RRG6nb70qZlD3FlsxtIjJijMXP6yVimbwiX5t+GQVpHqr3Gcl3Om6cFmFFYaG Y5K6e5DAvg7n8IfuxSPou8SqjwFrbSv+vMgqD+EvUmyuAaS6IeBWxOBec9jmFj9E00gl 29n+jzTJRI3CQt0lbm8M64TBfx3bYC+YXY12Kzim5e1Xpzr8vXUA7B7VsuJrnNAQyb8g 0Rf1WzqGhmmtjx1ndVwU/Je2GauO9QbSqcc0vr1Ech5pPMo84aw6lmtsheCAO4y5auFx 67IQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=PgRCWuAL+JILQAuJVgnpzN1VGDR5+ycwundGmuPsvAc=; fh=y1fJB49Srmd/28+jWUlkZ2584L7wNxrU3rXHRNkhmcE=; b=xICBGHzRTjmNeLc4+JTvcmox9/NtPByhrBk/TuljejsRti9p18y4b44HiHCJxBzT97 EpHGPUK2T2VeYt7zijx6rV4wBcmZhYVEMwnBIAG3mab0EcL0FISjr+XhCFLvsUdD7YWP QpXg4igZJCSlV25MyabqmmPREp2IBffDDQkG6fyGYjFy9Fzxbk3XZ5wfmzgTXMKdUhnB dp4P5qNoWqzjp7AqUP5H4OxUs9o5qcCINy0JWIp8ERmzzOB3MBbbpYoJzvmiCmjRT56Z yG7tM7txwPaOqwvxrOEl8ltvXwGNQVfDmGj4E+ofrpI4OP0pQKQrPFoHefIu2WY0miN5 A5bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Zp7/05od"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nv9-20020a17090b1b4900b00262f30ae90asi7798223pjb.118.2023.06.28.21.01.16; Wed, 28 Jun 2023 21:01:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@chromium.org header.s=google header.b="Zp7/05od"; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231758AbjF2Dy2 (ORCPT + 58 others); Wed, 28 Jun 2023 23:54:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231984AbjF2DyC (ORCPT ); Wed, 28 Jun 2023 23:54:02 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5988E2D7C for ; Wed, 28 Jun 2023 20:54:00 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6687446eaccso234510b3a.3 for ; Wed, 28 Jun 2023 20:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1688010840; x=1690602840; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=PgRCWuAL+JILQAuJVgnpzN1VGDR5+ycwundGmuPsvAc=; b=Zp7/05od1Hzmg3DamsY4xVwfn6tMykIurlQXX5Rz4Xuof4ze/XQSv561GpHeqSpoKh 2v+EzzaIXKRz/2+ZwPdbePYm00aj+7lpLYrNJ4hAYEhBfPYw1efyvEasC85ra7aPmZY2 HvVIPX6DZQ3ldkpxDKKby+eFfCylabLuTSQA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688010840; x=1690602840; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=PgRCWuAL+JILQAuJVgnpzN1VGDR5+ycwundGmuPsvAc=; b=cPvvzK9JK2B0g0l+eDxmlnl7ZezO+wKTrq4tO294WF5wRTfAvCp65rQg8FNoKRUvxQ X4WF4vtHWvJWSmMUtGYMc00wlQvQmltFJ9IznzVSUMGcph/cPZPGde39G03Kx8nAUFoN fh/OmVTLf9X+hcZqt6DUneQS2u/CIuArz71Z84l8T4eDU8RdPZBBusxTycWLYcmypW2g Qg9azM7StXxlkhKtTYHW1DJiBhdSA8CNDuO1NUZXjJtE8PRIIgsF5bObyoWXLjtHJELY zlGO8e8lu9HysjTPBml+YkjMHCaCls9Oph6d51NU5XhFk7tAmtJDwkIyKRUv85dTBblr sdlw== X-Gm-Message-State: AC+VfDw9yLQnvjpAg+hZQ43NSh5Y/B7Cy8g4CZvrbzPzKAXb/KDZHapE jHzOD+ToKj4kwiHHsxLyavazRw== X-Received: by 2002:a05:6a20:1605:b0:115:83f:fce1 with SMTP id l5-20020a056a20160500b00115083ffce1mr48159642pzj.5.1688010839715; Wed, 28 Jun 2023 20:53:59 -0700 (PDT) Received: from kuabhs-cdev.c.googlers.com.com (242.67.247.35.bc.googleusercontent.com. [35.247.67.242]) by smtp.gmail.com with ESMTPSA id r19-20020a634413000000b005579f12a238sm7019842pga.86.2023.06.28.20.53.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 20:53:59 -0700 (PDT) From: Abhishek Kumar To: johannes.berg@intel.com, kvalo@kernel.org Cc: linux-kernel@vger.kernel.org, kuabhs@chromium.org, netdev@vger.kernel.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Johannes Berg , Paolo Abeni Subject: [PATCH 1/2] wifi: cfg80211: call reg_call_notifier on beacon hints Date: Thu, 29 Jun 2023 03:52:54 +0000 Message-ID: <20230629035254.1.I059fe585f9f9e896c2d51028ef804d197c8c009e@changeid> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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-wireless@vger.kernel.org Currently the channel property updates are not propagated to driver. This causes issues in the discovery of hidden SSIDs and fails to connect to them. This change defines a new wiphy flag which when enabled by vendor driver, the reg_call_notifier callback will be trigger on beacon hints. This ensures that the channel property changes are visible to the vendor driver. The vendor changes the channels for active scans. This fixes the discovery issue of hidden SSID. Signed-off-by: Abhishek Kumar --- include/net/cfg80211.h | 3 +++ net/wireless/reg.c | 20 ++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 9e04f69712b1..48e6ebcdacb3 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -4783,6 +4783,8 @@ struct cfg80211_ops { * @WIPHY_FLAG_SUPPORTS_EXT_KCK_32: The device supports 32-byte KCK keys. * @WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER: The device could handle reg notify for * NL80211_REGDOM_SET_BY_DRIVER. + * @WIPHY_FLAG_CHANNEL_CHANGE_ON_BEACON: reg_call_notifier() is called if driver + * set this flag to update channels on beacon hints. */ enum wiphy_flags { WIPHY_FLAG_SUPPORTS_EXT_KEK_KCK = BIT(0), @@ -4809,6 +4811,7 @@ enum wiphy_flags { WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22), WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23), WIPHY_FLAG_NOTIFY_REGDOM_BY_DRIVER = BIT(24), + WIPHY_FLAG_CHANNEL_CHANGE_ON_BEACON = BIT(25), }; /** diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 26f11e4746c0..c76bfaad650b 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2149,6 +2149,13 @@ static bool reg_is_world_roaming(struct wiphy *wiphy) return false; } +static void reg_call_notifier(struct wiphy *wiphy, + struct regulatory_request *request) +{ + if (wiphy->reg_notifier) + wiphy->reg_notifier(wiphy, request); +} + static void handle_reg_beacon(struct wiphy *wiphy, unsigned int chan_idx, struct reg_beacon *reg_beacon) { @@ -2156,6 +2163,7 @@ static void handle_reg_beacon(struct wiphy *wiphy, unsigned int chan_idx, struct ieee80211_channel *chan; bool channel_changed = false; struct ieee80211_channel chan_before; + struct regulatory_request *lr = get_last_request(); sband = wiphy->bands[reg_beacon->chan.band]; chan = &sband->channels[chan_idx]; @@ -2181,8 +2189,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->flags & WIPHY_FLAG_CHANNEL_CHANGE_ON_BEACON) + reg_call_notifier(wiphy, lr); + } } /* @@ -2325,13 +2336,6 @@ static void reg_process_ht_flags(struct wiphy *wiphy) reg_process_ht_flags_band(wiphy, wiphy->bands[band]); } -static void reg_call_notifier(struct wiphy *wiphy, - struct regulatory_request *request) -{ - if (wiphy->reg_notifier) - wiphy->reg_notifier(wiphy, request); -} - static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) { struct cfg80211_chan_def chandef = {}; -- 2.41.0.162.gfafddb0af9-goog