diff options
author | Ilan Peer <ilan.peer@intel.com> | 2013-12-24 15:08:14 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-12-31 12:03:49 -0500 |
commit | 12d423e816c69b0b4457bc047dda9a0a1c1a53c1 (patch) | |
tree | 7c1451dbc5a846d2b90cd40a3bd2efed20da030e /drivers/net/wireless/iwlwifi | |
parent | 2dceedaed6db8bc21ba270e785a982ac23211d4d (diff) |
iwlwifi: mvm: Add a missed beacons threshold
Instead of always calling ieee80211_beacon_loss() on every missed
beacons notification, call this function only if the number of
consecutive missed beacons from last rx is higher than a predefined
threshold.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | 25 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 1 |
2 files changed, 21 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c index eaaf2db741f8..761cca3c3a2a 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | |||
@@ -1191,10 +1191,18 @@ int iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, | |||
1191 | static void iwl_mvm_beacon_loss_iterator(void *_data, u8 *mac, | 1191 | static void iwl_mvm_beacon_loss_iterator(void *_data, u8 *mac, |
1192 | struct ieee80211_vif *vif) | 1192 | struct ieee80211_vif *vif) |
1193 | { | 1193 | { |
1194 | u16 *id = _data; | 1194 | struct iwl_missed_beacons_notif *missed_beacons = _data; |
1195 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | 1195 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); |
1196 | 1196 | ||
1197 | if (mvmvif->id == *id) | 1197 | if (mvmvif->id != (u16)le32_to_cpu(missed_beacons->mac_id)) |
1198 | return; | ||
1199 | |||
1200 | /* | ||
1201 | * TODO: the threshold should be adjusted based on latency conditions, | ||
1202 | * and/or in case of a CS flow on one of the other AP vifs. | ||
1203 | */ | ||
1204 | if (le32_to_cpu(missed_beacons->consec_missed_beacons_since_last_rx) > | ||
1205 | IWL_MVM_MISSED_BEACONS_THRESHOLD) | ||
1198 | ieee80211_beacon_loss(vif); | 1206 | ieee80211_beacon_loss(vif); |
1199 | } | 1207 | } |
1200 | 1208 | ||
@@ -1203,12 +1211,19 @@ int iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, | |||
1203 | struct iwl_device_cmd *cmd) | 1211 | struct iwl_device_cmd *cmd) |
1204 | { | 1212 | { |
1205 | struct iwl_rx_packet *pkt = rxb_addr(rxb); | 1213 | struct iwl_rx_packet *pkt = rxb_addr(rxb); |
1206 | struct iwl_missed_beacons_notif *missed_beacons = (void *)pkt->data; | 1214 | struct iwl_missed_beacons_notif *mb = (void *)pkt->data; |
1207 | u16 id = (u16)le32_to_cpu(missed_beacons->mac_id); | 1215 | |
1216 | IWL_DEBUG_INFO(mvm, | ||
1217 | "missed bcn mac_id=%u, consecutive=%u (%u, %u, %u)\n", | ||
1218 | le32_to_cpu(mb->mac_id), | ||
1219 | le32_to_cpu(mb->consec_missed_beacons), | ||
1220 | le32_to_cpu(mb->consec_missed_beacons_since_last_rx), | ||
1221 | le32_to_cpu(mb->num_recvd_beacons), | ||
1222 | le32_to_cpu(mb->num_expected_beacons)); | ||
1208 | 1223 | ||
1209 | ieee80211_iterate_active_interfaces_atomic(mvm->hw, | 1224 | ieee80211_iterate_active_interfaces_atomic(mvm->hw, |
1210 | IEEE80211_IFACE_ITER_NORMAL, | 1225 | IEEE80211_IFACE_ITER_NORMAL, |
1211 | iwl_mvm_beacon_loss_iterator, | 1226 | iwl_mvm_beacon_loss_iterator, |
1212 | &id); | 1227 | mb); |
1213 | return 0; | 1228 | return 0; |
1214 | } | 1229 | } |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index 84edf3649ad2..ca8a9048383d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -81,6 +81,7 @@ | |||
81 | #define IWL_MVM_MAX_ADDRESSES 5 | 81 | #define IWL_MVM_MAX_ADDRESSES 5 |
82 | /* RSSI offset for WkP */ | 82 | /* RSSI offset for WkP */ |
83 | #define IWL_RSSI_OFFSET 50 | 83 | #define IWL_RSSI_OFFSET 50 |
84 | #define IWL_MVM_MISSED_BEACONS_THRESHOLD 8 | ||
84 | 85 | ||
85 | enum iwl_mvm_tx_fifo { | 86 | enum iwl_mvm_tx_fifo { |
86 | IWL_MVM_TX_FIFO_BK = 0, | 87 | IWL_MVM_TX_FIFO_BK = 0, |