diff options
author | Luciano Coelho <luciano.coelho@intel.com> | 2014-05-13 10:33:38 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-05-21 05:52:44 -0400 |
commit | bca49d9a220b2f277f8e6000ac3a9d129d88972c (patch) | |
tree | da1e6641002697b6caf2fcd7ceaa5af490a38510 | |
parent | fa7b2e7fd09f17c47ac312ade3aae48247a528f6 (diff) |
iwlwifi: mvm: pass force_assoc_off all the way down to avoid hacks
In some cases, we need to force the association to be off in the
MAC_CONTEXT_CMD command we send to the firmware. Instead of having to
hack the vif->bss_conf.assoc value, pass it all the way down the call
chain.
Additionally, for the iwl_mvm_mac_ctxt_add() case, we *always* set
forced_assoc_off to true, so we can remove the hack in the d3 code
that was forcing it to off by hacking the bss_conf.assoc value.
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/d3.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mac80211.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/mvm.h | 3 |
4 files changed, 18 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/d3.c b/drivers/net/wireless/iwlwifi/mvm/d3.c index 7dc71f344c94..48c192d85c4c 100644 --- a/drivers/net/wireless/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/iwlwifi/mvm/d3.c | |||
@@ -663,10 +663,8 @@ static int iwl_mvm_d3_reprogram(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
663 | 663 | ||
664 | if (WARN_ON(!vif->bss_conf.assoc)) | 664 | if (WARN_ON(!vif->bss_conf.assoc)) |
665 | return -EINVAL; | 665 | return -EINVAL; |
666 | /* hack */ | 666 | |
667 | vif->bss_conf.assoc = false; | ||
668 | ret = iwl_mvm_mac_ctxt_add(mvm, vif); | 667 | ret = iwl_mvm_mac_ctxt_add(mvm, vif); |
669 | vif->bss_conf.assoc = true; | ||
670 | if (ret) | 668 | if (ret) |
671 | return ret; | 669 | return ret; |
672 | 670 | ||
@@ -702,7 +700,7 @@ static int iwl_mvm_d3_reprogram(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
702 | return ret; | 700 | return ret; |
703 | rcu_assign_pointer(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], ap_sta); | 701 | rcu_assign_pointer(mvm->fw_id_to_mac_id[mvmvif->ap_sta_id], ap_sta); |
704 | 702 | ||
705 | ret = iwl_mvm_mac_ctxt_changed(mvm, vif); | 703 | ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false); |
706 | if (ret) | 704 | if (ret) |
707 | return ret; | 705 | return ret; |
708 | 706 | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c index fed012f2b6c0..8b5302777632 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | |||
@@ -1109,12 +1109,12 @@ static int iwl_mvm_mac_ctxt_cmd_go(struct iwl_mvm *mvm, | |||
1109 | } | 1109 | } |
1110 | 1110 | ||
1111 | static int iwl_mvm_mac_ctx_send(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | 1111 | static int iwl_mvm_mac_ctx_send(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
1112 | u32 action) | 1112 | u32 action, bool force_assoc_off) |
1113 | { | 1113 | { |
1114 | switch (vif->type) { | 1114 | switch (vif->type) { |
1115 | case NL80211_IFTYPE_STATION: | 1115 | case NL80211_IFTYPE_STATION: |
1116 | return iwl_mvm_mac_ctxt_cmd_sta(mvm, vif, action, | 1116 | return iwl_mvm_mac_ctxt_cmd_sta(mvm, vif, action, |
1117 | action == FW_CTXT_ACTION_ADD); | 1117 | force_assoc_off); |
1118 | break; | 1118 | break; |
1119 | case NL80211_IFTYPE_AP: | 1119 | case NL80211_IFTYPE_AP: |
1120 | if (!vif->p2p) | 1120 | if (!vif->p2p) |
@@ -1144,7 +1144,8 @@ int iwl_mvm_mac_ctxt_add(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
1144 | vif->addr, ieee80211_vif_type_p2p(vif))) | 1144 | vif->addr, ieee80211_vif_type_p2p(vif))) |
1145 | return -EIO; | 1145 | return -EIO; |
1146 | 1146 | ||
1147 | ret = iwl_mvm_mac_ctx_send(mvm, vif, FW_CTXT_ACTION_ADD); | 1147 | ret = iwl_mvm_mac_ctx_send(mvm, vif, FW_CTXT_ACTION_ADD, |
1148 | true); | ||
1148 | if (ret) | 1149 | if (ret) |
1149 | return ret; | 1150 | return ret; |
1150 | 1151 | ||
@@ -1155,7 +1156,8 @@ int iwl_mvm_mac_ctxt_add(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
1155 | return 0; | 1156 | return 0; |
1156 | } | 1157 | } |
1157 | 1158 | ||
1158 | int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | 1159 | int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
1160 | bool force_assoc_off) | ||
1159 | { | 1161 | { |
1160 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | 1162 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); |
1161 | 1163 | ||
@@ -1163,7 +1165,8 @@ int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | |||
1163 | vif->addr, ieee80211_vif_type_p2p(vif))) | 1165 | vif->addr, ieee80211_vif_type_p2p(vif))) |
1164 | return -EIO; | 1166 | return -EIO; |
1165 | 1167 | ||
1166 | return iwl_mvm_mac_ctx_send(mvm, vif, FW_CTXT_ACTION_MODIFY); | 1168 | return iwl_mvm_mac_ctx_send(mvm, vif, FW_CTXT_ACTION_MODIFY, |
1169 | force_assoc_off); | ||
1167 | } | 1170 | } |
1168 | 1171 | ||
1169 | int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif) | 1172 | int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif) |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 7411f12fd88d..1146cfbc7299 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c | |||
@@ -1271,7 +1271,7 @@ static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, | |||
1271 | if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc) | 1271 | if (changes & BSS_CHANGED_ASSOC && bss_conf->assoc) |
1272 | iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); | 1272 | iwl_mvm_mac_ctxt_recalc_tsf_id(mvm, vif); |
1273 | 1273 | ||
1274 | ret = iwl_mvm_mac_ctxt_changed(mvm, vif); | 1274 | ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false); |
1275 | if (ret) | 1275 | if (ret) |
1276 | IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); | 1276 | IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); |
1277 | 1277 | ||
@@ -1431,7 +1431,7 @@ static int iwl_mvm_start_ap_ibss(struct ieee80211_hw *hw, | |||
1431 | 1431 | ||
1432 | /* Need to update the P2P Device MAC (only GO, IBSS is single vif) */ | 1432 | /* Need to update the P2P Device MAC (only GO, IBSS is single vif) */ |
1433 | if (vif->p2p && mvm->p2p_device_vif) | 1433 | if (vif->p2p && mvm->p2p_device_vif) |
1434 | iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif); | 1434 | iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false); |
1435 | 1435 | ||
1436 | iwl_mvm_ref(mvm, IWL_MVM_REF_AP_IBSS); | 1436 | iwl_mvm_ref(mvm, IWL_MVM_REF_AP_IBSS); |
1437 | 1437 | ||
@@ -1471,7 +1471,7 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw, | |||
1471 | 1471 | ||
1472 | /* Need to update the P2P Device MAC (only GO, IBSS is single vif) */ | 1472 | /* Need to update the P2P Device MAC (only GO, IBSS is single vif) */ |
1473 | if (vif->p2p && mvm->p2p_device_vif) | 1473 | if (vif->p2p && mvm->p2p_device_vif) |
1474 | iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif); | 1474 | iwl_mvm_mac_ctxt_changed(mvm, mvm->p2p_device_vif, false); |
1475 | 1475 | ||
1476 | iwl_mvm_update_quotas(mvm, NULL); | 1476 | iwl_mvm_update_quotas(mvm, NULL); |
1477 | iwl_mvm_send_rm_bcast_sta(mvm, &mvmvif->bcast_sta); | 1477 | iwl_mvm_send_rm_bcast_sta(mvm, &mvmvif->bcast_sta); |
@@ -1498,7 +1498,7 @@ iwl_mvm_bss_info_changed_ap_ibss(struct iwl_mvm *mvm, | |||
1498 | 1498 | ||
1499 | if (changes & (BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_HT | | 1499 | if (changes & (BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_HT | |
1500 | BSS_CHANGED_BANDWIDTH) && | 1500 | BSS_CHANGED_BANDWIDTH) && |
1501 | iwl_mvm_mac_ctxt_changed(mvm, vif)) | 1501 | iwl_mvm_mac_ctxt_changed(mvm, vif, false)) |
1502 | IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); | 1502 | IWL_ERR(mvm, "failed to update MAC %pM\n", vif->addr); |
1503 | 1503 | ||
1504 | /* Need to send a new beacon template to the FW */ | 1504 | /* Need to send a new beacon template to the FW */ |
@@ -1799,7 +1799,7 @@ static int iwl_mvm_mac_conf_tx(struct ieee80211_hw *hw, | |||
1799 | int ret; | 1799 | int ret; |
1800 | 1800 | ||
1801 | mutex_lock(&mvm->mutex); | 1801 | mutex_lock(&mvm->mutex); |
1802 | ret = iwl_mvm_mac_ctxt_changed(mvm, vif); | 1802 | ret = iwl_mvm_mac_ctxt_changed(mvm, vif, false); |
1803 | mutex_unlock(&mvm->mutex); | 1803 | mutex_unlock(&mvm->mutex); |
1804 | return ret; | 1804 | return ret; |
1805 | } | 1805 | } |
@@ -2255,7 +2255,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw, | |||
2255 | /* Handle binding during CSA */ | 2255 | /* Handle binding during CSA */ |
2256 | if (vif->type == NL80211_IFTYPE_AP) { | 2256 | if (vif->type == NL80211_IFTYPE_AP) { |
2257 | iwl_mvm_update_quotas(mvm, vif); | 2257 | iwl_mvm_update_quotas(mvm, vif); |
2258 | iwl_mvm_mac_ctxt_changed(mvm, vif); | 2258 | iwl_mvm_mac_ctxt_changed(mvm, vif, false); |
2259 | } | 2259 | } |
2260 | 2260 | ||
2261 | goto out_unlock; | 2261 | goto out_unlock; |
diff --git a/drivers/net/wireless/iwlwifi/mvm/mvm.h b/drivers/net/wireless/iwlwifi/mvm/mvm.h index 6ccc88b0f76b..da8dc1461b21 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/iwlwifi/mvm/mvm.h | |||
@@ -814,7 +814,8 @@ void iwl_mvm_phy_ctxt_unref(struct iwl_mvm *mvm, | |||
814 | int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 814 | int iwl_mvm_mac_ctxt_init(struct iwl_mvm *mvm, struct ieee80211_vif *vif); |
815 | void iwl_mvm_mac_ctxt_release(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 815 | void iwl_mvm_mac_ctxt_release(struct iwl_mvm *mvm, struct ieee80211_vif *vif); |
816 | int iwl_mvm_mac_ctxt_add(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 816 | int iwl_mvm_mac_ctxt_add(struct iwl_mvm *mvm, struct ieee80211_vif *vif); |
817 | int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 817 | int iwl_mvm_mac_ctxt_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif, |
818 | bool force_assoc_off); | ||
818 | int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif); | 819 | int iwl_mvm_mac_ctxt_remove(struct iwl_mvm *mvm, struct ieee80211_vif *vif); |
819 | u32 iwl_mvm_mac_get_queues_mask(struct iwl_mvm *mvm, | 820 | u32 iwl_mvm_mac_get_queues_mask(struct iwl_mvm *mvm, |
820 | struct ieee80211_vif *vif); | 821 | struct ieee80211_vif *vif); |