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>
This commit is contained in:
parent
dad3340fd9
commit
09f1ee8cc1
@ -67,6 +67,10 @@
|
|||||||
* enum iwl_mac_conf_subcmd_ids - mac configuration command IDs
|
* enum iwl_mac_conf_subcmd_ids - mac configuration command IDs
|
||||||
*/
|
*/
|
||||||
enum iwl_mac_conf_subcmd_ids {
|
enum iwl_mac_conf_subcmd_ids {
|
||||||
|
/**
|
||||||
|
* @LOW_LATENCY_CMD: &struct iwl_mac_low_latency_cmd
|
||||||
|
*/
|
||||||
|
LOW_LATENCY_CMD = 0x3,
|
||||||
/**
|
/**
|
||||||
* @CHANNEL_SWITCH_NOA_NOTIF: &struct iwl_channel_switch_noa_notif
|
* @CHANNEL_SWITCH_NOA_NOTIF: &struct iwl_channel_switch_noa_notif
|
||||||
*/
|
*/
|
||||||
@ -82,4 +86,19 @@ struct iwl_channel_switch_noa_notif {
|
|||||||
__le32 id_and_color;
|
__le32 id_and_color;
|
||||||
} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
|
} __packed; /* CHANNEL_SWITCH_START_NTFY_API_S_VER_1 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct iwl_mac_low_latency_cmd - set/clear mac to 'low-latency mode'
|
||||||
|
*
|
||||||
|
* @mac_id: MAC ID to whom to apply the low-latency configurations
|
||||||
|
* @low_latency_rx: 1/0 to set/clear Rx low latency direction
|
||||||
|
* @low_latency_tx: 1/0 to set/clear Tx low latency direction
|
||||||
|
* @reserved: reserved for alignment purposes
|
||||||
|
*/
|
||||||
|
struct iwl_mac_low_latency_cmd {
|
||||||
|
__le32 mac_id;
|
||||||
|
u8 low_latency_rx;
|
||||||
|
u8 low_latency_tx;
|
||||||
|
__le16 reserved;
|
||||||
|
} __packed; /* MAC_LOW_LATENCY_API_S_VER_1 */
|
||||||
|
|
||||||
#endif /* __iwl_fw_api_mac_cfg_h__ */
|
#endif /* __iwl_fw_api_mac_cfg_h__ */
|
||||||
|
@ -1032,12 +1032,34 @@ int iwl_mvm_update_low_latency(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
|
|||||||
{
|
{
|
||||||
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
|
||||||
int res;
|
int res;
|
||||||
|
bool low_latency;
|
||||||
|
|
||||||
lockdep_assert_held(&mvm->mutex);
|
lockdep_assert_held(&mvm->mutex);
|
||||||
|
|
||||||
if (iwl_mvm_vif_low_latency(mvmvif) == prev)
|
low_latency = iwl_mvm_vif_low_latency(mvmvif);
|
||||||
|
|
||||||
|
if (low_latency == prev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (fw_has_capa(&mvm->fw->ucode_capa,
|
||||||
|
IWL_UCODE_TLV_CAPA_DYNAMIC_QUOTA)) {
|
||||||
|
struct iwl_mac_low_latency_cmd cmd = {
|
||||||
|
.mac_id = cpu_to_le32(mvmvif->id)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (low_latency) {
|
||||||
|
/* currently we don't care about the direction */
|
||||||
|
cmd.low_latency_rx = 1;
|
||||||
|
cmd.low_latency_tx = 1;
|
||||||
|
}
|
||||||
|
res = iwl_mvm_send_cmd_pdu(mvm,
|
||||||
|
iwl_cmd_id(LOW_LATENCY_CMD,
|
||||||
|
MAC_CONF_GROUP, 0),
|
||||||
|
0, sizeof(cmd), &cmd);
|
||||||
|
if (res)
|
||||||
|
IWL_ERR(mvm, "Failed to send low latency command\n");
|
||||||
|
}
|
||||||
|
|
||||||
res = iwl_mvm_update_quotas(mvm, false, NULL);
|
res = iwl_mvm_update_quotas(mvm, false, NULL);
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
|
Loading…
Reference in New Issue
Block a user