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.h319
1 files changed, 304 insertions, 15 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 0ad1f47d2dc7..58d719ddaa60 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -263,6 +263,7 @@ struct ieee80211_vif_chanctx_switch {
263 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed, 263 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed,
264 * note that this is only called when it changes after the channel 264 * note that this is only called when it changes after the channel
265 * context had been assigned. 265 * context had been assigned.
266 * @BSS_CHANGED_OCB: OCB join status changed
266 */ 267 */
267enum ieee80211_bss_change { 268enum ieee80211_bss_change {
268 BSS_CHANGED_ASSOC = 1<<0, 269 BSS_CHANGED_ASSOC = 1<<0,
@@ -287,6 +288,7 @@ enum ieee80211_bss_change {
287 BSS_CHANGED_P2P_PS = 1<<19, 288 BSS_CHANGED_P2P_PS = 1<<19,
288 BSS_CHANGED_BEACON_INFO = 1<<20, 289 BSS_CHANGED_BEACON_INFO = 1<<20,
289 BSS_CHANGED_BANDWIDTH = 1<<21, 290 BSS_CHANGED_BANDWIDTH = 1<<21,
291 BSS_CHANGED_OCB = 1<<22,
290 292
291 /* when adding here, make sure to change ieee80211_reconfig */ 293 /* when adding here, make sure to change ieee80211_reconfig */
292}; 294};
@@ -739,7 +741,8 @@ struct ieee80211_tx_info {
739 u8 ampdu_ack_len; 741 u8 ampdu_ack_len;
740 u8 ampdu_len; 742 u8 ampdu_len;
741 u8 antenna; 743 u8 antenna;
742 void *status_driver_data[21 / sizeof(void *)]; 744 u16 tx_time;
745 void *status_driver_data[19 / sizeof(void *)];
743 } status; 746 } status;
744 struct { 747 struct {
745 struct ieee80211_tx_rate driver_rates[ 748 struct ieee80211_tx_rate driver_rates[
@@ -879,6 +882,9 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
879 * subframes share the same sequence number. Reported subframes can be 882 * subframes share the same sequence number. Reported subframes can be
880 * either regular MSDU or singly A-MSDUs. Subframes must not be 883 * either regular MSDU or singly A-MSDUs. Subframes must not be
881 * interleaved with other frames. 884 * interleaved with other frames.
885 * @RX_FLAG_RADIOTAP_VENDOR_DATA: This frame contains vendor-specific
886 * radiotap data in the skb->data (before the frame) as described by
887 * the &struct ieee80211_vendor_radiotap.
882 */ 888 */
883enum mac80211_rx_flags { 889enum mac80211_rx_flags {
884 RX_FLAG_MMIC_ERROR = BIT(0), 890 RX_FLAG_MMIC_ERROR = BIT(0),
@@ -908,6 +914,7 @@ enum mac80211_rx_flags {
908 RX_FLAG_10MHZ = BIT(28), 914 RX_FLAG_10MHZ = BIT(28),
909 RX_FLAG_5MHZ = BIT(29), 915 RX_FLAG_5MHZ = BIT(29),
910 RX_FLAG_AMSDU_MORE = BIT(30), 916 RX_FLAG_AMSDU_MORE = BIT(30),
917 RX_FLAG_RADIOTAP_VENDOR_DATA = BIT(31),
911}; 918};
912 919
913#define RX_FLAG_STBC_SHIFT 26 920#define RX_FLAG_STBC_SHIFT 26
@@ -979,6 +986,39 @@ struct ieee80211_rx_status {
979}; 986};
980 987
981/** 988/**
989 * struct ieee80211_vendor_radiotap - vendor radiotap data information
990 * @present: presence bitmap for this vendor namespace
991 * (this could be extended in the future if any vendor needs more
992 * bits, the radiotap spec does allow for that)
993 * @align: radiotap vendor namespace alignment. This defines the needed
994 * alignment for the @data field below, not for the vendor namespace
995 * description itself (which has a fixed 2-byte alignment)
996 * Must be a power of two, and be set to at least 1!
997 * @oui: radiotap vendor namespace OUI
998 * @subns: radiotap vendor sub namespace
999 * @len: radiotap vendor sub namespace skip length, if alignment is done
1000 * then that's added to this, i.e. this is only the length of the
1001 * @data field.
1002 * @pad: number of bytes of padding after the @data, this exists so that
1003 * the skb data alignment can be preserved even if the data has odd
1004 * length
1005 * @data: the actual vendor namespace data
1006 *
1007 * This struct, including the vendor data, goes into the skb->data before
1008 * the 802.11 header. It's split up in mac80211 using the align/oui/subns
1009 * data.
1010 */
1011struct ieee80211_vendor_radiotap {
1012 u32 present;
1013 u8 align;
1014 u8 oui[3];
1015 u8 subns;
1016 u8 pad;
1017 u16 len;
1018 u8 data[];
1019} __packed;
1020
1021/**
982 * enum ieee80211_conf_flags - configuration flags 1022 * enum ieee80211_conf_flags - configuration flags
983 * 1023 *
984 * Flags to define PHY configuration options 1024 * Flags to define PHY configuration options
@@ -1117,6 +1157,8 @@ struct ieee80211_conf {
1117 * Function (TSF) timer when the frame containing the channel switch 1157 * Function (TSF) timer when the frame containing the channel switch
1118 * announcement was received. This is simply the rx.mactime parameter 1158 * announcement was received. This is simply the rx.mactime parameter
1119 * the driver passed into mac80211. 1159 * the driver passed into mac80211.
1160 * @device_timestamp: arbitrary timestamp for the device, this is the
1161 * rx.device_timestamp parameter the driver passed to mac80211.
1120 * @block_tx: Indicates whether transmission must be blocked before the 1162 * @block_tx: Indicates whether transmission must be blocked before the
1121 * scheduled channel switch, as indicated by the AP. 1163 * scheduled channel switch, as indicated by the AP.
1122 * @chandef: the new channel to switch to 1164 * @chandef: the new channel to switch to
@@ -1124,6 +1166,7 @@ struct ieee80211_conf {
1124 */ 1166 */
1125struct ieee80211_channel_switch { 1167struct ieee80211_channel_switch {
1126 u64 timestamp; 1168 u64 timestamp;
1169 u32 device_timestamp;
1127 bool block_tx; 1170 bool block_tx;
1128 struct cfg80211_chan_def chandef; 1171 struct cfg80211_chan_def chandef;
1129 u8 count; 1172 u8 count;
@@ -1423,6 +1466,8 @@ struct ieee80211_sta_rates {
1423 * @smps_mode: current SMPS mode (off, static or dynamic) 1466 * @smps_mode: current SMPS mode (off, static or dynamic)
1424 * @rates: rate control selection table 1467 * @rates: rate control selection table
1425 * @tdls: indicates whether the STA is a TDLS peer 1468 * @tdls: indicates whether the STA is a TDLS peer
1469 * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only
1470 * valid if the STA is a TDLS peer in the first place.
1426 */ 1471 */
1427struct ieee80211_sta { 1472struct ieee80211_sta {
1428 u32 supp_rates[IEEE80211_NUM_BANDS]; 1473 u32 supp_rates[IEEE80211_NUM_BANDS];
@@ -1438,6 +1483,7 @@ struct ieee80211_sta {
1438 enum ieee80211_smps_mode smps_mode; 1483 enum ieee80211_smps_mode smps_mode;
1439 struct ieee80211_sta_rates __rcu *rates; 1484 struct ieee80211_sta_rates __rcu *rates;
1440 bool tdls; 1485 bool tdls;
1486 bool tdls_initiator;
1441 1487
1442 /* must be last */ 1488 /* must be last */
1443 u8 drv_priv[0] __aligned(sizeof(void *)); 1489 u8 drv_priv[0] __aligned(sizeof(void *));
@@ -1576,6 +1622,10 @@ struct ieee80211_tx_control {
1576 * a virtual monitor interface when monitor interfaces are the only 1622 * a virtual monitor interface when monitor interfaces are the only
1577 * active interfaces. 1623 * active interfaces.
1578 * 1624 *
1625 * @IEEE80211_HW_NO_AUTO_VIF: The driver would like for no wlanX to
1626 * be created. It is expected user-space will create vifs as
1627 * desired (and thus have them named as desired).
1628 *
1579 * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface 1629 * @IEEE80211_HW_QUEUE_CONTROL: The driver wants to control per-interface
1580 * queue mapping in order to use different queues (not just one per AC) 1630 * queue mapping in order to use different queues (not just one per AC)
1581 * for different virtual interfaces. See the doc section on HW queue 1631 * for different virtual interfaces. See the doc section on HW queue
@@ -1622,7 +1672,8 @@ enum ieee80211_hw_flags {
1622 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12, 1672 IEEE80211_HW_SUPPORTS_DYNAMIC_PS = 1<<12,
1623 IEEE80211_HW_MFP_CAPABLE = 1<<13, 1673 IEEE80211_HW_MFP_CAPABLE = 1<<13,
1624 IEEE80211_HW_WANT_MONITOR_VIF = 1<<14, 1674 IEEE80211_HW_WANT_MONITOR_VIF = 1<<14,
1625 /* free slots */ 1675 IEEE80211_HW_NO_AUTO_VIF = 1<<15,
1676 /* free slot */
1626 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, 1677 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17,
1627 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, 1678 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
1628 IEEE80211_HW_CONNECTION_MONITOR = 1<<19, 1679 IEEE80211_HW_CONNECTION_MONITOR = 1<<19,
@@ -1776,6 +1827,31 @@ struct ieee80211_scan_request {
1776}; 1827};
1777 1828
1778/** 1829/**
1830 * struct ieee80211_tdls_ch_sw_params - TDLS channel switch parameters
1831 *
1832 * @sta: peer this TDLS channel-switch request/response came from
1833 * @chandef: channel referenced in a TDLS channel-switch request
1834 * @action_code: see &enum ieee80211_tdls_actioncode
1835 * @status: channel-switch response status
1836 * @timestamp: time at which the frame was received
1837 * @switch_time: switch-timing parameter received in the frame
1838 * @switch_timeout: switch-timing parameter received in the frame
1839 * @tmpl_skb: TDLS switch-channel response template
1840 * @ch_sw_tm_ie: offset of the channel-switch timing IE inside @tmpl_skb
1841 */
1842struct ieee80211_tdls_ch_sw_params {
1843 struct ieee80211_sta *sta;
1844 struct cfg80211_chan_def *chandef;
1845 u8 action_code;
1846 u32 status;
1847 u32 timestamp;
1848 u16 switch_time;
1849 u16 switch_timeout;
1850 struct sk_buff *tmpl_skb;
1851 u32 ch_sw_tm_ie;
1852};
1853
1854/**
1779 * wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy 1855 * wiphy_to_ieee80211_hw - return a mac80211 driver hw struct from a wiphy
1780 * 1856 *
1781 * @wiphy: the &struct wiphy which we want to query 1857 * @wiphy: the &struct wiphy which we want to query
@@ -2375,6 +2451,22 @@ enum ieee80211_roc_type {
2375}; 2451};
2376 2452
2377/** 2453/**
2454 * enum ieee80211_reconfig_complete_type - reconfig type
2455 *
2456 * This enum is used by the reconfig_complete() callback to indicate what
2457 * reconfiguration type was completed.
2458 *
2459 * @IEEE80211_RECONFIG_TYPE_RESTART: hw restart type
2460 * (also due to resume() callback returning 1)
2461 * @IEEE80211_RECONFIG_TYPE_SUSPEND: suspend type (regardless
2462 * of wowlan configuration)
2463 */
2464enum ieee80211_reconfig_type {
2465 IEEE80211_RECONFIG_TYPE_RESTART,
2466 IEEE80211_RECONFIG_TYPE_SUSPEND,
2467};
2468
2469/**
2378 * struct ieee80211_ops - callbacks from mac80211 to the driver 2470 * struct ieee80211_ops - callbacks from mac80211 to the driver
2379 * 2471 *
2380 * This structure contains various callbacks that the driver may 2472 * This structure contains various callbacks that the driver may
@@ -2530,7 +2622,9 @@ enum ieee80211_roc_type {
2530 * 2622 *
2531 * @sw_scan_start: Notifier function that is called just before a software scan 2623 * @sw_scan_start: Notifier function that is called just before a software scan
2532 * is started. Can be NULL, if the driver doesn't need this notification. 2624 * is started. Can be NULL, if the driver doesn't need this notification.
2533 * The callback can sleep. 2625 * The mac_addr parameter allows supporting NL80211_SCAN_FLAG_RANDOM_ADDR,
2626 * the driver may set the NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR flag if it
2627 * can use this parameter. The callback can sleep.
2534 * 2628 *
2535 * @sw_scan_complete: Notifier function that is called just after a 2629 * @sw_scan_complete: Notifier function that is called just after a
2536 * software scan finished. Can be NULL, if the driver doesn't need 2630 * software scan finished. Can be NULL, if the driver doesn't need
@@ -2601,6 +2695,9 @@ enum ieee80211_roc_type {
2601 * uses hardware rate control (%IEEE80211_HW_HAS_RATE_CONTROL) since 2695 * uses hardware rate control (%IEEE80211_HW_HAS_RATE_CONTROL) since
2602 * otherwise the rate control algorithm is notified directly. 2696 * otherwise the rate control algorithm is notified directly.
2603 * Must be atomic. 2697 * Must be atomic.
2698 * @sta_rate_tbl_update: Notifies the driver that the rate table changed. This
2699 * is only used if the configured rate control algorithm actually uses
2700 * the new rate table API, and is therefore optional. Must be atomic.
2604 * 2701 *
2605 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 2702 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
2606 * bursting) for a hardware TX queue. 2703 * bursting) for a hardware TX queue.
@@ -2809,11 +2906,11 @@ enum ieee80211_roc_type {
2809 * disabled/enabled via @bss_info_changed. 2906 * disabled/enabled via @bss_info_changed.
2810 * @stop_ap: Stop operation on the AP interface. 2907 * @stop_ap: Stop operation on the AP interface.
2811 * 2908 *
2812 * @restart_complete: Called after a call to ieee80211_restart_hw(), when the 2909 * @reconfig_complete: Called after a call to ieee80211_restart_hw() and
2813 * reconfiguration has completed. This can help the driver implement the 2910 * during resume, when the reconfiguration has completed.
2814 * reconfiguration step. Also called when reconfiguring because the 2911 * This can help the driver implement the reconfiguration step (and
2815 * driver's resume function returned 1, as this is just like an "inline" 2912 * indicate mac80211 is ready to receive frames).
2816 * hardware restart. This callback may sleep. 2913 * This callback may sleep.
2817 * 2914 *
2818 * @ipv6_addr_change: IPv6 address assignment on the given interface changed. 2915 * @ipv6_addr_change: IPv6 address assignment on the given interface changed.
2819 * Currently, this is only called for managed or P2P client interfaces. 2916 * Currently, this is only called for managed or P2P client interfaces.
@@ -2829,6 +2926,13 @@ enum ieee80211_roc_type {
2829 * transmitted and then call ieee80211_csa_finish(). 2926 * transmitted and then call ieee80211_csa_finish().
2830 * If the CSA count starts as zero or 1, this function will not be called, 2927 * If the CSA count starts as zero or 1, this function will not be called,
2831 * since there won't be any time to beacon before the switch anyway. 2928 * since there won't be any time to beacon before the switch anyway.
2929 * @pre_channel_switch: This is an optional callback that is called
2930 * before a channel switch procedure is started (ie. when a STA
2931 * gets a CSA or an userspace initiated channel-switch), allowing
2932 * the driver to prepare for the channel switch.
2933 * @post_channel_switch: This is an optional callback that is called
2934 * after a channel switch procedure is completed, allowing the
2935 * driver to go back to a normal configuration.
2832 * 2936 *
2833 * @join_ibss: Join an IBSS (on an IBSS interface); this is called after all 2937 * @join_ibss: Join an IBSS (on an IBSS interface); this is called after all
2834 * information in bss_conf is set up and the beacon can be retrieved. A 2938 * information in bss_conf is set up and the beacon can be retrieved. A
@@ -2838,6 +2942,26 @@ enum ieee80211_roc_type {
2838 * @get_expected_throughput: extract the expected throughput towards the 2942 * @get_expected_throughput: extract the expected throughput towards the
2839 * specified station. The returned value is expressed in Kbps. It returns 0 2943 * specified station. The returned value is expressed in Kbps. It returns 0
2840 * if the RC algorithm does not have proper data to provide. 2944 * if the RC algorithm does not have proper data to provide.
2945 *
2946 * @get_txpower: get current maximum tx power (in dBm) based on configuration
2947 * and hardware limits.
2948 *
2949 * @tdls_channel_switch: Start channel-switching with a TDLS peer. The driver
2950 * is responsible for continually initiating channel-switching operations
2951 * and returning to the base channel for communication with the AP. The
2952 * driver receives a channel-switch request template and the location of
2953 * the switch-timing IE within the template as part of the invocation.
2954 * The template is valid only within the call, and the driver can
2955 * optionally copy the skb for further re-use.
2956 * @tdls_cancel_channel_switch: Stop channel-switching with a TDLS peer. Both
2957 * peers must be on the base channel when the call completes.
2958 * @tdls_recv_channel_switch: a TDLS channel-switch related frame (request or
2959 * response) has been received from a remote peer. The driver gets
2960 * parameters parsed from the incoming frame and may use them to continue
2961 * an ongoing channel-switch operation. In addition, a channel-switch
2962 * response template is provided, together with the location of the
2963 * switch-timing IE within the template. The skb can only be used within
2964 * the function call.
2841 */ 2965 */
2842struct ieee80211_ops { 2966struct ieee80211_ops {
2843 void (*tx)(struct ieee80211_hw *hw, 2967 void (*tx)(struct ieee80211_hw *hw,
@@ -2897,8 +3021,11 @@ struct ieee80211_ops {
2897 struct ieee80211_scan_ies *ies); 3021 struct ieee80211_scan_ies *ies);
2898 int (*sched_scan_stop)(struct ieee80211_hw *hw, 3022 int (*sched_scan_stop)(struct ieee80211_hw *hw,
2899 struct ieee80211_vif *vif); 3023 struct ieee80211_vif *vif);
2900 void (*sw_scan_start)(struct ieee80211_hw *hw); 3024 void (*sw_scan_start)(struct ieee80211_hw *hw,
2901 void (*sw_scan_complete)(struct ieee80211_hw *hw); 3025 struct ieee80211_vif *vif,
3026 const u8 *mac_addr);
3027 void (*sw_scan_complete)(struct ieee80211_hw *hw,
3028 struct ieee80211_vif *vif);
2902 int (*get_stats)(struct ieee80211_hw *hw, 3029 int (*get_stats)(struct ieee80211_hw *hw,
2903 struct ieee80211_low_level_stats *stats); 3030 struct ieee80211_low_level_stats *stats);
2904 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, 3031 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx,
@@ -2932,6 +3059,9 @@ struct ieee80211_ops {
2932 struct ieee80211_vif *vif, 3059 struct ieee80211_vif *vif,
2933 struct ieee80211_sta *sta, 3060 struct ieee80211_sta *sta,
2934 u32 changed); 3061 u32 changed);
3062 void (*sta_rate_tbl_update)(struct ieee80211_hw *hw,
3063 struct ieee80211_vif *vif,
3064 struct ieee80211_sta *sta);
2935 int (*conf_tx)(struct ieee80211_hw *hw, 3065 int (*conf_tx)(struct ieee80211_hw *hw,
2936 struct ieee80211_vif *vif, u16 ac, 3066 struct ieee80211_vif *vif, u16 ac,
2937 const struct ieee80211_tx_queue_params *params); 3067 const struct ieee80211_tx_queue_params *params);
@@ -2959,6 +3089,7 @@ struct ieee80211_ops {
2959 void (*flush)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 3089 void (*flush)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2960 u32 queues, bool drop); 3090 u32 queues, bool drop);
2961 void (*channel_switch)(struct ieee80211_hw *hw, 3091 void (*channel_switch)(struct ieee80211_hw *hw,
3092 struct ieee80211_vif *vif,
2962 struct ieee80211_channel_switch *ch_switch); 3093 struct ieee80211_channel_switch *ch_switch);
2963 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant); 3094 int (*set_antenna)(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant);
2964 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); 3095 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
@@ -3025,7 +3156,8 @@ struct ieee80211_ops {
3025 int n_vifs, 3156 int n_vifs,
3026 enum ieee80211_chanctx_switch_mode mode); 3157 enum ieee80211_chanctx_switch_mode mode);
3027 3158
3028 void (*restart_complete)(struct ieee80211_hw *hw); 3159 void (*reconfig_complete)(struct ieee80211_hw *hw,
3160 enum ieee80211_reconfig_type reconfig_type);
3029 3161
3030#if IS_ENABLED(CONFIG_IPV6) 3162#if IS_ENABLED(CONFIG_IPV6)
3031 void (*ipv6_addr_change)(struct ieee80211_hw *hw, 3163 void (*ipv6_addr_change)(struct ieee80211_hw *hw,
@@ -3035,14 +3167,54 @@ struct ieee80211_ops {
3035 void (*channel_switch_beacon)(struct ieee80211_hw *hw, 3167 void (*channel_switch_beacon)(struct ieee80211_hw *hw,
3036 struct ieee80211_vif *vif, 3168 struct ieee80211_vif *vif,
3037 struct cfg80211_chan_def *chandef); 3169 struct cfg80211_chan_def *chandef);
3170 int (*pre_channel_switch)(struct ieee80211_hw *hw,
3171 struct ieee80211_vif *vif,
3172 struct ieee80211_channel_switch *ch_switch);
3173
3174 int (*post_channel_switch)(struct ieee80211_hw *hw,
3175 struct ieee80211_vif *vif);
3038 3176
3039 int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 3177 int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
3040 void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 3178 void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
3041 u32 (*get_expected_throughput)(struct ieee80211_sta *sta); 3179 u32 (*get_expected_throughput)(struct ieee80211_sta *sta);
3180 int (*get_txpower)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3181 int *dbm);
3182
3183 int (*tdls_channel_switch)(struct ieee80211_hw *hw,
3184 struct ieee80211_vif *vif,
3185 struct ieee80211_sta *sta, u8 oper_class,
3186 struct cfg80211_chan_def *chandef,
3187 struct sk_buff *tmpl_skb, u32 ch_sw_tm_ie);
3188 void (*tdls_cancel_channel_switch)(struct ieee80211_hw *hw,
3189 struct ieee80211_vif *vif,
3190 struct ieee80211_sta *sta);
3191 void (*tdls_recv_channel_switch)(struct ieee80211_hw *hw,
3192 struct ieee80211_vif *vif,
3193 struct ieee80211_tdls_ch_sw_params *params);
3042}; 3194};
3043 3195
3044/** 3196/**
3045 * ieee80211_alloc_hw - Allocate a new hardware device 3197 * ieee80211_alloc_hw_nm - Allocate a new hardware device
3198 *
3199 * This must be called once for each hardware device. The returned pointer
3200 * must be used to refer to this device when calling other functions.
3201 * mac80211 allocates a private data area for the driver pointed to by
3202 * @priv in &struct ieee80211_hw, the size of this area is given as
3203 * @priv_data_len.
3204 *
3205 * @priv_data_len: length of private data
3206 * @ops: callbacks for this device
3207 * @requested_name: Requested name for this device.
3208 * NULL is valid value, and means use the default naming (phy%d)
3209 *
3210 * Return: A pointer to the new hardware device, or %NULL on error.
3211 */
3212struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
3213 const struct ieee80211_ops *ops,
3214 const char *requested_name);
3215
3216/**
3217 * ieee80211_alloc_hw - Allocate a new hardware device
3046 * 3218 *
3047 * This must be called once for each hardware device. The returned pointer 3219 * This must be called once for each hardware device. The returned pointer
3048 * must be used to refer to this device when calling other functions. 3220 * must be used to refer to this device when calling other functions.
@@ -3055,8 +3227,12 @@ struct ieee80211_ops {
3055 * 3227 *
3056 * Return: A pointer to the new hardware device, or %NULL on error. 3228 * Return: A pointer to the new hardware device, or %NULL on error.
3057 */ 3229 */
3230static inline
3058struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, 3231struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
3059 const struct ieee80211_ops *ops); 3232 const struct ieee80211_ops *ops)
3233{
3234 return ieee80211_alloc_hw_nm(priv_data_len, ops, NULL);
3235}
3060 3236
3061/** 3237/**
3062 * ieee80211_register_hw - Register hardware device 3238 * ieee80211_register_hw - Register hardware device
@@ -3443,6 +3619,26 @@ void ieee80211_tx_status(struct ieee80211_hw *hw,
3443 struct sk_buff *skb); 3619 struct sk_buff *skb);
3444 3620
3445/** 3621/**
3622 * ieee80211_tx_status_noskb - transmit status callback without skb
3623 *
3624 * This function can be used as a replacement for ieee80211_tx_status
3625 * in drivers that cannot reliably map tx status information back to
3626 * specific skbs.
3627 *
3628 * Calls to this function for a single hardware must be synchronized
3629 * against each other. Calls to this function, ieee80211_tx_status_ni()
3630 * and ieee80211_tx_status_irqsafe() may not be mixed for a single hardware.
3631 *
3632 * @hw: the hardware the frame was transmitted by
3633 * @sta: the receiver station to which this packet is sent
3634 * (NULL for multicast packets)
3635 * @info: tx status information
3636 */
3637void ieee80211_tx_status_noskb(struct ieee80211_hw *hw,
3638 struct ieee80211_sta *sta,
3639 struct ieee80211_tx_info *info);
3640
3641/**
3446 * ieee80211_tx_status_ni - transmit status callback (in process context) 3642 * ieee80211_tx_status_ni - transmit status callback (in process context)
3447 * 3643 *
3448 * Like ieee80211_tx_status() but can be called in process context. 3644 * Like ieee80211_tx_status() but can be called in process context.
@@ -3655,7 +3851,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
3655/** 3851/**
3656 * ieee80211_probereq_get - retrieve a Probe Request template 3852 * ieee80211_probereq_get - retrieve a Probe Request template
3657 * @hw: pointer obtained from ieee80211_alloc_hw(). 3853 * @hw: pointer obtained from ieee80211_alloc_hw().
3658 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3854 * @src_addr: source MAC address
3659 * @ssid: SSID buffer 3855 * @ssid: SSID buffer
3660 * @ssid_len: length of SSID 3856 * @ssid_len: length of SSID
3661 * @tailroom: tailroom to reserve at end of SKB for IEs 3857 * @tailroom: tailroom to reserve at end of SKB for IEs
@@ -3666,7 +3862,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
3666 * Return: The Probe Request template. %NULL on error. 3862 * Return: The Probe Request template. %NULL on error.
3667 */ 3863 */
3668struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, 3864struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw,
3669 struct ieee80211_vif *vif, 3865 const u8 *src_addr,
3670 const u8 *ssid, size_t ssid_len, 3866 const u8 *ssid, size_t ssid_len,
3671 size_t tailroom); 3867 size_t tailroom);
3672 3868
@@ -4172,6 +4368,22 @@ void ieee80211_iterate_active_interfaces_rtnl(struct ieee80211_hw *hw,
4172 void *data); 4368 void *data);
4173 4369
4174/** 4370/**
4371 * ieee80211_iterate_stations_atomic - iterate stations
4372 *
4373 * This function iterates over all stations associated with a given
4374 * hardware that are currently uploaded to the driver and calls the callback
4375 * function for them.
4376 * This function requires the iterator callback function to be atomic,
4377 *
4378 * @hw: the hardware struct of which the interfaces should be iterated over
4379 * @iterator: the iterator function to call, cannot sleep
4380 * @data: first argument of the iterator function
4381 */
4382void ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,
4383 void (*iterator)(void *data,
4384 struct ieee80211_sta *sta),
4385 void *data);
4386/**
4175 * ieee80211_queue_work - add work onto the mac80211 workqueue 4387 * ieee80211_queue_work - add work onto the mac80211 workqueue
4176 * 4388 *
4177 * Drivers and mac80211 use this to add work onto the mac80211 workqueue. 4389 * Drivers and mac80211 use this to add work onto the mac80211 workqueue.
@@ -4480,6 +4692,14 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
4480 gfp_t gfp); 4692 gfp_t gfp);
4481 4693
4482/** 4694/**
4695 * ieee80211_cqm_beacon_loss_notify - inform CQM of beacon loss
4696 *
4697 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
4698 * @gfp: context flags
4699 */
4700void ieee80211_cqm_beacon_loss_notify(struct ieee80211_vif *vif, gfp_t gfp);
4701
4702/**
4483 * ieee80211_radar_detected - inform that a radar was detected 4703 * ieee80211_radar_detected - inform that a radar was detected
4484 * 4704 *
4485 * @hw: pointer as obtained from ieee80211_alloc_hw() 4705 * @hw: pointer as obtained from ieee80211_alloc_hw()
@@ -4637,6 +4857,10 @@ struct rate_control_ops {
4637 void (*free_sta)(void *priv, struct ieee80211_sta *sta, 4857 void (*free_sta)(void *priv, struct ieee80211_sta *sta,
4638 void *priv_sta); 4858 void *priv_sta);
4639 4859
4860 void (*tx_status_noskb)(void *priv,
4861 struct ieee80211_supported_band *sband,
4862 struct ieee80211_sta *sta, void *priv_sta,
4863 struct ieee80211_tx_info *info);
4640 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband, 4864 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
4641 struct ieee80211_sta *sta, void *priv_sta, 4865 struct ieee80211_sta *sta, void *priv_sta,
4642 struct sk_buff *skb); 4866 struct sk_buff *skb);
@@ -4888,4 +5112,69 @@ void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf);
4888void ieee80211_tdls_oper_request(struct ieee80211_vif *vif, const u8 *peer, 5112void ieee80211_tdls_oper_request(struct ieee80211_vif *vif, const u8 *peer,
4889 enum nl80211_tdls_operation oper, 5113 enum nl80211_tdls_operation oper,
4890 u16 reason_code, gfp_t gfp); 5114 u16 reason_code, gfp_t gfp);
5115
5116/**
5117 * ieee80211_reserve_tid - request to reserve a specific TID
5118 *
5119 * There is sometimes a need (such as in TDLS) for blocking the driver from
5120 * using a specific TID so that the FW can use it for certain operations such
5121 * as sending PTI requests. To make sure that the driver doesn't use that TID,
5122 * this function must be called as it flushes out packets on this TID and marks
5123 * it as blocked, so that any transmit for the station on this TID will be
5124 * redirected to the alternative TID in the same AC.
5125 *
5126 * Note that this function blocks and may call back into the driver, so it
5127 * should be called without driver locks held. Also note this function should
5128 * only be called from the driver's @sta_state callback.
5129 *
5130 * @sta: the station to reserve the TID for
5131 * @tid: the TID to reserve
5132 *
5133 * Returns: 0 on success, else on failure
5134 */
5135int ieee80211_reserve_tid(struct ieee80211_sta *sta, u8 tid);
5136
5137/**
5138 * ieee80211_unreserve_tid - request to unreserve a specific TID
5139 *
5140 * Once there is no longer any need for reserving a certain TID, this function
5141 * should be called, and no longer will packets have their TID modified for
5142 * preventing use of this TID in the driver.
5143 *
5144 * Note that this function blocks and acquires a lock, so it should be called
5145 * without driver locks held. Also note this function should only be called
5146 * from the driver's @sta_state callback.
5147 *
5148 * @sta: the station
5149 * @tid: the TID to unreserve
5150 */
5151void ieee80211_unreserve_tid(struct ieee80211_sta *sta, u8 tid);
5152
5153/**
5154 * ieee80211_ie_split - split an IE buffer according to ordering
5155 *
5156 * @ies: the IE buffer
5157 * @ielen: the length of the IE buffer
5158 * @ids: an array with element IDs that are allowed before
5159 * the split
5160 * @n_ids: the size of the element ID array
5161 * @offset: offset where to start splitting in the buffer
5162 *
5163 * This function splits an IE buffer by updating the @offset
5164 * variable to point to the location where the buffer should be
5165 * split.
5166 *
5167 * It assumes that the given IE buffer is well-formed, this
5168 * has to be guaranteed by the caller!
5169 *
5170 * It also assumes that the IEs in the buffer are ordered
5171 * correctly, if not the result of using this function will not
5172 * be ordered correctly either, i.e. it does no reordering.
5173 *
5174 * The function returns the offset where the next part of the
5175 * buffer starts, which may be @ielen if the entire (remainder)
5176 * of the buffer should be used.
5177 */
5178size_t ieee80211_ie_split(const u8 *ies, size_t ielen,
5179 const u8 *ids, int n_ids, size_t offset);
4891#endif /* MAC80211_H */ 5180#endif /* MAC80211_H */