diff options
author | Andrei Otcheretianski <andrei.otcheretianski@intel.com> | 2014-05-25 10:07:38 -0400 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2014-06-24 14:55:39 -0400 |
commit | 09b0ce1a874a644fb5799ebf5e54563632714115 (patch) | |
tree | 3eeca0c9bb9f8dd4a625dc3fe3da1eaff5d3cc32 | |
parent | 50675360a8b0190d23350d42cc12a4e31c056c4f (diff) |
iwlwifi: mvm: Introduce an API to set STA_FLG_DISABLE_TX flag
Introduce new station flag STA_FLG_DISABLE_TX, which is modified with ADD_STA
command. This flag, when set, disables tx to the STA.
Provide an API (iwl_mvm_sta_modify_disable_tx) to modify this flag, which
should be used in channel switch and immediate quiet flows.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@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/iwl-fw.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/sta.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/sta.h | 2 |
4 files changed, 26 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-fw.h b/drivers/net/wireless/iwlwifi/iwl-fw.h index 287b949c95f6..c71331034e9b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-fw.h +++ b/drivers/net/wireless/iwlwifi/iwl-fw.h | |||
@@ -120,10 +120,12 @@ enum iwl_ucode_tlv_flag { | |||
120 | * enum iwl_ucode_tlv_api - ucode api | 120 | * enum iwl_ucode_tlv_api - ucode api |
121 | * @IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID: wowlan config includes tid field. | 121 | * @IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID: wowlan config includes tid field. |
122 | * @IWL_UCODE_TLV_API_CSA_FLOW: ucode can do unbind-bind flow for CSA. | 122 | * @IWL_UCODE_TLV_API_CSA_FLOW: ucode can do unbind-bind flow for CSA. |
123 | * @IWL_UCODE_TLV_API_DISABLE_STA_TX: ucode supports tx_disable bit. | ||
123 | */ | 124 | */ |
124 | enum iwl_ucode_tlv_api { | 125 | enum iwl_ucode_tlv_api { |
125 | IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0), | 126 | IWL_UCODE_TLV_API_WOWLAN_CONFIG_TID = BIT(0), |
126 | IWL_UCODE_TLV_API_CSA_FLOW = BIT(4), | 127 | IWL_UCODE_TLV_API_CSA_FLOW = BIT(4), |
128 | IWL_UCODE_TLV_API_DISABLE_STA_TX = BIT(5), | ||
127 | }; | 129 | }; |
128 | 130 | ||
129 | /** | 131 | /** |
diff --git a/drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h b/drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h index 39cebee8016f..47bd0406355d 100644 --- a/drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h +++ b/drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h | |||
@@ -67,7 +67,7 @@ | |||
67 | * enum iwl_sta_flags - flags for the ADD_STA host command | 67 | * enum iwl_sta_flags - flags for the ADD_STA host command |
68 | * @STA_FLG_REDUCED_TX_PWR_CTRL: | 68 | * @STA_FLG_REDUCED_TX_PWR_CTRL: |
69 | * @STA_FLG_REDUCED_TX_PWR_DATA: | 69 | * @STA_FLG_REDUCED_TX_PWR_DATA: |
70 | * @STA_FLG_FLG_ANT_MSK: Antenna selection | 70 | * @STA_FLG_DISABLE_TX: set if TX should be disabled |
71 | * @STA_FLG_PS: set if STA is in Power Save | 71 | * @STA_FLG_PS: set if STA is in Power Save |
72 | * @STA_FLG_INVALID: set if STA is invalid | 72 | * @STA_FLG_INVALID: set if STA is invalid |
73 | * @STA_FLG_DLP_EN: Direct Link Protocol is enabled | 73 | * @STA_FLG_DLP_EN: Direct Link Protocol is enabled |
@@ -91,10 +91,7 @@ enum iwl_sta_flags { | |||
91 | STA_FLG_REDUCED_TX_PWR_CTRL = BIT(3), | 91 | STA_FLG_REDUCED_TX_PWR_CTRL = BIT(3), |
92 | STA_FLG_REDUCED_TX_PWR_DATA = BIT(6), | 92 | STA_FLG_REDUCED_TX_PWR_DATA = BIT(6), |
93 | 93 | ||
94 | STA_FLG_FLG_ANT_A = (1 << 4), | 94 | STA_FLG_DISABLE_TX = BIT(4), |
95 | STA_FLG_FLG_ANT_B = (2 << 4), | ||
96 | STA_FLG_FLG_ANT_MSK = (STA_FLG_FLG_ANT_A | | ||
97 | STA_FLG_FLG_ANT_B), | ||
98 | 95 | ||
99 | STA_FLG_PS = BIT(8), | 96 | STA_FLG_PS = BIT(8), |
100 | STA_FLG_DRAIN_FLOW = BIT(12), | 97 | STA_FLG_DRAIN_FLOW = BIT(12), |
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.c b/drivers/net/wireless/iwlwifi/mvm/sta.c index 1fb01ea2e704..d3a6cf7558eb 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/iwlwifi/mvm/sta.c | |||
@@ -1448,3 +1448,23 @@ int iwl_mvm_rx_eosp_notif(struct iwl_mvm *mvm, | |||
1448 | 1448 | ||
1449 | return 0; | 1449 | return 0; |
1450 | } | 1450 | } |
1451 | |||
1452 | void iwl_mvm_sta_modify_disable_tx(struct iwl_mvm *mvm, | ||
1453 | struct iwl_mvm_sta *mvmsta, bool disable) | ||
1454 | { | ||
1455 | struct iwl_mvm_add_sta_cmd cmd = { | ||
1456 | .add_modify = STA_MODE_MODIFY, | ||
1457 | .sta_id = mvmsta->sta_id, | ||
1458 | .station_flags = disable ? cpu_to_le32(STA_FLG_DISABLE_TX) : 0, | ||
1459 | .station_flags_msk = cpu_to_le32(STA_FLG_DISABLE_TX), | ||
1460 | .mac_id_n_color = cpu_to_le32(mvmsta->mac_id_n_color), | ||
1461 | }; | ||
1462 | int ret; | ||
1463 | |||
1464 | if (!(mvm->fw->ucode_capa.api[0] & IWL_UCODE_TLV_API_DISABLE_STA_TX)) | ||
1465 | return; | ||
1466 | |||
1467 | ret = iwl_mvm_send_cmd_pdu(mvm, ADD_STA, CMD_ASYNC, sizeof(cmd), &cmd); | ||
1468 | if (ret) | ||
1469 | IWL_ERR(mvm, "Failed to send ADD_STA command (%d)\n", ret); | ||
1470 | } | ||
diff --git a/drivers/net/wireless/iwlwifi/mvm/sta.h b/drivers/net/wireless/iwlwifi/mvm/sta.h index d98e8a2142b8..10c1a5352651 100644 --- a/drivers/net/wireless/iwlwifi/mvm/sta.h +++ b/drivers/net/wireless/iwlwifi/mvm/sta.h | |||
@@ -404,5 +404,7 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, | |||
404 | bool agg); | 404 | bool agg); |
405 | int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, | 405 | int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta, |
406 | bool drain); | 406 | bool drain); |
407 | void iwl_mvm_sta_modify_disable_tx(struct iwl_mvm *mvm, | ||
408 | struct iwl_mvm_sta *mvmsta, bool disable); | ||
407 | 409 | ||
408 | #endif /* __sta_h__ */ | 410 | #endif /* __sta_h__ */ |