diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2012-06-26 08:37:16 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-10-16 14:22:41 -0400 |
commit | d01a1e658606a0a69100f49c2ef09aacaf74d3e7 (patch) | |
tree | 30de068699ed95997ad44f4d0f703a6deb0ad95b /include | |
parent | ddffeb8c4d0331609ef2581d84de4d763607bd37 (diff) |
mac80211: introduce channel context skeleton code
Channel context are the foundation for multi-channel
operation. They are are immutable and are re-created
(or re-used if other interfaces are bound to a certain
channel and a compatible channel type) on channel
switching.
This is an initial implementation and more features
will come in separate patches.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
[some changes including RCU protection]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/mac80211.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 82558c8decf8..ab1b5bafb568 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -144,6 +144,32 @@ 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 | */ | ||
150 | enum ieee80211_chanctx_change { | ||
151 | IEEE80211_CHANCTX_CHANGE_CHANNEL_TYPE = BIT(0), | ||
152 | }; | ||
153 | |||
154 | /** | ||
155 | * struct ieee80211_chanctx_conf - channel context that vifs may be tuned to | ||
156 | * | ||
157 | * This is the driver-visible part. The ieee80211_chanctx | ||
158 | * that contains it is visible in mac80211 only. | ||
159 | * | ||
160 | * @channel: the channel to tune to | ||
161 | * @channel_type: the channel (HT) type | ||
162 | * @drv_priv: data area for driver use, will always be aligned to | ||
163 | * sizeof(void *), size is determined in hw information. | ||
164 | */ | ||
165 | struct ieee80211_chanctx_conf { | ||
166 | struct ieee80211_channel *channel; | ||
167 | enum nl80211_channel_type channel_type; | ||
168 | |||
169 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | ||
170 | }; | ||
171 | |||
172 | /** | ||
147 | * enum ieee80211_bss_change - BSS change notification flags | 173 | * enum ieee80211_bss_change - BSS change notification flags |
148 | * | 174 | * |
149 | * These flags are used with the bss_info_changed() callback | 175 | * These flags are used with the bss_info_changed() callback |
@@ -931,6 +957,11 @@ enum ieee80211_vif_flags { | |||
931 | * at runtime, mac80211 will never touch this field | 957 | * at runtime, mac80211 will never touch this field |
932 | * @hw_queue: hardware queue for each AC | 958 | * @hw_queue: hardware queue for each AC |
933 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only | 959 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only |
960 | * @chanctx_conf: The channel context this interface is assigned to, or %NULL | ||
961 | * when it is not assigned. This pointer is RCU-protected due to the TX | ||
962 | * path needing to access it; even though the netdev carrier will always | ||
963 | * be off when it is %NULL there can still be races and packets could be | ||
964 | * processed after it switches back to %NULL. | ||
934 | * @drv_priv: data area for driver use, will always be aligned to | 965 | * @drv_priv: data area for driver use, will always be aligned to |
935 | * sizeof(void *). | 966 | * sizeof(void *). |
936 | */ | 967 | */ |
@@ -943,6 +974,8 @@ struct ieee80211_vif { | |||
943 | u8 cab_queue; | 974 | u8 cab_queue; |
944 | u8 hw_queue[IEEE80211_NUM_ACS]; | 975 | u8 hw_queue[IEEE80211_NUM_ACS]; |
945 | 976 | ||
977 | struct ieee80211_chanctx_conf __rcu *chanctx_conf; | ||
978 | |||
946 | u32 driver_flags; | 979 | u32 driver_flags; |
947 | 980 | ||
948 | /* must be last */ | 981 | /* must be last */ |
@@ -1325,6 +1358,8 @@ enum ieee80211_hw_flags { | |||
1325 | * within &struct ieee80211_vif. | 1358 | * within &struct ieee80211_vif. |
1326 | * @sta_data_size: size (in bytes) of the drv_priv data area | 1359 | * @sta_data_size: size (in bytes) of the drv_priv data area |
1327 | * within &struct ieee80211_sta. | 1360 | * within &struct ieee80211_sta. |
1361 | * @chanctx_data_size: size (in bytes) of the drv_priv data area | ||
1362 | * within &struct ieee80211_chanctx_conf. | ||
1328 | * | 1363 | * |
1329 | * @max_rates: maximum number of alternate rate retry stages the hw | 1364 | * @max_rates: maximum number of alternate rate retry stages the hw |
1330 | * can handle. | 1365 | * can handle. |
@@ -1369,6 +1404,7 @@ struct ieee80211_hw { | |||
1369 | int channel_change_time; | 1404 | int channel_change_time; |
1370 | int vif_data_size; | 1405 | int vif_data_size; |
1371 | int sta_data_size; | 1406 | int sta_data_size; |
1407 | int chanctx_data_size; | ||
1372 | int napi_weight; | 1408 | int napi_weight; |
1373 | u16 queues; | 1409 | u16 queues; |
1374 | u16 max_listen_interval; | 1410 | u16 max_listen_interval; |