Commit 4f2210ee authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho

iwlwifi: mvm: remove version 2 of paging command

Only a000-series devices were going to use this, but actually
initialize using the context info, which includes paging, so
this code is never invoked; remove it.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 650aaed3
...@@ -326,7 +326,7 @@ enum iwl_legacy_cmds { ...@@ -326,7 +326,7 @@ enum iwl_legacy_cmds {
/** /**
* @FW_PAGING_BLOCK_CMD: * @FW_PAGING_BLOCK_CMD:
* &struct iwl_fw_paging_cmd or &struct iwl_fw_paging_cmd_v1 * &struct iwl_fw_paging_cmd
*/ */
FW_PAGING_BLOCK_CMD = 0x4f, FW_PAGING_BLOCK_CMD = 0x4f,
...@@ -998,25 +998,6 @@ struct iwl_nvm_access_cmd { ...@@ -998,25 +998,6 @@ struct iwl_nvm_access_cmd {
#define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */ #define NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */
/**
* struct iwl_fw_paging_cmd_v1 - paging layout
*
* (FW_PAGING_BLOCK_CMD = 0x4f)
*
* Send to FW the paging layout in the driver.
*
* @flags: various flags for the command
* @block_size: the block size in powers of 2
* @block_num: number of blocks specified in the command.
* @device_phy_addr: virtual addresses from device side
*/
struct iwl_fw_paging_cmd_v1 {
__le32 flags;
__le32 block_size;
__le32 block_num;
__le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
/** /**
* struct iwl_fw_paging_cmd - paging layout * struct iwl_fw_paging_cmd - paging layout
* *
...@@ -1033,8 +1014,8 @@ struct iwl_fw_paging_cmd { ...@@ -1033,8 +1014,8 @@ struct iwl_fw_paging_cmd {
__le32 flags; __le32 flags;
__le32 block_size; __le32 block_size;
__le32 block_num; __le32 block_num;
__le64 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS]; __le32 device_phy_addr[NUM_OF_FW_PAGING_BLOCKS];
} __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_2 */ } __packed; /* FW_PAGING_BLOCK_CMD_API_S_VER_1 */
/* /*
* Fw items ID's * Fw items ID's
......
...@@ -384,44 +384,29 @@ static int iwl_save_fw_paging(struct iwl_mvm *mvm, ...@@ -384,44 +384,29 @@ static int iwl_save_fw_paging(struct iwl_mvm *mvm,
/* send paging cmd to FW in case CPU2 has paging image */ /* send paging cmd to FW in case CPU2 has paging image */
static int iwl_send_paging_cmd(struct iwl_mvm *mvm, const struct fw_img *fw) static int iwl_send_paging_cmd(struct iwl_mvm *mvm, const struct fw_img *fw)
{ {
union { struct iwl_fw_paging_cmd paging_cmd = {
struct iwl_fw_paging_cmd v2; .flags = cpu_to_le32(PAGING_CMD_IS_SECURED |
struct iwl_fw_paging_cmd_v1 v1;
} paging_cmd = {
.v2.flags =
cpu_to_le32(PAGING_CMD_IS_SECURED |
PAGING_CMD_IS_ENABLED | PAGING_CMD_IS_ENABLED |
(mvm->num_of_pages_in_last_blk << (mvm->num_of_pages_in_last_blk <<
PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS)), PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS)),
.v2.block_size = cpu_to_le32(BLOCK_2_EXP_SIZE), .block_size = cpu_to_le32(BLOCK_2_EXP_SIZE),
.v2.block_num = cpu_to_le32(mvm->num_of_paging_blk), .block_num = cpu_to_le32(mvm->num_of_paging_blk),
}; };
int blk_idx, size = sizeof(paging_cmd.v2); int blk_idx;
/* A bit hard coded - but this is the old API and will be deprecated */
if (!iwl_mvm_has_new_tx_api(mvm))
size = sizeof(paging_cmd.v1);
/* loop for for all paging blocks + CSS block */ /* loop for for all paging blocks + CSS block */
for (blk_idx = 0; blk_idx < mvm->num_of_paging_blk + 1; blk_idx++) { for (blk_idx = 0; blk_idx < mvm->num_of_paging_blk + 1; blk_idx++) {
dma_addr_t addr = mvm->fw_paging_db[blk_idx].fw_paging_phys; dma_addr_t addr = mvm->fw_paging_db[blk_idx].fw_paging_phys;
__le32 phy_addr;
addr = addr >> PAGE_2_EXP_SIZE; addr = addr >> PAGE_2_EXP_SIZE;
phy_addr = cpu_to_le32(addr);
if (iwl_mvm_has_new_tx_api(mvm)) { paging_cmd.device_phy_addr[blk_idx] = phy_addr;
__le64 phy_addr = cpu_to_le64(addr);
paging_cmd.v2.device_phy_addr[blk_idx] = phy_addr;
} else {
__le32 phy_addr = cpu_to_le32(addr);
paging_cmd.v1.device_phy_addr[blk_idx] = phy_addr;
}
} }
return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(FW_PAGING_BLOCK_CMD, return iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(FW_PAGING_BLOCK_CMD,
IWL_ALWAYS_LONG_GROUP, 0), IWL_ALWAYS_LONG_GROUP, 0),
0, size, &paging_cmd); 0, sizeof(paging_cmd), &paging_cmd);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment