aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h272
1 files changed, 220 insertions, 52 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 17b60391fcd6..9083bafb63ca 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -139,17 +139,54 @@ enum ieee80211_phymode {
139}; 139};
140 140
141/** 141/**
142 * struct ieee80211_ht_info - describing STA's HT capabilities
143 *
144 * This structure describes most essential parameters needed
145 * to describe 802.11n HT capabilities for an STA.
146 *
147 * @ht_supported: is HT supported by STA, 0: no, 1: yes
148 * @cap: HT capabilities map as described in 802.11n spec
149 * @ampdu_factor: Maximum A-MPDU length factor
150 * @ampdu_density: Minimum A-MPDU spacing
151 * @supp_mcs_set: Supported MCS set as described in 802.11n spec
152 */
153struct ieee80211_ht_info {
154 u8 ht_supported;
155 u16 cap; /* use IEEE80211_HT_CAP_ */
156 u8 ampdu_factor;
157 u8 ampdu_density;
158 u8 supp_mcs_set[16];
159};
160
161/**
162 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
163 *
164 * This structure describes most essential parameters needed
165 * to describe 802.11n HT characteristics in a BSS
166 *
167 * @primary_channel: channel number of primery channel
168 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width)
169 * @bss_op_mode: 802.11n's BSS operation modes (e.g. HT protection)
170 */
171struct ieee80211_ht_bss_info {
172 u8 primary_channel;
173 u8 bss_cap; /* use IEEE80211_HT_IE_CHA_ */
174 u8 bss_op_mode; /* use IEEE80211_HT_IE_ */
175};
176
177/**
142 * struct ieee80211_hw_mode - PHY mode definition 178 * struct ieee80211_hw_mode - PHY mode definition
143 * 179 *
144 * This structure describes the capabilities supported by the device 180 * This structure describes the capabilities supported by the device
145 * in a single PHY mode. 181 * in a single PHY mode.
146 * 182 *
183 * @list: internal
184 * @channels: pointer to array of supported channels
185 * @rates: pointer to array of supported bitrates
147 * @mode: the PHY mode for this definition 186 * @mode: the PHY mode for this definition
148 * @num_channels: number of supported channels 187 * @num_channels: number of supported channels
149 * @channels: pointer to array of supported channels
150 * @num_rates: number of supported bitrates 188 * @num_rates: number of supported bitrates
151 * @rates: pointer to array of supported bitrates 189 * @ht_info: PHY's 802.11n HT abilities for this mode
152 * @list: internal
153 */ 190 */
154struct ieee80211_hw_mode { 191struct ieee80211_hw_mode {
155 struct list_head list; 192 struct list_head list;
@@ -158,6 +195,7 @@ struct ieee80211_hw_mode {
158 enum ieee80211_phymode mode; 195 enum ieee80211_phymode mode;
159 int num_channels; 196 int num_channels;
160 int num_rates; 197 int num_rates;
198 struct ieee80211_ht_info ht_info;
161}; 199};
162 200
163/** 201/**
@@ -237,11 +275,49 @@ struct ieee80211_low_level_stats {
237 unsigned int dot11RTSSuccessCount; 275 unsigned int dot11RTSSuccessCount;
238}; 276};
239 277
278/**
279 * enum ieee80211_bss_change - BSS change notification flags
280 *
281 * These flags are used with the bss_info_changed() callback
282 * to indicate which BSS parameter changed.
283 *
284 * @BSS_CHANGED_ASSOC: association status changed (associated/disassociated),
285 * also implies a change in the AID.
286 * @BSS_CHANGED_ERP_CTS_PROT: CTS protection changed
287 * @BSS_CHANGED_ERP_PREAMBLE: preamble changed
288 */
289enum ieee80211_bss_change {
290 BSS_CHANGED_ASSOC = 1<<0,
291 BSS_CHANGED_ERP_CTS_PROT = 1<<1,
292 BSS_CHANGED_ERP_PREAMBLE = 1<<2,
293};
294
295/**
296 * struct ieee80211_bss_conf - holds the BSS's changing parameters
297 *
298 * This structure keeps information about a BSS (and an association
299 * to that BSS) that can change during the lifetime of the BSS.
300 *
301 * @assoc: association status
302 * @aid: association ID number, valid only when @assoc is true
303 * @use_cts_prot: use CTS protection
304 * @use_short_preamble: use 802.11b short preamble
305 */
306struct ieee80211_bss_conf {
307 /* association related data */
308 bool assoc;
309 u16 aid;
310 /* erp related data */
311 bool use_cts_prot;
312 bool use_short_preamble;
313};
314
240/* Transmit control fields. This data structure is passed to low-level driver 315/* Transmit control fields. This data structure is passed to low-level driver
241 * with each TX frame. The low-level driver is responsible for configuring 316 * with each TX frame. The low-level driver is responsible for configuring
242 * the hardware to use given values (depending on what is supported). */ 317 * the hardware to use given values (depending on what is supported). */
243 318
244struct ieee80211_tx_control { 319struct ieee80211_tx_control {
320 struct ieee80211_vif *vif;
245 int tx_rate; /* Transmit rate, given as the hw specific value for the 321 int tx_rate; /* Transmit rate, given as the hw specific value for the
246 * rate (from struct ieee80211_rate) */ 322 * rate (from struct ieee80211_rate) */
247 int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw 323 int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw
@@ -269,6 +345,9 @@ struct ieee80211_tx_control {
269 * using the through 345 * using the through
270 * set_retry_limit configured 346 * set_retry_limit configured
271 * long retry value */ 347 * long retry value */
348#define IEEE80211_TXCTL_EAPOL_FRAME (1<<11) /* internal to mac80211 */
349#define IEEE80211_TXCTL_SEND_AFTER_DTIM (1<<12) /* send this frame after DTIM
350 * beacon */
272 u32 flags; /* tx control flags defined 351 u32 flags; /* tx control flags defined
273 * above */ 352 * above */
274 u8 key_idx; /* keyidx from hw->set_key(), undefined if 353 u8 key_idx; /* keyidx from hw->set_key(), undefined if
@@ -291,7 +370,6 @@ struct ieee80211_tx_control {
291 * packet dropping when probing higher rates, if hw 370 * packet dropping when probing higher rates, if hw
292 * supports multiple retry rates. -1 = not used */ 371 * supports multiple retry rates. -1 = not used */
293 int type; /* internal */ 372 int type; /* internal */
294 int ifindex; /* internal */
295}; 373};
296 374
297 375
@@ -312,6 +390,8 @@ struct ieee80211_tx_control {
312 * the frame. 390 * the frame.
313 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on 391 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
314 * the frame. 392 * the frame.
393 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field)
394 * is valid.
315 */ 395 */
316enum mac80211_rx_flags { 396enum mac80211_rx_flags {
317 RX_FLAG_MMIC_ERROR = 1<<0, 397 RX_FLAG_MMIC_ERROR = 1<<0,
@@ -321,6 +401,7 @@ enum mac80211_rx_flags {
321 RX_FLAG_IV_STRIPPED = 1<<4, 401 RX_FLAG_IV_STRIPPED = 1<<4,
322 RX_FLAG_FAILED_FCS_CRC = 1<<5, 402 RX_FLAG_FAILED_FCS_CRC = 1<<5,
323 RX_FLAG_FAILED_PLCP_CRC = 1<<6, 403 RX_FLAG_FAILED_PLCP_CRC = 1<<6,
404 RX_FLAG_TSFT = 1<<7,
324}; 405};
325 406
326/** 407/**
@@ -406,11 +487,12 @@ struct ieee80211_tx_status {
406 * 487 *
407 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time 488 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
408 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) 489 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
409 * 490 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
410 */ 491 */
411enum ieee80211_conf_flags { 492enum ieee80211_conf_flags {
412 IEEE80211_CONF_SHORT_SLOT_TIME = 1<<0, 493 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0),
413 IEEE80211_CONF_RADIOTAP = 1<<1, 494 IEEE80211_CONF_RADIOTAP = (1<<1),
495 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2),
414}; 496};
415 497
416/** 498/**
@@ -434,6 +516,8 @@ enum ieee80211_conf_flags {
434 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity, 516 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
435 * 1/2: antenna 0/1 517 * 1/2: antenna 0/1
436 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx 518 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
519 * @ht_conf: describes current self configuration of 802.11n HT capabilies
520 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
437 */ 521 */
438struct ieee80211_conf { 522struct ieee80211_conf {
439 int channel; /* IEEE 802.11 channel number */ 523 int channel; /* IEEE 802.11 channel number */
@@ -452,6 +536,9 @@ struct ieee80211_conf {
452 u8 antenna_max; 536 u8 antenna_max;
453 u8 antenna_sel_tx; 537 u8 antenna_sel_tx;
454 u8 antenna_sel_rx; 538 u8 antenna_sel_rx;
539
540 struct ieee80211_ht_info ht_conf;
541 struct ieee80211_ht_bss_info ht_bss_conf;
455}; 542};
456 543
457/** 544/**
@@ -480,13 +567,27 @@ enum ieee80211_if_types {
480}; 567};
481 568
482/** 569/**
570 * struct ieee80211_vif - per-interface data
571 *
572 * Data in this structure is continually present for driver
573 * use during the life of a virtual interface.
574 *
575 * @type: type of this virtual interface
576 * @drv_priv: data area for driver use, will always be aligned to
577 * sizeof(void *).
578 */
579struct ieee80211_vif {
580 enum ieee80211_if_types type;
581 /* must be last */
582 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
583};
584
585/**
483 * struct ieee80211_if_init_conf - initial configuration of an interface 586 * struct ieee80211_if_init_conf - initial configuration of an interface
484 * 587 *
485 * @if_id: internal interface ID. This number has no particular meaning to 588 * @vif: pointer to a driver-use per-interface structure. The pointer
486 * drivers and the only allowed usage is to pass it to 589 * itself is also used for various functions including
487 * ieee80211_beacon_get() and ieee80211_get_buffered_bc() functions. 590 * ieee80211_beacon_get() and ieee80211_get_buffered_bc().
488 * This field is not valid for monitor interfaces
489 * (interfaces of %IEEE80211_IF_TYPE_MNTR type).
490 * @type: one of &enum ieee80211_if_types constants. Determines the type of 591 * @type: one of &enum ieee80211_if_types constants. Determines the type of
491 * added/removed interface. 592 * added/removed interface.
492 * @mac_addr: pointer to MAC address of the interface. This pointer is valid 593 * @mac_addr: pointer to MAC address of the interface. This pointer is valid
@@ -503,8 +604,8 @@ enum ieee80211_if_types {
503 * in pure monitor mode. 604 * in pure monitor mode.
504 */ 605 */
505struct ieee80211_if_init_conf { 606struct ieee80211_if_init_conf {
506 int if_id;
507 enum ieee80211_if_types type; 607 enum ieee80211_if_types type;
608 struct ieee80211_vif *vif;
508 void *mac_addr; 609 void *mac_addr;
509}; 610};
510 611
@@ -597,9 +698,6 @@ struct ieee80211_key_conf {
597 u8 key[0]; 698 u8 key[0];
598}; 699};
599 700
600#define IEEE80211_SEQ_COUNTER_RX 0
601#define IEEE80211_SEQ_COUNTER_TX 1
602
603/** 701/**
604 * enum set_key_cmd - key command 702 * enum set_key_cmd - key command
605 * 703 *
@@ -710,6 +808,9 @@ enum ieee80211_hw_flags {
710 * @rate_control_algorithm: rate control algorithm for this hardware. 808 * @rate_control_algorithm: rate control algorithm for this hardware.
711 * If unset (NULL), the default algorithm will be used. Must be 809 * If unset (NULL), the default algorithm will be used. Must be
712 * set before calling ieee80211_register_hw(). 810 * set before calling ieee80211_register_hw().
811 *
812 * @vif_data_size: size (in bytes) of the drv_priv data area
813 * within &struct ieee80211_vif.
713 */ 814 */
714struct ieee80211_hw { 815struct ieee80211_hw {
715 struct ieee80211_conf conf; 816 struct ieee80211_conf conf;
@@ -720,6 +821,7 @@ struct ieee80211_hw {
720 u32 flags; 821 u32 flags;
721 unsigned int extra_tx_headroom; 822 unsigned int extra_tx_headroom;
722 int channel_change_time; 823 int channel_change_time;
824 int vif_data_size;
723 u8 queues; 825 u8 queues;
724 s8 max_rssi; 826 s8 max_rssi;
725 s8 max_signal; 827 s8 max_signal;
@@ -859,19 +961,18 @@ enum ieee80211_filter_flags {
859}; 961};
860 962
861/** 963/**
862 * enum ieee80211_erp_change_flags - erp change flags 964 * enum ieee80211_ampdu_mlme_action - A-MPDU actions
863 * 965 *
864 * These flags are used with the erp_ie_changed() callback in 966 * These flags are used with the ampdu_action() callback in
865 * &struct ieee80211_ops to indicate which parameter(s) changed. 967 * &struct ieee80211_ops to indicate which action is needed.
866 * @IEEE80211_ERP_CHANGE_PROTECTION: protection changed 968 * @IEEE80211_AMPDU_RX_START: start Rx aggregation
867 * @IEEE80211_ERP_CHANGE_PREAMBLE: barker preamble mode changed 969 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
868 */ 970 */
869enum ieee80211_erp_change_flags { 971enum ieee80211_ampdu_mlme_action {
870 IEEE80211_ERP_CHANGE_PROTECTION = 1<<0, 972 IEEE80211_AMPDU_RX_START,
871 IEEE80211_ERP_CHANGE_PREAMBLE = 1<<1, 973 IEEE80211_AMPDU_RX_STOP,
872}; 974};
873 975
874
875/** 976/**
876 * struct ieee80211_ops - callbacks from mac80211 to the driver 977 * struct ieee80211_ops - callbacks from mac80211 to the driver
877 * 978 *
@@ -927,6 +1028,14 @@ enum ieee80211_erp_change_flags {
927 * @config_interface: Handler for configuration requests related to interfaces 1028 * @config_interface: Handler for configuration requests related to interfaces
928 * (e.g. BSSID changes.) 1029 * (e.g. BSSID changes.)
929 * 1030 *
1031 * @bss_info_changed: Handler for configuration requests related to BSS
1032 * parameters that may vary during BSS's lifespan, and may affect low
1033 * level driver (e.g. assoc/disassoc status, erp parameters).
1034 * This function should not be used if no BSS has been set, unless
1035 * for association indication. The @changed parameter indicates which
1036 * of the bss parameters has changed when a call is made. This callback
1037 * has to be atomic.
1038 *
930 * @configure_filter: Configure the device's RX filter. 1039 * @configure_filter: Configure the device's RX filter.
931 * See the section "Frame filtering" for more information. 1040 * See the section "Frame filtering" for more information.
932 * This callback must be implemented and atomic. 1041 * This callback must be implemented and atomic.
@@ -946,9 +1055,9 @@ enum ieee80211_erp_change_flags {
946 * 1055 *
947 * @get_stats: return low-level statistics 1056 * @get_stats: return low-level statistics
948 * 1057 *
949 * @get_sequence_counter: For devices that have internal sequence counters this 1058 * @get_tkip_seq: If your device implements TKIP encryption in hardware this
950 * callback allows mac80211 to access the current value of a counter. 1059 * callback should be provided to read the TKIP transmit IVs (both IV32
951 * This callback seems not well-defined, tell us if you need it. 1060 * and IV16) for the given key from hardware.
952 * 1061 *
953 * @set_rts_threshold: Configuration of RTS threshold (if device needs it) 1062 * @set_rts_threshold: Configuration of RTS threshold (if device needs it)
954 * 1063 *
@@ -961,8 +1070,6 @@ enum ieee80211_erp_change_flags {
961 * @sta_notify: Notifies low level driver about addition or removal 1070 * @sta_notify: Notifies low level driver about addition or removal
962 * of assocaited station or AP. 1071 * of assocaited station or AP.
963 * 1072 *
964 * @erp_ie_changed: Handle ERP IE change notifications. Must be atomic.
965 *
966 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1073 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
967 * bursting) for a hardware TX queue. The @queue parameter uses the 1074 * bursting) for a hardware TX queue. The @queue parameter uses the
968 * %IEEE80211_TX_QUEUE_* constants. Must be atomic. 1075 * %IEEE80211_TX_QUEUE_* constants. Must be atomic.
@@ -997,6 +1104,14 @@ enum ieee80211_erp_change_flags {
997 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. 1104 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
998 * This is needed only for IBSS mode and the result of this function is 1105 * This is needed only for IBSS mode and the result of this function is
999 * used to determine whether to reply to Probe Requests. 1106 * used to determine whether to reply to Probe Requests.
1107 *
1108 * @conf_ht: Configures low level driver with 802.11n HT data. Must be atomic.
1109 *
1110 * @ampdu_action: Perform a certain A-MPDU action
1111 * The RA/TID combination determines the destination and TID we want
1112 * the ampdu action to be performed for. The action is defined through
1113 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn)
1114 * is the first frame we expect to perform the action on.
1000 */ 1115 */
1001struct ieee80211_ops { 1116struct ieee80211_ops {
1002 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, 1117 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
@@ -1009,7 +1124,12 @@ struct ieee80211_ops {
1009 struct ieee80211_if_init_conf *conf); 1124 struct ieee80211_if_init_conf *conf);
1010 int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 1125 int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
1011 int (*config_interface)(struct ieee80211_hw *hw, 1126 int (*config_interface)(struct ieee80211_hw *hw,
1012 int if_id, struct ieee80211_if_conf *conf); 1127 struct ieee80211_vif *vif,
1128 struct ieee80211_if_conf *conf);
1129 void (*bss_info_changed)(struct ieee80211_hw *hw,
1130 struct ieee80211_vif *vif,
1131 struct ieee80211_bss_conf *info,
1132 u32 changed);
1013 void (*configure_filter)(struct ieee80211_hw *hw, 1133 void (*configure_filter)(struct ieee80211_hw *hw,
1014 unsigned int changed_flags, 1134 unsigned int changed_flags,
1015 unsigned int *total_flags, 1135 unsigned int *total_flags,
@@ -1021,17 +1141,14 @@ struct ieee80211_ops {
1021 int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); 1141 int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len);
1022 int (*get_stats)(struct ieee80211_hw *hw, 1142 int (*get_stats)(struct ieee80211_hw *hw,
1023 struct ieee80211_low_level_stats *stats); 1143 struct ieee80211_low_level_stats *stats);
1024 int (*get_sequence_counter)(struct ieee80211_hw *hw, 1144 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx,
1025 u8* addr, u8 keyidx, u8 txrx, 1145 u32 *iv32, u16 *iv16);
1026 u32* iv32, u16* iv16);
1027 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); 1146 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
1028 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); 1147 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
1029 int (*set_retry_limit)(struct ieee80211_hw *hw, 1148 int (*set_retry_limit)(struct ieee80211_hw *hw,
1030 u32 short_retry, u32 long_retr); 1149 u32 short_retry, u32 long_retr);
1031 void (*sta_notify)(struct ieee80211_hw *hw, int if_id, 1150 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1032 enum sta_notify_cmd, const u8 *addr); 1151 enum sta_notify_cmd, const u8 *addr);
1033 void (*erp_ie_changed)(struct ieee80211_hw *hw, u8 changes,
1034 int cts_protection, int preamble);
1035 int (*conf_tx)(struct ieee80211_hw *hw, int queue, 1152 int (*conf_tx)(struct ieee80211_hw *hw, int queue,
1036 const struct ieee80211_tx_queue_params *params); 1153 const struct ieee80211_tx_queue_params *params);
1037 int (*get_tx_stats)(struct ieee80211_hw *hw, 1154 int (*get_tx_stats)(struct ieee80211_hw *hw,
@@ -1042,6 +1159,10 @@ struct ieee80211_ops {
1042 struct sk_buff *skb, 1159 struct sk_buff *skb,
1043 struct ieee80211_tx_control *control); 1160 struct ieee80211_tx_control *control);
1044 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1161 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1162 int (*conf_ht)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
1163 int (*ampdu_action)(struct ieee80211_hw *hw,
1164 enum ieee80211_ampdu_mlme_action action,
1165 const u8 *ra, u16 tid, u16 ssn);
1045}; 1166};
1046 1167
1047/** 1168/**
@@ -1073,6 +1194,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw);
1073extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); 1194extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw);
1074extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); 1195extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw);
1075extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); 1196extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw);
1197extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw);
1076#endif 1198#endif
1077/** 1199/**
1078 * ieee80211_get_tx_led_name - get name of TX LED 1200 * ieee80211_get_tx_led_name - get name of TX LED
@@ -1112,6 +1234,16 @@ static inline char *ieee80211_get_rx_led_name(struct ieee80211_hw *hw)
1112#endif 1234#endif
1113} 1235}
1114 1236
1237/**
1238 * ieee80211_get_assoc_led_name - get name of association LED
1239 *
1240 * mac80211 creates a association LED trigger for each wireless hardware
1241 * that can be used to drive LEDs if your driver registers a LED device.
1242 * This function returns the name (or %NULL if not configured for LEDs)
1243 * of the trigger so you can automatically link the LED device.
1244 *
1245 * @hw: the hardware to get the LED trigger name for
1246 */
1115static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw) 1247static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw)
1116{ 1248{
1117#ifdef CONFIG_MAC80211_LEDS 1249#ifdef CONFIG_MAC80211_LEDS
@@ -1121,6 +1253,24 @@ static inline char *ieee80211_get_assoc_led_name(struct ieee80211_hw *hw)
1121#endif 1253#endif
1122} 1254}
1123 1255
1256/**
1257 * ieee80211_get_radio_led_name - get name of radio LED
1258 *
1259 * mac80211 creates a radio change LED trigger for each wireless hardware
1260 * that can be used to drive LEDs if your driver registers a LED device.
1261 * This function returns the name (or %NULL if not configured for LEDs)
1262 * of the trigger so you can automatically link the LED device.
1263 *
1264 * @hw: the hardware to get the LED trigger name for
1265 */
1266static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
1267{
1268#ifdef CONFIG_MAC80211_LEDS
1269 return __ieee80211_get_radio_led_name(hw);
1270#else
1271 return NULL;
1272#endif
1273}
1124 1274
1125/* Register a new hardware PHYMODE capability to the stack. */ 1275/* Register a new hardware PHYMODE capability to the stack. */
1126int ieee80211_register_hwmode(struct ieee80211_hw *hw, 1276int ieee80211_register_hwmode(struct ieee80211_hw *hw,
@@ -1210,7 +1360,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1210/** 1360/**
1211 * ieee80211_beacon_get - beacon generation function 1361 * ieee80211_beacon_get - beacon generation function
1212 * @hw: pointer obtained from ieee80211_alloc_hw(). 1362 * @hw: pointer obtained from ieee80211_alloc_hw().
1213 * @if_id: interface ID from &struct ieee80211_if_init_conf. 1363 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1214 * @control: will be filled with information needed to send this beacon. 1364 * @control: will be filled with information needed to send this beacon.
1215 * 1365 *
1216 * If the beacon frames are generated by the host system (i.e., not in 1366 * If the beacon frames are generated by the host system (i.e., not in
@@ -1221,13 +1371,13 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1221 * is responsible of freeing it. 1371 * is responsible of freeing it.
1222 */ 1372 */
1223struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 1373struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1224 int if_id, 1374 struct ieee80211_vif *vif,
1225 struct ieee80211_tx_control *control); 1375 struct ieee80211_tx_control *control);
1226 1376
1227/** 1377/**
1228 * ieee80211_rts_get - RTS frame generation function 1378 * ieee80211_rts_get - RTS frame generation function
1229 * @hw: pointer obtained from ieee80211_alloc_hw(). 1379 * @hw: pointer obtained from ieee80211_alloc_hw().
1230 * @if_id: interface ID from &struct ieee80211_if_init_conf. 1380 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1231 * @frame: pointer to the frame that is going to be protected by the RTS. 1381 * @frame: pointer to the frame that is going to be protected by the RTS.
1232 * @frame_len: the frame length (in octets). 1382 * @frame_len: the frame length (in octets).
1233 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1383 * @frame_txctl: &struct ieee80211_tx_control of the frame.
@@ -1238,7 +1388,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1238 * the next RTS frame from the 802.11 code. The low-level is responsible 1388 * the next RTS frame from the 802.11 code. The low-level is responsible
1239 * for calling this function before and RTS frame is needed. 1389 * for calling this function before and RTS frame is needed.
1240 */ 1390 */
1241void ieee80211_rts_get(struct ieee80211_hw *hw, int if_id, 1391void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1242 const void *frame, size_t frame_len, 1392 const void *frame, size_t frame_len,
1243 const struct ieee80211_tx_control *frame_txctl, 1393 const struct ieee80211_tx_control *frame_txctl,
1244 struct ieee80211_rts *rts); 1394 struct ieee80211_rts *rts);
@@ -1246,7 +1396,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, int if_id,
1246/** 1396/**
1247 * ieee80211_rts_duration - Get the duration field for an RTS frame 1397 * ieee80211_rts_duration - Get the duration field for an RTS frame
1248 * @hw: pointer obtained from ieee80211_alloc_hw(). 1398 * @hw: pointer obtained from ieee80211_alloc_hw().
1249 * @if_id: interface ID from &struct ieee80211_if_init_conf. 1399 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1250 * @frame_len: the length of the frame that is going to be protected by the RTS. 1400 * @frame_len: the length of the frame that is going to be protected by the RTS.
1251 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1401 * @frame_txctl: &struct ieee80211_tx_control of the frame.
1252 * 1402 *
@@ -1254,14 +1404,14 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, int if_id,
1254 * the duration field, the low-level driver uses this function to receive 1404 * the duration field, the low-level driver uses this function to receive
1255 * the duration field value in little-endian byteorder. 1405 * the duration field value in little-endian byteorder.
1256 */ 1406 */
1257__le16 ieee80211_rts_duration(struct ieee80211_hw *hw, int if_id, 1407__le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1258 size_t frame_len, 1408 struct ieee80211_vif *vif, size_t frame_len,
1259 const struct ieee80211_tx_control *frame_txctl); 1409 const struct ieee80211_tx_control *frame_txctl);
1260 1410
1261/** 1411/**
1262 * ieee80211_ctstoself_get - CTS-to-self frame generation function 1412 * ieee80211_ctstoself_get - CTS-to-self frame generation function
1263 * @hw: pointer obtained from ieee80211_alloc_hw(). 1413 * @hw: pointer obtained from ieee80211_alloc_hw().
1264 * @if_id: interface ID from &struct ieee80211_if_init_conf. 1414 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1265 * @frame: pointer to the frame that is going to be protected by the CTS-to-self. 1415 * @frame: pointer to the frame that is going to be protected by the CTS-to-self.
1266 * @frame_len: the frame length (in octets). 1416 * @frame_len: the frame length (in octets).
1267 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1417 * @frame_txctl: &struct ieee80211_tx_control of the frame.
@@ -1272,7 +1422,8 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, int if_id,
1272 * the next CTS-to-self frame from the 802.11 code. The low-level is responsible 1422 * the next CTS-to-self frame from the 802.11 code. The low-level is responsible
1273 * for calling this function before and CTS-to-self frame is needed. 1423 * for calling this function before and CTS-to-self frame is needed.
1274 */ 1424 */
1275void ieee80211_ctstoself_get(struct ieee80211_hw *hw, int if_id, 1425void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1426 struct ieee80211_vif *vif,
1276 const void *frame, size_t frame_len, 1427 const void *frame, size_t frame_len,
1277 const struct ieee80211_tx_control *frame_txctl, 1428 const struct ieee80211_tx_control *frame_txctl,
1278 struct ieee80211_cts *cts); 1429 struct ieee80211_cts *cts);
@@ -1280,7 +1431,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, int if_id,
1280/** 1431/**
1281 * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame 1432 * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame
1282 * @hw: pointer obtained from ieee80211_alloc_hw(). 1433 * @hw: pointer obtained from ieee80211_alloc_hw().
1283 * @if_id: interface ID from &struct ieee80211_if_init_conf. 1434 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1284 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. 1435 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self.
1285 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1436 * @frame_txctl: &struct ieee80211_tx_control of the frame.
1286 * 1437 *
@@ -1288,28 +1439,30 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, int if_id,
1288 * the duration field, the low-level driver uses this function to receive 1439 * the duration field, the low-level driver uses this function to receive
1289 * the duration field value in little-endian byteorder. 1440 * the duration field value in little-endian byteorder.
1290 */ 1441 */
1291__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, int if_id, 1442__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1443 struct ieee80211_vif *vif,
1292 size_t frame_len, 1444 size_t frame_len,
1293 const struct ieee80211_tx_control *frame_txctl); 1445 const struct ieee80211_tx_control *frame_txctl);
1294 1446
1295/** 1447/**
1296 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 1448 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
1297 * @hw: pointer obtained from ieee80211_alloc_hw(). 1449 * @hw: pointer obtained from ieee80211_alloc_hw().
1298 * @if_id: interface ID from &struct ieee80211_if_init_conf. 1450 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1299 * @frame_len: the length of the frame. 1451 * @frame_len: the length of the frame.
1300 * @rate: the rate (in 100kbps) at which the frame is going to be transmitted. 1452 * @rate: the rate (in 100kbps) at which the frame is going to be transmitted.
1301 * 1453 *
1302 * Calculate the duration field of some generic frame, given its 1454 * Calculate the duration field of some generic frame, given its
1303 * length and transmission rate (in 100kbps). 1455 * length and transmission rate (in 100kbps).
1304 */ 1456 */
1305__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, int if_id, 1457__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1458 struct ieee80211_vif *vif,
1306 size_t frame_len, 1459 size_t frame_len,
1307 int rate); 1460 int rate);
1308 1461
1309/** 1462/**
1310 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames 1463 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
1311 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1464 * @hw: pointer as obtained from ieee80211_alloc_hw().
1312 * @if_id: interface ID from &struct ieee80211_if_init_conf. 1465 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1313 * @control: will be filled with information needed to send returned frame. 1466 * @control: will be filled with information needed to send returned frame.
1314 * 1467 *
1315 * Function for accessing buffered broadcast and multicast frames. If 1468 * Function for accessing buffered broadcast and multicast frames. If
@@ -1328,7 +1481,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, int if_id,
1328 * use common code for all beacons. 1481 * use common code for all beacons.
1329 */ 1482 */
1330struct sk_buff * 1483struct sk_buff *
1331ieee80211_get_buffered_bc(struct ieee80211_hw *hw, int if_id, 1484ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1332 struct ieee80211_tx_control *control); 1485 struct ieee80211_tx_control *control);
1333 1486
1334/** 1487/**
@@ -1406,4 +1559,19 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
1406 */ 1559 */
1407void ieee80211_scan_completed(struct ieee80211_hw *hw); 1560void ieee80211_scan_completed(struct ieee80211_hw *hw);
1408 1561
1562/**
1563 * ieee80211_iterate_active_interfaces - iterate active interfaces
1564 *
1565 * This function iterates over the interfaces associated with a given
1566 * hardware that are currently active and calls the callback for them.
1567 *
1568 * @hw: the hardware struct of which the interfaces should be iterated over
1569 * @iterator: the iterator function to call, cannot sleep
1570 * @data: first argument of the iterator function
1571 */
1572void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
1573 void (*iterator)(void *data, u8 *mac,
1574 struct ieee80211_vif *vif),
1575 void *data);
1576
1409#endif /* MAC80211_H */ 1577#endif /* MAC80211_H */