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.h101
1 files changed, 100 insertions, 1 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 82558c8decf8..71c2f9c2f5be 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -144,6 +144,41 @@ struct ieee80211_low_level_stats {
144}; 144};
145 145
146/** 146/**
147 * enum ieee80211_chanctx_change - change flag for channel context
148 * @IEEE80211_CHANCTX_CHANGE_CHANNEL_TYPE: The channel type was changed
149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
150 */
151enum ieee80211_chanctx_change {
152 IEEE80211_CHANCTX_CHANGE_CHANNEL_TYPE = BIT(0),
153 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
154};
155
156/**
157 * struct ieee80211_chanctx_conf - channel context that vifs may be tuned to
158 *
159 * This is the driver-visible part. The ieee80211_chanctx
160 * that contains it is visible in mac80211 only.
161 *
162 * @channel: the channel to tune to
163 * @channel_type: the channel (HT) type
164 * @rx_chains_static: The number of RX chains that must always be
165 * active on the channel to receive MIMO transmissions
166 * @rx_chains_dynamic: The number of RX chains that must be enabled
167 * after RTS/CTS handshake to receive SMPS MIMO transmissions;
168 * this will always be >= @rx_chains_always.
169 * @drv_priv: data area for driver use, will always be aligned to
170 * sizeof(void *), size is determined in hw information.
171 */
172struct ieee80211_chanctx_conf {
173 struct ieee80211_channel *channel;
174 enum nl80211_channel_type channel_type;
175
176 u8 rx_chains_static, rx_chains_dynamic;
177
178 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
179};
180
181/**
147 * enum ieee80211_bss_change - BSS change notification flags 182 * enum ieee80211_bss_change - BSS change notification flags
148 * 183 *
149 * These flags are used with the bss_info_changed() callback 184 * These flags are used with the bss_info_changed() callback
@@ -223,6 +258,7 @@ enum ieee80211_rssi_event {
223 * @assoc: association status 258 * @assoc: association status
224 * @ibss_joined: indicates whether this station is part of an IBSS 259 * @ibss_joined: indicates whether this station is part of an IBSS
225 * or not 260 * or not
261 * @ibss_creator: indicates if a new IBSS network is being created
226 * @aid: association ID number, valid only when @assoc is true 262 * @aid: association ID number, valid only when @assoc is true
227 * @use_cts_prot: use CTS protection 263 * @use_cts_prot: use CTS protection
228 * @use_short_preamble: use 802.11b short preamble; 264 * @use_short_preamble: use 802.11b short preamble;
@@ -278,6 +314,7 @@ struct ieee80211_bss_conf {
278 const u8 *bssid; 314 const u8 *bssid;
279 /* association related data */ 315 /* association related data */
280 bool assoc, ibss_joined; 316 bool assoc, ibss_joined;
317 bool ibss_creator;
281 u16 aid; 318 u16 aid;
282 /* erp related data */ 319 /* erp related data */
283 bool use_cts_prot; 320 bool use_cts_prot;
@@ -794,6 +831,8 @@ enum ieee80211_conf_flags {
794 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 831 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
795 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 832 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
796 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed 833 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed
834 * Note that this is only valid if channel contexts are not used,
835 * otherwise each channel context has the number of chains listed.
797 */ 836 */
798enum ieee80211_conf_changed { 837enum ieee80211_conf_changed {
799 IEEE80211_CONF_CHANGE_SMPS = BIT(1), 838 IEEE80211_CONF_CHANGE_SMPS = BIT(1),
@@ -859,7 +898,9 @@ enum ieee80211_smps_mode {
859 * 898 *
860 * @smps_mode: spatial multiplexing powersave mode; note that 899 * @smps_mode: spatial multiplexing powersave mode; note that
861 * %IEEE80211_SMPS_STATIC is used when the device is not 900 * %IEEE80211_SMPS_STATIC is used when the device is not
862 * configured for an HT channel 901 * configured for an HT channel.
902 * Note that this is only valid if channel contexts are not used,
903 * otherwise each channel context has the number of chains listed.
863 */ 904 */
864struct ieee80211_conf { 905struct ieee80211_conf {
865 u32 flags; 906 u32 flags;
@@ -931,6 +972,11 @@ enum ieee80211_vif_flags {
931 * at runtime, mac80211 will never touch this field 972 * at runtime, mac80211 will never touch this field
932 * @hw_queue: hardware queue for each AC 973 * @hw_queue: hardware queue for each AC
933 * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only 974 * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only
975 * @chanctx_conf: The channel context this interface is assigned to, or %NULL
976 * when it is not assigned. This pointer is RCU-protected due to the TX
977 * path needing to access it; even though the netdev carrier will always
978 * be off when it is %NULL there can still be races and packets could be
979 * processed after it switches back to %NULL.
934 * @drv_priv: data area for driver use, will always be aligned to 980 * @drv_priv: data area for driver use, will always be aligned to
935 * sizeof(void *). 981 * sizeof(void *).
936 */ 982 */
@@ -943,6 +989,8 @@ struct ieee80211_vif {
943 u8 cab_queue; 989 u8 cab_queue;
944 u8 hw_queue[IEEE80211_NUM_ACS]; 990 u8 hw_queue[IEEE80211_NUM_ACS];
945 991
992 struct ieee80211_chanctx_conf __rcu *chanctx_conf;
993
946 u32 driver_flags; 994 u32 driver_flags;
947 995
948 /* must be last */ 996 /* must be last */
@@ -1076,6 +1124,8 @@ enum ieee80211_sta_state {
1076 * @aid: AID we assigned to the station if we're an AP 1124 * @aid: AID we assigned to the station if we're an AP
1077 * @supp_rates: Bitmap of supported rates (per band) 1125 * @supp_rates: Bitmap of supported rates (per band)
1078 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities 1126 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
1127 * @vht_cap: VHT capabilities of this STA; Not restricting any capabilities
1128 * of remote STA. Taking as is.
1079 * @wme: indicates whether the STA supports WME. Only valid during AP-mode. 1129 * @wme: indicates whether the STA supports WME. Only valid during AP-mode.
1080 * @drv_priv: data area for driver use, will always be aligned to 1130 * @drv_priv: data area for driver use, will always be aligned to
1081 * sizeof(void *), size is determined in hw information. 1131 * sizeof(void *), size is determined in hw information.
@@ -1088,6 +1138,7 @@ struct ieee80211_sta {
1088 u8 addr[ETH_ALEN]; 1138 u8 addr[ETH_ALEN];
1089 u16 aid; 1139 u16 aid;
1090 struct ieee80211_sta_ht_cap ht_cap; 1140 struct ieee80211_sta_ht_cap ht_cap;
1141 struct ieee80211_sta_vht_cap vht_cap;
1091 bool wme; 1142 bool wme;
1092 u8 uapsd_queues; 1143 u8 uapsd_queues;
1093 u8 max_sp; 1144 u8 max_sp;
@@ -1325,6 +1376,8 @@ enum ieee80211_hw_flags {
1325 * within &struct ieee80211_vif. 1376 * within &struct ieee80211_vif.
1326 * @sta_data_size: size (in bytes) of the drv_priv data area 1377 * @sta_data_size: size (in bytes) of the drv_priv data area
1327 * within &struct ieee80211_sta. 1378 * within &struct ieee80211_sta.
1379 * @chanctx_data_size: size (in bytes) of the drv_priv data area
1380 * within &struct ieee80211_chanctx_conf.
1328 * 1381 *
1329 * @max_rates: maximum number of alternate rate retry stages the hw 1382 * @max_rates: maximum number of alternate rate retry stages the hw
1330 * can handle. 1383 * can handle.
@@ -1369,6 +1422,7 @@ struct ieee80211_hw {
1369 int channel_change_time; 1422 int channel_change_time;
1370 int vif_data_size; 1423 int vif_data_size;
1371 int sta_data_size; 1424 int sta_data_size;
1425 int chanctx_data_size;
1372 int napi_weight; 1426 int napi_weight;
1373 u16 queues; 1427 u16 queues;
1374 u16 max_listen_interval; 1428 u16 max_listen_interval;
@@ -2317,6 +2371,16 @@ enum ieee80211_rate_control_changed {
2317 * The callback will be called before each transmission and upon return 2371 * The callback will be called before each transmission and upon return
2318 * mac80211 will transmit the frame right away. 2372 * mac80211 will transmit the frame right away.
2319 * The callback is optional and can (should!) sleep. 2373 * The callback is optional and can (should!) sleep.
2374 *
2375 * @add_chanctx: Notifies device driver about new channel context creation.
2376 * @remove_chanctx: Notifies device driver about channel context destruction.
2377 * @change_chanctx: Notifies device driver about channel context changes that
2378 * may happen when combining different virtual interfaces on the same
2379 * channel context with different settings
2380 * @assign_vif_chanctx: Notifies device driver about channel context being bound
2381 * to vif. Possible use is for hw queue remapping.
2382 * @unassign_vif_chanctx: Notifies device driver about channel context being
2383 * unbound from vif.
2320 */ 2384 */
2321struct ieee80211_ops { 2385struct ieee80211_ops {
2322 void (*tx)(struct ieee80211_hw *hw, 2386 void (*tx)(struct ieee80211_hw *hw,
@@ -2461,6 +2525,20 @@ struct ieee80211_ops {
2461 2525
2462 void (*mgd_prepare_tx)(struct ieee80211_hw *hw, 2526 void (*mgd_prepare_tx)(struct ieee80211_hw *hw,
2463 struct ieee80211_vif *vif); 2527 struct ieee80211_vif *vif);
2528
2529 int (*add_chanctx)(struct ieee80211_hw *hw,
2530 struct ieee80211_chanctx_conf *ctx);
2531 void (*remove_chanctx)(struct ieee80211_hw *hw,
2532 struct ieee80211_chanctx_conf *ctx);
2533 void (*change_chanctx)(struct ieee80211_hw *hw,
2534 struct ieee80211_chanctx_conf *ctx,
2535 u32 changed);
2536 int (*assign_vif_chanctx)(struct ieee80211_hw *hw,
2537 struct ieee80211_vif *vif,
2538 struct ieee80211_chanctx_conf *ctx);
2539 void (*unassign_vif_chanctx)(struct ieee80211_hw *hw,
2540 struct ieee80211_vif *vif,
2541 struct ieee80211_chanctx_conf *ctx);
2464}; 2542};
2465 2543
2466/** 2544/**
@@ -3524,6 +3602,27 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
3524 void *iter_data); 3602 void *iter_data);
3525 3603
3526/** 3604/**
3605 * ieee80211_iter_chan_contexts_atomic - iterate channel contexts
3606 * @hw: pointre obtained from ieee80211_alloc_hw().
3607 * @iter: iterator function
3608 * @iter_data: data passed to iterator function
3609 *
3610 * Iterate all active channel contexts. This function is atomic and
3611 * doesn't acquire any locks internally that might be held in other
3612 * places while calling into the driver.
3613 *
3614 * The iterator will not find a context that's being added (during
3615 * the driver callback to add it) but will find it while it's being
3616 * removed.
3617 */
3618void ieee80211_iter_chan_contexts_atomic(
3619 struct ieee80211_hw *hw,
3620 void (*iter)(struct ieee80211_hw *hw,
3621 struct ieee80211_chanctx_conf *chanctx_conf,
3622 void *data),
3623 void *iter_data);
3624
3625/**
3527 * ieee80211_ap_probereq_get - retrieve a Probe Request template 3626 * ieee80211_ap_probereq_get - retrieve a Probe Request template
3528 * @hw: pointer obtained from ieee80211_alloc_hw(). 3627 * @hw: pointer obtained from ieee80211_alloc_hw().
3529 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3628 * @vif: &struct ieee80211_vif pointer from the add_interface callback.