aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2008-08-07 13:07:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:23:55 -0400
commit9f1ba9062e032fb7b395cd27fc564754fe4e9867 (patch)
tree6610106cd769aa3cc144b7a4f1547e07eeba5c88 /net/mac80211/cfg.c
parent7f93ea3e246db512c0c17b79847f57dd3a2891e1 (diff)
mac80211/cfg80211: Add BSS configuration options for AP mode
This change adds a new cfg80211 command, NL80211_CMD_SET_BSS, to allow AP mode BSS parameters to be changed from user space (e.g., hostapd). The drivers using mac80211 are expected to be modified with separate changes to use the new BSS info parameter for short slot time in the bss_info_changed() handler. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 6d2ad2bf3ab5..2b19532f4c8a 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1010,6 +1010,42 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev,
1010} 1010}
1011#endif 1011#endif
1012 1012
1013static int ieee80211_change_bss(struct wiphy *wiphy,
1014 struct net_device *dev,
1015 struct bss_parameters *params)
1016{
1017 struct ieee80211_local *local = wiphy_priv(wiphy);
1018 struct ieee80211_sub_if_data *sdata;
1019 u32 changed = 0;
1020
1021 if (dev == local->mdev)
1022 return -EOPNOTSUPP;
1023
1024 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1025
1026 if (sdata->vif.type != IEEE80211_IF_TYPE_AP)
1027 return -EINVAL;
1028
1029 if (params->use_cts_prot >= 0) {
1030 sdata->bss_conf.use_cts_prot = params->use_cts_prot;
1031 changed |= BSS_CHANGED_ERP_CTS_PROT;
1032 }
1033 if (params->use_short_preamble >= 0) {
1034 sdata->bss_conf.use_short_preamble =
1035 params->use_short_preamble;
1036 changed |= BSS_CHANGED_ERP_PREAMBLE;
1037 }
1038 if (params->use_short_slot_time >= 0) {
1039 sdata->bss_conf.use_short_slot =
1040 params->use_short_slot_time;
1041 changed |= BSS_CHANGED_ERP_SLOT;
1042 }
1043
1044 ieee80211_bss_info_change_notify(sdata, changed);
1045
1046 return 0;
1047}
1048
1013struct cfg80211_ops mac80211_config_ops = { 1049struct cfg80211_ops mac80211_config_ops = {
1014 .add_virtual_intf = ieee80211_add_iface, 1050 .add_virtual_intf = ieee80211_add_iface,
1015 .del_virtual_intf = ieee80211_del_iface, 1051 .del_virtual_intf = ieee80211_del_iface,
@@ -1033,4 +1069,5 @@ struct cfg80211_ops mac80211_config_ops = {
1033 .get_mpath = ieee80211_get_mpath, 1069 .get_mpath = ieee80211_get_mpath,
1034 .dump_mpath = ieee80211_dump_mpath, 1070 .dump_mpath = ieee80211_dump_mpath,
1035#endif 1071#endif
1072 .change_bss = ieee80211_change_bss,
1036}; 1073};