iwlwifi: mvm: move existing UMAC commands to group 1
Existing UMAC commands already use the long header, but are sent
with group 0 and the long header inserted manually. Move them to
the group 1 to take advantage of the header building in the low-
level transport.
Existing firmware ignores the group_id field (it's reserved) and
the first firmware that really supports long command headers can
parse all commands in both group 0 (with short header) and group
1 (with long header.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
diff --git a/drivers/net/wireless/iwlwifi/mvm/tof.c b/drivers/net/wireless/iwlwifi/mvm/tof.c
index 5a8e96f..d060e12 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tof.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tof.c
@@ -74,33 +74,21 @@
memset(tof_data, 0, sizeof(*tof_data));
- tof_data->tof_cfg.hdr.size =
- cpu_to_le16(sizeof(struct iwl_tof_config_cmd) -
- sizeof(struct iwl_mvm_umac_cmd_hdr));
tof_data->tof_cfg.sub_grp_cmd_id = cpu_to_le32(TOF_CONFIG_CMD);
#ifdef CONFIG_IWLWIFI_DEBUGFS
if (IWL_MVM_TOF_IS_RESPONDER) {
- tof_data->responder_cfg.hdr.size =
- cpu_to_le16(sizeof(struct iwl_tof_responder_config_cmd) -
- sizeof(struct iwl_mvm_umac_cmd_hdr));
tof_data->responder_cfg.sub_grp_cmd_id =
cpu_to_le32(TOF_RESPONDER_CONFIG_CMD);
tof_data->responder_cfg.sta_id = IWL_MVM_STATION_COUNT;
}
#endif
- tof_data->range_req.hdr.size =
- cpu_to_le16(sizeof(struct iwl_tof_range_req_cmd) -
- sizeof(struct iwl_mvm_umac_cmd_hdr));
tof_data->range_req.sub_grp_cmd_id = cpu_to_le32(TOF_RANGE_REQ_CMD);
tof_data->range_req.req_timeout = 1;
tof_data->range_req.initiator = 1;
tof_data->range_req.report_policy = 3;
- tof_data->range_req_ext.hdr.size =
- cpu_to_le16(sizeof(struct iwl_tof_range_req_ext_cmd) -
- sizeof(struct iwl_mvm_umac_cmd_hdr));
tof_data->range_req_ext.sub_grp_cmd_id =
cpu_to_le32(TOF_RANGE_REQ_EXT_CMD);
@@ -147,15 +135,15 @@
}
mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID;
- return iwl_mvm_send_cmd_pdu(mvm, TOF_CMD, 0, sizeof(*cmd), cmd);
+ return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD,
+ IWL_ALWAYS_LONG_GROUP, 0),
+ 0, sizeof(*cmd), cmd);
}
int iwl_mvm_tof_range_abort_cmd(struct iwl_mvm *mvm, u8 id)
{
struct iwl_tof_range_abort_cmd cmd = {
.sub_grp_cmd_id = cpu_to_le32(TOF_RANGE_ABORT_CMD),
- .hdr.size = cpu_to_le16(sizeof(struct iwl_tof_range_abort_cmd) -
- sizeof(struct iwl_mvm_umac_cmd_hdr)),
.request_id = id,
};
@@ -173,7 +161,9 @@
/* after abort is sent there's no active request anymore */
mvm->tof_data.active_range_request = IWL_MVM_TOF_RANGE_REQ_MAX_ID;
- return iwl_mvm_send_cmd_pdu(mvm, TOF_CMD, 0, sizeof(cmd), &cmd);
+ return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD,
+ IWL_ALWAYS_LONG_GROUP, 0),
+ 0, sizeof(cmd), &cmd);
}
#ifdef CONFIG_IWLWIFI_DEBUGFS
@@ -194,7 +184,9 @@
}
cmd->sta_id = mvmvif->bcast_sta.sta_id;
- return iwl_mvm_send_cmd_pdu(mvm, TOF_CMD, 0, sizeof(*cmd), cmd);
+ return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD,
+ IWL_ALWAYS_LONG_GROUP, 0),
+ 0, sizeof(*cmd), cmd);
}
#endif
@@ -245,8 +237,9 @@
return -EIO;
}
- return iwl_mvm_send_cmd_pdu(mvm, TOF_CMD, 0,
- sizeof(mvm->tof_data.range_req_ext),
+ return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(TOF_CMD,
+ IWL_ALWAYS_LONG_GROUP, 0),
+ 0, sizeof(mvm->tof_data.range_req_ext),
&mvm->tof_data.range_req_ext);
}