mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:19:34 +02:00
wifi: mac80211: remove 5/10 MHz channel code
Now that cfg80211 refuses all attempts to use 5/10 MHz channels, all of this code is unreachable; remove it. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Lachlan Hodges <lachlan.hodges@morsemicro.com> Link: https://patch.msgid.link/20260529084502.4e5a9350206c.I2f6169a067ddd1b5e234668fcb6e07957fafacf2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
@@ -4591,8 +4591,6 @@ static int ieee80211_set_csa_beacon(struct ieee80211_link_data *link_data,
|
||||
cfg80211_get_chandef_type(&sdata->u.ibss.chandef))
|
||||
return -EINVAL;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
case NL80211_CHAN_WIDTH_20_NOHT:
|
||||
case NL80211_CHAN_WIDTH_20:
|
||||
break;
|
||||
|
||||
+1
-3
@@ -642,9 +642,7 @@ __ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local,
|
||||
lockdep_assert_wiphy(local->hw.wiphy);
|
||||
|
||||
/* don't optimize non-20MHz based and radar_enabled confs */
|
||||
if (ctx->conf.def.width == NL80211_CHAN_WIDTH_5 ||
|
||||
ctx->conf.def.width == NL80211_CHAN_WIDTH_10 ||
|
||||
ctx->conf.def.width == NL80211_CHAN_WIDTH_1 ||
|
||||
if (ctx->conf.def.width == NL80211_CHAN_WIDTH_1 ||
|
||||
ctx->conf.def.width == NL80211_CHAN_WIDTH_2 ||
|
||||
ctx->conf.def.width == NL80211_CHAN_WIDTH_4 ||
|
||||
ctx->conf.def.width == NL80211_CHAN_WIDTH_8 ||
|
||||
|
||||
+2
-29
@@ -167,8 +167,6 @@ ieee80211_ibss_build_presp(struct ieee80211_sub_if_data *sdata,
|
||||
|
||||
/* add HT capability and information IEs */
|
||||
if (chandef->width != NL80211_CHAN_WIDTH_20_NOHT &&
|
||||
chandef->width != NL80211_CHAN_WIDTH_5 &&
|
||||
chandef->width != NL80211_CHAN_WIDTH_10 &&
|
||||
sband->ht_cap.ht_supported) {
|
||||
struct ieee80211_sta_ht_cap ht_cap;
|
||||
|
||||
@@ -259,9 +257,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||
chan = chanreq.oper.chan;
|
||||
if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chanreq.oper,
|
||||
NL80211_IFTYPE_ADHOC)) {
|
||||
if (chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
chanreq.oper.width == NL80211_CHAN_WIDTH_10 ||
|
||||
chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
if (chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
chanreq.oper.width == NL80211_CHAN_WIDTH_20) {
|
||||
sdata_info(sdata,
|
||||
"Failed to join IBSS, beacons forbidden\n");
|
||||
@@ -405,12 +401,6 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
|
||||
chan_type = cfg80211_get_chandef_type(&sdata->u.ibss.chandef);
|
||||
cfg80211_chandef_create(&chandef, cbss->channel, chan_type);
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
cfg80211_chandef_create(&chandef, cbss->channel,
|
||||
NL80211_CHAN_NO_HT);
|
||||
chandef.width = sdata->u.ibss.chandef.width;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_80:
|
||||
case NL80211_CHAN_WIDTH_80P80:
|
||||
case NL80211_CHAN_WIDTH_160:
|
||||
@@ -762,8 +752,6 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
|
||||
lockdep_assert_wiphy(sdata->local->hw.wiphy);
|
||||
|
||||
switch (ifibss->chandef.width) {
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
case NL80211_CHAN_WIDTH_20_NOHT:
|
||||
conn.mode = IEEE80211_CONN_MODE_LEGACY;
|
||||
fallthrough;
|
||||
@@ -811,19 +799,6 @@ ieee80211_ibss_process_chanswitch(struct ieee80211_sub_if_data *sdata,
|
||||
cfg80211_chandef_create(¶ms.chandef, params.chandef.chan,
|
||||
ch_type);
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
if (params.chandef.width != ifibss->chandef.width) {
|
||||
sdata_info(sdata,
|
||||
"IBSS %pM received channel switch from incompatible channel width (%d MHz, width:%d, CF1/2: %d/%d MHz), disconnecting\n",
|
||||
ifibss->bssid,
|
||||
params.chandef.chan->center_freq,
|
||||
params.chandef.width,
|
||||
params.chandef.center_freq1,
|
||||
params.chandef.center_freq2);
|
||||
goto disconnect;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* should not happen, conn_flags should prevent VHT modes. */
|
||||
WARN_ON(1);
|
||||
@@ -1005,9 +980,7 @@ static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata,
|
||||
}
|
||||
|
||||
if (sta && elems->ht_operation && elems->ht_cap_elem &&
|
||||
sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT &&
|
||||
sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_5 &&
|
||||
sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_10) {
|
||||
sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT) {
|
||||
/* we both use HT */
|
||||
struct ieee80211_ht_cap htcap_ie;
|
||||
struct cfg80211_chan_def chandef;
|
||||
|
||||
+9
-27
@@ -439,9 +439,7 @@ int mesh_add_ht_cap_ie(struct ieee80211_sub_if_data *sdata,
|
||||
return 0;
|
||||
|
||||
if (!sband->ht_cap.ht_supported ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return 0;
|
||||
|
||||
if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_cap))
|
||||
@@ -480,9 +478,7 @@ int mesh_add_ht_oper_ie(struct ieee80211_sub_if_data *sdata,
|
||||
return 0;
|
||||
|
||||
if (!ht_cap->ht_supported ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return 0;
|
||||
|
||||
if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_ht_operation))
|
||||
@@ -511,9 +507,7 @@ int mesh_add_vht_cap_ie(struct ieee80211_sub_if_data *sdata,
|
||||
return 0;
|
||||
|
||||
if (!sband->vht_cap.vht_supported ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return 0;
|
||||
|
||||
if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_vht_cap))
|
||||
@@ -552,9 +546,7 @@ int mesh_add_vht_oper_ie(struct ieee80211_sub_if_data *sdata,
|
||||
return 0;
|
||||
|
||||
if (!vht_cap->vht_supported ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return 0;
|
||||
|
||||
if (skb_tailroom(skb) < 2 + sizeof(struct ieee80211_vht_operation))
|
||||
@@ -576,9 +568,7 @@ int mesh_add_he_cap_ie(struct ieee80211_sub_if_data *sdata,
|
||||
if (!sband)
|
||||
return -EINVAL;
|
||||
|
||||
if (sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
if (sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return 0;
|
||||
|
||||
return ieee80211_put_he_cap(skb, sdata, sband, NULL);
|
||||
@@ -598,9 +588,7 @@ int mesh_add_he_oper_ie(struct ieee80211_sub_if_data *sdata,
|
||||
|
||||
he_cap = ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_MESH_POINT);
|
||||
if (!he_cap ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return 0;
|
||||
|
||||
len = 2 + 1 + sizeof(struct ieee80211_he_operation);
|
||||
@@ -648,9 +636,7 @@ int mesh_add_eht_cap_ie(struct ieee80211_sub_if_data *sdata,
|
||||
if (!sband)
|
||||
return -EINVAL;
|
||||
|
||||
if (sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
if (sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return 0;
|
||||
|
||||
return ieee80211_put_eht_cap(skb, sdata, sband, NULL);
|
||||
@@ -669,9 +655,7 @@ int mesh_add_eht_oper_ie(struct ieee80211_sub_if_data *sdata, struct sk_buff *sk
|
||||
|
||||
eht_cap = ieee80211_get_eht_iftype_cap(sband, NL80211_IFTYPE_MESH_POINT);
|
||||
if (!eht_cap ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return 0;
|
||||
|
||||
len = 2 + 1 + offsetof(struct ieee80211_eht_operation, optional) +
|
||||
@@ -729,9 +713,7 @@ ieee80211_mesh_update_bss_params(struct ieee80211_sub_if_data *sdata,
|
||||
return;
|
||||
|
||||
if (!ieee80211_get_he_iftype_cap(sband, NL80211_IFTYPE_MESH_POINT) ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_10)
|
||||
sdata->vif.bss_conf.chanreq.oper.width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return;
|
||||
|
||||
sdata->vif.bss_conf.he_support = true;
|
||||
|
||||
@@ -165,8 +165,6 @@ static u64 mesh_set_ht_prot_mode(struct ieee80211_sub_if_data *sdata)
|
||||
|
||||
switch (sdata->vif.bss_conf.chanreq.oper.width) {
|
||||
case NL80211_CHAN_WIDTH_20_NOHT:
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
return 0;
|
||||
default:
|
||||
break;
|
||||
|
||||
+2
-4
@@ -6376,10 +6376,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
|
||||
ret = ieee80211_link_use_channel(link, &chanreq,
|
||||
IEEE80211_CHANCTX_SHARED);
|
||||
|
||||
/* don't downgrade for 5/10/S1G MHz channels, though. */
|
||||
if (chanreq.oper.width == NL80211_CHAN_WIDTH_5 ||
|
||||
chanreq.oper.width == NL80211_CHAN_WIDTH_10 ||
|
||||
cfg80211_chandef_is_s1g(&chanreq.oper))
|
||||
/* don't downgrade for S1G channels, though. */
|
||||
if (cfg80211_chandef_is_s1g(&chanreq.oper))
|
||||
return ret;
|
||||
|
||||
while (ret && chanreq.oper.width != NL80211_CHAN_WIDTH_20_NOHT) {
|
||||
|
||||
@@ -355,9 +355,7 @@ static void _ieee80211_start_next_roc(struct ieee80211_local *local)
|
||||
* Note: scan can't run, tmp_channel is what we use, so this
|
||||
* must be the currently active channel.
|
||||
*/
|
||||
roc->on_channel = roc->chan == local->hw.conf.chandef.chan &&
|
||||
local->hw.conf.chandef.width != NL80211_CHAN_WIDTH_5 &&
|
||||
local->hw.conf.chandef.width != NL80211_CHAN_WIDTH_10;
|
||||
roc->on_channel = roc->chan == local->hw.conf.chandef.chan;
|
||||
|
||||
/* start this ROC */
|
||||
ieee80211_recalc_idle(local);
|
||||
|
||||
+1
-7
@@ -601,14 +601,8 @@ static void rate_idx_match_mask(s8 *rate_idx, u16 *rate_flags,
|
||||
return;
|
||||
|
||||
/* if HT BSS, and we handle a data frame, also try HT rates */
|
||||
switch (chan_width) {
|
||||
case NL80211_CHAN_WIDTH_20_NOHT:
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
if (chan_width == NL80211_CHAN_WIDTH_20_NOHT)
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
*rate_idx = 0;
|
||||
/* keep protection flags */
|
||||
|
||||
@@ -329,16 +329,6 @@ int ieee80211_parse_ch_switch_ie(struct ieee80211_sub_if_data *sdata,
|
||||
case -1:
|
||||
cfg80211_chandef_create(&csa_ie->chanreq.oper, new_chan,
|
||||
NL80211_CHAN_NO_HT);
|
||||
/* keep width for 5/10 MHz channels */
|
||||
switch (sdata->vif.bss_conf.chanreq.oper.width) {
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
csa_ie->chanreq.oper.width =
|
||||
sdata->vif.bss_conf.chanreq.oper.width;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -3816,13 +3816,6 @@ again:
|
||||
conn->mode = IEEE80211_CONN_MODE_S1G;
|
||||
conn->bw_limit = IEEE80211_CONN_BW_LIMIT_20;
|
||||
break;
|
||||
case NL80211_CHAN_WIDTH_5:
|
||||
case NL80211_CHAN_WIDTH_10:
|
||||
WARN_ON_ONCE(1);
|
||||
/* keep c->width */
|
||||
conn->mode = IEEE80211_CONN_MODE_LEGACY;
|
||||
conn->bw_limit = IEEE80211_CONN_BW_LIMIT_20;
|
||||
break;
|
||||
}
|
||||
|
||||
if (new_primary_width != NL80211_CHAN_WIDTH_20_NOHT) {
|
||||
|
||||
Reference in New Issue
Block a user