diff options
author | Shaul Triebitz <shaul.triebitz@intel.com> | 2017-12-10 10:11:38 -0500 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2017-12-20 11:28:25 -0500 |
commit | 09f1ee8cc1fc59f6795550f378e57e204698ed65 (patch) | |
tree | 7033d73d5744311a94ffbb2ba19e71f626937b9b /drivers/net/wireless/intel/iwlwifi | |
parent | dad3340fd988173aa79afb03941416c85f82ac0c (diff) |
iwlwifi: mvm: send the low latency command
Recently a new command was added to the firmware
for setting a MAC's low-latency mode. Use it.
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h | 19 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 24 |
2 files changed, 42 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h index ec42c84e5df2..17c7ef1662a9 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h | |||
@@ -68,6 +68,10 @@ | |||
68 | */ | 68 | */ |
69 | enum iwl_mac_conf_subcmd_ids { | 69 | enum iwl_mac_conf_subcmd_ids { |
70 | /** | 70 | /** |
71 | * @LOW_LATENCY_CMD: &struct iwl_mac_low_latency_cmd | ||
72 | */ | ||
73 | LOW_LATENCY_CMD = 0x3, | ||
74 | /** | ||
71 | * @CHANNEL_SWITCH_NOA_NOTIF: &struct iwl_channel_switch_noa_notif | 75 | * @CHANNEL_SWITCH_NOA_NOTIF: &struct iwl_channel_switch_noa_notif |
72 | */ | 76 | */ |
73 | CHANNEL_SWITCH_NOA_NOTIF = 0xFF, | 77 | CHANNEL_SWITCH_NOA_NOTIF = 0xFF, |
@@ -82,4 +86,19 @@ struct iwl_channel_switch_noa_notif { | |||
82 | __le32 id_and_color; | 86 | __le32 id_and_color; |
83 | } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */ | 87 | } __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */ |
84 | 88 | ||
89 | /** | ||
90 | * struct iwl_mac_low_latency_cmd - set/clear mac to 'low-latency mode' | ||
91 | * | ||
92 | * @mac_id: MAC ID to whom to apply the low-latency configurations | ||
93 | * @low_latency_rx: 1/0 to set/clear Rx low latency direction | ||
94 | * @low_latency_tx: 1/0 to set/clear Tx low latency direction | ||
95 | * @reserved: reserved for alignment purposes | ||
96 | */ | ||
97 | struct iwl_mac_low_latency_cmd { | ||
98 | __le32 mac_id; | ||
99 | u8 low_latency_rx; | ||
100 | u8 low_latency_tx; | ||
101 | __le16 reserved; | ||
102 | } __packed; /* MAC_LOW_LATENCY_API_S_VER_1 */ | ||
103 | |||
85 | #endif /* __iwl_fw_api_mac_cfg_h__ */ | 104 | #endif /* __iwl_fw_api_mac_cfg_h__ */ |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c index b2e9a79d4186..2fead5eb63fe 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c | |||
@@ -1032,12 +1032,34 @@ int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif, | |||
1032 | { | 1032 | { |
1033 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); | 1033 | struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); |
1034 | int res; | 1034 | int res; |
1035 | bool low_latency; | ||
1035 | 1036 | ||
1036 | lockdep_assert_held(&mvm->mutex); | 1037 | lockdep_assert_held(&mvm->mutex); |
1037 | 1038 | ||
1038 | if (iwl_mvm_vif_low_latency(mvmvif) == prev) | 1039 | low_latency = iwl_mvm_vif_low_latency(mvmvif); |
1040 | |||
1041 | if (low_latency == prev) | ||
1039 | return 0; | 1042 | return 0; |
1040 | 1043 | ||
1044 | if (fw_has_capa(&mvm->fw->ucode_capa, | ||
1045 | IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA)) { | ||
1046 | struct iwl_mac_low_latency_cmd cmd = { | ||
1047 | .mac_id = cpu_to_le32(mvmvif->id) | ||
1048 | }; | ||
1049 | |||
1050 | if (low_latency) { | ||
1051 | /* currently we don't care about the direction */ | ||
1052 | cmd.low_latency_rx = 1; | ||
1053 | cmd.low_latency_tx = 1; | ||
1054 | } | ||
1055 | res = iwl_mvm_send_cmd_pdu(mvm, | ||
1056 | iwl_cmd_id(LOW_LATENCY_CMD, | ||
1057 | MAC_CONF_GROUP, 0), | ||
1058 | 0, sizeof(cmd), &cmd); | ||
1059 | if (res) | ||
1060 | IWL_ERR(mvm, "Failed to send low latency command\n"); | ||
1061 | } | ||
1062 | |||
1041 | res = iwl_mvm_update_quotas(mvm, false, NULL); | 1063 | res = iwl_mvm_update_quotas(mvm, false, NULL); |
1042 | if (res) | 1064 | if (res) |
1043 | return res; | 1065 | return res; |