Skip to content

Commit 2fac67e

Browse files
dberlinmarcan
authored andcommitted
EScan was not including band in chanspec conversion during prep,
causing it to only scan 2g channels by default. It would run through all channels, but only construct 2g band chanspecs for them. We would discover BSSID's on other bands only through passive scans/etc. Fixed by having chanspec used during escan prep, and verifying it now sees 2g/5g/6g in escan. Signed-off-by: Daniel Berlin <[email protected]>
1 parent 0a4a55f commit 2fac67e

1 file changed

Lines changed: 22 additions & 14 deletions

File tree

  • drivers/net/wireless/broadcom/brcm80211/brcmfmac

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,26 @@ static enum nl80211_band fwil_band_to_nl80211(u8 band)
386386
return 0;
387387
}
388388

389+
static __le32 nl80211_band_to_chanspec_band(enum nl80211_band band)
390+
{
391+
switch (band) {
392+
case NL80211_BAND_2GHZ:
393+
return BRCMU_CHAN_BAND_2G;
394+
break;
395+
case NL80211_BAND_5GHZ:
396+
return BRCMU_CHAN_BAND_5G;
397+
break;
398+
case NL80211_BAND_6GHZ:
399+
return BRCMU_CHAN_BAND_6G;
400+
break;
401+
case NL80211_BAND_60GHZ:
402+
default:
403+
WARN_ON_ONCE(1);
404+
// Choose a safe default
405+
return BRCMU_CHAN_BAND_2G;
406+
}
407+
}
408+
389409
static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
390410
struct cfg80211_chan_def *ch)
391411
{
@@ -445,20 +465,7 @@ static u16 chandef_to_chanspec(struct brcmu_d11inf *d11inf,
445465
default:
446466
WARN_ON_ONCE(1);
447467
}
448-
switch (ch->chan->band) {
449-
case NL80211_BAND_2GHZ:
450-
ch_inf.band = BRCMU_CHAN_BAND_2G;
451-
break;
452-
case NL80211_BAND_5GHZ:
453-
ch_inf.band = BRCMU_CHAN_BAND_5G;
454-
break;
455-
case NL80211_BAND_6GHZ:
456-
ch_inf.band = BRCMU_CHAN_BAND_6G;
457-
break;
458-
case NL80211_BAND_60GHZ:
459-
default:
460-
WARN_ON_ONCE(1);
461-
}
468+
ch_inf.band = nl80211_band_to_chanspec_band(ch->chan->band);
462469
d11inf->encchspec(&ch_inf);
463470

464471
brcmf_dbg(TRACE, "chanspec: 0x%x\n", ch_inf.chspec);
@@ -470,6 +477,7 @@ u16 channel_to_chanspec(struct brcmu_d11inf *d11inf,
470477
{
471478
struct brcmu_chan ch_inf;
472479

480+
ch_inf.band = nl80211_band_to_chanspec_band(ch->band);
473481
ch_inf.chnum = ieee80211_frequency_to_channel(ch->center_freq);
474482
ch_inf.bw = BRCMU_CHAN_BW_20;
475483
d11inf->encchspec(&ch_inf);

0 commit comments

Comments
 (0)