From patchwork Tue Jan 3 12:41:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 639230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3315C46467 for ; Tue, 3 Jan 2023 12:41:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237478AbjACMl3 (ORCPT ); Tue, 3 Jan 2023 07:41:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237503AbjACMl0 (ORCPT ); Tue, 3 Jan 2023 07:41:26 -0500 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBAE6DF68 for ; Tue, 3 Jan 2023 04:41:25 -0800 (PST) Received: by mail-qt1-x834.google.com with SMTP id a16so24395607qtw.10 for ; Tue, 03 Jan 2023 04:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Zr1P2m3QGY64uK4Hr8KjO71zO/BKXEV5BxS5c+e6GrE=; b=IJKFCQKWuRh4cVITb7XZKAJ3pacTGWtZL9pMd5aH7ADayKHEa6gqUAu0QIZXS1GeYC 1eR3NJXU82UzIk8M8y00Akkx5uCAjknMiO8iqVs09bMUvQ6imRCle+GJxscpopfYFaMd 5XjhPiOXLpzooTTE5EOKKberZVNEm5G8PPn9o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Zr1P2m3QGY64uK4Hr8KjO71zO/BKXEV5BxS5c+e6GrE=; b=lC28BsZB7OBDDHKYLCLDbpLZuQKq4ll3HaOK4rmqYtV7y3hymAOANVmsQ0bbEisG7y 8XuAYjWH89ln/J3s2xvD0nF4AIKGNsHQubbuaA/Nf8JIrCAI63RO6270KG9Ya6IJ4gSl kAG8Q5Dk4RWQvgIP4HfAjkU5n45sEIXJCNB7cYJ1PegMBDX/mAVlpQGslXRMnD/r9ofZ Sgp+Vle2N1Eb+YsO3wRwdODZXnOqCB3Z7I/Rjk4PC86tZub60LXqe9Qe02eRZbfPOz9t GLmyvBNl9APD6Y+yJj3Ul4jjHcbL9W4FtJdkvSKMbFM+lc9GtDgnwP8WLwmasahjTFyI tQIw== X-Gm-Message-State: AFqh2kpqR2Nc7B8e/8CUy+U84uZnDtZxO3TyNmTwFK8AqW6UVJhCCCJP t2q2POgPUvghMa9FIdtZGuXi+VEv98JqM3tb X-Google-Smtp-Source: AMrXdXs1nsFS7f6TOeJBpqIR6MEXHSEJs/nzmAQdHiYTVZ+Q4hS1leuTqXP/JG7QrOUGbUyE4Lb+YA== X-Received: by 2002:a05:622a:230e:b0:3a4:e849:a235 with SMTP id ck14-20020a05622a230e00b003a4e849a235mr66067756qtb.34.1672749684884; Tue, 03 Jan 2023 04:41:24 -0800 (PST) Received: from bld-bun-02.bun.broadcom.com ([192.19.148.250]) by smtp.gmail.com with ESMTPSA id t1-20020ac865c1000000b003a7e4129f83sm18439047qto.85.2023.01.03.04.41.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2023 04:41:24 -0800 (PST) From: Arend van Spriel To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Arend van Spriel , Stefan Wahren Subject: [PATCH for-6.2 1/3] wifi: brcmfmac: avoid handling disabled channels for survey dump Date: Tue, 3 Jan 2023 13:41:15 +0100 Message-Id: <20230103124117.271988-2-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230103124117.271988-1-arend.vanspriel@broadcom.com> References: <20230103124117.271988-1-arend.vanspriel@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org An issue was reported in which periodically error messages are printed in the kernel log: [ 26.303445] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6 [ 26.303554] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,3-model-b-plus.bin failed with error -2 [ 26.516752] brcmfmac_wcc: brcmf_wcc_attach: executing [ 26.528264] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Jan 4 2021 19:56:29 version 7.45.229 (617f1f5 CY) FWID 01-2dbd9d2e [ 27.076829] Bluetooth: hci0: BCM: features 0x2f [ 27.078592] Bluetooth: hci0: BCM43455 37.4MHz Raspberry Pi 3+ [ 27.078601] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0342 [ 30.142104] Adding 102396k swap on /var/swap. Priority:-2 extents:1 across:102396k SS [ 30.590017] Bluetooth: MGMT ver 1.22 [ 104.897615] brcmfmac: cfg80211_set_channel: set chanspec 0x100e fail, reason -52 [ 104.897992] brcmfmac: cfg80211_set_channel: set chanspec 0xd022 fail, reason -52 [ 105.007672] brcmfmac: cfg80211_set_channel: set chanspec 0xd026 fail, reason -52 [ 105.117654] brcmfmac: cfg80211_set_channel: set chanspec 0xd02a fail, reason -52 [ 105.227636] brcmfmac: cfg80211_set_channel: set chanspec 0xd02e fail, reason -52 [ 106.987552] brcmfmac: cfg80211_set_channel: set chanspec 0xd090 fail, reason -52 [ 106.987911] brcmfmac: cfg80211_set_channel: set chanspec 0xd095 fail, reason -52 [ 106.988233] brcmfmac: cfg80211_set_channel: set chanspec 0xd099 fail, reason -52 [ 106.988565] brcmfmac: cfg80211_set_channel: set chanspec 0xd09d fail, reason -52 [ 106.988909] brcmfmac: cfg80211_set_channel: set chanspec 0xd0a1 fail, reason -52 This happens in brcmf_cfg80211_dump_survey() because we try a disabled channel. When channel is marked as disabled we do not need to fill any other info so bail out. Fixes: 6c04deae1438 ("brcmfmac: Add dump_survey cfg80211 ops for HostApd AutoChannelSelection") Reported-by: Stefan Wahren Signed-off-by: Arend van Spriel --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index bff3128c2f26..478ca3848c64 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -7937,6 +7937,9 @@ cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); + if (chan->flags & IEEE80211_CHAN_DISABLED) + return -EINVAL; + /* set_channel */ chspec = channel_to_chanspec(&cfg->d11inf, chan); if (chspec != INVCHANSPEC) { @@ -7961,7 +7964,6 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev, struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); struct brcmf_dump_survey survey = {}; struct ieee80211_supported_band *band; - struct ieee80211_channel *chan; struct cca_msrmnt_query req; u32 noise; int err; @@ -7987,13 +7989,10 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev, } /* Setting current channel to the requested channel */ - chan = &band->channels[idx]; - err = cfg80211_set_channel(wiphy, ndev, chan, NL80211_CHAN_HT20); - if (err) { - info->channel = chan; - info->filled = 0; + info->filled = 0; + info->channel = &band->channels[idx]; + if (cfg80211_set_channel(wiphy, ndev, info->channel, NL80211_CHAN_HT20)) return 0; - } /* Disable mpc */ brcmf_set_mpc(ifp, 0); @@ -8028,7 +8027,6 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev, if (err) goto exit; - info->channel = chan; info->noise = noise; info->time = ACS_MSRMNT_DELAY; info->time_busy = ACS_MSRMNT_DELAY - survey.idle; @@ -8040,7 +8038,7 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev, SURVEY_INFO_TIME_TX; brcmf_dbg(INFO, "OBSS dump: channel %d: survey duration %d\n", - ieee80211_frequency_to_channel(chan->center_freq), + ieee80211_frequency_to_channel(info->channel->center_freq), ACS_MSRMNT_DELAY); brcmf_dbg(INFO, "noise(%d) busy(%llu) rx(%llu) tx(%llu)\n", info->noise, info->time_busy, info->time_rx, info->time_tx); From patchwork Tue Jan 3 12:41:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 639029 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 794EEC3DA7D for ; Tue, 3 Jan 2023 12:41:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237544AbjACMlb (ORCPT ); Tue, 3 Jan 2023 07:41:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237503AbjACMl3 (ORCPT ); Tue, 3 Jan 2023 07:41:29 -0500 Received: from mail-qt1-x833.google.com (mail-qt1-x833.google.com [IPv6:2607:f8b0:4864:20::833]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88EF89FD3 for ; Tue, 3 Jan 2023 04:41:28 -0800 (PST) Received: by mail-qt1-x833.google.com with SMTP id g7so24431098qts.1 for ; Tue, 03 Jan 2023 04:41:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=yZdk8oR+49bqTq5guiux1sDGdmnCiNU4UDcA+2pJa58=; b=NHS/zeyb9qbTELhfZzO70oONF2SW1sxMfY+RpkDKVw11ZaSJFyh/hNDm4CyFfmA6pq m3sTegkWjGLn32COqp8SXiGxD0gdqejycI7FjAFoBkaNPgsnrIa0H4wzISaQlyzPJ8O8 WVWk4h3foioWJMm4itUNfzmqxyJQBWyfwKkgQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=yZdk8oR+49bqTq5guiux1sDGdmnCiNU4UDcA+2pJa58=; b=LwIVw0n9KpJz2mak5HUFLLTnI3MgOwl3uDkzPHhEh8ve4XnxQ3rbd4IbFGpgb/foB7 7drPM7U8rnYqqOEMJPbgHg74g/fATQnbWiKNDtgE0ET5cLhJAV39M5mEcL7MucsrRFWI eO1G83ansyD158QEKC84QBktSACfq1qGgs7ykK9oVPu79ICkcUsGvyHWsC12OUWXr8Uh rsapgglZlJYQbbEqvdQ4oYS0+DDTOS2/SYexV+41lZfR8BHPzd8viWIOsd9MNMNBFPbT WPdjZIDxmt++vjfv8F3hhz+sqNkxDtW6VgNhNfff6AggHIOpAF0uHE6wf59ygF4l3+dA pjBA== X-Gm-Message-State: AFqh2krpcT5zcGh8UUVnnSdpwwY2P79zMNE+/oYJjpKe/Gvu2eDuZdAq ep9ip68hfYJegAN+D4WUbPe8KM+0GwYS+8qG X-Google-Smtp-Source: AMrXdXsakFc7YCQFvNU9/9Uu0NhgQIbb7RbnGa+W+uEi2ARnsKvEWyjfyY+v5kwW5C7QLCqaixrlCg== X-Received: by 2002:ac8:72c5:0:b0:3a6:a86f:33cd with SMTP id o5-20020ac872c5000000b003a6a86f33cdmr59631220qtp.51.1672749687585; Tue, 03 Jan 2023 04:41:27 -0800 (PST) Received: from bld-bun-02.bun.broadcom.com ([192.19.148.250]) by smtp.gmail.com with ESMTPSA id t1-20020ac865c1000000b003a7e4129f83sm18439047qto.85.2023.01.03.04.41.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2023 04:41:26 -0800 (PST) From: Arend van Spriel To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Arend van Spriel Subject: [PATCH for-6.2 2/3] wifi: brcmfmac: avoid NULL-deref in survey dump for 2G only device Date: Tue, 3 Jan 2023 13:41:16 +0100 Message-Id: <20230103124117.271988-3-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230103124117.271988-1-arend.vanspriel@broadcom.com> References: <20230103124117.271988-1-arend.vanspriel@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When dealing with a device for 2GHz band only the wiphy->bands for 5GHz will be NULL. This would result in a NULL-deref in the brcmf_cfg80211_dump_survey() function. Rework the code with a for-loop to make it easier to add another band. Signed-off-by: Arend van Spriel --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 478ca3848c64..b115902eb475 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -7964,6 +7964,7 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev, struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); struct brcmf_dump_survey survey = {}; struct ieee80211_supported_band *band; + enum nl80211_band band_id; struct cca_msrmnt_query req; u32 noise; int err; @@ -7976,21 +7977,23 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev, return -EBUSY; } - band = wiphy->bands[NL80211_BAND_2GHZ]; - if (band && idx >= band->n_channels) { - idx -= band->n_channels; - band = NULL; - } + for (band_id = 0; band_id < NUM_NL80211_BANDS; band_id++) { + band = wiphy->bands[band_id]; + if (!band) + continue; + if (idx >= band->n_channels) { + idx -= band->n_channels; + continue; + } - if (!band || idx >= band->n_channels) { - band = wiphy->bands[NL80211_BAND_5GHZ]; - if (idx >= band->n_channels) - return -ENOENT; + info->channel = &band->channels[idx]; + break; } + if (band_id == NUM_NL80211_BANDS) + return -ENOENT; /* Setting current channel to the requested channel */ info->filled = 0; - info->channel = &band->channels[idx]; if (cfg80211_set_channel(wiphy, ndev, info->channel, NL80211_CHAN_HT20)) return 0; From patchwork Tue Jan 3 12:41:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 639229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BDC5C46467 for ; Tue, 3 Jan 2023 12:41:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237320AbjACMld (ORCPT ); Tue, 3 Jan 2023 07:41:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237550AbjACMlc (ORCPT ); Tue, 3 Jan 2023 07:41:32 -0500 Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 397FEDF6A for ; Tue, 3 Jan 2023 04:41:31 -0800 (PST) Received: by mail-qt1-x82e.google.com with SMTP id bp44so21790884qtb.0 for ; Tue, 03 Jan 2023 04:41:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=cSS8F/rKGNiGpoxFka3z9bGZCT6G8zFruXj9sEzA+6U=; b=VRxXv9j/NR6glaECZl58yhYNS8EjXmEu6/CNn75ortjKfx+XMwjDCr0VSwoLYybilk 7Hjd4FJKBeSfxMUGqk4HG10oO0mE13DB/Z8C8sE9y4EVuXYC+L3Xyf30AugHfApruVS1 G126+62oGIb123eMVfelp6Fuzvdqz5xawOjJE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cSS8F/rKGNiGpoxFka3z9bGZCT6G8zFruXj9sEzA+6U=; b=z9fZpgO7PmTGiYbttjOi0OE15/JfXcfKj+taKbROY78Da42X4JjHVsV69f0xzsKMVq iMTo6m5NxYe6nyGOu7UZK2f5HfCge1n+gQWDlBLQfKf+1SD2SS04FLdBp8j3kLh9X8xj GCQG0kIxV/MsIxJRNJhn2z29cZIpE0K95AbSmWhxniSj43BfhvglOkW0czZrDxn9C/uv YFeAN8p0TxViLPyGTB/yKZRc+pKGIlgtkUeIlQ8tgEJO/eWXasgckEn3Wsp3FZuPeJ3D hGFyK0z5XD8D3LM2ixWYxe65cE/nGvhBusM2h29KCP/Wy6bKuh5E+cT41Vquas8s2jcf OSDg== X-Gm-Message-State: AFqh2kpqBhFUeUfFb27ddYh90wBajw/AaRu0+6hQiNpYG6fmQTvHluTb 1ADhu52M4+px9aGSXsoNOG+RMu1waCqsIl1I X-Google-Smtp-Source: AMrXdXuCOZ9g5WIeevu1s08ELDNaYJItcMTUr7U2LWHojtNcQPu6m4YV2B91rwOIn5/99okVESDY6g== X-Received: by 2002:ac8:7778:0:b0:3ab:af31:ee3e with SMTP id h24-20020ac87778000000b003abaf31ee3emr14529394qtu.60.1672749690346; Tue, 03 Jan 2023 04:41:30 -0800 (PST) Received: from bld-bun-02.bun.broadcom.com ([192.19.148.250]) by smtp.gmail.com with ESMTPSA id t1-20020ac865c1000000b003a7e4129f83sm18439047qto.85.2023.01.03.04.41.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jan 2023 04:41:29 -0800 (PST) From: Arend van Spriel To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Arend van Spriel Subject: [PATCH for-6.2 3/3] wifi: brcmfmac: change cfg80211_set_channel() name and signature Date: Tue, 3 Jan 2023 13:41:17 +0100 Message-Id: <20230103124117.271988-4-arend.vanspriel@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230103124117.271988-1-arend.vanspriel@broadcom.com> References: <20230103124117.271988-1-arend.vanspriel@broadcom.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The function cfg80211_set_channel() is an static function in brcmfmac but the name is misleading. Hence rename it with 'brcmf' prefix. Also changing the parameters to avoid additional conversions. Signed-off-by: Arend van Spriel --- .../net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index b115902eb475..a9690ec4c850 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -7928,13 +7928,10 @@ brcmf_dump_obss(struct brcmf_if *ifp, struct cca_msrmnt_query req, } static s32 -cfg80211_set_channel(struct wiphy *wiphy, struct net_device *dev, - struct ieee80211_channel *chan, - enum nl80211_channel_type channel_type) +brcmf_set_channel(struct brcmf_cfg80211_info *cfg, struct ieee80211_channel *chan) { u16 chspec = 0; int err = 0; - struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); if (chan->flags & IEEE80211_CHAN_DISABLED) @@ -7994,7 +7991,7 @@ brcmf_cfg80211_dump_survey(struct wiphy *wiphy, struct net_device *ndev, /* Setting current channel to the requested channel */ info->filled = 0; - if (cfg80211_set_channel(wiphy, ndev, info->channel, NL80211_CHAN_HT20)) + if (brcmf_set_channel(cfg, info->channel)) return 0; /* Disable mpc */