mac80211: Support dynamic AP mode channel width changes
PATCH 2/3 mac80211: Support dynamic AP mode channel width changes
Implement the new cfg80211 capability to enable mac80211-based drivers to support for dynamic channel bandwidth changes (e.g., HT 20/40 MHz changes).
--- net/mac80211/cfg.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
net/mac80211/cfg.c +16 -0
@@ -3949,6 +3949,21 @@ static int ieee80211_set_qos_map(struct wiphy *wiphy,return 0 ; } +static int ieee80211_set_ap_channel (struct wiphy *wiphy, +struct net_device *dev, +struct cfg80211_chan_def *chandef) +{ +struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); +int ret; +u32 changed =0 ; + + ret =ieee80211_vif_change_bandwidth (sdata, chandef, &changed); +if (ret ==0 ) +ieee80211_bss_info_change_notify (sdata, changed); + +return ret; +} +const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface,
@@ -4029,4 +4044,5 @@ const struct cfg80211_ops mac80211_config_ops = { .start_radar_detection = ieee80211_start_radar_detection, .channel_switch = ieee80211_channel_switch, .set_qos_map = ieee80211_set_qos_map, + .set_ap_channel = ieee80211_set_ap_channel, };
Signature · 5 lines
1.7.9.5 -- Jouni Malinen PGP id EFC895FA
Quoted 15 lines · Jouni Malinen
Implement the new cfg80211 capability to enable mac80211-based drivers to support for dynamic channel bandwidth changes (e.g., HT 20/40 MHz changes).
Signed-off-by Jouni Malinen <[email protected]>--- net/mac80211/cfg.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)net/mac80211/cfg.c +0
-0@@ -3949,6 +3949,21 @@ static int ieee80211_set_qos_map(struct wiphy *wiphy,return 0 ;
net/mac80211/cfg.c static int ieee80211_set_qos_map(struct wiphy *wiphy, · line 3959
Quoted 10 lines
net/mac80211/cfg.c +8
-0} +static int ieee80211_set_ap_channel (struct wiphy *wiphy, +struct net_device *dev, +struct cfg80211_chan_def *chandef) +{ +struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); +int ret; +u32 changed =0 ; +
Shouldn't interface combinations be verified here? What if there was a bandwidth upgrade (after a downgrade) but in the meantime a vif with a to-be incompatible chandef was brought up? I think the existing usage of ieee80211_vif_change_bandwidth() in ieee80211_config_bw() already suffers from this problem or am I missing something?
net/mac80211/cfg.c static int ieee80211_set_qos_map(struct wiphy *wiphy, · line 3965
Quoted 6 lines
net/mac80211/cfg.c +6
-0+ ret =ieee80211_vif_change_bandwidth (sdata, chandef, &changed); +if (ret ==0 ) +ieee80211_bss_info_change_notify (sdata, changed); + +return ret; +}
Michał
Johannes Berg
maintainerQuoted 4 lines · Michal Kazior
Quoted 4 lines
net/mac80211/cfg.c +4
-0+static int ieee80211_set_ap_channel (struct wiphy *wiphy, +struct net_device *dev, +struct cfg80211_chan_def *chandef) +{
Quoted 8 lines
net/mac80211/cfg.c static int ieee80211_set_qos_map(struct wiphy *wiphy, · line 3959
Quoted 4 lines
net/mac80211/cfg.c +4
-0+struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); +int ret; +u32 changed =0 ; +Shouldn't interface combinations be verified here? What if there was a bandwidth upgrade (after a downgrade) but in the meantime a vif with a to-be incompatible chandef was brought up?
Yeah that seems like a potential issue.
Quoted 3 lines
I think the existing usage
ofieee80211_vif_change_bandwidth()inieee80211_config_bw()already suffers from this problem or am I missing something?
That sounds like you're arguing it should be fixed in a separate patch to ieee80211_vif_change_bandwidth()? :)
johannes
Johannes Berg
maintainerQuoted 5 lines · Johannes Berg
Quoted 3 lines
Shouldn't interface combinations be verified here? What if there was a bandwidth upgrade (after a downgrade) but in the meantime a vif with a to-be incompatible chandef was brought up?
Yeah that seems like a potential issue.
Hm, wait, isn't this addressed by this code inieee80211_vif_change_bandwidth():
ctx = container_of(conf, struct ieee80211_chanctx, conf);
if (!cfg80211_chandef_compatible(&conf->def, chandef)) {
ret = -EINVAL;
goto out;
}johannes
Quoted 8 lines · Johannes Berg
Quoted 5 lines · Johannes Berg
Quoted 3 lines
Shouldn't interface combinations be verified here? What if there was a bandwidth upgrade (after a downgrade) but in the meantime a vif with a to-be incompatible chandef was brought up?
Yeah that seems like a potential issue.
Quoted 8 lines
Hm, wait, isn't this addressed by this code in
ieee80211_vif_change_bandwidth():ctx = container_of(conf, struct ieee80211_chanctx, conf); if (!cfg80211_chandef_compatible(&conf->def, chandef)) { ret = -EINVAL; goto out; }
Yeah, you're right.
Michał