diff options
Diffstat (limited to 'include/net/mac80211.h')
| -rw-r--r-- | include/net/mac80211.h | 251 |
1 files changed, 210 insertions, 41 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index d52914b75331..b4bef1152c05 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -84,6 +84,39 @@ | |||
| 84 | * | 84 | * |
| 85 | */ | 85 | */ |
| 86 | 86 | ||
| 87 | /** | ||
| 88 | * DOC: mac80211 software tx queueing | ||
| 89 | * | ||
| 90 | * mac80211 provides an optional intermediate queueing implementation designed | ||
| 91 | * to allow the driver to keep hardware queues short and provide some fairness | ||
| 92 | * between different stations/interfaces. | ||
| 93 | * In this model, the driver pulls data frames from the mac80211 queue instead | ||
| 94 | * of letting mac80211 push them via drv_tx(). | ||
| 95 | * Other frames (e.g. control or management) are still pushed using drv_tx(). | ||
| 96 | * | ||
| 97 | * Drivers indicate that they use this model by implementing the .wake_tx_queue | ||
| 98 | * driver operation. | ||
| 99 | * | ||
| 100 | * Intermediate queues (struct ieee80211_txq) are kept per-sta per-tid, with a | ||
| 101 | * single per-vif queue for multicast data frames. | ||
| 102 | * | ||
| 103 | * The driver is expected to initialize its private per-queue data for stations | ||
| 104 | * and interfaces in the .add_interface and .sta_add ops. | ||
| 105 | * | ||
| 106 | * The driver can't access the queue directly. To dequeue a frame, it calls | ||
| 107 | * ieee80211_tx_dequeue(). Whenever mac80211 adds a new frame to a queue, it | ||
| 108 | * calls the .wake_tx_queue driver op. | ||
| 109 | * | ||
| 110 | * For AP powersave TIM handling, the driver only needs to indicate if it has | ||
| 111 | * buffered packets in the driver specific data structures by calling | ||
| 112 | * ieee80211_sta_set_buffered(). For frames buffered in the ieee80211_txq | ||
| 113 | * struct, mac80211 sets the appropriate TIM PVB bits and calls | ||
| 114 | * .release_buffered_frames(). | ||
| 115 | * In that callback the driver is therefore expected to release its own | ||
| 116 | * buffered frames and afterwards also frames from the ieee80211_txq (obtained | ||
| 117 | * via the usual ieee80211_tx_dequeue). | ||
| 118 | */ | ||
| 119 | |||
| 87 | struct device; | 120 | struct device; |
| 88 | 121 | ||
| 89 | /** | 122 | /** |
| @@ -301,17 +334,86 @@ enum ieee80211_bss_change { | |||
| 301 | #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 | 334 | #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 |
| 302 | 335 | ||
| 303 | /** | 336 | /** |
| 304 | * enum ieee80211_rssi_event - RSSI threshold event | 337 | * enum ieee80211_event_type - event to be notified to the low level driver |
| 305 | * An indicator for when RSSI goes below/above a certain threshold. | 338 | * @RSSI_EVENT: AP's rssi crossed the a threshold set by the driver. |
| 306 | * @RSSI_EVENT_HIGH: AP's rssi crossed the high threshold set by the driver. | 339 | * @MLME_EVENT: event related to MLME |
| 307 | * @RSSI_EVENT_LOW: AP's rssi crossed the low threshold set by the driver. | ||
| 308 | */ | 340 | */ |
| 309 | enum ieee80211_rssi_event { | 341 | enum ieee80211_event_type { |
| 342 | RSSI_EVENT, | ||
| 343 | MLME_EVENT, | ||
| 344 | }; | ||
| 345 | |||
| 346 | /** | ||
| 347 | * enum ieee80211_rssi_event_data - relevant when event type is %RSSI_EVENT | ||
| 348 | * @RSSI_EVENT_HIGH: AP's rssi went below the threshold set by the driver. | ||
| 349 | * @RSSI_EVENT_LOW: AP's rssi went above the threshold set by the driver. | ||
| 350 | */ | ||
| 351 | enum ieee80211_rssi_event_data { | ||
| 310 | RSSI_EVENT_HIGH, | 352 | RSSI_EVENT_HIGH, |
| 311 | RSSI_EVENT_LOW, | 353 | RSSI_EVENT_LOW, |
| 312 | }; | 354 | }; |
| 313 | 355 | ||
| 314 | /** | 356 | /** |
| 357 | * enum ieee80211_rssi_event - data attached to an %RSSI_EVENT | ||
| 358 | * @data: See &enum ieee80211_rssi_event_data | ||
| 359 | */ | ||
| 360 | struct ieee80211_rssi_event { | ||
| 361 | enum ieee80211_rssi_event_data data; | ||
| 362 | }; | ||
| 363 | |||
| 364 | /** | ||
| 365 | * enum ieee80211_mlme_event_data - relevant when event type is %MLME_EVENT | ||
| 366 | * @AUTH_EVENT: the MLME operation is authentication | ||
| 367 | * @ASSOC_EVENT: the MLME operation is association | ||
| 368 | * @DEAUTH_RX_EVENT: deauth received.. | ||
| 369 | * @DEAUTH_TX_EVENT: deauth sent. | ||
| 370 | */ | ||
| 371 | enum ieee80211_mlme_event_data { | ||
| 372 | AUTH_EVENT, | ||
| 373 | ASSOC_EVENT, | ||
| 374 | DEAUTH_RX_EVENT, | ||
| 375 | DEAUTH_TX_EVENT, | ||
| 376 | }; | ||
| 377 | |||
| 378 | /** | ||
| 379 | * enum ieee80211_mlme_event_status - relevant when event type is %MLME_EVENT | ||
| 380 | * @MLME_SUCCESS: the MLME operation completed successfully. | ||
| 381 | * @MLME_DENIED: the MLME operation was denied by the peer. | ||
| 382 | * @MLME_TIMEOUT: the MLME operation timed out. | ||
| 383 | */ | ||
| 384 | enum ieee80211_mlme_event_status { | ||
| 385 | MLME_SUCCESS, | ||
| 386 | MLME_DENIED, | ||
| 387 | MLME_TIMEOUT, | ||
| 388 | }; | ||
| 389 | |||
| 390 | /** | ||
| 391 | * enum ieee80211_mlme_event - data attached to an %MLME_EVENT | ||
| 392 | * @data: See &enum ieee80211_mlme_event_data | ||
| 393 | * @status: See &enum ieee80211_mlme_event_status | ||
| 394 | * @reason: the reason code if applicable | ||
| 395 | */ | ||
| 396 | struct ieee80211_mlme_event { | ||
| 397 | enum ieee80211_mlme_event_data data; | ||
| 398 | enum ieee80211_mlme_event_status status; | ||
| 399 | u16 reason; | ||
| 400 | }; | ||
| 401 | |||
| 402 | /** | ||
| 403 | * struct ieee80211_event - event to be sent to the driver | ||
| 404 | * @type The event itself. See &enum ieee80211_event_type. | ||
| 405 | * @rssi: relevant if &type is %RSSI_EVENT | ||
| 406 | * @mlme: relevant if &type is %AUTH_EVENT | ||
| 407 | */ | ||
| 408 | struct ieee80211_event { | ||
| 409 | enum ieee80211_event_type type; | ||
| 410 | union { | ||
| 411 | struct ieee80211_rssi_event rssi; | ||
| 412 | struct ieee80211_mlme_event mlme; | ||
| 413 | } u; | ||
| 414 | }; | ||
| 415 | |||
| 416 | /** | ||
| 315 | * struct ieee80211_bss_conf - holds the BSS's changing parameters | 417 | * struct ieee80211_bss_conf - holds the BSS's changing parameters |
| 316 | * | 418 | * |
| 317 | * This structure keeps information about a BSS (and an association | 419 | * This structure keeps information about a BSS (and an association |
| @@ -337,12 +439,15 @@ enum ieee80211_rssi_event { | |||
| 337 | * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can | 439 | * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can |
| 338 | * only come from a beacon, but might not become valid until after | 440 | * only come from a beacon, but might not become valid until after |
| 339 | * association when a beacon is received (which is notified with the | 441 | * association when a beacon is received (which is notified with the |
| 340 | * %BSS_CHANGED_DTIM flag.) | 442 | * %BSS_CHANGED_DTIM flag.). See also sync_dtim_count important notice. |
| 341 | * @sync_device_ts: the device timestamp corresponding to the sync_tsf, | 443 | * @sync_device_ts: the device timestamp corresponding to the sync_tsf, |
| 342 | * the driver/device can use this to calculate synchronisation | 444 | * the driver/device can use this to calculate synchronisation |
| 343 | * (see @sync_tsf) | 445 | * (see @sync_tsf). See also sync_dtim_count important notice. |
| 344 | * @sync_dtim_count: Only valid when %IEEE80211_HW_TIMING_BEACON_ONLY | 446 | * @sync_dtim_count: Only valid when %IEEE80211_HW_TIMING_BEACON_ONLY |
| 345 | * is requested, see @sync_tsf/@sync_device_ts. | 447 | * is requested, see @sync_tsf/@sync_device_ts. |
| 448 | * IMPORTANT: These three sync_* parameters would possibly be out of sync | ||
| 449 | * by the time the driver will use them. The synchronized view is currently | ||
| 450 | * guaranteed only in certain callbacks. | ||
| 346 | * @beacon_int: beacon interval | 451 | * @beacon_int: beacon interval |
| 347 | * @assoc_capability: capabilities taken from assoc resp | 452 | * @assoc_capability: capabilities taken from assoc resp |
| 348 | * @basic_rates: bitmap of basic rates, each bit stands for an | 453 | * @basic_rates: bitmap of basic rates, each bit stands for an |
| @@ -1234,6 +1339,7 @@ enum ieee80211_vif_flags { | |||
| 1234 | * monitor interface (if that is requested.) | 1339 | * monitor interface (if that is requested.) |
| 1235 | * @drv_priv: data area for driver use, will always be aligned to | 1340 | * @drv_priv: data area for driver use, will always be aligned to |
| 1236 | * sizeof(void *). | 1341 | * sizeof(void *). |
| 1342 | * @txq: the multicast data TX queue (if driver uses the TXQ abstraction) | ||
| 1237 | */ | 1343 | */ |
| 1238 | struct ieee80211_vif { | 1344 | struct ieee80211_vif { |
| 1239 | enum nl80211_iftype type; | 1345 | enum nl80211_iftype type; |
| @@ -1245,6 +1351,8 @@ struct ieee80211_vif { | |||
| 1245 | u8 cab_queue; | 1351 | u8 cab_queue; |
| 1246 | u8 hw_queue[IEEE80211_NUM_ACS]; | 1352 | u8 hw_queue[IEEE80211_NUM_ACS]; |
| 1247 | 1353 | ||
| 1354 | struct ieee80211_txq *txq; | ||
| 1355 | |||
| 1248 | struct ieee80211_chanctx_conf __rcu *chanctx_conf; | 1356 | struct ieee80211_chanctx_conf __rcu *chanctx_conf; |
| 1249 | 1357 | ||
| 1250 | u32 driver_flags; | 1358 | u32 driver_flags; |
| @@ -1279,6 +1387,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
| 1279 | struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); | 1387 | struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); |
| 1280 | 1388 | ||
| 1281 | /** | 1389 | /** |
| 1390 | * ieee80211_vif_to_wdev - return a wdev struct from a vif | ||
| 1391 | * @vif: the vif to get the wdev for | ||
| 1392 | * | ||
| 1393 | * This can be used by mac80211 drivers with direct cfg80211 APIs | ||
| 1394 | * (like the vendor commands) that needs to get the wdev for a vif. | ||
| 1395 | * | ||
| 1396 | * Note that this function may return %NULL if the given wdev isn't | ||
| 1397 | * associated with a vif that the driver knows about (e.g. monitor | ||
| 1398 | * or AP_VLAN interfaces.) | ||
| 1399 | */ | ||
| 1400 | struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif); | ||
| 1401 | |||
| 1402 | /** | ||
| 1282 | * enum ieee80211_key_flags - key flags | 1403 | * enum ieee80211_key_flags - key flags |
| 1283 | * | 1404 | * |
| 1284 | * These flags are used for communication about keys between the driver | 1405 | * These flags are used for communication about keys between the driver |
| @@ -1472,7 +1593,8 @@ struct ieee80211_sta_rates { | |||
| 1472 | * @supp_rates: Bitmap of supported rates (per band) | 1593 | * @supp_rates: Bitmap of supported rates (per band) |
| 1473 | * @ht_cap: HT capabilities of this STA; restricted to our own capabilities | 1594 | * @ht_cap: HT capabilities of this STA; restricted to our own capabilities |
| 1474 | * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities | 1595 | * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities |
| 1475 | * @wme: indicates whether the STA supports QoS/WME. | 1596 | * @wme: indicates whether the STA supports QoS/WME (if local devices does, |
| 1597 | * otherwise always false) | ||
| 1476 | * @drv_priv: data area for driver use, will always be aligned to | 1598 | * @drv_priv: data area for driver use, will always be aligned to |
| 1477 | * sizeof(void *), size is determined in hw information. | 1599 | * sizeof(void *), size is determined in hw information. |
| 1478 | * @uapsd_queues: bitmap of queues configured for uapsd. Only valid | 1600 | * @uapsd_queues: bitmap of queues configured for uapsd. Only valid |
| @@ -1488,6 +1610,8 @@ struct ieee80211_sta_rates { | |||
| 1488 | * @tdls: indicates whether the STA is a TDLS peer | 1610 | * @tdls: indicates whether the STA is a TDLS peer |
| 1489 | * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only | 1611 | * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only |
| 1490 | * valid if the STA is a TDLS peer in the first place. | 1612 | * valid if the STA is a TDLS peer in the first place. |
| 1613 | * @mfp: indicates whether the STA uses management frame protection or not. | ||
| 1614 | * @txq: per-TID data TX queues (if driver uses the TXQ abstraction) | ||
| 1491 | */ | 1615 | */ |
| 1492 | struct ieee80211_sta { | 1616 | struct ieee80211_sta { |
| 1493 | u32 supp_rates[IEEE80211_NUM_BANDS]; | 1617 | u32 supp_rates[IEEE80211_NUM_BANDS]; |
| @@ -1504,6 +1628,9 @@ struct ieee80211_sta { | |||
| 1504 | struct ieee80211_sta_rates __rcu *rates; | 1628 | struct ieee80211_sta_rates __rcu *rates; |
| 1505 | bool tdls; | 1629 | bool tdls; |
| 1506 | bool tdls_initiator; | 1630 | bool tdls_initiator; |
| 1631 | bool mfp; | ||
| 1632 | |||
| 1633 | struct ieee80211_txq *txq[IEEE80211_NUM_TIDS]; | ||
| 1507 | 1634 | ||
| 1508 | /* must be last */ | 1635 | /* must be last */ |
| 1509 | u8 drv_priv[0] __aligned(sizeof(void *)); | 1636 | u8 drv_priv[0] __aligned(sizeof(void *)); |
| @@ -1533,6 +1660,27 @@ struct ieee80211_tx_control { | |||
| 1533 | }; | 1660 | }; |
| 1534 | 1661 | ||
| 1535 | /** | 1662 | /** |
| 1663 | * struct ieee80211_txq - Software intermediate tx queue | ||
| 1664 | * | ||
| 1665 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 1666 | * @sta: station table entry, %NULL for per-vif queue | ||
| 1667 | * @tid: the TID for this queue (unused for per-vif queue) | ||
| 1668 | * @ac: the AC for this queue | ||
| 1669 | * | ||
| 1670 | * The driver can obtain packets from this queue by calling | ||
| 1671 | * ieee80211_tx_dequeue(). | ||
| 1672 | */ | ||
| 1673 | struct ieee80211_txq { | ||
| 1674 | struct ieee80211_vif *vif; | ||
| 1675 | struct ieee80211_sta *sta; | ||
| 1676 | u8 tid; | ||
| 1677 | u8 ac; | ||
| 1678 | |||
| 1679 | /* must be last */ | ||
| 1680 | u8 drv_priv[0] __aligned(sizeof(void *)); | ||
| 1681 | }; | ||
| 1682 | |||
| 1683 | /** | ||
| 1536 | * enum ieee80211_hw_flags - hardware flags | 1684 | * enum ieee80211_hw_flags - hardware flags |
| 1537 | * | 1685 | * |
| 1538 | * These flags are used to indicate hardware capabilities to | 1686 | * These flags are used to indicate hardware capabilities to |
| @@ -1756,6 +1904,8 @@ enum ieee80211_hw_flags { | |||
| 1756 | * within &struct ieee80211_sta. | 1904 | * within &struct ieee80211_sta. |
| 1757 | * @chanctx_data_size: size (in bytes) of the drv_priv data area | 1905 | * @chanctx_data_size: size (in bytes) of the drv_priv data area |
| 1758 | * within &struct ieee80211_chanctx_conf. | 1906 | * within &struct ieee80211_chanctx_conf. |
| 1907 | * @txq_data_size: size (in bytes) of the drv_priv data area | ||
| 1908 | * within @struct ieee80211_txq. | ||
| 1759 | * | 1909 | * |
| 1760 | * @max_rates: maximum number of alternate rate retry stages the hw | 1910 | * @max_rates: maximum number of alternate rate retry stages the hw |
| 1761 | * can handle. | 1911 | * can handle. |
| @@ -1804,6 +1954,9 @@ enum ieee80211_hw_flags { | |||
| 1804 | * @n_cipher_schemes: a size of an array of cipher schemes definitions. | 1954 | * @n_cipher_schemes: a size of an array of cipher schemes definitions. |
| 1805 | * @cipher_schemes: a pointer to an array of cipher scheme definitions | 1955 | * @cipher_schemes: a pointer to an array of cipher scheme definitions |
| 1806 | * supported by HW. | 1956 | * supported by HW. |
| 1957 | * | ||
| 1958 | * @txq_ac_max_pending: maximum number of frames per AC pending in all txq | ||
| 1959 | * entries for a vif. | ||
| 1807 | */ | 1960 | */ |
| 1808 | struct ieee80211_hw { | 1961 | struct ieee80211_hw { |
| 1809 | struct ieee80211_conf conf; | 1962 | struct ieee80211_conf conf; |
| @@ -1816,6 +1969,7 @@ struct ieee80211_hw { | |||
| 1816 | int vif_data_size; | 1969 | int vif_data_size; |
| 1817 | int sta_data_size; | 1970 | int sta_data_size; |
| 1818 | int chanctx_data_size; | 1971 | int chanctx_data_size; |
| 1972 | int txq_data_size; | ||
| 1819 | u16 queues; | 1973 | u16 queues; |
| 1820 | u16 max_listen_interval; | 1974 | u16 max_listen_interval; |
| 1821 | s8 max_signal; | 1975 | s8 max_signal; |
| @@ -1832,6 +1986,7 @@ struct ieee80211_hw { | |||
| 1832 | u8 uapsd_max_sp_len; | 1986 | u8 uapsd_max_sp_len; |
| 1833 | u8 n_cipher_schemes; | 1987 | u8 n_cipher_schemes; |
| 1834 | const struct ieee80211_cipher_scheme *cipher_schemes; | 1988 | const struct ieee80211_cipher_scheme *cipher_schemes; |
| 1989 | int txq_ac_max_pending; | ||
| 1835 | }; | 1990 | }; |
| 1836 | 1991 | ||
| 1837 | /** | 1992 | /** |
| @@ -2844,8 +2999,9 @@ enum ieee80211_reconfig_type { | |||
| 2844 | * @set_bitrate_mask: Set a mask of rates to be used for rate control selection | 2999 | * @set_bitrate_mask: Set a mask of rates to be used for rate control selection |
| 2845 | * when transmitting a frame. Currently only legacy rates are handled. | 3000 | * when transmitting a frame. Currently only legacy rates are handled. |
| 2846 | * The callback can sleep. | 3001 | * The callback can sleep. |
| 2847 | * @rssi_callback: Notify driver when the average RSSI goes above/below | 3002 | * @event_callback: Notify driver about any event in mac80211. See |
| 2848 | * thresholds that were registered previously. The callback can sleep. | 3003 | * &enum ieee80211_event_type for the different types. |
| 3004 | * The callback can sleep. | ||
| 2849 | * | 3005 | * |
| 2850 | * @release_buffered_frames: Release buffered frames according to the given | 3006 | * @release_buffered_frames: Release buffered frames according to the given |
| 2851 | * parameters. In the case where the driver buffers some frames for | 3007 | * parameters. In the case where the driver buffers some frames for |
| @@ -2993,6 +3149,8 @@ enum ieee80211_reconfig_type { | |||
| 2993 | * response template is provided, together with the location of the | 3149 | * response template is provided, together with the location of the |
| 2994 | * switch-timing IE within the template. The skb can only be used within | 3150 | * switch-timing IE within the template. The skb can only be used within |
| 2995 | * the function call. | 3151 | * the function call. |
| 3152 | * | ||
| 3153 | * @wake_tx_queue: Called when new packets have been added to the queue. | ||
| 2996 | */ | 3154 | */ |
| 2997 | struct ieee80211_ops { | 3155 | struct ieee80211_ops { |
| 2998 | void (*tx)(struct ieee80211_hw *hw, | 3156 | void (*tx)(struct ieee80211_hw *hw, |
| @@ -3141,9 +3299,9 @@ struct ieee80211_ops { | |||
| 3141 | bool (*tx_frames_pending)(struct ieee80211_hw *hw); | 3299 | bool (*tx_frames_pending)(struct ieee80211_hw *hw); |
| 3142 | int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 3300 | int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 3143 | const struct cfg80211_bitrate_mask *mask); | 3301 | const struct cfg80211_bitrate_mask *mask); |
| 3144 | void (*rssi_callback)(struct ieee80211_hw *hw, | 3302 | void (*event_callback)(struct ieee80211_hw *hw, |
| 3145 | struct ieee80211_vif *vif, | 3303 | struct ieee80211_vif *vif, |
| 3146 | enum ieee80211_rssi_event rssi_event); | 3304 | const struct ieee80211_event *event); |
| 3147 | 3305 | ||
| 3148 | void (*allow_buffered_frames)(struct ieee80211_hw *hw, | 3306 | void (*allow_buffered_frames)(struct ieee80211_hw *hw, |
| 3149 | struct ieee80211_sta *sta, | 3307 | struct ieee80211_sta *sta, |
| @@ -3224,6 +3382,9 @@ struct ieee80211_ops { | |||
| 3224 | void (*tdls_recv_channel_switch)(struct ieee80211_hw *hw, | 3382 | void (*tdls_recv_channel_switch)(struct ieee80211_hw *hw, |
| 3225 | struct ieee80211_vif *vif, | 3383 | struct ieee80211_vif *vif, |
| 3226 | struct ieee80211_tdls_ch_sw_params *params); | 3384 | struct ieee80211_tdls_ch_sw_params *params); |
| 3385 | |||
| 3386 | void (*wake_tx_queue)(struct ieee80211_hw *hw, | ||
| 3387 | struct ieee80211_txq *txq); | ||
| 3227 | }; | 3388 | }; |
| 3228 | 3389 | ||
| 3229 | /** | 3390 | /** |
| @@ -4343,13 +4504,33 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | |||
| 4343 | * haven't been re-added to the driver yet. | 4504 | * haven't been re-added to the driver yet. |
| 4344 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all | 4505 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all |
| 4345 | * interfaces, even if they haven't been re-added to the driver yet. | 4506 | * interfaces, even if they haven't been re-added to the driver yet. |
| 4507 | * @IEEE80211_IFACE_ITER_ACTIVE: Iterate only active interfaces (netdev is up). | ||
| 4346 | */ | 4508 | */ |
| 4347 | enum ieee80211_interface_iteration_flags { | 4509 | enum ieee80211_interface_iteration_flags { |
| 4348 | IEEE80211_IFACE_ITER_NORMAL = 0, | 4510 | IEEE80211_IFACE_ITER_NORMAL = 0, |
| 4349 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), | 4511 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), |
| 4512 | IEEE80211_IFACE_ITER_ACTIVE = BIT(1), | ||
| 4350 | }; | 4513 | }; |
| 4351 | 4514 | ||
| 4352 | /** | 4515 | /** |
| 4516 | * ieee80211_iterate_interfaces - iterate interfaces | ||
| 4517 | * | ||
| 4518 | * This function iterates over the interfaces associated with a given | ||
| 4519 | * hardware and calls the callback for them. This includes active as well as | ||
| 4520 | * inactive interfaces. This function allows the iterator function to sleep. | ||
| 4521 | * Will iterate over a new interface during add_interface(). | ||
| 4522 | * | ||
| 4523 | * @hw: the hardware struct of which the interfaces should be iterated over | ||
| 4524 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
| 4525 | * @iterator: the iterator function to call | ||
| 4526 | * @data: first argument of the iterator function | ||
| 4527 | */ | ||
| 4528 | void ieee80211_iterate_interfaces(struct ieee80211_hw *hw, u32 iter_flags, | ||
| 4529 | void (*iterator)(void *data, u8 *mac, | ||
| 4530 | struct ieee80211_vif *vif), | ||
| 4531 | void *data); | ||
| 4532 | |||
| 4533 | /** | ||
| 4353 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 4534 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
| 4354 | * | 4535 | * |
| 4355 | * This function iterates over the interfaces associated with a given | 4536 | * This function iterates over the interfaces associated with a given |
| @@ -4364,11 +4545,16 @@ enum ieee80211_interface_iteration_flags { | |||
| 4364 | * @iterator: the iterator function to call | 4545 | * @iterator: the iterator function to call |
| 4365 | * @data: first argument of the iterator function | 4546 | * @data: first argument of the iterator function |
| 4366 | */ | 4547 | */ |
| 4367 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | 4548 | static inline void |
| 4368 | u32 iter_flags, | 4549 | ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, u32 iter_flags, |
| 4369 | void (*iterator)(void *data, u8 *mac, | 4550 | void (*iterator)(void *data, u8 *mac, |
| 4370 | struct ieee80211_vif *vif), | 4551 | struct ieee80211_vif *vif), |
| 4371 | void *data); | 4552 | void *data) |
| 4553 | { | ||
| 4554 | ieee80211_iterate_interfaces(hw, | ||
| 4555 | iter_flags | IEEE80211_IFACE_ITER_ACTIVE, | ||
| 4556 | iterator, data); | ||
| 4557 | } | ||
| 4372 | 4558 | ||
| 4373 | /** | 4559 | /** |
| 4374 | * ieee80211_iterate_active_interfaces_atomic - iterate active interfaces | 4560 | * ieee80211_iterate_active_interfaces_atomic - iterate active interfaces |
| @@ -5194,30 +5380,13 @@ int ieee80211_reserve_tid(struct ieee80211_sta *sta, u8 tid); | |||
| 5194 | void ieee80211_unreserve_tid(struct ieee80211_sta *sta, u8 tid); | 5380 | void ieee80211_unreserve_tid(struct ieee80211_sta *sta, u8 tid); |
| 5195 | 5381 | ||
| 5196 | /** | 5382 | /** |
| 5197 | * ieee80211_ie_split - split an IE buffer according to ordering | 5383 | * ieee80211_tx_dequeue - dequeue a packet from a software tx queue |
| 5198 | * | ||
| 5199 | * @ies: the IE buffer | ||
| 5200 | * @ielen: the length of the IE buffer | ||
| 5201 | * @ids: an array with element IDs that are allowed before | ||
| 5202 | * the split | ||
| 5203 | * @n_ids: the size of the element ID array | ||
| 5204 | * @offset: offset where to start splitting in the buffer | ||
| 5205 | * | ||
| 5206 | * This function splits an IE buffer by updating the @offset | ||
| 5207 | * variable to point to the location where the buffer should be | ||
| 5208 | * split. | ||
| 5209 | * | 5384 | * |
| 5210 | * It assumes that the given IE buffer is well-formed, this | 5385 | * @hw: pointer as obtained from ieee80211_alloc_hw() |
| 5211 | * has to be guaranteed by the caller! | 5386 | * @txq: pointer obtained from station or virtual interface |
| 5212 | * | ||
| 5213 | * It also assumes that the IEs in the buffer are ordered | ||
| 5214 | * correctly, if not the result of using this function will not | ||
| 5215 | * be ordered correctly either, i.e. it does no reordering. | ||
| 5216 | * | 5387 | * |
| 5217 | * The function returns the offset where the next part of the | 5388 | * Returns the skb if successful, %NULL if no frame was available. |
| 5218 | * buffer starts, which may be @ielen if the entire (remainder) | ||
| 5219 | * of the buffer should be used. | ||
| 5220 | */ | 5389 | */ |
| 5221 | size_t ieee80211_ie_split(const u8 *ies, size_t ielen, | 5390 | struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw, |
| 5222 | const u8 *ids, int n_ids, size_t offset); | 5391 | struct ieee80211_txq *txq); |
| 5223 | #endif /* MAC80211_H */ | 5392 | #endif /* MAC80211_H */ |
