aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/cfg80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r--include/net/cfg80211.h89
1 files changed, 87 insertions, 2 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e00750836ba5..0e85ec39b638 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -152,6 +152,7 @@ struct station_parameters {
152 u16 aid; 152 u16 aid;
153 u8 supported_rates_len; 153 u8 supported_rates_len;
154 u8 plink_action; 154 u8 plink_action;
155 struct ieee80211_ht_cap *ht_capa;
155}; 156};
156 157
157/** 158/**
@@ -268,6 +269,83 @@ struct mpath_info {
268 u8 flags; 269 u8 flags;
269}; 270};
270 271
272/**
273 * struct bss_parameters - BSS parameters
274 *
275 * Used to change BSS parameters (mainly for AP mode).
276 *
277 * @use_cts_prot: Whether to use CTS protection
278 * (0 = no, 1 = yes, -1 = do not change)
279 * @use_short_preamble: Whether the use of short preambles is allowed
280 * (0 = no, 1 = yes, -1 = do not change)
281 * @use_short_slot_time: Whether the use of short slot time is allowed
282 * (0 = no, 1 = yes, -1 = do not change)
283 */
284struct bss_parameters {
285 int use_cts_prot;
286 int use_short_preamble;
287 int use_short_slot_time;
288};
289
290/**
291 * enum reg_set_by - Indicates who is trying to set the regulatory domain
292 * @REGDOM_SET_BY_INIT: regulatory domain was set by initialization. We will be
293 * using a static world regulatory domain by default.
294 * @REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world regulatory domain.
295 * @REGDOM_SET_BY_USER: User asked the wireless core to set the
296 * regulatory domain.
297 * @REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the wireless core
298 * it thinks its knows the regulatory domain we should be in.
299 * @REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an 802.11 country
300 * information element with regulatory information it thinks we
301 * should consider.
302 */
303enum reg_set_by {
304 REGDOM_SET_BY_INIT,
305 REGDOM_SET_BY_CORE,
306 REGDOM_SET_BY_USER,
307 REGDOM_SET_BY_DRIVER,
308 REGDOM_SET_BY_COUNTRY_IE,
309};
310
311struct ieee80211_freq_range {
312 u32 start_freq_khz;
313 u32 end_freq_khz;
314 u32 max_bandwidth_khz;
315};
316
317struct ieee80211_power_rule {
318 u32 max_antenna_gain;
319 u32 max_eirp;
320};
321
322struct ieee80211_reg_rule {
323 struct ieee80211_freq_range freq_range;
324 struct ieee80211_power_rule power_rule;
325 u32 flags;
326};
327
328struct ieee80211_regdomain {
329 u32 n_reg_rules;
330 char alpha2[2];
331 struct ieee80211_reg_rule reg_rules[];
332};
333
334#define MHZ_TO_KHZ(freq) (freq * 1000)
335#define KHZ_TO_MHZ(freq) (freq / 1000)
336#define DBI_TO_MBI(gain) (gain * 100)
337#define MBI_TO_DBI(gain) (gain / 100)
338#define DBM_TO_MBM(gain) (gain * 100)
339#define MBM_TO_DBM(gain) (gain / 100)
340
341#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \
342 .freq_range.start_freq_khz = (start) * 1000, \
343 .freq_range.end_freq_khz = (end) * 1000, \
344 .freq_range.max_bandwidth_khz = (bw) * 1000, \
345 .power_rule.max_antenna_gain = (gain) * 100, \
346 .power_rule.max_eirp = (eirp) * 100, \
347 .flags = reg_flags, \
348 }
271 349
272/* from net/wireless.h */ 350/* from net/wireless.h */
273struct wiphy; 351struct wiphy;
@@ -285,11 +363,13 @@ struct wiphy;
285 * wireless extensions but this is subject to reevaluation as soon as this 363 * wireless extensions but this is subject to reevaluation as soon as this
286 * code is used more widely and we have a first user without wext. 364 * code is used more widely and we have a first user without wext.
287 * 365 *
288 * @add_virtual_intf: create a new virtual interface with the given name 366 * @add_virtual_intf: create a new virtual interface with the given name,
367 * must set the struct wireless_dev's iftype.
289 * 368 *
290 * @del_virtual_intf: remove the virtual interface determined by ifindex. 369 * @del_virtual_intf: remove the virtual interface determined by ifindex.
291 * 370 *
292 * @change_virtual_intf: change type of virtual interface 371 * @change_virtual_intf: change type/configuration of virtual interface,
372 * keep the struct wireless_dev's iftype updated.
293 * 373 *
294 * @add_key: add a key with the given parameters. @mac_addr will be %NULL 374 * @add_key: add a key with the given parameters. @mac_addr will be %NULL
295 * when adding a group key. 375 * when adding a group key.
@@ -318,6 +398,8 @@ struct wiphy;
318 * @change_station: Modify a given station. 398 * @change_station: Modify a given station.
319 * 399 *
320 * @set_mesh_cfg: set mesh parameters (by now, just mesh id) 400 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
401 *
402 * @change_bss: Modify parameters for a given BSS.
321 */ 403 */
322struct cfg80211_ops { 404struct cfg80211_ops {
323 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 405 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
@@ -370,6 +452,9 @@ struct cfg80211_ops {
370 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, 452 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
371 int idx, u8 *dst, u8 *next_hop, 453 int idx, u8 *dst, u8 *next_hop,
372 struct mpath_info *pinfo); 454 struct mpath_info *pinfo);
455
456 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
457 struct bss_parameters *params);
373}; 458};
374 459
375#endif /* __NET_CFG80211_H */ 460#endif /* __NET_CFG80211_H */