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.h109
1 files changed, 48 insertions, 61 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 95e39b6a02ec..bb86aa6f98dd 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -233,8 +233,10 @@ enum ieee80211_rssi_event {
233 * valid in station mode only while @assoc is true and if also 233 * valid in station mode only while @assoc is true and if also
234 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf 234 * requested by %IEEE80211_HW_NEED_DTIM_PERIOD (cf. also hw conf
235 * @ps_dtim_period) 235 * @ps_dtim_period)
236 * @last_tsf: last beacon's/probe response's TSF timestamp (could be old 236 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old
237 * as it may have been received during scanning long ago) 237 * as it may have been received during scanning long ago)
238 * @sync_device_ts: the device timestamp corresponding to the sync_tsf,
239 * the driver/device can use this to calculate synchronisation
238 * @beacon_int: beacon interval 240 * @beacon_int: beacon interval
239 * @assoc_capability: capabilities taken from assoc resp 241 * @assoc_capability: capabilities taken from assoc resp
240 * @basic_rates: bitmap of basic rates, each bit stands for an 242 * @basic_rates: bitmap of basic rates, each bit stands for an
@@ -281,7 +283,8 @@ struct ieee80211_bss_conf {
281 u8 dtim_period; 283 u8 dtim_period;
282 u16 beacon_int; 284 u16 beacon_int;
283 u16 assoc_capability; 285 u16 assoc_capability;
284 u64 last_tsf; 286 u64 sync_tsf;
287 u32 sync_device_ts;
285 u32 basic_rates; 288 u32 basic_rates;
286 int mcast_rate[IEEE80211_NUM_BANDS]; 289 int mcast_rate[IEEE80211_NUM_BANDS];
287 u16 ht_operation_mode; 290 u16 ht_operation_mode;
@@ -475,7 +478,7 @@ enum mac80211_rate_control_flags {
475#define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24 478#define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24
476 479
477/* maximum number of rate stages */ 480/* maximum number of rate stages */
478#define IEEE80211_TX_MAX_RATES 5 481#define IEEE80211_TX_MAX_RATES 4
479 482
480/** 483/**
481 * struct ieee80211_tx_rate - rate selection/status 484 * struct ieee80211_tx_rate - rate selection/status
@@ -563,11 +566,11 @@ struct ieee80211_tx_info {
563 } control; 566 } control;
564 struct { 567 struct {
565 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; 568 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
566 u8 ampdu_ack_len;
567 int ack_signal; 569 int ack_signal;
570 u8 ampdu_ack_len;
568 u8 ampdu_len; 571 u8 ampdu_len;
569 u8 antenna; 572 u8 antenna;
570 /* 14 bytes free */ 573 /* 21 bytes free */
571 } status; 574 } status;
572 struct { 575 struct {
573 struct ieee80211_tx_rate driver_rates[ 576 struct ieee80211_tx_rate driver_rates[
@@ -634,7 +637,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
634 info->status.rates[i].count = 0; 637 info->status.rates[i].count = 0;
635 638
636 BUILD_BUG_ON( 639 BUILD_BUG_ON(
637 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len) != 23); 640 offsetof(struct ieee80211_tx_info, status.ack_signal) != 20);
638 memset(&info->status.ampdu_ack_len, 0, 641 memset(&info->status.ampdu_ack_len, 0,
639 sizeof(struct ieee80211_tx_info) - 642 sizeof(struct ieee80211_tx_info) -
640 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len)); 643 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len));
@@ -696,6 +699,8 @@ enum mac80211_rx_flags {
696 * 699 *
697 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 700 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
698 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 701 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
702 * @device_timestamp: arbitrary timestamp for the device, mac80211 doesn't use
703 * it but can store it and pass it back to the driver for synchronisation
699 * @band: the active band when this frame was received 704 * @band: the active band when this frame was received
700 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 705 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
701 * @signal: signal strength when receiving this frame, either in dBm, in dB or 706 * @signal: signal strength when receiving this frame, either in dBm, in dB or
@@ -709,13 +714,14 @@ enum mac80211_rx_flags {
709 */ 714 */
710struct ieee80211_rx_status { 715struct ieee80211_rx_status {
711 u64 mactime; 716 u64 mactime;
712 enum ieee80211_band band; 717 u32 device_timestamp;
713 int freq; 718 u16 flag;
714 int signal; 719 u16 freq;
715 int antenna; 720 u8 rate_idx;
716 int rate_idx; 721 u8 rx_flags;
717 int flag; 722 u8 band;
718 unsigned int rx_flags; 723 u8 antenna;
724 s8 signal;
719}; 725};
720 726
721/** 727/**
@@ -1297,6 +1303,10 @@ enum ieee80211_hw_flags {
1297 * reports, by default it is set to _MCS, _GI and _BW but doesn't 1303 * reports, by default it is set to _MCS, _GI and _BW but doesn't
1298 * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only 1304 * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only
1299 * adding _BW is supported today. 1305 * adding _BW is supported today.
1306 *
1307 * @netdev_features: netdev features to be set in each netdev created
1308 * from this HW. Note only HW checksum features are currently
1309 * compatible with mac80211. Other feature bits will be rejected.
1300 */ 1310 */
1301struct ieee80211_hw { 1311struct ieee80211_hw {
1302 struct ieee80211_conf conf; 1312 struct ieee80211_conf conf;
@@ -1319,6 +1329,7 @@ struct ieee80211_hw {
1319 u8 max_tx_aggregation_subframes; 1329 u8 max_tx_aggregation_subframes;
1320 u8 offchannel_tx_hw_queue; 1330 u8 offchannel_tx_hw_queue;
1321 u8 radiotap_mcs_details; 1331 u8 radiotap_mcs_details;
1332 netdev_features_t netdev_features;
1322}; 1333};
1323 1334
1324/** 1335/**
@@ -1891,19 +1902,6 @@ enum ieee80211_rate_control_changed {
1891 * The low-level driver should send the frame out based on 1902 * The low-level driver should send the frame out based on
1892 * configuration in the TX control data. This handler should, 1903 * configuration in the TX control data. This handler should,
1893 * preferably, never fail and stop queues appropriately. 1904 * preferably, never fail and stop queues appropriately.
1894 * This must be implemented if @tx_frags is not.
1895 * Must be atomic.
1896 *
1897 * @tx_frags: Called to transmit multiple fragments of a single MSDU.
1898 * This handler must consume all fragments, sending out some of
1899 * them only is useless and it can't ask for some of them to be
1900 * queued again. If the frame is not fragmented the queue has a
1901 * single SKB only. To avoid issues with the networking stack
1902 * when TX status is reported the frames should be removed from
1903 * the skb queue.
1904 * If this is used, the tx_info @vif and @sta pointers will be
1905 * invalid -- you must not use them in that case.
1906 * This must be implemented if @tx isn't.
1907 * Must be atomic. 1905 * Must be atomic.
1908 * 1906 *
1909 * @start: Called before the first netdevice attached to the hardware 1907 * @start: Called before the first netdevice attached to the hardware
@@ -2183,7 +2181,10 @@ enum ieee80211_rate_control_changed {
2183 * offload. Frames to transmit on the off-channel channel are transmitted 2181 * offload. Frames to transmit on the off-channel channel are transmitted
2184 * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the 2182 * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the
2185 * duration (which will always be non-zero) expires, the driver must call 2183 * duration (which will always be non-zero) expires, the driver must call
2186 * ieee80211_remain_on_channel_expired(). This callback may sleep. 2184 * ieee80211_remain_on_channel_expired().
2185 * Note that this callback may be called while the device is in IDLE and
2186 * must be accepted in this case.
2187 * This callback may sleep.
2187 * @cancel_remain_on_channel: Requests that an ongoing off-channel period is 2188 * @cancel_remain_on_channel: Requests that an ongoing off-channel period is
2188 * aborted before it expires. This callback may sleep. 2189 * aborted before it expires. This callback may sleep.
2189 * 2190 *
@@ -2246,11 +2247,24 @@ enum ieee80211_rate_control_changed {
2246 * @get_et_strings: Ethtool API to get a set of strings to describe stats 2247 * @get_et_strings: Ethtool API to get a set of strings to describe stats
2247 * and perhaps other supported types of ethtool data-sets. 2248 * and perhaps other supported types of ethtool data-sets.
2248 * 2249 *
2250 * @get_rssi: Get current signal strength in dBm, the function is optional
2251 * and can sleep.
2252 *
2253 * @mgd_prepare_tx: Prepare for transmitting a management frame for association
2254 * before associated. In multi-channel scenarios, a virtual interface is
2255 * bound to a channel before it is associated, but as it isn't associated
2256 * yet it need not necessarily be given airtime, in particular since any
2257 * transmission to a P2P GO needs to be synchronized against the GO's
2258 * powersave state. mac80211 will call this function before transmitting a
2259 * management frame prior to having successfully associated to allow the
2260 * driver to give it channel time for the transmission, to get a response
2261 * and to be able to synchronize with the GO.
2262 * The callback will be called before each transmission and upon return
2263 * mac80211 will transmit the frame right away.
2264 * The callback is optional and can (should!) sleep.
2249 */ 2265 */
2250struct ieee80211_ops { 2266struct ieee80211_ops {
2251 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 2267 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
2252 void (*tx_frags)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2253 struct ieee80211_sta *sta, struct sk_buff_head *skbs);
2254 int (*start)(struct ieee80211_hw *hw); 2268 int (*start)(struct ieee80211_hw *hw);
2255 void (*stop)(struct ieee80211_hw *hw); 2269 void (*stop)(struct ieee80211_hw *hw);
2256#ifdef CONFIG_PM 2270#ifdef CONFIG_PM
@@ -2385,6 +2399,11 @@ struct ieee80211_ops {
2385 void (*get_et_strings)(struct ieee80211_hw *hw, 2399 void (*get_et_strings)(struct ieee80211_hw *hw,
2386 struct ieee80211_vif *vif, 2400 struct ieee80211_vif *vif,
2387 u32 sset, u8 *data); 2401 u32 sset, u8 *data);
2402 int (*get_rssi)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2403 struct ieee80211_sta *sta, s8 *rssi_dbm);
2404
2405 void (*mgd_prepare_tx)(struct ieee80211_hw *hw,
2406 struct ieee80211_vif *vif);
2388}; 2407};
2389 2408
2390/** 2409/**
@@ -3557,16 +3576,6 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
3557 gfp_t gfp); 3576 gfp_t gfp);
3558 3577
3559/** 3578/**
3560 * ieee80211_get_operstate - get the operstate of the vif
3561 *
3562 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3563 *
3564 * The driver might need to know the operstate of the net_device
3565 * (specifically, whether the link is IF_OPER_UP after resume)
3566 */
3567unsigned char ieee80211_get_operstate(struct ieee80211_vif *vif);
3568
3569/**
3570 * ieee80211_chswitch_done - Complete channel switch process 3579 * ieee80211_chswitch_done - Complete channel switch process
3571 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3580 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3572 * @success: make the channel switch successful or not 3581 * @success: make the channel switch successful or not
@@ -3589,22 +3598,6 @@ void ieee80211_request_smps(struct ieee80211_vif *vif,
3589 enum ieee80211_smps_mode smps_mode); 3598 enum ieee80211_smps_mode smps_mode);
3590 3599
3591/** 3600/**
3592 * ieee80211_key_removed - disable hw acceleration for key
3593 * @key_conf: The key hw acceleration should be disabled for
3594 *
3595 * This allows drivers to indicate that the given key has been
3596 * removed from hardware acceleration, due to a new key that
3597 * was added. Don't use this if the key can continue to be used
3598 * for TX, if the key restriction is on RX only it is permitted
3599 * to keep the key for TX only and not call this function.
3600 *
3601 * Due to locking constraints, it may only be called during
3602 * @set_key. This function must be allowed to sleep, and the
3603 * key it tries to disable may still be used until it returns.
3604 */
3605void ieee80211_key_removed(struct ieee80211_key_conf *key_conf);
3606
3607/**
3608 * ieee80211_ready_on_channel - notification of remain-on-channel start 3601 * ieee80211_ready_on_channel - notification of remain-on-channel start
3609 * @hw: pointer as obtained from ieee80211_alloc_hw() 3602 * @hw: pointer as obtained from ieee80211_alloc_hw()
3610 */ 3603 */
@@ -3829,12 +3822,6 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
3829 3822
3830void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); 3823void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
3831 3824
3832int ieee80211_add_srates_ie(struct ieee80211_vif *vif,
3833 struct sk_buff *skb, bool need_basic);
3834
3835int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif,
3836 struct sk_buff *skb, bool need_basic);
3837
3838/** 3825/**
3839 * ieee80211_ave_rssi - report the average rssi for the specified interface 3826 * ieee80211_ave_rssi - report the average rssi for the specified interface
3840 * 3827 *