aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2016-08-24 04:05:40 -0400
committerLuca Coelho <luciano.coelho@intel.com>2016-09-19 04:29:32 -0400
commit186cd49a4d9ad1a0d4a7371c2d02a05a8ac53a03 (patch)
treeb6dc634e6e3c488dc19222b6f5ee5655acb63f08 /drivers/net/wireless/intel
parent8b6607cc6cdecd932201e63597b3b0c0f7958f33 (diff)
iwlwifi: mvm: move AP-specific code to right function
There's no need for the common MAC context function to have an if on AP mode, the values can be overridden in the AP-specific function later. Clean that up by adding the full command as a new parameter to the AP-specific function, and doing it there. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
index d742d27d8de0..6b962d6b067a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
@@ -774,26 +774,6 @@ static void iwl_mvm_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
774 cmd->ac[txf].fifos_mask = BIT(txf); 774 cmd->ac[txf].fifos_mask = BIT(txf);
775 } 775 }
776 776
777 if (vif->type == NL80211_IFTYPE_AP) {
778 /* in AP mode, the MCAST FIFO takes the EDCA params from VO */
779 cmd->ac[IWL_MVM_TX_FIFO_VO].fifos_mask |=
780 BIT(IWL_MVM_TX_FIFO_MCAST);
781
782 /*
783 * in AP mode, pass probe requests and beacons from other APs
784 * (needed for ht protection); when there're no any associated
785 * station don't ask FW to pass beacons to prevent unnecessary
786 * wake-ups.
787 */
788 cmd->filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST);
789 if (mvmvif->ap_assoc_sta_count || !mvm->drop_bcn_ap_mode) {
790 cmd->filter_flags |= cpu_to_le32(MAC_FILTER_IN_BEACON);
791 IWL_DEBUG_HC(mvm, "Asking FW to pass beacons\n");
792 } else {
793 IWL_DEBUG_HC(mvm, "No need to receive beacons\n");
794 }
795 }
796
797 if (vif->bss_conf.qos) 777 if (vif->bss_conf.qos)
798 cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA); 778 cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA);
799 779
@@ -1191,6 +1171,7 @@ static void iwl_mvm_mac_ap_iterator(void *_data, u8 *mac,
1191 */ 1171 */
1192static void iwl_mvm_mac_ctxt_cmd_fill_ap(struct iwl_mvm *mvm, 1172static void iwl_mvm_mac_ctxt_cmd_fill_ap(struct iwl_mvm *mvm,
1193 struct ieee80211_vif *vif, 1173 struct ieee80211_vif *vif,
1174 struct iwl_mac_ctx_cmd *cmd,
1194 struct iwl_mac_data_ap *ctxt_ap, 1175 struct iwl_mac_data_ap *ctxt_ap,
1195 bool add) 1176 bool add)
1196{ 1177{
@@ -1201,6 +1182,23 @@ static void iwl_mvm_mac_ctxt_cmd_fill_ap(struct iwl_mvm *mvm,
1201 .beacon_device_ts = 0 1182 .beacon_device_ts = 0
1202 }; 1183 };
1203 1184
1185 /* in AP mode, the MCAST FIFO takes the EDCA params from VO */
1186 cmd->ac[IWL_MVM_TX_FIFO_VO].fifos_mask |= BIT(IWL_MVM_TX_FIFO_MCAST);
1187
1188 /*
1189 * in AP mode, pass probe requests and beacons from other APs
1190 * (needed for ht protection); when there're no any associated
1191 * station don't ask FW to pass beacons to prevent unnecessary
1192 * wake-ups.
1193 */
1194 cmd->filter_flags |= cpu_to_le32(MAC_FILTER_IN_PROBE_REQUEST);
1195 if (mvmvif->ap_assoc_sta_count || !mvm->drop_bcn_ap_mode) {
1196 cmd->filter_flags |= cpu_to_le32(MAC_FILTER_IN_BEACON);
1197 IWL_DEBUG_HC(mvm, "Asking FW to pass beacons\n");
1198 } else {
1199 IWL_DEBUG_HC(mvm, "No need to receive beacons\n");
1200 }
1201
1204 ctxt_ap->bi = cpu_to_le32(vif->bss_conf.beacon_int); 1202 ctxt_ap->bi = cpu_to_le32(vif->bss_conf.beacon_int);
1205 ctxt_ap->bi_reciprocal = 1203 ctxt_ap->bi_reciprocal =
1206 cpu_to_le32(iwl_mvm_reciprocal(vif->bss_conf.beacon_int)); 1204 cpu_to_le32(iwl_mvm_reciprocal(vif->bss_conf.beacon_int));
@@ -1258,7 +1256,7 @@ static int iwl_mvm_mac_ctxt_cmd_ap(struct iwl_mvm *mvm,
1258 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); 1256 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action);
1259 1257
1260 /* Fill the data specific for ap mode */ 1258 /* Fill the data specific for ap mode */
1261 iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.ap, 1259 iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd, &cmd.ap,
1262 action == FW_CTXT_ACTION_ADD); 1260 action == FW_CTXT_ACTION_ADD);
1263 1261
1264 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); 1262 return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd);
@@ -1277,7 +1275,7 @@ static int iwl_mvm_mac_ctxt_cmd_go(struct iwl_mvm *mvm,
1277 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action); 1275 iwl_mvm_mac_ctxt_cmd_common(mvm, vif, &cmd, NULL, action);
1278 1276
1279 /* Fill the data specific for GO mode */ 1277 /* Fill the data specific for GO mode */
1280 iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.go.ap, 1278 iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd, &cmd.go.ap,
1281 action == FW_CTXT_ACTION_ADD); 1279 action == FW_CTXT_ACTION_ADD);
1282 1280
1283 cmd.go.ctwin = cpu_to_le32(noa->oppps_ctwindow & 1281 cmd.go.ctwin = cpu_to_le32(noa->oppps_ctwindow &