diff options
author | Sara Sharon <sara.sharon@intel.com> | 2016-08-15 10:36:47 -0400 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2016-09-19 03:09:39 -0400 |
commit | 5b88792cd8505d3804be199c10b3c4159fecb258 (patch) | |
tree | 2465f5aed065e455b33b57f4d5af762b7950016d /drivers/net/wireless/intel | |
parent | 607876f1dac6c644d83964f3f4691e79737b5bb2 (diff) |
iwlwifi: move to wide ID for all commands
Due to firmware design considerations, move to wide ID for
all commands.
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-notif-wait.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-trans.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/internal.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/pcie/tx.c | 2 |
7 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-notif-wait.c b/drivers/net/wireless/intel/iwlwifi/iwl-notif-wait.c index 8aa1f2b7fdfc..88f260db3744 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-notif-wait.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-notif-wait.c | |||
@@ -99,8 +99,12 @@ void iwl_notification_wait_notify(struct iwl_notif_wait_data *notif_wait, | |||
99 | continue; | 99 | continue; |
100 | 100 | ||
101 | for (i = 0; i < w->n_cmds; i++) { | 101 | for (i = 0; i < w->n_cmds; i++) { |
102 | if (w->cmds[i] == | 102 | u16 rec_id = WIDE_ID(pkt->hdr.group_id, |
103 | WIDE_ID(pkt->hdr.group_id, pkt->hdr.cmd)) { | 103 | pkt->hdr.cmd); |
104 | |||
105 | if (w->cmds[i] == rec_id || | ||
106 | (!iwl_cmd_groupid(w->cmds[i]) && | ||
107 | DEF_ID(w->cmds[i]) == rec_id)) { | ||
104 | found = true; | 108 | found = true; |
105 | break; | 109 | break; |
106 | } | 110 | } |
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c index b0bd67c64b5c..b42152c697be 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c | |||
@@ -140,6 +140,9 @@ int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) | |||
140 | if (!(cmd->flags & CMD_ASYNC)) | 140 | if (!(cmd->flags & CMD_ASYNC)) |
141 | lock_map_acquire_read(&trans->sync_cmd_lockdep_map); | 141 | lock_map_acquire_read(&trans->sync_cmd_lockdep_map); |
142 | 142 | ||
143 | if (trans->wide_cmd_header && !iwl_cmd_groupid(cmd->id)) | ||
144 | cmd->id = DEF_ID(cmd->id); | ||
145 | |||
143 | ret = trans->ops->send_cmd(trans, cmd); | 146 | ret = trans->ops->send_cmd(trans, cmd); |
144 | 147 | ||
145 | if (!(cmd->flags & CMD_ASYNC)) | 148 | if (!(cmd->flags & CMD_ASYNC)) |
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h index 04e998d9d5fe..0296124a7f9c 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h | |||
@@ -153,6 +153,7 @@ static inline u32 iwl_cmd_id(u8 opcode, u8 groupid, u8 version) | |||
153 | 153 | ||
154 | /* make u16 wide id out of u8 group and opcode */ | 154 | /* make u16 wide id out of u8 group and opcode */ |
155 | #define WIDE_ID(grp, opcode) ((grp << 8) | opcode) | 155 | #define WIDE_ID(grp, opcode) ((grp << 8) | opcode) |
156 | #define DEF_ID(opcode) ((1 << 8) | (opcode)) | ||
156 | 157 | ||
157 | /* due to the conversion, this group is special; new groups | 158 | /* due to the conversion, this group is special; new groups |
158 | * should be defined in the appropriate fw-api header files | 159 | * should be defined in the appropriate fw-api header files |
@@ -484,7 +485,6 @@ struct iwl_hcmd_arr { | |||
484 | * @bc_table_dword: set to true if the BC table expects the byte count to be | 485 | * @bc_table_dword: set to true if the BC table expects the byte count to be |
485 | * in DWORD (as opposed to bytes) | 486 | * in DWORD (as opposed to bytes) |
486 | * @scd_set_active: should the transport configure the SCD for HCMD queue | 487 | * @scd_set_active: should the transport configure the SCD for HCMD queue |
487 | * @wide_cmd_header: firmware supports wide host command header | ||
488 | * @sw_csum_tx: transport should compute the TCP checksum | 488 | * @sw_csum_tx: transport should compute the TCP checksum |
489 | * @command_groups: array of command groups, each member is an array of the | 489 | * @command_groups: array of command groups, each member is an array of the |
490 | * commands in the group; for debugging only | 490 | * commands in the group; for debugging only |
@@ -506,7 +506,6 @@ struct iwl_trans_config { | |||
506 | enum iwl_amsdu_size rx_buf_size; | 506 | enum iwl_amsdu_size rx_buf_size; |
507 | bool bc_table_dword; | 507 | bool bc_table_dword; |
508 | bool scd_set_active; | 508 | bool scd_set_active; |
509 | bool wide_cmd_header; | ||
510 | bool sw_csum_tx; | 509 | bool sw_csum_tx; |
511 | const struct iwl_hcmd_arr *command_groups; | 510 | const struct iwl_hcmd_arr *command_groups; |
512 | int command_groups_size; | 511 | int command_groups_size; |
@@ -770,6 +769,7 @@ enum iwl_plat_pm_mode { | |||
770 | * @hw_id_str: a string with info about HW ID. Set during transport allocation. | 769 | * @hw_id_str: a string with info about HW ID. Set during transport allocation. |
771 | * @pm_support: set to true in start_hw if link pm is supported | 770 | * @pm_support: set to true in start_hw if link pm is supported |
772 | * @ltr_enabled: set to true if the LTR is enabled | 771 | * @ltr_enabled: set to true if the LTR is enabled |
772 | * @wide_cmd_header: true when ucode supports wide command header format | ||
773 | * @num_rx_queues: number of RX queues allocated by the transport; | 773 | * @num_rx_queues: number of RX queues allocated by the transport; |
774 | * the transport must set this before calling iwl_drv_start() | 774 | * the transport must set this before calling iwl_drv_start() |
775 | * @dev_cmd_pool: pool for Tx cmd allocation - for internal use only. | 775 | * @dev_cmd_pool: pool for Tx cmd allocation - for internal use only. |
@@ -821,6 +821,7 @@ struct iwl_trans { | |||
821 | 821 | ||
822 | const struct iwl_hcmd_arr *command_groups; | 822 | const struct iwl_hcmd_arr *command_groups; |
823 | int command_groups_size; | 823 | int command_groups_size; |
824 | bool wide_cmd_header; | ||
824 | 825 | ||
825 | u8 num_rx_queues; | 826 | u8 num_rx_queues; |
826 | 827 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index de34c9f4f0f4..b2d8722cbb11 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c | |||
@@ -652,8 +652,8 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, | |||
652 | /* the hardware splits the A-MSDU */ | 652 | /* the hardware splits the A-MSDU */ |
653 | if (mvm->cfg->mq_rx_supported) | 653 | if (mvm->cfg->mq_rx_supported) |
654 | trans_cfg.rx_buf_size = IWL_AMSDU_4K; | 654 | trans_cfg.rx_buf_size = IWL_AMSDU_4K; |
655 | trans_cfg.wide_cmd_header = fw_has_api(&mvm->fw->ucode_capa, | 655 | trans->wide_cmd_header = fw_has_api(&mvm->fw->ucode_capa, |
656 | IWL_UCODE_TLV_API_WIDE_CMD_HDR); | 656 | IWL_UCODE_TLV_API_WIDE_CMD_HDR); |
657 | 657 | ||
658 | if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_DW_BC_TABLE) | 658 | if (mvm->fw->ucode_capa.flags & IWL_UCODE_TLV_FLAGS_DW_BC_TABLE) |
659 | trans_cfg.bc_table_dword = true; | 659 | trans_cfg.bc_table_dword = true; |
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h index 987a0770fb5b..2d81630fba0f 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/internal.h +++ b/drivers/net/wireless/intel/iwlwifi/pcie/internal.h | |||
@@ -332,7 +332,6 @@ enum iwl_shared_irq_flags { | |||
332 | * @rx_buf_size: Rx buffer size | 332 | * @rx_buf_size: Rx buffer size |
333 | * @bc_table_dword: true if the BC table expects DWORD (as opposed to bytes) | 333 | * @bc_table_dword: true if the BC table expects DWORD (as opposed to bytes) |
334 | * @scd_set_active: should the transport configure the SCD for HCMD queue | 334 | * @scd_set_active: should the transport configure the SCD for HCMD queue |
335 | * @wide_cmd_header: true when ucode supports wide command header format | ||
336 | * @sw_csum_tx: if true, then the transport will compute the csum of the TXed | 335 | * @sw_csum_tx: if true, then the transport will compute the csum of the TXed |
337 | * frame. | 336 | * frame. |
338 | * @rx_page_order: page order for receive buffer size | 337 | * @rx_page_order: page order for receive buffer size |
@@ -405,7 +404,6 @@ struct iwl_trans_pcie { | |||
405 | enum iwl_amsdu_size rx_buf_size; | 404 | enum iwl_amsdu_size rx_buf_size; |
406 | bool bc_table_dword; | 405 | bool bc_table_dword; |
407 | bool scd_set_active; | 406 | bool scd_set_active; |
408 | bool wide_cmd_header; | ||
409 | bool sw_csum_tx; | 407 | bool sw_csum_tx; |
410 | u32 rx_page_order; | 408 | u32 rx_page_order; |
411 | 409 | ||
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c index 74199b174948..68fa84381343 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c | |||
@@ -1755,7 +1755,6 @@ static void iwl_trans_pcie_configure(struct iwl_trans *trans, | |||
1755 | trans_pcie->rx_page_order = | 1755 | trans_pcie->rx_page_order = |
1756 | iwl_trans_get_rb_size_order(trans_pcie->rx_buf_size); | 1756 | iwl_trans_get_rb_size_order(trans_pcie->rx_buf_size); |
1757 | 1757 | ||
1758 | trans_pcie->wide_cmd_header = trans_cfg->wide_cmd_header; | ||
1759 | trans_pcie->bc_table_dword = trans_cfg->bc_table_dword; | 1758 | trans_pcie->bc_table_dword = trans_cfg->bc_table_dword; |
1760 | trans_pcie->scd_set_active = trans_cfg->scd_set_active; | 1759 | trans_pcie->scd_set_active = trans_cfg->scd_set_active; |
1761 | trans_pcie->sw_csum_tx = trans_cfg->sw_csum_tx; | 1760 | trans_pcie->sw_csum_tx = trans_cfg->sw_csum_tx; |
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c index 0d156fddbf3d..e00e7d8f197a 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/tx.c | |||
@@ -1493,7 +1493,7 @@ static int iwl_pcie_enqueue_hcmd(struct iwl_trans *trans, | |||
1493 | const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD]; | 1493 | const u8 *cmddata[IWL_MAX_CMD_TBS_PER_TFD]; |
1494 | u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD]; | 1494 | u16 cmdlen[IWL_MAX_CMD_TBS_PER_TFD]; |
1495 | 1495 | ||
1496 | if (WARN(!trans_pcie->wide_cmd_header && | 1496 | if (WARN(!trans->wide_cmd_header && |
1497 | group_id > IWL_ALWAYS_LONG_GROUP, | 1497 | group_id > IWL_ALWAYS_LONG_GROUP, |
1498 | "unsupported wide command %#x\n", cmd->id)) | 1498 | "unsupported wide command %#x\n", cmd->id)) |
1499 | return -EINVAL; | 1499 | return -EINVAL; |