mac80211.h (429a380571a6e6b8525b93161544eafc9b227e44) mac80211.h (6ef307bc561911c8cdda98ef3896b5982b602a43)
1/*
2 * mac80211 <-> driver interface
3 *
4 * Copyright 2002-2005, Devicescape Software, Inc.
5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
6 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 28 unchanged lines hidden (view full) ---

37 * Only ieee80211_tx_status_irqsafe() and ieee80211_rx_irqsafe() can be
38 * called in hardware interrupt context. The low-level driver must not call any
39 * other functions in hardware interrupt context. If there is a need for such
40 * call, the low-level driver should first ACK the interrupt and perform the
41 * IEEE 802.11 code call after this, e.g. from a scheduled workqueue or even
42 * tasklet function.
43 *
44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also
1/*
2 * mac80211 <-> driver interface
3 *
4 * Copyright 2002-2005, Devicescape Software, Inc.
5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
6 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 28 unchanged lines hidden (view full) ---

37 * Only ieee80211_tx_status_irqsafe() and ieee80211_rx_irqsafe() can be
38 * called in hardware interrupt context. The low-level driver must not call any
39 * other functions in hardware interrupt context. If there is a need for such
40 * call, the low-level driver should first ACK the interrupt and perform the
41 * IEEE 802.11 code call after this, e.g. from a scheduled workqueue or even
42 * tasklet function.
43 *
44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also
45 * use the non-irqsafe functions!
45 * use the non-IRQ-safe functions!
46 */
47
48/**
49 * DOC: Warning
50 *
51 * If you're reading this document and not the header file itself, it will
52 * be incomplete because not all documentation has been converted yet.
53 */

--- 26 unchanged lines hidden (view full) ---

80enum ieee80211_notification_types {
81 IEEE80211_NOTIFY_RE_ASSOC,
82};
83
84/**
85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
86 *
87 * This structure describes most essential parameters needed
46 */
47
48/**
49 * DOC: Warning
50 *
51 * If you're reading this document and not the header file itself, it will
52 * be incomplete because not all documentation has been converted yet.
53 */

--- 26 unchanged lines hidden (view full) ---

80enum ieee80211_notification_types {
81 IEEE80211_NOTIFY_RE_ASSOC,
82};
83
84/**
85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
86 *
87 * This structure describes most essential parameters needed
88 * to describe 802.11n HT characteristics in a BSS
88 * to describe 802.11n HT characteristics in a BSS.
89 *
90 * @primary_channel: channel number of primery channel
91 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width)
92 * @bss_op_mode: 802.11n's BSS operation modes (e.g. HT protection)
93 */
94struct ieee80211_ht_bss_info {
95 u8 primary_channel;
96 u8 bss_cap; /* use IEEE80211_HT_IE_CHA_ */

--- 99 unchanged lines hidden (view full) ---

196 u64 timestamp;
197 /* ht related data */
198 bool assoc_ht;
199 struct ieee80211_ht_info *ht_conf;
200 struct ieee80211_ht_bss_info *ht_bss_conf;
201};
202
203/**
89 *
90 * @primary_channel: channel number of primery channel
91 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width)
92 * @bss_op_mode: 802.11n's BSS operation modes (e.g. HT protection)
93 */
94struct ieee80211_ht_bss_info {
95 u8 primary_channel;
96 u8 bss_cap; /* use IEEE80211_HT_IE_CHA_ */

--- 99 unchanged lines hidden (view full) ---

196 u64 timestamp;
197 /* ht related data */
198 bool assoc_ht;
199 struct ieee80211_ht_info *ht_conf;
200 struct ieee80211_ht_bss_info *ht_bss_conf;
201};
202
203/**
204 * enum mac80211_tx_flags - flags to transmission information/status
204 * enum mac80211_tx_control_flags - flags to describe transmission information/status
205 *
205 *
206 * These flags are used with the @flags member of &ieee80211_tx_info
206 * These flags are used with the @flags member of &ieee80211_tx_info.
207 *
208 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame.
209 * @IEEE80211_TX_CTL_DO_NOT_ENCRYPT: send this frame without encryption;
210 * e.g., for EAPOL frame
211 * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame
212 * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g.,
213 * for combined 802.11g / 802.11b networks)
214 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
207 *
208 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame.
209 * @IEEE80211_TX_CTL_DO_NOT_ENCRYPT: send this frame without encryption;
210 * e.g., for EAPOL frame
211 * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame
212 * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g.,
213 * for combined 802.11g / 802.11b networks)
214 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
215 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE
215 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: TBD
216 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
217 * station
216 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
217 * station
218 * @IEEE80211_TX_CTL_REQUEUE:
218 * @IEEE80211_TX_CTL_REQUEUE: TBD
219 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame
219 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame
220 * @IEEE80211_TX_CTL_SHORT_PREAMBLE: TBD
220 * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the
221 * through set_retry_limit configured long retry value
222 * @IEEE80211_TX_CTL_EAPOL_FRAME: internal to mac80211
223 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
224 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
225 * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number
226 * of streams when this flag is on can be extracted from antenna_sel_tx,
227 * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n
228 * antennas marked use MIMO_n.
229 * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame
230 * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
231 * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
232 * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval
221 * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the
222 * through set_retry_limit configured long retry value
223 * @IEEE80211_TX_CTL_EAPOL_FRAME: internal to mac80211
224 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
225 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
226 * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number
227 * of streams when this flag is on can be extracted from antenna_sel_tx,
228 * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n
229 * antennas marked use MIMO_n.
230 * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame
231 * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
232 * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
233 * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval
234 * @IEEE80211_TX_CTL_INJECTED: TBD
233 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted
234 * because the destination STA was in powersave mode.
235 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
236 * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status
237 * is for the whole aggregation.
238 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned,
239 * so consider using block ack request (BAR).
240 */

--- 34 unchanged lines hidden (view full) ---

275 * struct ieee80211_tx_info - skb transmit information
276 *
277 * This structure is placed in skb->cb for three uses:
278 * (1) mac80211 TX control - mac80211 tells the driver what to do
279 * (2) driver internal use (if applicable)
280 * (3) TX status information - driver tells mac80211 what happened
281 *
282 * @flags: transmit info flags, defined above
235 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted
236 * because the destination STA was in powersave mode.
237 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
238 * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status
239 * is for the whole aggregation.
240 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned,
241 * so consider using block ack request (BAR).
242 */

--- 34 unchanged lines hidden (view full) ---

277 * struct ieee80211_tx_info - skb transmit information
278 *
279 * This structure is placed in skb->cb for three uses:
280 * (1) mac80211 TX control - mac80211 tells the driver what to do
281 * (2) driver internal use (if applicable)
282 * (3) TX status information - driver tells mac80211 what happened
283 *
284 * @flags: transmit info flags, defined above
285 * @band: TBD
286 * @tx_rate_idx: TBD
287 * @antenna_sel_tx: TBD
288 * @control: union for control data
289 * @status: union for status data
290 * @driver_data: array of driver_data pointers
283 * @retry_count: number of retries
284 * @excessive_retries: set to 1 if the frame was retried many times
285 * but not acknowledged
286 * @ampdu_ack_len: number of aggregated frames.
287 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
288 * @ampdu_ack_map: block ack bit map for the aggregation.
289 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
290 * @ack_signal: signal strength of the ACK frame

--- 266 unchanged lines hidden (view full) ---

557enum ieee80211_key_alg {
558 ALG_WEP,
559 ALG_TKIP,
560 ALG_CCMP,
561};
562
563/**
564 * enum ieee80211_key_len - key length
291 * @retry_count: number of retries
292 * @excessive_retries: set to 1 if the frame was retried many times
293 * but not acknowledged
294 * @ampdu_ack_len: number of aggregated frames.
295 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
296 * @ampdu_ack_map: block ack bit map for the aggregation.
297 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
298 * @ack_signal: signal strength of the ACK frame

--- 266 unchanged lines hidden (view full) ---

565enum ieee80211_key_alg {
566 ALG_WEP,
567 ALG_TKIP,
568 ALG_CCMP,
569};
570
571/**
572 * enum ieee80211_key_len - key length
565 * @WEP40: WEP 5 byte long key
566 * @WEP104: WEP 13 byte long key
573 * @LEN_WEP40: WEP 5-byte long key
574 * @LEN_WEP104: WEP 13-byte long key
567 */
568enum ieee80211_key_len {
569 LEN_WEP40 = 5,
570 LEN_WEP104 = 13,
571};
572
573/**
574 * enum ieee80211_key_flags - key flags

--- 60 unchanged lines hidden (view full) ---

635enum set_key_cmd {
636 SET_KEY, DISABLE_KEY,
637};
638
639/**
640 * enum sta_notify_cmd - sta notify command
641 *
642 * Used with the sta_notify() callback in &struct ieee80211_ops, this
575 */
576enum ieee80211_key_len {
577 LEN_WEP40 = 5,
578 LEN_WEP104 = 13,
579};
580
581/**
582 * enum ieee80211_key_flags - key flags

--- 60 unchanged lines hidden (view full) ---

643enum set_key_cmd {
644 SET_KEY, DISABLE_KEY,
645};
646
647/**
648 * enum sta_notify_cmd - sta notify command
649 *
650 * Used with the sta_notify() callback in &struct ieee80211_ops, this
643 * indicates addition and removal of a station to station table
651 * indicates addition and removal of a station to station table.
644 *
645 * @STA_NOTIFY_ADD: a station was added to the station table
646 * @STA_NOTIFY_REMOVE: a station being removed from the station table
647 */
648enum sta_notify_cmd {
649 STA_NOTIFY_ADD, STA_NOTIFY_REMOVE
650};
651

--- 683 unchanged lines hidden (view full) ---

1335 */
1336void ieee80211_unregister_hw(struct ieee80211_hw *hw);
1337
1338/**
1339 * ieee80211_free_hw - free hardware descriptor
1340 *
1341 * This function frees everything that was allocated, including the
1342 * private data for the driver. You must call ieee80211_unregister_hw()
652 *
653 * @STA_NOTIFY_ADD: a station was added to the station table
654 * @STA_NOTIFY_REMOVE: a station being removed from the station table
655 */
656enum sta_notify_cmd {
657 STA_NOTIFY_ADD, STA_NOTIFY_REMOVE
658};
659

--- 683 unchanged lines hidden (view full) ---

1343 */
1344void ieee80211_unregister_hw(struct ieee80211_hw *hw);
1345
1346/**
1347 * ieee80211_free_hw - free hardware descriptor
1348 *
1349 * This function frees everything that was allocated, including the
1350 * private data for the driver. You must call ieee80211_unregister_hw()
1343 * before calling this function
1351 * before calling this function.
1344 *
1345 * @hw: the hardware to free
1346 */
1347void ieee80211_free_hw(struct ieee80211_hw *hw);
1348
1349/* trick to avoid symbol clashes with the ieee80211 subsystem */
1350void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1351 struct ieee80211_rx_status *status);

--- 54 unchanged lines hidden (view full) ---

1406 *
1407 * @hw: the hardware the frame was transmitted by
1408 * @skb: the frame that was transmitted, owned by mac80211 after this call
1409 */
1410void ieee80211_tx_status(struct ieee80211_hw *hw,
1411 struct sk_buff *skb);
1412
1413/**
1352 *
1353 * @hw: the hardware to free
1354 */
1355void ieee80211_free_hw(struct ieee80211_hw *hw);
1356
1357/* trick to avoid symbol clashes with the ieee80211 subsystem */
1358void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1359 struct ieee80211_rx_status *status);

--- 54 unchanged lines hidden (view full) ---

1414 *
1415 * @hw: the hardware the frame was transmitted by
1416 * @skb: the frame that was transmitted, owned by mac80211 after this call
1417 */
1418void ieee80211_tx_status(struct ieee80211_hw *hw,
1419 struct sk_buff *skb);
1420
1421/**
1414 * ieee80211_tx_status_irqsafe - irq-safe transmit status callback
1422 * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback
1415 *
1416 * Like ieee80211_tx_status() but can be called in IRQ context
1417 * (internally defers to a tasklet.)
1418 *
1419 * Calls to this function and ieee80211_tx_status() may not be mixed for a
1420 * single hardware.
1421 *
1422 * @hw: the hardware the frame was transmitted by

--- 161 unchanged lines hidden (view full) ---

1584 * This function computes a TKIP rc4 key for an skb. It computes
1585 * a phase 1 key if needed (iv16 wraps around). This function is to
1586 * be used by drivers which can do HW encryption but need to compute
1587 * to phase 1/2 key in SW.
1588 *
1589 * @keyconf: the parameter passed with the set key
1590 * @skb: the skb for which the key is needed
1591 * @rc4key: a buffer to which the key will be written
1423 *
1424 * Like ieee80211_tx_status() but can be called in IRQ context
1425 * (internally defers to a tasklet.)
1426 *
1427 * Calls to this function and ieee80211_tx_status() may not be mixed for a
1428 * single hardware.
1429 *
1430 * @hw: the hardware the frame was transmitted by

--- 161 unchanged lines hidden (view full) ---

1592 * This function computes a TKIP rc4 key for an skb. It computes
1593 * a phase 1 key if needed (iv16 wraps around). This function is to
1594 * be used by drivers which can do HW encryption but need to compute
1595 * to phase 1/2 key in SW.
1596 *
1597 * @keyconf: the parameter passed with the set key
1598 * @skb: the skb for which the key is needed
1599 * @rc4key: a buffer to which the key will be written
1600 * @type: TBD
1601 * @key: TBD
1592 */
1593void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
1594 struct sk_buff *skb,
1595 enum ieee80211_tkip_key_type type, u8 *key);
1596/**
1597 * ieee80211_wake_queue - wake specific queue
1598 * @hw: pointer as obtained from ieee80211_alloc_hw().
1599 * @queue: queue number (counted from zero).

--- 34 unchanged lines hidden (view full) ---

1634 * assigned) this function needs to be called by the driver to notify
1635 * mac80211 that the scan finished.
1636 *
1637 * @hw: the hardware that finished the scan
1638 */
1639void ieee80211_scan_completed(struct ieee80211_hw *hw);
1640
1641/**
1602 */
1603void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
1604 struct sk_buff *skb,
1605 enum ieee80211_tkip_key_type type, u8 *key);
1606/**
1607 * ieee80211_wake_queue - wake specific queue
1608 * @hw: pointer as obtained from ieee80211_alloc_hw().
1609 * @queue: queue number (counted from zero).

--- 34 unchanged lines hidden (view full) ---

1644 * assigned) this function needs to be called by the driver to notify
1645 * mac80211 that the scan finished.
1646 *
1647 * @hw: the hardware that finished the scan
1648 */
1649void ieee80211_scan_completed(struct ieee80211_hw *hw);
1650
1651/**
1642 * ieee80211_iterate_active_interfaces- iterate active interfaces
1652 * ieee80211_iterate_active_interfaces - iterate active interfaces
1643 *
1644 * This function iterates over the interfaces associated with a given
1645 * hardware that are currently active and calls the callback for them.
1646 * This function allows the iterator function to sleep, when the iterator
1647 * function is atomic @ieee80211_iterate_active_interfaces_atomic can
1648 * be used.
1649 *
1650 * @hw: the hardware struct of which the interfaces should be iterated over

--- 50 unchanged lines hidden (view full) ---

1701/**
1702 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
1703 * @hw: pointer as obtained from ieee80211_alloc_hw().
1704 * @ra: receiver address of the BA session recipient.
1705 * @tid: the TID to BA on.
1706 *
1707 * This function must be called by low level driver once it has
1708 * finished with preparations for the BA session.
1653 *
1654 * This function iterates over the interfaces associated with a given
1655 * hardware that are currently active and calls the callback for them.
1656 * This function allows the iterator function to sleep, when the iterator
1657 * function is atomic @ieee80211_iterate_active_interfaces_atomic can
1658 * be used.
1659 *
1660 * @hw: the hardware struct of which the interfaces should be iterated over

--- 50 unchanged lines hidden (view full) ---

1711/**
1712 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
1713 * @hw: pointer as obtained from ieee80211_alloc_hw().
1714 * @ra: receiver address of the BA session recipient.
1715 * @tid: the TID to BA on.
1716 *
1717 * This function must be called by low level driver once it has
1718 * finished with preparations for the BA session.
1709 * This version of the function is irq safe.
1719 * This version of the function is IRQ-safe.
1710 */
1711void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1712 u16 tid);
1713
1714/**
1715 * ieee80211_stop_tx_ba_session - Stop a Block Ack session.
1716 * @hw: pointer as obtained from ieee80211_alloc_hw().
1717 * @ra: receiver address of the BA session recipient

--- 23 unchanged lines hidden (view full) ---

1741/**
1742 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
1743 * @hw: pointer as obtained from ieee80211_alloc_hw().
1744 * @ra: receiver address of the BA session recipient.
1745 * @tid: the desired TID to BA on.
1746 *
1747 * This function must be called by low level driver once it has
1748 * finished with preparations for the BA session tear down.
1720 */
1721void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1722 u16 tid);
1723
1724/**
1725 * ieee80211_stop_tx_ba_session - Stop a Block Ack session.
1726 * @hw: pointer as obtained from ieee80211_alloc_hw().
1727 * @ra: receiver address of the BA session recipient

--- 23 unchanged lines hidden (view full) ---

1751/**
1752 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
1753 * @hw: pointer as obtained from ieee80211_alloc_hw().
1754 * @ra: receiver address of the BA session recipient.
1755 * @tid: the desired TID to BA on.
1756 *
1757 * This function must be called by low level driver once it has
1758 * finished with preparations for the BA session tear down.
1749 * This version of the function is irq safe.
1759 * This version of the function is IRQ-safe.
1750 */
1751void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1752 u16 tid);
1753
1754/**
1755 * ieee80211_notify_mac - low level driver notification
1756 * @hw: pointer as obtained from ieee80211_alloc_hw().
1760 */
1761void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1762 u16 tid);
1763
1764/**
1765 * ieee80211_notify_mac - low level driver notification
1766 * @hw: pointer as obtained from ieee80211_alloc_hw().
1757 * @notification_types: enum ieee80211_notification_types
1767 * @notif_type: enum ieee80211_notification_types
1758 *
1759 * This function must be called by low level driver to inform mac80211 of
1760 * low level driver status change or force mac80211 to re-assoc for low
1761 * level driver internal error that require re-assoc.
1762 */
1763void ieee80211_notify_mac(struct ieee80211_hw *hw,
1764 enum ieee80211_notification_types notif_type);
1765#endif /* MAC80211_H */
1768 *
1769 * This function must be called by low level driver to inform mac80211 of
1770 * low level driver status change or force mac80211 to re-assoc for low
1771 * level driver internal error that require re-assoc.
1772 */
1773void ieee80211_notify_mac(struct ieee80211_hw *hw,
1774 enum ieee80211_notification_types notif_type);
1775#endif /* MAC80211_H */