aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/mac80211.h
diff options
context:
space:
mode:
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>2014-05-09 07:11:50 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-05-15 09:01:00 -0400
commit1af586c9116cdf6863823a830593c48cd9bcecde (patch)
tree4026e2cc9aa1172aaaadc70025a74fcd083cf8eb /include/net/mac80211.h
parent6ec8c332a0f93959e615158cc212b3abfd52abe7 (diff)
mac80211: Handle the CSA counters correctly
Make the beacon CSA counters part of ieee80211_mutable_offsets and don't decrement CSA counters when generating a beacon template. This permits the driver to offload the CSA counters handling. Since mac80211 updates the probe responses with the correct counter, the driver should sync the counter's value with mac80211 using ieee80211_csa_update_counter function. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include/net/mac80211.h')
-rw-r--r--include/net/mac80211.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e6521261a585..982d2cd80166 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3411,14 +3411,20 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
3411 */ 3411 */
3412void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets); 3412void ieee80211_report_low_ack(struct ieee80211_sta *sta, u32 num_packets);
3413 3413
3414#define IEEE80211_MAX_CSA_COUNTERS_NUM 2
3415
3414/** 3416/**
3415 * struct ieee80211_mutable_offsets - mutable beacon offsets 3417 * struct ieee80211_mutable_offsets - mutable beacon offsets
3416 * @tim_offset: position of TIM element 3418 * @tim_offset: position of TIM element
3417 * @tim_length: size of TIM element 3419 * @tim_length: size of TIM element
3420 * @csa_offs: array of IEEE80211_MAX_CSA_COUNTERS_NUM offsets to CSA counters.
3421 * This array can contain zero values which should be ignored.
3418 */ 3422 */
3419struct ieee80211_mutable_offsets { 3423struct ieee80211_mutable_offsets {
3420 u16 tim_offset; 3424 u16 tim_offset;
3421 u16 tim_length; 3425 u16 tim_length;
3426
3427 u16 csa_counter_offs[IEEE80211_MAX_CSA_COUNTERS_NUM];
3422}; 3428};
3423 3429
3424/** 3430/**
@@ -3433,7 +3439,8 @@ struct ieee80211_mutable_offsets {
3433 * 3439 *
3434 * This function should be used if the beacon frames are generated by the 3440 * This function should be used if the beacon frames are generated by the
3435 * device, and then the driver must use the returned beacon as the template 3441 * device, and then the driver must use the returned beacon as the template
3436 * The driver is responsible to update the DTIM count. 3442 * The driver or the device are responsible to update the DTIM and, when
3443 * applicable, the CSA count.
3437 * 3444 *
3438 * The driver is responsible for freeing the returned skb. 3445 * The driver is responsible for freeing the returned skb.
3439 * 3446 *
@@ -3486,6 +3493,20 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3486} 3493}
3487 3494
3488/** 3495/**
3496 * ieee80211_csa_update_counter - request mac80211 to decrement the csa counter
3497 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3498 *
3499 * The csa counter should be updated after each beacon transmission.
3500 * This function is called implicitly when
3501 * ieee80211_beacon_get/ieee80211_beacon_get_tim are called, however if the
3502 * beacon frames are generated by the device, the driver should call this
3503 * function after each beacon transmission to sync mac80211's csa counters.
3504 *
3505 * Return: new csa counter value
3506 */
3507u8 ieee80211_csa_update_counter(struct ieee80211_vif *vif);
3508
3509/**
3489 * ieee80211_csa_finish - notify mac80211 about channel switch 3510 * ieee80211_csa_finish - notify mac80211 about channel switch
3490 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3511 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3491 * 3512 *