diff options
Diffstat (limited to 'include/net/mac80211.h')
| -rw-r--r-- | include/net/mac80211.h | 386 |
1 files changed, 277 insertions, 109 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 0bf369752274..80eb7cc42ce9 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright 2002-2005, Devicescape Software, Inc. | 4 | * Copyright 2002-2005, Devicescape Software, Inc. |
| 5 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> | 5 | * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> |
| 6 | * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net> | 6 | * Copyright 2007-2010 Johannes Berg <johannes@sipsolutions.net> |
| 7 | * | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
| @@ -107,25 +107,14 @@ enum ieee80211_max_queues { | |||
| 107 | * 2^n-1 in the range 1..32767] | 107 | * 2^n-1 in the range 1..32767] |
| 108 | * @cw_max: maximum contention window [like @cw_min] | 108 | * @cw_max: maximum contention window [like @cw_min] |
| 109 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled | 109 | * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled |
| 110 | * @uapsd: is U-APSD mode enabled for the queue | ||
| 110 | */ | 111 | */ |
| 111 | struct ieee80211_tx_queue_params { | 112 | struct ieee80211_tx_queue_params { |
| 112 | u16 txop; | 113 | u16 txop; |
| 113 | u16 cw_min; | 114 | u16 cw_min; |
| 114 | u16 cw_max; | 115 | u16 cw_max; |
| 115 | u8 aifs; | 116 | u8 aifs; |
| 116 | }; | 117 | bool uapsd; |
| 117 | |||
| 118 | /** | ||
| 119 | * struct ieee80211_tx_queue_stats - transmit queue statistics | ||
| 120 | * | ||
| 121 | * @len: number of packets in queue | ||
| 122 | * @limit: queue length limit | ||
| 123 | * @count: number of frames sent | ||
| 124 | */ | ||
| 125 | struct ieee80211_tx_queue_stats { | ||
| 126 | unsigned int len; | ||
| 127 | unsigned int limit; | ||
| 128 | unsigned int count; | ||
| 129 | }; | 118 | }; |
| 130 | 119 | ||
| 131 | struct ieee80211_low_level_stats { | 120 | struct ieee80211_low_level_stats { |
| @@ -184,7 +173,8 @@ enum ieee80211_bss_change { | |||
| 184 | * @use_short_slot: use short slot time (only relevant for ERP); | 173 | * @use_short_slot: use short slot time (only relevant for ERP); |
| 185 | * if the hardware cannot handle this it must set the | 174 | * if the hardware cannot handle this it must set the |
| 186 | * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag | 175 | * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag |
| 187 | * @dtim_period: num of beacons before the next DTIM, for PSM | 176 | * @dtim_period: num of beacons before the next DTIM, for beaconing, |
| 177 | * not valid in station mode (cf. hw conf ps_dtim_period) | ||
| 188 | * @timestamp: beacon timestamp | 178 | * @timestamp: beacon timestamp |
| 189 | * @beacon_int: beacon interval | 179 | * @beacon_int: beacon interval |
| 190 | * @assoc_capability: capabilities taken from assoc resp | 180 | * @assoc_capability: capabilities taken from assoc resp |
| @@ -255,9 +245,6 @@ struct ieee80211_bss_conf { | |||
| 255 | * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be | 245 | * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be |
| 256 | * set by rate control algorithms to indicate probe rate, will | 246 | * set by rate control algorithms to indicate probe rate, will |
| 257 | * be cleared for fragmented frames (except on the last fragment) | 247 | * be cleared for fragmented frames (except on the last fragment) |
| 258 | * @IEEE80211_TX_INTFL_RCALGO: mac80211 internal flag, do not test or | ||
| 259 | * set this flag in the driver; indicates that the rate control | ||
| 260 | * algorithm was used and should be notified of TX status | ||
| 261 | * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, | 248 | * @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211, |
| 262 | * used to indicate that a pending frame requires TX processing before | 249 | * used to indicate that a pending frame requires TX processing before |
| 263 | * it can be sent out. | 250 | * it can be sent out. |
| @@ -272,6 +259,14 @@ struct ieee80211_bss_conf { | |||
| 272 | * transmit function after the current frame, this can be used | 259 | * transmit function after the current frame, this can be used |
| 273 | * by drivers to kick the DMA queue only if unset or when the | 260 | * by drivers to kick the DMA queue only if unset or when the |
| 274 | * queue gets full. | 261 | * queue gets full. |
| 262 | * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted | ||
| 263 | * after TX status because the destination was asleep, it must not | ||
| 264 | * be modified again (no seqno assignment, crypto, etc.) | ||
| 265 | * @IEEE80211_TX_INTFL_HAS_RADIOTAP: This frame was injected and still | ||
| 266 | * has a radiotap header at skb->data. | ||
| 267 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 | ||
| 268 | * MLME command (internal to mac80211 to figure out whether to send TX | ||
| 269 | * status to user space) | ||
| 275 | */ | 270 | */ |
| 276 | enum mac80211_tx_control_flags { | 271 | enum mac80211_tx_control_flags { |
| 277 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), | 272 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
| @@ -287,12 +282,14 @@ enum mac80211_tx_control_flags { | |||
| 287 | IEEE80211_TX_STAT_AMPDU = BIT(10), | 282 | IEEE80211_TX_STAT_AMPDU = BIT(10), |
| 288 | IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), | 283 | IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11), |
| 289 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), | 284 | IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12), |
| 290 | IEEE80211_TX_INTFL_RCALGO = BIT(13), | ||
| 291 | IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), | 285 | IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), |
| 292 | IEEE80211_TX_INTFL_RETRIED = BIT(15), | 286 | IEEE80211_TX_INTFL_RETRIED = BIT(15), |
| 293 | IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), | 287 | IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), |
| 294 | IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), | 288 | IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), |
| 295 | IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), | 289 | IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), |
| 290 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), | ||
| 291 | IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), | ||
| 292 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | ||
| 296 | }; | 293 | }; |
| 297 | 294 | ||
| 298 | /** | 295 | /** |
| @@ -571,7 +568,13 @@ struct ieee80211_rx_status { | |||
| 571 | * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this | 568 | * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this |
| 572 | * to determine for example whether to calculate timestamps for packets | 569 | * to determine for example whether to calculate timestamps for packets |
| 573 | * or not, do not use instead of filter flags! | 570 | * or not, do not use instead of filter flags! |
| 574 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) | 571 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only). |
| 572 | * This is the power save mode defined by IEEE 802.11-2007 section 11.2, | ||
| 573 | * meaning that the hardware still wakes up for beacons, is able to | ||
| 574 | * transmit frames and receive the possible acknowledgment frames. | ||
| 575 | * Not to be confused with hardware specific wakeup/sleep states, | ||
| 576 | * driver is responsible for that. See the section "Powersave support" | ||
| 577 | * for more. | ||
| 575 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set | 578 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set |
| 576 | * the driver should be prepared to handle configuration requests but | 579 | * the driver should be prepared to handle configuration requests but |
| 577 | * may turn the device off as much as possible. Typically, this flag will | 580 | * may turn the device off as much as possible. Typically, this flag will |
| @@ -595,8 +598,10 @@ enum ieee80211_conf_flags { | |||
| 595 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed | 598 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed |
| 596 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 599 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
| 597 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | 600 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed |
| 601 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed | ||
| 598 | */ | 602 | */ |
| 599 | enum ieee80211_conf_changed { | 603 | enum ieee80211_conf_changed { |
| 604 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), | ||
| 600 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), | 605 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), |
| 601 | IEEE80211_CONF_CHANGE_MONITOR = BIT(3), | 606 | IEEE80211_CONF_CHANGE_MONITOR = BIT(3), |
| 602 | IEEE80211_CONF_CHANGE_PS = BIT(4), | 607 | IEEE80211_CONF_CHANGE_PS = BIT(4), |
| @@ -607,6 +612,25 @@ enum ieee80211_conf_changed { | |||
| 607 | }; | 612 | }; |
| 608 | 613 | ||
| 609 | /** | 614 | /** |
| 615 | * enum ieee80211_smps_mode - spatial multiplexing power save mode | ||
| 616 | * | ||
| 617 | * @IEEE80211_SMPS_AUTOMATIC: automatic | ||
| 618 | * @IEEE80211_SMPS_OFF: off | ||
| 619 | * @IEEE80211_SMPS_STATIC: static | ||
| 620 | * @IEEE80211_SMPS_DYNAMIC: dynamic | ||
| 621 | * @IEEE80211_SMPS_NUM_MODES: internal, don't use | ||
| 622 | */ | ||
| 623 | enum ieee80211_smps_mode { | ||
| 624 | IEEE80211_SMPS_AUTOMATIC, | ||
| 625 | IEEE80211_SMPS_OFF, | ||
| 626 | IEEE80211_SMPS_STATIC, | ||
| 627 | IEEE80211_SMPS_DYNAMIC, | ||
| 628 | |||
| 629 | /* keep last */ | ||
| 630 | IEEE80211_SMPS_NUM_MODES, | ||
| 631 | }; | ||
| 632 | |||
| 633 | /** | ||
| 610 | * struct ieee80211_conf - configuration of the device | 634 | * struct ieee80211_conf - configuration of the device |
| 611 | * | 635 | * |
| 612 | * This struct indicates how the driver shall configure the hardware. | 636 | * This struct indicates how the driver shall configure the hardware. |
| @@ -619,6 +643,9 @@ enum ieee80211_conf_changed { | |||
| 619 | * value will be only achievable between DTIM frames, the hardware | 643 | * value will be only achievable between DTIM frames, the hardware |
| 620 | * needs to check for the multicast traffic bit in DTIM beacons. | 644 | * needs to check for the multicast traffic bit in DTIM beacons. |
| 621 | * This variable is valid only when the CONF_PS flag is set. | 645 | * This variable is valid only when the CONF_PS flag is set. |
| 646 | * @ps_dtim_period: The DTIM period of the AP we're connected to, for use | ||
| 647 | * in power saving. Power saving will not be enabled until a beacon | ||
| 648 | * has been received and the DTIM period is known. | ||
| 622 | * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the | 649 | * @dynamic_ps_timeout: The dynamic powersave timeout (in ms), see the |
| 623 | * powersave documentation below. This variable is valid only when | 650 | * powersave documentation below. This variable is valid only when |
| 624 | * the CONF_PS flag is set. | 651 | * the CONF_PS flag is set. |
| @@ -634,6 +661,10 @@ enum ieee80211_conf_changed { | |||
| 634 | * @short_frame_max_tx_count: Maximum number of transmissions for a "short" | 661 | * @short_frame_max_tx_count: Maximum number of transmissions for a "short" |
| 635 | * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the | 662 | * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the |
| 636 | * number of transmissions not the number of retries | 663 | * number of transmissions not the number of retries |
| 664 | * | ||
| 665 | * @smps_mode: spatial multiplexing powersave mode; note that | ||
| 666 | * %IEEE80211_SMPS_STATIC is used when the device is not | ||
| 667 | * configured for an HT channel | ||
| 637 | */ | 668 | */ |
| 638 | struct ieee80211_conf { | 669 | struct ieee80211_conf { |
| 639 | u32 flags; | 670 | u32 flags; |
| @@ -641,11 +672,13 @@ struct ieee80211_conf { | |||
| 641 | int max_sleep_period; | 672 | int max_sleep_period; |
| 642 | 673 | ||
| 643 | u16 listen_interval; | 674 | u16 listen_interval; |
| 675 | u8 ps_dtim_period; | ||
| 644 | 676 | ||
| 645 | u8 long_frame_max_tx_count, short_frame_max_tx_count; | 677 | u8 long_frame_max_tx_count, short_frame_max_tx_count; |
| 646 | 678 | ||
| 647 | struct ieee80211_channel *channel; | 679 | struct ieee80211_channel *channel; |
| 648 | enum nl80211_channel_type channel_type; | 680 | enum nl80211_channel_type channel_type; |
| 681 | enum ieee80211_smps_mode smps_mode; | ||
| 649 | }; | 682 | }; |
| 650 | 683 | ||
| 651 | /** | 684 | /** |
| @@ -657,12 +690,14 @@ struct ieee80211_conf { | |||
| 657 | * @type: type of this virtual interface | 690 | * @type: type of this virtual interface |
| 658 | * @bss_conf: BSS configuration for this interface, either our own | 691 | * @bss_conf: BSS configuration for this interface, either our own |
| 659 | * or the BSS we're associated to | 692 | * or the BSS we're associated to |
| 693 | * @addr: address of this interface | ||
| 660 | * @drv_priv: data area for driver use, will always be aligned to | 694 | * @drv_priv: data area for driver use, will always be aligned to |
| 661 | * sizeof(void *). | 695 | * sizeof(void *). |
| 662 | */ | 696 | */ |
| 663 | struct ieee80211_vif { | 697 | struct ieee80211_vif { |
| 664 | enum nl80211_iftype type; | 698 | enum nl80211_iftype type; |
| 665 | struct ieee80211_bss_conf bss_conf; | 699 | struct ieee80211_bss_conf bss_conf; |
| 700 | u8 addr[ETH_ALEN]; | ||
| 666 | /* must be last */ | 701 | /* must be last */ |
| 667 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 702 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
| 668 | }; | 703 | }; |
| @@ -676,33 +711,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
| 676 | } | 711 | } |
| 677 | 712 | ||
| 678 | /** | 713 | /** |
| 679 | * struct ieee80211_if_init_conf - initial configuration of an interface | ||
| 680 | * | ||
| 681 | * @vif: pointer to a driver-use per-interface structure. The pointer | ||
| 682 | * itself is also used for various functions including | ||
| 683 | * ieee80211_beacon_get() and ieee80211_get_buffered_bc(). | ||
| 684 | * @type: one of &enum nl80211_iftype constants. Determines the type of | ||
| 685 | * added/removed interface. | ||
| 686 | * @mac_addr: pointer to MAC address of the interface. This pointer is valid | ||
| 687 | * until the interface is removed (i.e. it cannot be used after | ||
| 688 | * remove_interface() callback was called for this interface). | ||
| 689 | * | ||
| 690 | * This structure is used in add_interface() and remove_interface() | ||
| 691 | * callbacks of &struct ieee80211_hw. | ||
| 692 | * | ||
| 693 | * When you allow multiple interfaces to be added to your PHY, take care | ||
| 694 | * that the hardware can actually handle multiple MAC addresses. However, | ||
| 695 | * also take care that when there's no interface left with mac_addr != %NULL | ||
| 696 | * you remove the MAC address from the device to avoid acknowledging packets | ||
| 697 | * in pure monitor mode. | ||
| 698 | */ | ||
| 699 | struct ieee80211_if_init_conf { | ||
| 700 | enum nl80211_iftype type; | ||
| 701 | struct ieee80211_vif *vif; | ||
| 702 | void *mac_addr; | ||
| 703 | }; | ||
| 704 | |||
| 705 | /** | ||
| 706 | * enum ieee80211_key_alg - key algorithm | 714 | * enum ieee80211_key_alg - key algorithm |
| 707 | * @ALG_WEP: WEP40 or WEP104 | 715 | * @ALG_WEP: WEP40 or WEP104 |
| 708 | * @ALG_TKIP: TKIP | 716 | * @ALG_TKIP: TKIP |
| @@ -797,7 +805,7 @@ enum set_key_cmd { | |||
| 797 | * mac80211, any ieee80211_sta pointer you get access to must | 805 | * mac80211, any ieee80211_sta pointer you get access to must |
| 798 | * either be protected by rcu_read_lock() explicitly or implicitly, | 806 | * either be protected by rcu_read_lock() explicitly or implicitly, |
| 799 | * or you must take good care to not use such a pointer after a | 807 | * or you must take good care to not use such a pointer after a |
| 800 | * call to your sta_notify callback that removed it. | 808 | * call to your sta_remove callback that removed it. |
| 801 | * | 809 | * |
| 802 | * @addr: MAC address | 810 | * @addr: MAC address |
| 803 | * @aid: AID we assigned to the station if we're an AP | 811 | * @aid: AID we assigned to the station if we're an AP |
| @@ -823,8 +831,8 @@ struct ieee80211_sta { | |||
| 823 | * indicates addition and removal of a station to station table, | 831 | * indicates addition and removal of a station to station table, |
| 824 | * or if a associated station made a power state transition. | 832 | * or if a associated station made a power state transition. |
| 825 | * | 833 | * |
| 826 | * @STA_NOTIFY_ADD: a station was added to the station table | 834 | * @STA_NOTIFY_ADD: (DEPRECATED) a station was added to the station table |
| 827 | * @STA_NOTIFY_REMOVE: a station being removed from the station table | 835 | * @STA_NOTIFY_REMOVE: (DEPRECATED) a station being removed from the station table |
| 828 | * @STA_NOTIFY_SLEEP: a station is now sleeping | 836 | * @STA_NOTIFY_SLEEP: a station is now sleeping |
| 829 | * @STA_NOTIFY_AWAKE: a sleeping station woke up | 837 | * @STA_NOTIFY_AWAKE: a sleeping station woke up |
| 830 | */ | 838 | */ |
| @@ -926,6 +934,26 @@ enum ieee80211_tkip_key_type { | |||
| 926 | * @IEEE80211_HW_BEACON_FILTER: | 934 | * @IEEE80211_HW_BEACON_FILTER: |
| 927 | * Hardware supports dropping of irrelevant beacon frames to | 935 | * Hardware supports dropping of irrelevant beacon frames to |
| 928 | * avoid waking up cpu. | 936 | * avoid waking up cpu. |
| 937 | * | ||
| 938 | * @IEEE80211_HW_SUPPORTS_STATIC_SMPS: | ||
| 939 | * Hardware supports static spatial multiplexing powersave, | ||
| 940 | * ie. can turn off all but one chain even on HT connections | ||
| 941 | * that should be using more chains. | ||
| 942 | * | ||
| 943 | * @IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS: | ||
| 944 | * Hardware supports dynamic spatial multiplexing powersave, | ||
| 945 | * ie. can turn off all but one chain and then wake the rest | ||
| 946 | * up as required after, for example, rts/cts handshake. | ||
| 947 | * | ||
| 948 | * @IEEE80211_HW_SUPPORTS_UAPSD: | ||
| 949 | * Hardware supports Unscheduled Automatic Power Save Delivery | ||
| 950 | * (U-APSD) in managed mode. The mode is configured with | ||
| 951 | * conf_tx() operation. | ||
| 952 | * | ||
| 953 | * @IEEE80211_HW_REPORTS_TX_ACK_STATUS: | ||
| 954 | * Hardware can provide ack status reports of Tx frames to | ||
| 955 | * the stack. | ||
| 956 | * | ||
| 929 | */ | 957 | */ |
| 930 | enum ieee80211_hw_flags { | 958 | enum ieee80211_hw_flags { |
| 931 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 959 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
| @@ -943,6 +971,10 @@ enum ieee80211_hw_flags { | |||
| 943 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, | 971 | IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, |
| 944 | IEEE80211_HW_MFP_CAPABLE = 1<<13, | 972 | IEEE80211_HW_MFP_CAPABLE = 1<<13, |
| 945 | IEEE80211_HW_BEACON_FILTER = 1<<14, | 973 | IEEE80211_HW_BEACON_FILTER = 1<<14, |
| 974 | IEEE80211_HW_SUPPORTS_STATIC_SMPS = 1<<15, | ||
| 975 | IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS = 1<<16, | ||
| 976 | IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, | ||
| 977 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, | ||
| 946 | }; | 978 | }; |
| 947 | 979 | ||
| 948 | /** | 980 | /** |
| @@ -1121,18 +1153,24 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1121 | * | 1153 | * |
| 1122 | * mac80211 has support for various powersave implementations. | 1154 | * mac80211 has support for various powersave implementations. |
| 1123 | * | 1155 | * |
| 1124 | * First, it can support hardware that handles all powersaving by | 1156 | * First, it can support hardware that handles all powersaving by itself, |
| 1125 | * itself, such hardware should simply set the %IEEE80211_HW_SUPPORTS_PS | 1157 | * such hardware should simply set the %IEEE80211_HW_SUPPORTS_PS hardware |
| 1126 | * hardware flag. In that case, it will be told about the desired | 1158 | * flag. In that case, it will be told about the desired powersave mode |
| 1127 | * powersave mode depending on the association status, and the driver | 1159 | * with the %IEEE80211_CONF_PS flag depending on the association status. |
| 1128 | * must take care of sending nullfunc frames when necessary, i.e. when | 1160 | * The hardware must take care of sending nullfunc frames when necessary, |
| 1129 | * entering and leaving powersave mode. The driver is required to look at | 1161 | * i.e. when entering and leaving powersave mode. The hardware is required |
| 1130 | * the AID in beacons and signal to the AP that it woke up when it finds | 1162 | * to look at the AID in beacons and signal to the AP that it woke up when |
| 1131 | * traffic directed to it. This mode supports dynamic PS by simply | 1163 | * it finds traffic directed to it. |
| 1132 | * enabling/disabling PS. | 1164 | * |
| 1133 | * | 1165 | * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in |
| 1134 | * Additionally, such hardware may set the %IEEE80211_HW_SUPPORTS_DYNAMIC_PS | 1166 | * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused |
| 1135 | * flag to indicate that it can support dynamic PS mode itself (see below). | 1167 | * with hardware wakeup and sleep states. Driver is responsible for waking |
| 1168 | * up the hardware before issueing commands to the hardware and putting it | ||
| 1169 | * back to sleep at approriate times. | ||
| 1170 | * | ||
| 1171 | * When PS is enabled, hardware needs to wakeup for beacons and receive the | ||
| 1172 | * buffered multicast/broadcast frames after the beacon. Also it must be | ||
| 1173 | * possible to send frames and receive the acknowledment frame. | ||
| 1136 | * | 1174 | * |
| 1137 | * Other hardware designs cannot send nullfunc frames by themselves and also | 1175 | * Other hardware designs cannot send nullfunc frames by themselves and also |
| 1138 | * need software support for parsing the TIM bitmap. This is also supported | 1176 | * need software support for parsing the TIM bitmap. This is also supported |
| @@ -1140,14 +1178,35 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1140 | * %IEEE80211_HW_PS_NULLFUNC_STACK flags. The hardware is of course still | 1178 | * %IEEE80211_HW_PS_NULLFUNC_STACK flags. The hardware is of course still |
| 1141 | * required to pass up beacons. The hardware is still required to handle | 1179 | * required to pass up beacons. The hardware is still required to handle |
| 1142 | * waking up for multicast traffic; if it cannot the driver must handle that | 1180 | * waking up for multicast traffic; if it cannot the driver must handle that |
| 1143 | * as best as it can, mac80211 is too slow. | 1181 | * as best as it can, mac80211 is too slow to do that. |
| 1144 | * | 1182 | * |
| 1145 | * Dynamic powersave mode is an extension to normal powersave mode in which | 1183 | * Dynamic powersave is an extension to normal powersave in which the |
| 1146 | * the hardware stays awake for a user-specified period of time after sending | 1184 | * hardware stays awake for a user-specified period of time after sending a |
| 1147 | * a frame so that reply frames need not be buffered and therefore delayed | 1185 | * frame so that reply frames need not be buffered and therefore delayed to |
| 1148 | * to the next wakeup. This can either be supported by hardware, in which case | 1186 | * the next wakeup. It's compromise of getting good enough latency when |
| 1149 | * the driver needs to look at the @dynamic_ps_timeout hardware configuration | 1187 | * there's data traffic and still saving significantly power in idle |
| 1150 | * value, or by the stack if all nullfunc handling is in the stack. | 1188 | * periods. |
| 1189 | * | ||
| 1190 | * Dynamic powersave is supported by simply mac80211 enabling and disabling | ||
| 1191 | * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS | ||
| 1192 | * flag and mac80211 will handle everything automatically. Additionally, | ||
| 1193 | * hardware having support for the dynamic PS feature may set the | ||
| 1194 | * %IEEE80211_HW_SUPPORTS_DYNAMIC_PS flag to indicate that it can support | ||
| 1195 | * dynamic PS mode itself. The driver needs to look at the | ||
| 1196 | * @dynamic_ps_timeout hardware configuration value and use it that value | ||
| 1197 | * whenever %IEEE80211_CONF_PS is set. In this case mac80211 will disable | ||
| 1198 | * dynamic PS feature in stack and will just keep %IEEE80211_CONF_PS | ||
| 1199 | * enabled whenever user has enabled powersave. | ||
| 1200 | * | ||
| 1201 | * Driver informs U-APSD client support by enabling | ||
| 1202 | * %IEEE80211_HW_SUPPORTS_UAPSD flag. The mode is configured through the | ||
| 1203 | * uapsd paramater in conf_tx() operation. Hardware needs to send the QoS | ||
| 1204 | * Nullfunc frames and stay awake until the service period has ended. To | ||
| 1205 | * utilize U-APSD, dynamic powersave is disabled for voip AC and all frames | ||
| 1206 | * from that AC are transmitted with powersave enabled. | ||
| 1207 | * | ||
| 1208 | * Note: U-APSD client mode is not yet supported with | ||
| 1209 | * %IEEE80211_HW_PS_NULLFUNC_STACK. | ||
| 1151 | */ | 1210 | */ |
| 1152 | 1211 | ||
| 1153 | /** | 1212 | /** |
| @@ -1211,6 +1270,31 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1211 | */ | 1270 | */ |
| 1212 | 1271 | ||
| 1213 | /** | 1272 | /** |
| 1273 | * DOC: Spatial multiplexing power save | ||
| 1274 | * | ||
| 1275 | * SMPS (Spatial multiplexing power save) is a mechanism to conserve | ||
| 1276 | * power in an 802.11n implementation. For details on the mechanism | ||
| 1277 | * and rationale, please refer to 802.11 (as amended by 802.11n-2009) | ||
| 1278 | * "11.2.3 SM power save". | ||
| 1279 | * | ||
| 1280 | * The mac80211 implementation is capable of sending action frames | ||
| 1281 | * to update the AP about the station's SMPS mode, and will instruct | ||
| 1282 | * the driver to enter the specific mode. It will also announce the | ||
| 1283 | * requested SMPS mode during the association handshake. Hardware | ||
| 1284 | * support for this feature is required, and can be indicated by | ||
| 1285 | * hardware flags. | ||
| 1286 | * | ||
| 1287 | * The default mode will be "automatic", which nl80211/cfg80211 | ||
| 1288 | * defines to be dynamic SMPS in (regular) powersave, and SMPS | ||
| 1289 | * turned off otherwise. | ||
| 1290 | * | ||
| 1291 | * To support this feature, the driver must set the appropriate | ||
| 1292 | * hardware support flags, and handle the SMPS flag to the config() | ||
| 1293 | * operation. It will then with this mechanism be instructed to | ||
| 1294 | * enter the requested SMPS mode while associated to an HT AP. | ||
| 1295 | */ | ||
| 1296 | |||
| 1297 | /** | ||
| 1214 | * DOC: Frame filtering | 1298 | * DOC: Frame filtering |
| 1215 | * | 1299 | * |
| 1216 | * mac80211 requires to see many management frames for proper | 1300 | * mac80211 requires to see many management frames for proper |
| @@ -1347,7 +1431,7 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1347 | * When the device is started it should not have a MAC address | 1431 | * When the device is started it should not have a MAC address |
| 1348 | * to avoid acknowledging frames before a non-monitor device | 1432 | * to avoid acknowledging frames before a non-monitor device |
| 1349 | * is added. | 1433 | * is added. |
| 1350 | * Must be implemented. | 1434 | * Must be implemented and can sleep. |
| 1351 | * | 1435 | * |
| 1352 | * @stop: Called after last netdevice attached to the hardware | 1436 | * @stop: Called after last netdevice attached to the hardware |
| 1353 | * is disabled. This should turn off the hardware (at least | 1437 | * is disabled. This should turn off the hardware (at least |
| @@ -1355,7 +1439,7 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1355 | * May be called right after add_interface if that rejects | 1439 | * May be called right after add_interface if that rejects |
| 1356 | * an interface. If you added any work onto the mac80211 workqueue | 1440 | * an interface. If you added any work onto the mac80211 workqueue |
| 1357 | * you should ensure to cancel it on this callback. | 1441 | * you should ensure to cancel it on this callback. |
| 1358 | * Must be implemented. | 1442 | * Must be implemented and can sleep. |
| 1359 | * | 1443 | * |
| 1360 | * @add_interface: Called when a netdevice attached to the hardware is | 1444 | * @add_interface: Called when a netdevice attached to the hardware is |
| 1361 | * enabled. Because it is not called for monitor mode devices, @start | 1445 | * enabled. Because it is not called for monitor mode devices, @start |
| @@ -1365,7 +1449,7 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1365 | * interface is given in the conf parameter. | 1449 | * interface is given in the conf parameter. |
| 1366 | * The callback may refuse to add an interface by returning a | 1450 | * The callback may refuse to add an interface by returning a |
| 1367 | * negative error code (which will be seen in userspace.) | 1451 | * negative error code (which will be seen in userspace.) |
| 1368 | * Must be implemented. | 1452 | * Must be implemented and can sleep. |
| 1369 | * | 1453 | * |
| 1370 | * @remove_interface: Notifies a driver that an interface is going down. | 1454 | * @remove_interface: Notifies a driver that an interface is going down. |
| 1371 | * The @stop callback is called after this if it is the last interface | 1455 | * The @stop callback is called after this if it is the last interface |
| @@ -1374,19 +1458,20 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1374 | * must be cleared so the device no longer acknowledges packets, | 1458 | * must be cleared so the device no longer acknowledges packets, |
| 1375 | * the mac_addr member of the conf structure is, however, set to the | 1459 | * the mac_addr member of the conf structure is, however, set to the |
| 1376 | * MAC address of the device going away. | 1460 | * MAC address of the device going away. |
| 1377 | * Hence, this callback must be implemented. | 1461 | * Hence, this callback must be implemented. It can sleep. |
| 1378 | * | 1462 | * |
| 1379 | * @config: Handler for configuration requests. IEEE 802.11 code calls this | 1463 | * @config: Handler for configuration requests. IEEE 802.11 code calls this |
| 1380 | * function to change hardware configuration, e.g., channel. | 1464 | * function to change hardware configuration, e.g., channel. |
| 1381 | * This function should never fail but returns a negative error code | 1465 | * This function should never fail but returns a negative error code |
| 1382 | * if it does. | 1466 | * if it does. The callback can sleep. |
| 1383 | * | 1467 | * |
| 1384 | * @bss_info_changed: Handler for configuration requests related to BSS | 1468 | * @bss_info_changed: Handler for configuration requests related to BSS |
| 1385 | * parameters that may vary during BSS's lifespan, and may affect low | 1469 | * parameters that may vary during BSS's lifespan, and may affect low |
| 1386 | * level driver (e.g. assoc/disassoc status, erp parameters). | 1470 | * level driver (e.g. assoc/disassoc status, erp parameters). |
| 1387 | * This function should not be used if no BSS has been set, unless | 1471 | * This function should not be used if no BSS has been set, unless |
| 1388 | * for association indication. The @changed parameter indicates which | 1472 | * for association indication. The @changed parameter indicates which |
| 1389 | * of the bss parameters has changed when a call is made. | 1473 | * of the bss parameters has changed when a call is made. The callback |
| 1474 | * can sleep. | ||
| 1390 | * | 1475 | * |
| 1391 | * @prepare_multicast: Prepare for multicast filter configuration. | 1476 | * @prepare_multicast: Prepare for multicast filter configuration. |
| 1392 | * This callback is optional, and its return value is passed | 1477 | * This callback is optional, and its return value is passed |
| @@ -1394,20 +1479,22 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1394 | * | 1479 | * |
| 1395 | * @configure_filter: Configure the device's RX filter. | 1480 | * @configure_filter: Configure the device's RX filter. |
| 1396 | * See the section "Frame filtering" for more information. | 1481 | * See the section "Frame filtering" for more information. |
| 1397 | * This callback must be implemented. | 1482 | * This callback must be implemented and can sleep. |
| 1398 | * | 1483 | * |
| 1399 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit | 1484 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit |
| 1400 | * must be set or cleared for a given STA. Must be atomic. | 1485 | * must be set or cleared for a given STA. Must be atomic. |
| 1401 | * | 1486 | * |
| 1402 | * @set_key: See the section "Hardware crypto acceleration" | 1487 | * @set_key: See the section "Hardware crypto acceleration" |
| 1403 | * This callback can sleep, and is only called between add_interface | 1488 | * This callback is only called between add_interface and |
| 1404 | * and remove_interface calls, i.e. while the given virtual interface | 1489 | * remove_interface calls, i.e. while the given virtual interface |
| 1405 | * is enabled. | 1490 | * is enabled. |
| 1406 | * Returns a negative error code if the key can't be added. | 1491 | * Returns a negative error code if the key can't be added. |
| 1492 | * The callback can sleep. | ||
| 1407 | * | 1493 | * |
| 1408 | * @update_tkip_key: See the section "Hardware crypto acceleration" | 1494 | * @update_tkip_key: See the section "Hardware crypto acceleration" |
| 1409 | * This callback will be called in the context of Rx. Called for drivers | 1495 | * This callback will be called in the context of Rx. Called for drivers |
| 1410 | * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. | 1496 | * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. |
| 1497 | * The callback must be atomic. | ||
| 1411 | * | 1498 | * |
| 1412 | * @hw_scan: Ask the hardware to service the scan request, no need to start | 1499 | * @hw_scan: Ask the hardware to service the scan request, no need to start |
| 1413 | * the scan state machine in stack. The scan must honour the channel | 1500 | * the scan state machine in stack. The scan must honour the channel |
| @@ -1421,53 +1508,64 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1421 | * When the scan finishes, ieee80211_scan_completed() must be called; | 1508 | * When the scan finishes, ieee80211_scan_completed() must be called; |
| 1422 | * note that it also must be called when the scan cannot finish due to | 1509 | * note that it also must be called when the scan cannot finish due to |
| 1423 | * any error unless this callback returned a negative error code. | 1510 | * any error unless this callback returned a negative error code. |
| 1511 | * The callback can sleep. | ||
| 1424 | * | 1512 | * |
| 1425 | * @sw_scan_start: Notifier function that is called just before a software scan | 1513 | * @sw_scan_start: Notifier function that is called just before a software scan |
| 1426 | * is started. Can be NULL, if the driver doesn't need this notification. | 1514 | * is started. Can be NULL, if the driver doesn't need this notification. |
| 1515 | * The callback can sleep. | ||
| 1427 | * | 1516 | * |
| 1428 | * @sw_scan_complete: Notifier function that is called just after a software scan | 1517 | * @sw_scan_complete: Notifier function that is called just after a |
| 1429 | * finished. Can be NULL, if the driver doesn't need this notification. | 1518 | * software scan finished. Can be NULL, if the driver doesn't need |
| 1519 | * this notification. | ||
| 1520 | * The callback can sleep. | ||
| 1430 | * | 1521 | * |
| 1431 | * @get_stats: Return low-level statistics. | 1522 | * @get_stats: Return low-level statistics. |
| 1432 | * Returns zero if statistics are available. | 1523 | * Returns zero if statistics are available. |
| 1524 | * The callback can sleep. | ||
| 1433 | * | 1525 | * |
| 1434 | * @get_tkip_seq: If your device implements TKIP encryption in hardware this | 1526 | * @get_tkip_seq: If your device implements TKIP encryption in hardware this |
| 1435 | * callback should be provided to read the TKIP transmit IVs (both IV32 | 1527 | * callback should be provided to read the TKIP transmit IVs (both IV32 |
| 1436 | * and IV16) for the given key from hardware. | 1528 | * and IV16) for the given key from hardware. |
| 1529 | * The callback must be atomic. | ||
| 1437 | * | 1530 | * |
| 1438 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) | 1531 | * @set_rts_threshold: Configuration of RTS threshold (if device needs it) |
| 1532 | * The callback can sleep. | ||
| 1533 | * | ||
| 1534 | * @sta_add: Notifies low level driver about addition of an associated station, | ||
| 1535 | * AP, IBSS/WDS/mesh peer etc. This callback can sleep. | ||
| 1536 | * | ||
| 1537 | * @sta_remove: Notifies low level driver about removal of an associated | ||
| 1538 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | ||
| 1439 | * | 1539 | * |
| 1440 | * @sta_notify: Notifies low level driver about addition, removal or power | 1540 | * @sta_notify: Notifies low level driver about power state transition of an |
| 1441 | * state transition of an associated station, AP, IBSS/WDS/mesh peer etc. | 1541 | * associated station, AP, IBSS/WDS/mesh peer etc. Must be atomic. |
| 1442 | * Must be atomic. | ||
| 1443 | * | 1542 | * |
| 1444 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), | 1543 | * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), |
| 1445 | * bursting) for a hardware TX queue. | 1544 | * bursting) for a hardware TX queue. |
| 1446 | * Returns a negative error code on failure. | 1545 | * Returns a negative error code on failure. |
| 1447 | * | 1546 | * The callback can sleep. |
| 1448 | * @get_tx_stats: Get statistics of the current TX queue status. This is used | ||
| 1449 | * to get number of currently queued packets (queue length), maximum queue | ||
| 1450 | * size (limit), and total number of packets sent using each TX queue | ||
| 1451 | * (count). The 'stats' pointer points to an array that has hw->queues | ||
| 1452 | * items. | ||
| 1453 | * | 1547 | * |
| 1454 | * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, | 1548 | * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, |
| 1455 | * this is only used for IBSS mode BSSID merging and debugging. Is not a | 1549 | * this is only used for IBSS mode BSSID merging and debugging. Is not a |
| 1456 | * required function. | 1550 | * required function. |
| 1551 | * The callback can sleep. | ||
| 1457 | * | 1552 | * |
| 1458 | * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. | 1553 | * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. |
| 1459 | * Currently, this is only used for IBSS mode debugging. Is not a | 1554 | * Currently, this is only used for IBSS mode debugging. Is not a |
| 1460 | * required function. | 1555 | * required function. |
| 1556 | * The callback can sleep. | ||
| 1461 | * | 1557 | * |
| 1462 | * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize | 1558 | * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize |
| 1463 | * with other STAs in the IBSS. This is only used in IBSS mode. This | 1559 | * with other STAs in the IBSS. This is only used in IBSS mode. This |
| 1464 | * function is optional if the firmware/hardware takes full care of | 1560 | * function is optional if the firmware/hardware takes full care of |
| 1465 | * TSF synchronization. | 1561 | * TSF synchronization. |
| 1562 | * The callback can sleep. | ||
| 1466 | * | 1563 | * |
| 1467 | * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. | 1564 | * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. |
| 1468 | * This is needed only for IBSS mode and the result of this function is | 1565 | * This is needed only for IBSS mode and the result of this function is |
| 1469 | * used to determine whether to reply to Probe Requests. | 1566 | * used to determine whether to reply to Probe Requests. |
| 1470 | * Returns non-zero if this device sent the last beacon. | 1567 | * Returns non-zero if this device sent the last beacon. |
| 1568 | * The callback can sleep. | ||
| 1471 | * | 1569 | * |
| 1472 | * @ampdu_action: Perform a certain A-MPDU action | 1570 | * @ampdu_action: Perform a certain A-MPDU action |
| 1473 | * The RA/TID combination determines the destination and TID we want | 1571 | * The RA/TID combination determines the destination and TID we want |
| @@ -1476,21 +1574,32 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1476 | * is the first frame we expect to perform the action on. Notice | 1574 | * is the first frame we expect to perform the action on. Notice |
| 1477 | * that TX/RX_STOP can pass NULL for this parameter. | 1575 | * that TX/RX_STOP can pass NULL for this parameter. |
| 1478 | * Returns a negative error code on failure. | 1576 | * Returns a negative error code on failure. |
| 1577 | * The callback must be atomic. | ||
| 1479 | * | 1578 | * |
| 1480 | * @rfkill_poll: Poll rfkill hardware state. If you need this, you also | 1579 | * @rfkill_poll: Poll rfkill hardware state. If you need this, you also |
| 1481 | * need to set wiphy->rfkill_poll to %true before registration, | 1580 | * need to set wiphy->rfkill_poll to %true before registration, |
| 1482 | * and need to call wiphy_rfkill_set_hw_state() in the callback. | 1581 | * and need to call wiphy_rfkill_set_hw_state() in the callback. |
| 1582 | * The callback can sleep. | ||
| 1583 | * | ||
| 1584 | * @set_coverage_class: Set slot time for given coverage class as specified | ||
| 1585 | * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout | ||
| 1586 | * accordingly. This callback is not required and may sleep. | ||
| 1483 | * | 1587 | * |
| 1484 | * @testmode_cmd: Implement a cfg80211 test mode command. | 1588 | * @testmode_cmd: Implement a cfg80211 test mode command. |
| 1589 | * The callback can sleep. | ||
| 1590 | * | ||
| 1591 | * @flush: Flush all pending frames from the hardware queue, making sure | ||
| 1592 | * that the hardware queues are empty. If the parameter @drop is set | ||
| 1593 | * to %true, pending frames may be dropped. The callback can sleep. | ||
| 1485 | */ | 1594 | */ |
| 1486 | struct ieee80211_ops { | 1595 | struct ieee80211_ops { |
| 1487 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1596 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
| 1488 | int (*start)(struct ieee80211_hw *hw); | 1597 | int (*start)(struct ieee80211_hw *hw); |
| 1489 | void (*stop)(struct ieee80211_hw *hw); | 1598 | void (*stop)(struct ieee80211_hw *hw); |
| 1490 | int (*add_interface)(struct ieee80211_hw *hw, | 1599 | int (*add_interface)(struct ieee80211_hw *hw, |
| 1491 | struct ieee80211_if_init_conf *conf); | 1600 | struct ieee80211_vif *vif); |
| 1492 | void (*remove_interface)(struct ieee80211_hw *hw, | 1601 | void (*remove_interface)(struct ieee80211_hw *hw, |
| 1493 | struct ieee80211_if_init_conf *conf); | 1602 | struct ieee80211_vif *vif); |
| 1494 | int (*config)(struct ieee80211_hw *hw, u32 changed); | 1603 | int (*config)(struct ieee80211_hw *hw, u32 changed); |
| 1495 | void (*bss_info_changed)(struct ieee80211_hw *hw, | 1604 | void (*bss_info_changed)(struct ieee80211_hw *hw, |
| 1496 | struct ieee80211_vif *vif, | 1605 | struct ieee80211_vif *vif, |
| @@ -1508,8 +1617,10 @@ struct ieee80211_ops { | |||
| 1508 | struct ieee80211_vif *vif, struct ieee80211_sta *sta, | 1617 | struct ieee80211_vif *vif, struct ieee80211_sta *sta, |
| 1509 | struct ieee80211_key_conf *key); | 1618 | struct ieee80211_key_conf *key); |
| 1510 | void (*update_tkip_key)(struct ieee80211_hw *hw, | 1619 | void (*update_tkip_key)(struct ieee80211_hw *hw, |
| 1511 | struct ieee80211_key_conf *conf, const u8 *address, | 1620 | struct ieee80211_vif *vif, |
| 1512 | u32 iv32, u16 *phase1key); | 1621 | struct ieee80211_key_conf *conf, |
| 1622 | struct ieee80211_sta *sta, | ||
| 1623 | u32 iv32, u16 *phase1key); | ||
| 1513 | int (*hw_scan)(struct ieee80211_hw *hw, | 1624 | int (*hw_scan)(struct ieee80211_hw *hw, |
| 1514 | struct cfg80211_scan_request *req); | 1625 | struct cfg80211_scan_request *req); |
| 1515 | void (*sw_scan_start)(struct ieee80211_hw *hw); | 1626 | void (*sw_scan_start)(struct ieee80211_hw *hw); |
| @@ -1519,12 +1630,14 @@ struct ieee80211_ops { | |||
| 1519 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, | 1630 | void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, |
| 1520 | u32 *iv32, u16 *iv16); | 1631 | u32 *iv32, u16 *iv16); |
| 1521 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); | 1632 | int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); |
| 1633 | int (*sta_add)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
| 1634 | struct ieee80211_sta *sta); | ||
| 1635 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | ||
| 1636 | struct ieee80211_sta *sta); | ||
| 1522 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1637 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 1523 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 1638 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
| 1524 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, | 1639 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, |
| 1525 | const struct ieee80211_tx_queue_params *params); | 1640 | const struct ieee80211_tx_queue_params *params); |
| 1526 | int (*get_tx_stats)(struct ieee80211_hw *hw, | ||
| 1527 | struct ieee80211_tx_queue_stats *stats); | ||
| 1528 | u64 (*get_tsf)(struct ieee80211_hw *hw); | 1641 | u64 (*get_tsf)(struct ieee80211_hw *hw); |
| 1529 | void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf); | 1642 | void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf); |
| 1530 | void (*reset_tsf)(struct ieee80211_hw *hw); | 1643 | void (*reset_tsf)(struct ieee80211_hw *hw); |
| @@ -1535,9 +1648,11 @@ struct ieee80211_ops { | |||
| 1535 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1648 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
| 1536 | 1649 | ||
| 1537 | void (*rfkill_poll)(struct ieee80211_hw *hw); | 1650 | void (*rfkill_poll)(struct ieee80211_hw *hw); |
| 1651 | void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); | ||
| 1538 | #ifdef CONFIG_NL80211_TESTMODE | 1652 | #ifdef CONFIG_NL80211_TESTMODE |
| 1539 | int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); | 1653 | int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); |
| 1540 | #endif | 1654 | #endif |
| 1655 | void (*flush)(struct ieee80211_hw *hw, bool drop); | ||
| 1541 | }; | 1656 | }; |
| 1542 | 1657 | ||
| 1543 | /** | 1658 | /** |
| @@ -1777,7 +1892,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | |||
| 1777 | /** | 1892 | /** |
| 1778 | * ieee80211_beacon_get_tim - beacon generation function | 1893 | * ieee80211_beacon_get_tim - beacon generation function |
| 1779 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1894 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1780 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1895 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 1781 | * @tim_offset: pointer to variable that will receive the TIM IE offset. | 1896 | * @tim_offset: pointer to variable that will receive the TIM IE offset. |
| 1782 | * Set to 0 if invalid (in non-AP modes). | 1897 | * Set to 0 if invalid (in non-AP modes). |
| 1783 | * @tim_length: pointer to variable that will receive the TIM IE length, | 1898 | * @tim_length: pointer to variable that will receive the TIM IE length, |
| @@ -1805,7 +1920,7 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, | |||
| 1805 | /** | 1920 | /** |
| 1806 | * ieee80211_beacon_get - beacon generation function | 1921 | * ieee80211_beacon_get - beacon generation function |
| 1807 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1922 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1808 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1923 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 1809 | * | 1924 | * |
| 1810 | * See ieee80211_beacon_get_tim(). | 1925 | * See ieee80211_beacon_get_tim(). |
| 1811 | */ | 1926 | */ |
| @@ -1816,9 +1931,56 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
| 1816 | } | 1931 | } |
| 1817 | 1932 | ||
| 1818 | /** | 1933 | /** |
| 1934 | * ieee80211_pspoll_get - retrieve a PS Poll template | ||
| 1935 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
| 1936 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 1937 | * | ||
| 1938 | * Creates a PS Poll a template which can, for example, uploaded to | ||
| 1939 | * hardware. The template must be updated after association so that correct | ||
| 1940 | * AID, BSSID and MAC address is used. | ||
| 1941 | * | ||
| 1942 | * Note: Caller (or hardware) is responsible for setting the | ||
| 1943 | * &IEEE80211_FCTL_PM bit. | ||
| 1944 | */ | ||
| 1945 | struct sk_buff *ieee80211_pspoll_get(struct ieee80211_hw *hw, | ||
| 1946 | struct ieee80211_vif *vif); | ||
| 1947 | |||
| 1948 | /** | ||
| 1949 | * ieee80211_nullfunc_get - retrieve a nullfunc template | ||
| 1950 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
| 1951 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 1952 | * | ||
| 1953 | * Creates a Nullfunc template which can, for example, uploaded to | ||
| 1954 | * hardware. The template must be updated after association so that correct | ||
| 1955 | * BSSID and address is used. | ||
| 1956 | * | ||
| 1957 | * Note: Caller (or hardware) is responsible for setting the | ||
| 1958 | * &IEEE80211_FCTL_PM bit as well as Duration and Sequence Control fields. | ||
| 1959 | */ | ||
| 1960 | struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw, | ||
| 1961 | struct ieee80211_vif *vif); | ||
| 1962 | |||
| 1963 | /** | ||
| 1964 | * ieee80211_probereq_get - retrieve a Probe Request template | ||
| 1965 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
| 1966 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 1967 | * @ssid: SSID buffer | ||
| 1968 | * @ssid_len: length of SSID | ||
| 1969 | * @ie: buffer containing all IEs except SSID for the template | ||
| 1970 | * @ie_len: length of the IE buffer | ||
| 1971 | * | ||
| 1972 | * Creates a Probe Request template which can, for example, be uploaded to | ||
| 1973 | * hardware. | ||
| 1974 | */ | ||
| 1975 | struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, | ||
| 1976 | struct ieee80211_vif *vif, | ||
| 1977 | const u8 *ssid, size_t ssid_len, | ||
| 1978 | const u8 *ie, size_t ie_len); | ||
| 1979 | |||
| 1980 | /** | ||
| 1819 | * ieee80211_rts_get - RTS frame generation function | 1981 | * ieee80211_rts_get - RTS frame generation function |
| 1820 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1982 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1821 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1983 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 1822 | * @frame: pointer to the frame that is going to be protected by the RTS. | 1984 | * @frame: pointer to the frame that is going to be protected by the RTS. |
| 1823 | * @frame_len: the frame length (in octets). | 1985 | * @frame_len: the frame length (in octets). |
| 1824 | * @frame_txctl: &struct ieee80211_tx_info of the frame. | 1986 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
| @@ -1837,7 +1999,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | |||
| 1837 | /** | 1999 | /** |
| 1838 | * ieee80211_rts_duration - Get the duration field for an RTS frame | 2000 | * ieee80211_rts_duration - Get the duration field for an RTS frame |
| 1839 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 2001 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1840 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2002 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 1841 | * @frame_len: the length of the frame that is going to be protected by the RTS. | 2003 | * @frame_len: the length of the frame that is going to be protected by the RTS. |
| 1842 | * @frame_txctl: &struct ieee80211_tx_info of the frame. | 2004 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
| 1843 | * | 2005 | * |
| @@ -1852,7 +2014,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw, | |||
| 1852 | /** | 2014 | /** |
| 1853 | * ieee80211_ctstoself_get - CTS-to-self frame generation function | 2015 | * ieee80211_ctstoself_get - CTS-to-self frame generation function |
| 1854 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 2016 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1855 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2017 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 1856 | * @frame: pointer to the frame that is going to be protected by the CTS-to-self. | 2018 | * @frame: pointer to the frame that is going to be protected by the CTS-to-self. |
| 1857 | * @frame_len: the frame length (in octets). | 2019 | * @frame_len: the frame length (in octets). |
| 1858 | * @frame_txctl: &struct ieee80211_tx_info of the frame. | 2020 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
| @@ -1872,7 +2034,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw, | |||
| 1872 | /** | 2034 | /** |
| 1873 | * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame | 2035 | * ieee80211_ctstoself_duration - Get the duration field for a CTS-to-self frame |
| 1874 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 2036 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1875 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2037 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 1876 | * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. | 2038 | * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. |
| 1877 | * @frame_txctl: &struct ieee80211_tx_info of the frame. | 2039 | * @frame_txctl: &struct ieee80211_tx_info of the frame. |
| 1878 | * | 2040 | * |
| @@ -1888,7 +2050,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, | |||
| 1888 | /** | 2050 | /** |
| 1889 | * ieee80211_generic_frame_duration - Calculate the duration field for a frame | 2051 | * ieee80211_generic_frame_duration - Calculate the duration field for a frame |
| 1890 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 2052 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1891 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2053 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 1892 | * @frame_len: the length of the frame. | 2054 | * @frame_len: the length of the frame. |
| 1893 | * @rate: the rate at which the frame is going to be transmitted. | 2055 | * @rate: the rate at which the frame is going to be transmitted. |
| 1894 | * | 2056 | * |
| @@ -1903,7 +2065,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, | |||
| 1903 | /** | 2065 | /** |
| 1904 | * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames | 2066 | * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames |
| 1905 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2067 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
| 1906 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2068 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 1907 | * | 2069 | * |
| 1908 | * Function for accessing buffered broadcast and multicast frames. If | 2070 | * Function for accessing buffered broadcast and multicast frames. If |
| 1909 | * hardware/firmware does not implement buffering of broadcast/multicast | 2071 | * hardware/firmware does not implement buffering of broadcast/multicast |
| @@ -2071,7 +2233,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); | |||
| 2071 | 2233 | ||
| 2072 | /** | 2234 | /** |
| 2073 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. | 2235 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. |
| 2074 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf | 2236 | * @vif: &struct ieee80211_vif pointer from the add_interface callback |
| 2075 | * @ra: receiver address of the BA session recipient. | 2237 | * @ra: receiver address of the BA session recipient. |
| 2076 | * @tid: the TID to BA on. | 2238 | * @tid: the TID to BA on. |
| 2077 | * | 2239 | * |
| @@ -2082,7 +2244,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); | |||
| 2082 | 2244 | ||
| 2083 | /** | 2245 | /** |
| 2084 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2246 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
| 2085 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf | 2247 | * @vif: &struct ieee80211_vif pointer from the add_interface callback |
| 2086 | * @ra: receiver address of the BA session recipient. | 2248 | * @ra: receiver address of the BA session recipient. |
| 2087 | * @tid: the TID to BA on. | 2249 | * @tid: the TID to BA on. |
| 2088 | * | 2250 | * |
| @@ -2110,7 +2272,7 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid, | |||
| 2110 | 2272 | ||
| 2111 | /** | 2273 | /** |
| 2112 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. | 2274 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. |
| 2113 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf | 2275 | * @vif: &struct ieee80211_vif pointer from the add_interface callback |
| 2114 | * @ra: receiver address of the BA session recipient. | 2276 | * @ra: receiver address of the BA session recipient. |
| 2115 | * @tid: the desired TID to BA on. | 2277 | * @tid: the desired TID to BA on. |
| 2116 | * | 2278 | * |
| @@ -2121,7 +2283,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); | |||
| 2121 | 2283 | ||
| 2122 | /** | 2284 | /** |
| 2123 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. | 2285 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. |
| 2124 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf | 2286 | * @vif: &struct ieee80211_vif pointer from the add_interface callback |
| 2125 | * @ra: receiver address of the BA session recipient. | 2287 | * @ra: receiver address of the BA session recipient. |
| 2126 | * @tid: the desired TID to BA on. | 2288 | * @tid: the desired TID to BA on. |
| 2127 | * | 2289 | * |
| @@ -2200,7 +2362,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
| 2200 | /** | 2362 | /** |
| 2201 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2363 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
| 2202 | * | 2364 | * |
| 2203 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2365 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 2204 | * | 2366 | * |
| 2205 | * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and | 2367 | * When beacon filtering is enabled with IEEE80211_HW_BEACON_FILTERING and |
| 2206 | * IEEE80211_CONF_PS is set, the driver needs to inform whenever the | 2368 | * IEEE80211_CONF_PS is set, the driver needs to inform whenever the |
| @@ -2234,8 +2396,12 @@ enum rate_control_changed { | |||
| 2234 | * @short_preamble: whether mac80211 will request short-preamble transmission | 2396 | * @short_preamble: whether mac80211 will request short-preamble transmission |
| 2235 | * if the selected rate supports it | 2397 | * if the selected rate supports it |
| 2236 | * @max_rate_idx: user-requested maximum rate (not MCS for now) | 2398 | * @max_rate_idx: user-requested maximum rate (not MCS for now) |
| 2399 | * (deprecated; this will be removed once drivers get updated to use | ||
| 2400 | * rate_idx_mask) | ||
| 2401 | * @rate_idx_mask: user-requested rate mask (not MCS for now) | ||
| 2237 | * @skb: the skb that will be transmitted, the control information in it needs | 2402 | * @skb: the skb that will be transmitted, the control information in it needs |
| 2238 | * to be filled in | 2403 | * to be filled in |
| 2404 | * @ap: whether this frame is sent out in AP mode | ||
| 2239 | */ | 2405 | */ |
| 2240 | struct ieee80211_tx_rate_control { | 2406 | struct ieee80211_tx_rate_control { |
| 2241 | struct ieee80211_hw *hw; | 2407 | struct ieee80211_hw *hw; |
| @@ -2245,6 +2411,8 @@ struct ieee80211_tx_rate_control { | |||
| 2245 | struct ieee80211_tx_rate reported_rate; | 2411 | struct ieee80211_tx_rate reported_rate; |
| 2246 | bool rts, short_preamble; | 2412 | bool rts, short_preamble; |
| 2247 | u8 max_rate_idx; | 2413 | u8 max_rate_idx; |
| 2414 | u32 rate_idx_mask; | ||
| 2415 | bool ap; | ||
| 2248 | }; | 2416 | }; |
| 2249 | 2417 | ||
| 2250 | struct rate_control_ops { | 2418 | struct rate_control_ops { |
