Skip to content

Commit 5add321

Browse files
committed
wifi: cfg80211: remove scan_width support
There really isn't any support for scanning at different channel widths than 20 MHz since there's no way to set it. Remove this support for now, if somebody wants to maintain this whole thing later we can revisit how it should work. Signed-off-by: Johannes Berg <[email protected]>
1 parent 22446b7 commit 5add321

File tree

13 files changed

+35
-191
lines changed

13 files changed

+35
-191
lines changed

drivers/net/wireless/ath/wil6210/wmi.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,6 @@ static void wmi_evt_rx_mgmt(struct wil6210_vif *vif, int id, void *d, int len)
870870
struct cfg80211_bss *bss;
871871
struct cfg80211_inform_bss bss_data = {
872872
.chan = channel,
873-
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
874873
.signal = signal,
875874
.boottime_ns = ktime_to_ns(ktime_get_boottime()),
876875
};
@@ -1389,7 +1388,6 @@ wmi_evt_sched_scan_result(struct wil6210_vif *vif, int id, void *d, int len)
13891388
u32 d_len;
13901389
struct cfg80211_bss *bss;
13911390
struct cfg80211_inform_bss bss_data = {
1392-
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
13931391
.boottime_ns = ktime_to_ns(ktime_get_boottime()),
13941392
};
13951393

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3367,7 +3367,6 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_info *cfg,
33673367

33683368
freq = ieee80211_channel_to_frequency(channel, band);
33693369
bss_data.chan = ieee80211_get_channel(wiphy, freq);
3370-
bss_data.scan_width = NL80211_BSS_CHAN_WIDTH_20;
33713370
bss_data.boottime_ns = ktime_to_ns(ktime_get_boottime());
33723371

33733372
notify_capability = le16_to_cpu(bi->capability);

include/net/cfg80211.h

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2536,7 +2536,6 @@ struct cfg80211_scan_6ghz_params {
25362536
* @n_ssids: number of SSIDs
25372537
* @channels: channels to scan on.
25382538
* @n_channels: total number of channels to scan
2539-
* @scan_width: channel width for scanning
25402539
* @ie: optional information element(s) to add into Probe Request or %NULL
25412540
* @ie_len: length of ie in octets
25422541
* @duration: how long to listen on each channel, in TUs. If
@@ -2566,7 +2565,6 @@ struct cfg80211_scan_request {
25662565
struct cfg80211_ssid *ssids;
25672566
int n_ssids;
25682567
u32 n_channels;
2569-
enum nl80211_bss_scan_width scan_width;
25702568
const u8 *ie;
25712569
size_t ie_len;
25722570
u16 duration;
@@ -2661,7 +2659,6 @@ struct cfg80211_bss_select_adjust {
26612659
* @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
26622660
* @n_ssids: number of SSIDs
26632661
* @n_channels: total number of channels to scan
2664-
* @scan_width: channel width for scanning
26652662
* @ie: optional information element(s) to add into Probe Request or %NULL
26662663
* @ie_len: length of ie in octets
26672664
* @flags: control flags from &enum nl80211_scan_flags
@@ -2709,7 +2706,6 @@ struct cfg80211_sched_scan_request {
27092706
struct cfg80211_ssid *ssids;
27102707
int n_ssids;
27112708
u32 n_channels;
2712-
enum nl80211_bss_scan_width scan_width;
27132709
const u8 *ie;
27142710
size_t ie_len;
27152711
u32 flags;
@@ -2757,7 +2753,6 @@ enum cfg80211_signal_type {
27572753
/**
27582754
* struct cfg80211_inform_bss - BSS inform data
27592755
* @chan: channel the frame was received on
2760-
* @scan_width: scan width that was used
27612756
* @signal: signal strength value, according to the wiphy's
27622757
* signal type
27632758
* @boottime_ns: timestamp (CLOCK_BOOTTIME) when the information was
@@ -2777,7 +2772,6 @@ enum cfg80211_signal_type {
27772772
*/
27782773
struct cfg80211_inform_bss {
27792774
struct ieee80211_channel *chan;
2780-
enum nl80211_bss_scan_width scan_width;
27812775
s32 signal;
27822776
u64 boottime_ns;
27832777
u64 parent_tsf;
@@ -2811,7 +2805,6 @@ struct cfg80211_bss_ies {
28112805
* for use in scan results and similar.
28122806
*
28132807
* @channel: channel this BSS is on
2814-
* @scan_width: width of the control channel
28152808
* @bssid: BSSID of the BSS
28162809
* @beacon_interval: the beacon interval as from the frame
28172810
* @capability: the capability field in host byte order
@@ -2841,7 +2834,6 @@ struct cfg80211_bss_ies {
28412834
*/
28422835
struct cfg80211_bss {
28432836
struct ieee80211_channel *channel;
2844-
enum nl80211_bss_scan_width scan_width;
28452837

28462838
const struct cfg80211_bss_ies __rcu *ies;
28472839
const struct cfg80211_bss_ies __rcu *beacon_ies;
@@ -6321,13 +6313,11 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
63216313
/**
63226314
* ieee80211_mandatory_rates - get mandatory rates for a given band
63236315
* @sband: the band to look for rates in
6324-
* @scan_width: width of the control channel
63256316
*
63266317
* This function returns a bitmap of the mandatory rates for the given
63276318
* band, bits are set according to the rate position in the bitrates array.
63286319
*/
6329-
u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband,
6330-
enum nl80211_bss_scan_width scan_width);
6320+
u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband);
63316321

63326322
/*
63336323
* Radiotap parsing functions -- for controlled injection support
@@ -6988,22 +6978,6 @@ cfg80211_inform_bss_frame_data(struct wiphy *wiphy,
69886978
struct ieee80211_mgmt *mgmt, size_t len,
69896979
gfp_t gfp);
69906980

6991-
static inline struct cfg80211_bss * __must_check
6992-
cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
6993-
struct ieee80211_channel *rx_channel,
6994-
enum nl80211_bss_scan_width scan_width,
6995-
struct ieee80211_mgmt *mgmt, size_t len,
6996-
s32 signal, gfp_t gfp)
6997-
{
6998-
struct cfg80211_inform_bss data = {
6999-
.chan = rx_channel,
7000-
.scan_width = scan_width,
7001-
.signal = signal,
7002-
};
7003-
7004-
return cfg80211_inform_bss_frame_data(wiphy, &data, mgmt, len, gfp);
7005-
}
7006-
70076981
static inline struct cfg80211_bss * __must_check
70086982
cfg80211_inform_bss_frame(struct wiphy *wiphy,
70096983
struct ieee80211_channel *rx_channel,
@@ -7012,7 +6986,6 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
70126986
{
70136987
struct cfg80211_inform_bss data = {
70146988
.chan = rx_channel,
7015-
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
70166989
.signal = signal,
70176990
};
70186991

@@ -7114,26 +7087,6 @@ cfg80211_inform_bss_data(struct wiphy *wiphy,
71147087
u16 beacon_interval, const u8 *ie, size_t ielen,
71157088
gfp_t gfp);
71167089

7117-
static inline struct cfg80211_bss * __must_check
7118-
cfg80211_inform_bss_width(struct wiphy *wiphy,
7119-
struct ieee80211_channel *rx_channel,
7120-
enum nl80211_bss_scan_width scan_width,
7121-
enum cfg80211_bss_frame_type ftype,
7122-
const u8 *bssid, u64 tsf, u16 capability,
7123-
u16 beacon_interval, const u8 *ie, size_t ielen,
7124-
s32 signal, gfp_t gfp)
7125-
{
7126-
struct cfg80211_inform_bss data = {
7127-
.chan = rx_channel,
7128-
.scan_width = scan_width,
7129-
.signal = signal,
7130-
};
7131-
7132-
return cfg80211_inform_bss_data(wiphy, &data, ftype, bssid, tsf,
7133-
capability, beacon_interval, ie, ielen,
7134-
gfp);
7135-
}
7136-
71377090
static inline struct cfg80211_bss * __must_check
71387091
cfg80211_inform_bss(struct wiphy *wiphy,
71397092
struct ieee80211_channel *rx_channel,
@@ -7144,7 +7097,6 @@ cfg80211_inform_bss(struct wiphy *wiphy,
71447097
{
71457098
struct cfg80211_inform_bss data = {
71467099
.chan = rx_channel,
7147-
.scan_width = NL80211_BSS_CHAN_WIDTH_20,
71487100
.signal = signal,
71497101
};
71507102

@@ -7229,19 +7181,6 @@ void cfg80211_bss_iter(struct wiphy *wiphy,
72297181
void *data),
72307182
void *iter_data);
72317183

7232-
static inline enum nl80211_bss_scan_width
7233-
cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef)
7234-
{
7235-
switch (chandef->width) {
7236-
case NL80211_CHAN_WIDTH_5:
7237-
return NL80211_BSS_CHAN_WIDTH_5;
7238-
case NL80211_CHAN_WIDTH_10:
7239-
return NL80211_BSS_CHAN_WIDTH_10;
7240-
default:
7241-
return NL80211_BSS_CHAN_WIDTH_20;
7242-
}
7243-
}
7244-
72457184
/**
72467185
* cfg80211_rx_mlme_mgmt - notification of processed MLME management frame
72477186
* @dev: network device

include/uapi/linux/nl80211.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5038,7 +5038,7 @@ enum nl80211_bss_scan_width {
50385038
* elements from a Beacon frame (bin); not present if no Beacon frame has
50395039
* yet been received
50405040
* @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
5041-
* (u32, enum nl80211_bss_scan_width)
5041+
* (u32, enum nl80211_bss_scan_width) - No longer used!
50425042
* @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64)
50435043
* (not present if no beacon frame has been received yet)
50445044
* @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and

net/mac80211/ibss.c

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
377377
round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
378378

379379
bss_meta.chan = chan;
380-
bss_meta.scan_width = cfg80211_chandef_to_scan_width(&chandef);
381380
bss = cfg80211_inform_bss_frame_data(local->hw.wiphy, &bss_meta, mgmt,
382381
presp->head_len, GFP_KERNEL);
383382

@@ -595,7 +594,6 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
595594
struct sta_info *sta;
596595
struct ieee80211_chanctx_conf *chanctx_conf;
597596
struct ieee80211_supported_band *sband;
598-
enum nl80211_bss_scan_width scan_width;
599597
int band;
600598

601599
/*
@@ -624,7 +622,6 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
624622
if (WARN_ON_ONCE(!chanctx_conf))
625623
return NULL;
626624
band = chanctx_conf->def.chan->band;
627-
scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
628625
rcu_read_unlock();
629626

630627
sta = sta_info_alloc(sdata, addr, GFP_KERNEL);
@@ -636,7 +633,7 @@ ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata, const u8 *bssid,
636633
/* make sure mandatory rates are always added */
637634
sband = local->hw.wiphy->bands[band];
638635
sta->sta.deflink.supp_rates[band] = supp_rates |
639-
ieee80211_mandatory_rates(sband, scan_width);
636+
ieee80211_mandatory_rates(sband);
640637

641638
return ieee80211_ibss_finish_sta(sta);
642639
}
@@ -975,7 +972,6 @@ static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata,
975972
{
976973
struct sta_info *sta;
977974
enum nl80211_band band = rx_status->band;
978-
enum nl80211_bss_scan_width scan_width;
979975
struct ieee80211_local *local = sdata->local;
980976
struct ieee80211_supported_band *sband;
981977
bool rates_updated = false;
@@ -1001,15 +997,9 @@ static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata,
1001997
u32 prev_rates;
1002998

1003999
prev_rates = sta->sta.deflink.supp_rates[band];
1004-
/* make sure mandatory rates are always added */
1005-
scan_width = NL80211_BSS_CHAN_WIDTH_20;
1006-
if (rx_status->bw == RATE_INFO_BW_5)
1007-
scan_width = NL80211_BSS_CHAN_WIDTH_5;
1008-
else if (rx_status->bw == RATE_INFO_BW_10)
1009-
scan_width = NL80211_BSS_CHAN_WIDTH_10;
10101000

10111001
sta->sta.deflink.supp_rates[band] = supp_rates |
1012-
ieee80211_mandatory_rates(sband, scan_width);
1002+
ieee80211_mandatory_rates(sband);
10131003
if (sta->sta.deflink.supp_rates[band] != prev_rates) {
10141004
ibss_dbg(sdata,
10151005
"updated supp_rates set for %pM based on beacon/probe_resp (0x%x -> 0x%x)\n",
@@ -1196,7 +1186,6 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
11961186
struct sta_info *sta;
11971187
struct ieee80211_chanctx_conf *chanctx_conf;
11981188
struct ieee80211_supported_band *sband;
1199-
enum nl80211_bss_scan_width scan_width;
12001189
int band;
12011190

12021191
/*
@@ -1222,7 +1211,6 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
12221211
return;
12231212
}
12241213
band = chanctx_conf->def.chan->band;
1225-
scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
12261214
rcu_read_unlock();
12271215

12281216
sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
@@ -1232,7 +1220,7 @@ void ieee80211_ibss_rx_no_sta(struct ieee80211_sub_if_data *sdata,
12321220
/* make sure mandatory rates are always added */
12331221
sband = local->hw.wiphy->bands[band];
12341222
sta->sta.deflink.supp_rates[band] = supp_rates |
1235-
ieee80211_mandatory_rates(sband, scan_width);
1223+
ieee80211_mandatory_rates(sband);
12361224

12371225
spin_lock(&ifibss->incomplete_lock);
12381226
list_add(&sta->list, &ifibss->incomplete_stations);
@@ -1282,7 +1270,6 @@ static void ieee80211_ibss_sta_expire(struct ieee80211_sub_if_data *sdata)
12821270
static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata)
12831271
{
12841272
struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
1285-
enum nl80211_bss_scan_width scan_width;
12861273

12871274
lockdep_assert_wiphy(sdata->local->hw.wiphy);
12881275

@@ -1304,9 +1291,8 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata)
13041291
sdata_info(sdata,
13051292
"No active IBSS STAs - trying to scan for other IBSS networks with same SSID (merge)\n");
13061293

1307-
scan_width = cfg80211_chandef_to_scan_width(&ifibss->chandef);
13081294
ieee80211_request_ibss_scan(sdata, ifibss->ssid, ifibss->ssid_len,
1309-
NULL, 0, scan_width);
1295+
NULL, 0);
13101296
}
13111297

13121298
static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
@@ -1424,7 +1410,6 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
14241410
struct cfg80211_bss *cbss;
14251411
struct ieee80211_channel *chan = NULL;
14261412
const u8 *bssid = NULL;
1427-
enum nl80211_bss_scan_width scan_width;
14281413
int active_ibss;
14291414

14301415
lockdep_assert_wiphy(sdata->local->hw.wiphy);
@@ -1483,20 +1468,17 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
14831468

14841469
sdata_info(sdata, "Trigger new scan to find an IBSS to join\n");
14851470

1486-
scan_width = cfg80211_chandef_to_scan_width(&ifibss->chandef);
1487-
14881471
if (ifibss->fixed_channel) {
14891472
num = ieee80211_ibss_setup_scan_channels(local->hw.wiphy,
14901473
&ifibss->chandef,
14911474
channels,
14921475
ARRAY_SIZE(channels));
14931476
ieee80211_request_ibss_scan(sdata, ifibss->ssid,
14941477
ifibss->ssid_len, channels,
1495-
num, scan_width);
1478+
num);
14961479
} else {
14971480
ieee80211_request_ibss_scan(sdata, ifibss->ssid,
1498-
ifibss->ssid_len, NULL,
1499-
0, scan_width);
1481+
ifibss->ssid_len, NULL, 0);
15001482
}
15011483
} else {
15021484
int interval = IEEE80211_SCAN_INTERVAL;

net/mac80211/ieee80211_i.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,8 +1911,7 @@ void ieee80211_scan_work(struct wiphy *wiphy, struct wiphy_work *work);
19111911
int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata,
19121912
const u8 *ssid, u8 ssid_len,
19131913
struct ieee80211_channel **channels,
1914-
unsigned int n_channels,
1915-
enum nl80211_bss_scan_width scan_width);
1914+
unsigned int n_channels);
19161915
int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata,
19171916
struct cfg80211_scan_request *req);
19181917
void ieee80211_scan_cancel(struct ieee80211_local *local);

net/mac80211/ocb.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ void ieee80211_ocb_rx_no_sta(struct ieee80211_sub_if_data *sdata,
4444
struct ieee80211_local *local = sdata->local;
4545
struct ieee80211_chanctx_conf *chanctx_conf;
4646
struct ieee80211_supported_band *sband;
47-
enum nl80211_bss_scan_width scan_width;
4847
struct sta_info *sta;
4948
int band;
5049

@@ -66,7 +65,6 @@ void ieee80211_ocb_rx_no_sta(struct ieee80211_sub_if_data *sdata,
6665
return;
6766
}
6867
band = chanctx_conf->def.chan->band;
69-
scan_width = cfg80211_chandef_to_scan_width(&chanctx_conf->def);
7068
rcu_read_unlock();
7169

7270
sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
@@ -75,8 +73,7 @@ void ieee80211_ocb_rx_no_sta(struct ieee80211_sub_if_data *sdata,
7573

7674
/* Add only mandatory rates for now */
7775
sband = local->hw.wiphy->bands[band];
78-
sta->sta.deflink.supp_rates[band] =
79-
ieee80211_mandatory_rates(sband, scan_width);
76+
sta->sta.deflink.supp_rates[band] = ieee80211_mandatory_rates(sband);
8077

8178
spin_lock(&ifocb->incomplete_lock);
8279
list_add(&sta->list, &ifocb->incomplete_stations);

0 commit comments

Comments
 (0)