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.h142
1 files changed, 130 insertions, 12 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0e85ec39b638..23c0ab74ded6 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -5,6 +5,8 @@
5#include <linux/skbuff.h> 5#include <linux/skbuff.h>
6#include <linux/nl80211.h> 6#include <linux/nl80211.h>
7#include <net/genetlink.h> 7#include <net/genetlink.h>
8/* remove once we remove the wext stuff */
9#include <net/iw_handler.h>
8 10
9/* 11/*
10 * 802.11 configuration in-kernel interface 12 * 802.11 configuration in-kernel interface
@@ -167,6 +169,9 @@ struct station_parameters {
167 * @STATION_INFO_LLID: @llid filled 169 * @STATION_INFO_LLID: @llid filled
168 * @STATION_INFO_PLID: @plid filled 170 * @STATION_INFO_PLID: @plid filled
169 * @STATION_INFO_PLINK_STATE: @plink_state filled 171 * @STATION_INFO_PLINK_STATE: @plink_state filled
172 * @STATION_INFO_SIGNAL: @signal filled
173 * @STATION_INFO_TX_BITRATE: @tx_bitrate fields are filled
174 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
170 */ 175 */
171enum station_info_flags { 176enum station_info_flags {
172 STATION_INFO_INACTIVE_TIME = 1<<0, 177 STATION_INFO_INACTIVE_TIME = 1<<0,
@@ -175,6 +180,39 @@ enum station_info_flags {
175 STATION_INFO_LLID = 1<<3, 180 STATION_INFO_LLID = 1<<3,
176 STATION_INFO_PLID = 1<<4, 181 STATION_INFO_PLID = 1<<4,
177 STATION_INFO_PLINK_STATE = 1<<5, 182 STATION_INFO_PLINK_STATE = 1<<5,
183 STATION_INFO_SIGNAL = 1<<6,
184 STATION_INFO_TX_BITRATE = 1<<7,
185};
186
187/**
188 * enum station_info_rate_flags - bitrate info flags
189 *
190 * Used by the driver to indicate the specific rate transmission
191 * type for 802.11n transmissions.
192 *
193 * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled
194 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission
195 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
196 */
197enum rate_info_flags {
198 RATE_INFO_FLAGS_MCS = 1<<0,
199 RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1,
200 RATE_INFO_FLAGS_SHORT_GI = 1<<2,
201};
202
203/**
204 * struct rate_info - bitrate information
205 *
206 * Information about a receiving or transmitting bitrate
207 *
208 * @flags: bitflag of flags from &enum rate_info_flags
209 * @mcs: mcs index if struct describes a 802.11n bitrate
210 * @legacy: bitrate in 100kbit/s for 802.11abg
211 */
212struct rate_info {
213 u8 flags;
214 u8 mcs;
215 u16 legacy;
178}; 216};
179 217
180/** 218/**
@@ -189,6 +227,8 @@ enum station_info_flags {
189 * @llid: mesh local link id 227 * @llid: mesh local link id
190 * @plid: mesh peer link id 228 * @plid: mesh peer link id
191 * @plink_state: mesh peer link state 229 * @plink_state: mesh peer link state
230 * @signal: signal strength of last received packet in dBm
231 * @txrate: current unicast bitrate to this station
192 */ 232 */
193struct station_info { 233struct station_info {
194 u32 filled; 234 u32 filled;
@@ -198,6 +238,8 @@ struct station_info {
198 u16 llid; 238 u16 llid;
199 u16 plid; 239 u16 plid;
200 u8 plink_state; 240 u8 plink_state;
241 s8 signal;
242 struct rate_info txrate;
201}; 243};
202 244
203/** 245/**
@@ -280,11 +322,16 @@ struct mpath_info {
280 * (0 = no, 1 = yes, -1 = do not change) 322 * (0 = no, 1 = yes, -1 = do not change)
281 * @use_short_slot_time: Whether the use of short slot time is allowed 323 * @use_short_slot_time: Whether the use of short slot time is allowed
282 * (0 = no, 1 = yes, -1 = do not change) 324 * (0 = no, 1 = yes, -1 = do not change)
325 * @basic_rates: basic rates in IEEE 802.11 format
326 * (or NULL for no change)
327 * @basic_rates_len: number of basic rates
283 */ 328 */
284struct bss_parameters { 329struct bss_parameters {
285 int use_cts_prot; 330 int use_cts_prot;
286 int use_short_preamble; 331 int use_short_preamble;
287 int use_short_slot_time; 332 int use_short_slot_time;
333 u8 *basic_rates;
334 u8 basic_rates_len;
288}; 335};
289 336
290/** 337/**
@@ -331,25 +378,65 @@ struct ieee80211_regdomain {
331 struct ieee80211_reg_rule reg_rules[]; 378 struct ieee80211_reg_rule reg_rules[];
332}; 379};
333 380
334#define MHZ_TO_KHZ(freq) (freq * 1000) 381#define MHZ_TO_KHZ(freq) ((freq) * 1000)
335#define KHZ_TO_MHZ(freq) (freq / 1000) 382#define KHZ_TO_MHZ(freq) ((freq) / 1000)
336#define DBI_TO_MBI(gain) (gain * 100) 383#define DBI_TO_MBI(gain) ((gain) * 100)
337#define MBI_TO_DBI(gain) (gain / 100) 384#define MBI_TO_DBI(gain) ((gain) / 100)
338#define DBM_TO_MBM(gain) (gain * 100) 385#define DBM_TO_MBM(gain) ((gain) * 100)
339#define MBM_TO_DBM(gain) (gain / 100) 386#define MBM_TO_DBM(gain) ((gain) / 100)
340 387
341#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \ 388#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \
342 .freq_range.start_freq_khz = (start) * 1000, \ 389 .freq_range.start_freq_khz = MHZ_TO_KHZ(start), \
343 .freq_range.end_freq_khz = (end) * 1000, \ 390 .freq_range.end_freq_khz = MHZ_TO_KHZ(end), \
344 .freq_range.max_bandwidth_khz = (bw) * 1000, \ 391 .freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw), \
345 .power_rule.max_antenna_gain = (gain) * 100, \ 392 .power_rule.max_antenna_gain = DBI_TO_MBI(gain), \
346 .power_rule.max_eirp = (eirp) * 100, \ 393 .power_rule.max_eirp = DBM_TO_MBM(eirp), \
347 .flags = reg_flags, \ 394 .flags = reg_flags, \
348 } 395 }
349 396
397struct mesh_config {
398 /* Timeouts in ms */
399 /* Mesh plink management parameters */
400 u16 dot11MeshRetryTimeout;
401 u16 dot11MeshConfirmTimeout;
402 u16 dot11MeshHoldingTimeout;
403 u16 dot11MeshMaxPeerLinks;
404 u8 dot11MeshMaxRetries;
405 u8 dot11MeshTTL;
406 bool auto_open_plinks;
407 /* HWMP parameters */
408 u8 dot11MeshHWMPmaxPREQretries;
409 u32 path_refresh_time;
410 u16 min_discovery_timeout;
411 u32 dot11MeshHWMPactivePathTimeout;
412 u16 dot11MeshHWMPpreqMinInterval;
413 u16 dot11MeshHWMPnetDiameterTraversalTime;
414};
415
416/**
417 * struct ieee80211_txq_params - TX queue parameters
418 * @queue: TX queue identifier (NL80211_TXQ_Q_*)
419 * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled
420 * @cwmin: Minimum contention window [a value of the form 2^n-1 in the range
421 * 1..32767]
422 * @cwmax: Maximum contention window [a value of the form 2^n-1 in the range
423 * 1..32767]
424 * @aifs: Arbitration interframe space [0..255]
425 */
426struct ieee80211_txq_params {
427 enum nl80211_txq_q queue;
428 u16 txop;
429 u16 cwmin;
430 u16 cwmax;
431 u8 aifs;
432};
433
350/* from net/wireless.h */ 434/* from net/wireless.h */
351struct wiphy; 435struct wiphy;
352 436
437/* from net/ieee80211.h */
438struct ieee80211_channel;
439
353/** 440/**
354 * struct cfg80211_ops - backend description for wireless configuration 441 * struct cfg80211_ops - backend description for wireless configuration
355 * 442 *
@@ -397,9 +484,19 @@ struct wiphy;
397 * 484 *
398 * @change_station: Modify a given station. 485 * @change_station: Modify a given station.
399 * 486 *
487 * @get_mesh_params: Put the current mesh parameters into *params
488 *
489 * @set_mesh_params: Set mesh parameters.
490 * The mask is a bitfield which tells us which parameters to
491 * set, and which to leave alone.
492 *
400 * @set_mesh_cfg: set mesh parameters (by now, just mesh id) 493 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
401 * 494 *
402 * @change_bss: Modify parameters for a given BSS. 495 * @change_bss: Modify parameters for a given BSS.
496 *
497 * @set_txq_params: Set TX queue parameters
498 *
499 * @set_channel: Set channel
403 */ 500 */
404struct cfg80211_ops { 501struct cfg80211_ops {
405 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 502 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
@@ -452,9 +549,30 @@ struct cfg80211_ops {
452 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, 549 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
453 int idx, u8 *dst, u8 *next_hop, 550 int idx, u8 *dst, u8 *next_hop,
454 struct mpath_info *pinfo); 551 struct mpath_info *pinfo);
455 552 int (*get_mesh_params)(struct wiphy *wiphy,
553 struct net_device *dev,
554 struct mesh_config *conf);
555 int (*set_mesh_params)(struct wiphy *wiphy,
556 struct net_device *dev,
557 const struct mesh_config *nconf, u32 mask);
456 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, 558 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
457 struct bss_parameters *params); 559 struct bss_parameters *params);
560
561 int (*set_txq_params)(struct wiphy *wiphy,
562 struct ieee80211_txq_params *params);
563
564 int (*set_channel)(struct wiphy *wiphy,
565 struct ieee80211_channel *chan,
566 enum nl80211_channel_type channel_type);
458}; 567};
459 568
569/* temporary wext handlers */
570int cfg80211_wext_giwname(struct net_device *dev,
571 struct iw_request_info *info,
572 char *name, char *extra);
573int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
574 u32 *mode, char *extra);
575int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
576 u32 *mode, char *extra);
577
460#endif /* __NET_CFG80211_H */ 578#endif /* __NET_CFG80211_H */