diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-03-20 15:28:27 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-03 22:49:12 +0200 |
commit | 9166b1eeb7f3e98d76ab735bf91d01a7516562da (patch) | |
tree | b33fd17c9a5d7f8bf303d38007fb040c92ee69f9 /drivers/net/wireless/iwlwifi/mvm/bt-coex.c | |
parent | 2b76ef13086ff0170abfc7f7ebfd104abfdee463 (diff) |
iwlwifi: mvm: remove BT Coex constraints upon roaming to A band
When we roam to A band, we don't need to constraint WiFi
any more since it is operating on a different band.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/bt-coex.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/bt-coex.c | 67 |
1 files changed, 50 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c index 91788fe011a..398cd9fe68e 100644 --- a/drivers/net/wireless/iwlwifi/mvm/bt-coex.c +++ b/drivers/net/wireless/iwlwifi/mvm/bt-coex.c @@ -362,11 +362,13 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac, band = -1; rcu_read_unlock(); - if (band != IEEE80211_BAND_2GHZ) - return; - smps_mode = IEEE80211_SMPS_AUTOMATIC; + if (band != IEEE80211_BAND_2GHZ) { + ieee80211_request_smps(vif, smps_mode); + return; + } + if (data->notif->bt_status) smps_mode = IEEE80211_SMPS_DYNAMIC; @@ -432,13 +434,9 @@ static void iwl_mvm_bt_notif_iterator(void *_data, u8 *mac, BT_ENABLE_REDUCED_TXPOWER_THRESHOLD); } -/* upon association, the fw will send in BT Coex notification */ -int iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm, - struct iwl_rx_cmd_buffer *rxb, - struct iwl_device_cmd *dev_cmd) +static void iwl_mvm_new_bt_coex_notif(struct iwl_mvm *mvm, + struct iwl_bt_coex_profile_notif *notif) { - struct iwl_rx_packet *pkt = rxb_addr(rxb); - struct iwl_bt_coex_profile_notif *notif = (void *)pkt->data; struct iwl_bt_iterator_data data = { .mvm = mvm, .notif = notif, @@ -446,14 +444,6 @@ int iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm, }; bool reduced_tx_power; - IWL_DEBUG_COEX(mvm, "BT Coex Notification received\n"); - IWL_DEBUG_COEX(mvm, "\tBT %salive\n", notif->bt_status ? "" : "not "); - IWL_DEBUG_COEX(mvm, "\tBT open conn %d\n", notif->bt_open_conn); - IWL_DEBUG_COEX(mvm, "\tBT traffic load %d\n", notif->bt_traffic_load); - IWL_DEBUG_COEX(mvm, "\tBT agg traffic load %d\n", - notif->bt_agg_traffic_load); - IWL_DEBUG_COEX(mvm, "\tBT ci compliance %d\n", notif->bt_ci_compliance); - /* remember this notification for future use: rssi fluctuations */ memcpy(&mvm->last_bt_notif, notif, sizeof(mvm->last_bt_notif)); @@ -474,6 +464,26 @@ int iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm, if (iwl_mvm_bt_udpate_ctrl_kill_msk(mvm, reduced_tx_power)) IWL_ERR(mvm, "Failed to update the ctrl_kill_msk\n"); +} + +/* upon association, the fw will send in BT Coex notification */ +int iwl_mvm_rx_bt_coex_notif(struct iwl_mvm *mvm, + struct iwl_rx_cmd_buffer *rxb, + struct iwl_device_cmd *dev_cmd) +{ + struct iwl_rx_packet *pkt = rxb_addr(rxb); + struct iwl_bt_coex_profile_notif *notif = (void *)pkt->data; + + + IWL_DEBUG_COEX(mvm, "BT Coex Notification received\n"); + IWL_DEBUG_COEX(mvm, "\tBT %salive\n", notif->bt_status ? "" : "not "); + IWL_DEBUG_COEX(mvm, "\tBT open conn %d\n", notif->bt_open_conn); + IWL_DEBUG_COEX(mvm, "\tBT traffic load %d\n", notif->bt_traffic_load); + IWL_DEBUG_COEX(mvm, "\tBT agg traffic load %d\n", + notif->bt_agg_traffic_load); + IWL_DEBUG_COEX(mvm, "\tBT ci compliance %d\n", notif->bt_ci_compliance); + + iwl_mvm_new_bt_coex_notif(mvm, notif); /* * This is an async handler for a notification, returning anything other @@ -567,3 +577,26 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif, out_unlock: mutex_unlock(&mvm->mutex); } + +void iwl_mvm_bt_coex_vif_assoc(struct iwl_mvm *mvm, struct ieee80211_vif *vif) +{ + struct ieee80211_chanctx_conf *chanctx_conf; + enum ieee80211_band band; + + rcu_read_lock(); + chanctx_conf = rcu_dereference(vif->chanctx_conf); + if (chanctx_conf && chanctx_conf->def.chan) + band = chanctx_conf->def.chan->band; + else + band = -1; + rcu_read_unlock(); + + /* if we are in 2GHz we will get a notification from the fw */ + if (band == IEEE80211_BAND_2GHZ) + return; + + /* else, we can remove all the constraints */ + memset(&mvm->last_bt_notif, 0, sizeof(mvm->last_bt_notif)); + + iwl_mvm_new_bt_coex_notif(mvm, &mvm->last_bt_notif); +} |