aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/linux/nl80211.h19
-rw-r--r--include/net/cfg80211.h22
-rw-r--r--include/net/mac80211.h9
3 files changed, 50 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 2be7c63bc0f..447c02a5190 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -89,6 +89,8 @@
89 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC 89 * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC
90 * or, if no MAC address given, all mesh paths, on the interface identified 90 * or, if no MAC address given, all mesh paths, on the interface identified
91 * by %NL80211_ATTR_IFINDEX. 91 * by %NL80211_ATTR_IFINDEX.
92 * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
93 * %NL80211_ATTR_IFINDEX.
92 * 94 *
93 * @NL80211_CMD_MAX: highest used command number 95 * @NL80211_CMD_MAX: highest used command number
94 * @__NL80211_CMD_AFTER_LAST: internal use 96 * @__NL80211_CMD_AFTER_LAST: internal use
@@ -127,6 +129,8 @@ enum nl80211_commands {
127 NL80211_CMD_NEW_MPATH, 129 NL80211_CMD_NEW_MPATH,
128 NL80211_CMD_DEL_MPATH, 130 NL80211_CMD_DEL_MPATH,
129 131
132 NL80211_CMD_SET_BSS,
133
130 /* add commands here */ 134 /* add commands here */
131 135
132 /* used to define NL80211_CMD_MAX below */ 136 /* used to define NL80211_CMD_MAX below */
@@ -134,6 +138,11 @@ enum nl80211_commands {
134 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 138 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
135}; 139};
136 140
141/*
142 * Allow user space programs to use #ifdef on new commands by defining them
143 * here
144 */
145#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
137 146
138/** 147/**
139 * enum nl80211_attrs - nl80211 netlink attributes 148 * enum nl80211_attrs - nl80211 netlink attributes
@@ -192,6 +201,12 @@ enum nl80211_commands {
192 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of 201 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
193 * &enum nl80211_mntr_flags. 202 * &enum nl80211_mntr_flags.
194 * 203 *
204 * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
205 * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
206 * (u8, 0 or 1)
207 * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
208 * (u8, 0 or 1)
209 *
195 * @NL80211_ATTR_MAX: highest attribute number currently defined 210 * @NL80211_ATTR_MAX: highest attribute number currently defined
196 * @__NL80211_ATTR_AFTER_LAST: internal use 211 * @__NL80211_ATTR_AFTER_LAST: internal use
197 */ 212 */
@@ -235,6 +250,10 @@ enum nl80211_attrs {
235 NL80211_ATTR_MPATH_NEXT_HOP, 250 NL80211_ATTR_MPATH_NEXT_HOP,
236 NL80211_ATTR_MPATH_INFO, 251 NL80211_ATTR_MPATH_INFO,
237 252
253 NL80211_ATTR_BSS_CTS_PROT,
254 NL80211_ATTR_BSS_SHORT_PREAMBLE,
255 NL80211_ATTR_BSS_SHORT_SLOT_TIME,
256
238 /* add attributes here, update the policy in nl80211.c */ 257 /* add attributes here, update the policy in nl80211.c */
239 258
240 __NL80211_ATTR_AFTER_LAST, 259 __NL80211_ATTR_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e00750836ba..7afef14d5c5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -268,6 +268,23 @@ struct mpath_info {
268 u8 flags; 268 u8 flags;
269}; 269};
270 270
271/**
272 * struct bss_parameters - BSS parameters
273 *
274 * Used to change BSS parameters (mainly for AP mode).
275 *
276 * @use_cts_prot: Whether to use CTS protection
277 * (0 = no, 1 = yes, -1 = do not change)
278 * @use_short_preamble: Whether the use of short preambles is allowed
279 * (0 = no, 1 = yes, -1 = do not change)
280 * @use_short_slot_time: Whether the use of short slot time is allowed
281 * (0 = no, 1 = yes, -1 = do not change)
282 */
283struct bss_parameters {
284 int use_cts_prot;
285 int use_short_preamble;
286 int use_short_slot_time;
287};
271 288
272/* from net/wireless.h */ 289/* from net/wireless.h */
273struct wiphy; 290struct wiphy;
@@ -318,6 +335,8 @@ struct wiphy;
318 * @change_station: Modify a given station. 335 * @change_station: Modify a given station.
319 * 336 *
320 * @set_mesh_cfg: set mesh parameters (by now, just mesh id) 337 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
338 *
339 * @change_bss: Modify parameters for a given BSS.
321 */ 340 */
322struct cfg80211_ops { 341struct cfg80211_ops {
323 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 342 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
@@ -370,6 +389,9 @@ struct cfg80211_ops {
370 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, 389 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
371 int idx, u8 *dst, u8 *next_hop, 390 int idx, u8 *dst, u8 *next_hop,
372 struct mpath_info *pinfo); 391 struct mpath_info *pinfo);
392
393 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
394 struct bss_parameters *params);
373}; 395};
374 396
375#endif /* __NET_CFG80211_H */ 397#endif /* __NET_CFG80211_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0fdc3dabc96..7c399a9c11d 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -158,12 +158,14 @@ struct ieee80211_low_level_stats {
158 * also implies a change in the AID. 158 * also implies a change in the AID.
159 * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed 159 * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed
160 * @BSS_CHANGED_ERP_PREAMBLE: preamble changed 160 * @BSS_CHANGED_ERP_PREAMBLE: preamble changed
161 * @BSS_CHANGED_ERP_SLOT: slot timing changed
161 * @BSS_CHANGED_HT: 802.11n parameters changed 162 * @BSS_CHANGED_HT: 802.11n parameters changed
162 */ 163 */
163enum ieee80211_bss_change { 164enum ieee80211_bss_change {
164 BSS_CHANGED_ASSOC = 1<<0, 165 BSS_CHANGED_ASSOC = 1<<0,
165 BSS_CHANGED_ERP_CTS_PROT = 1<<1, 166 BSS_CHANGED_ERP_CTS_PROT = 1<<1,
166 BSS_CHANGED_ERP_PREAMBLE = 1<<2, 167 BSS_CHANGED_ERP_PREAMBLE = 1<<2,
168 BSS_CHANGED_ERP_SLOT = 1<<3,
167 BSS_CHANGED_HT = 1<<4, 169 BSS_CHANGED_HT = 1<<4,
168}; 170};
169 171
@@ -177,6 +179,7 @@ enum ieee80211_bss_change {
177 * @aid: association ID number, valid only when @assoc is true 179 * @aid: association ID number, valid only when @assoc is true
178 * @use_cts_prot: use CTS protection 180 * @use_cts_prot: use CTS protection
179 * @use_short_preamble: use 802.11b short preamble 181 * @use_short_preamble: use 802.11b short preamble
182 * @use_short_slot: use short slot time (only relevant for ERP)
180 * @dtim_period: num of beacons before the next DTIM, for PSM 183 * @dtim_period: num of beacons before the next DTIM, for PSM
181 * @timestamp: beacon timestamp 184 * @timestamp: beacon timestamp
182 * @beacon_int: beacon interval 185 * @beacon_int: beacon interval
@@ -192,6 +195,7 @@ struct ieee80211_bss_conf {
192 /* erp related data */ 195 /* erp related data */
193 bool use_cts_prot; 196 bool use_cts_prot;
194 bool use_short_preamble; 197 bool use_short_preamble;
198 bool use_short_slot;
195 u8 dtim_period; 199 u8 dtim_period;
196 u16 beacon_int; 200 u16 beacon_int;
197 u16 assoc_capability; 201 u16 assoc_capability;
@@ -420,6 +424,11 @@ struct ieee80211_rx_status {
420 * @IEEE80211_CONF_PS: Enable 802.11 power save mode 424 * @IEEE80211_CONF_PS: Enable 802.11 power save mode
421 */ 425 */
422enum ieee80211_conf_flags { 426enum ieee80211_conf_flags {
427 /*
428 * TODO: IEEE80211_CONF_SHORT_SLOT_TIME will be removed once drivers
429 * have been converted to use bss_info_changed() for slot time
430 * configuration
431 */
423 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), 432 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0),
424 IEEE80211_CONF_RADIOTAP = (1<<1), 433 IEEE80211_CONF_RADIOTAP = (1<<1),
425 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), 434 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2),