Lines Matching full:trans
74 static int iwl_pcie_gen2_enqueue_hcmd(struct iwl_trans *trans, in iwl_pcie_gen2_enqueue_hcmd() argument
77 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_pcie_gen2_enqueue_hcmd()
78 struct iwl_txq *txq = trans->txqs.txq[trans->txqs.cmd.q_id]; in iwl_pcie_gen2_enqueue_hcmd()
154 iwl_get_cmd_string(trans, cmd->id), cmd->id, copy_size)) { in iwl_pcie_gen2_enqueue_hcmd()
162 tfd = iwl_txq_get_tfd(trans, txq, txq->write_ptr); in iwl_pcie_gen2_enqueue_hcmd()
165 if (iwl_txq_space(trans, txq) < ((cmd->flags & CMD_ASYNC) ? 2 : 1)) { in iwl_pcie_gen2_enqueue_hcmd()
168 IWL_ERR(trans, "No space in command queue\n"); in iwl_pcie_gen2_enqueue_hcmd()
169 iwl_op_mode_cmd_queue_full(trans->op_mode); in iwl_pcie_gen2_enqueue_hcmd()
190 cpu_to_le16(QUEUE_TO_SEQ(trans->txqs.cmd.q_id) | in iwl_pcie_gen2_enqueue_hcmd()
234 IWL_DEBUG_HC(trans, in iwl_pcie_gen2_enqueue_hcmd()
236 iwl_get_cmd_string(trans, cmd->id), group_id, in iwl_pcie_gen2_enqueue_hcmd()
238 cmd_size, txq->write_ptr, idx, trans->txqs.cmd.q_id); in iwl_pcie_gen2_enqueue_hcmd()
243 iwl_txq_gen2_set_tb(trans, tfd, iwl_txq_get_first_tb_dma(txq, idx), in iwl_pcie_gen2_enqueue_hcmd()
248 phys_addr = dma_map_single(trans->dev, in iwl_pcie_gen2_enqueue_hcmd()
252 if (dma_mapping_error(trans->dev, phys_addr)) { in iwl_pcie_gen2_enqueue_hcmd()
254 iwl_txq_gen2_tfd_unmap(trans, out_meta, tfd); in iwl_pcie_gen2_enqueue_hcmd()
257 iwl_txq_gen2_set_tb(trans, tfd, phys_addr, in iwl_pcie_gen2_enqueue_hcmd()
272 phys_addr = dma_map_single(trans->dev, (void *)data, in iwl_pcie_gen2_enqueue_hcmd()
274 if (dma_mapping_error(trans->dev, phys_addr)) { in iwl_pcie_gen2_enqueue_hcmd()
276 iwl_txq_gen2_tfd_unmap(trans, out_meta, tfd); in iwl_pcie_gen2_enqueue_hcmd()
279 iwl_txq_gen2_set_tb(trans, tfd, phys_addr, cmdlen[i]); in iwl_pcie_gen2_enqueue_hcmd()
288 trace_iwlwifi_dev_hcmd(trans->dev, cmd, cmd_size, &out_cmd->hdr_wide); in iwl_pcie_gen2_enqueue_hcmd()
296 txq->write_ptr = iwl_txq_inc_wrap(trans, txq->write_ptr); in iwl_pcie_gen2_enqueue_hcmd()
297 iwl_txq_inc_wr_ptr(trans, txq); in iwl_pcie_gen2_enqueue_hcmd()
310 static int iwl_pcie_gen2_send_hcmd_sync(struct iwl_trans *trans, in iwl_pcie_gen2_send_hcmd_sync() argument
313 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); in iwl_pcie_gen2_send_hcmd_sync()
314 const char *cmd_str = iwl_get_cmd_string(trans, cmd->id); in iwl_pcie_gen2_send_hcmd_sync()
315 struct iwl_txq *txq = trans->txqs.txq[trans->txqs.cmd.q_id]; in iwl_pcie_gen2_send_hcmd_sync()
319 IWL_DEBUG_INFO(trans, "Attempting to send sync command %s\n", cmd_str); in iwl_pcie_gen2_send_hcmd_sync()
322 &trans->status), in iwl_pcie_gen2_send_hcmd_sync()
326 IWL_DEBUG_INFO(trans, "Setting HCMD_ACTIVE for command %s\n", cmd_str); in iwl_pcie_gen2_send_hcmd_sync()
328 cmd_idx = iwl_pcie_gen2_enqueue_hcmd(trans, cmd); in iwl_pcie_gen2_send_hcmd_sync()
331 clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status); in iwl_pcie_gen2_send_hcmd_sync()
332 IWL_ERR(trans, "Error sending %s: enqueue_hcmd failed: %d\n", in iwl_pcie_gen2_send_hcmd_sync()
339 &trans->status), in iwl_pcie_gen2_send_hcmd_sync()
342 IWL_ERR(trans, "Error sending %s: time out after %dms.\n", in iwl_pcie_gen2_send_hcmd_sync()
345 IWL_ERR(trans, "Current CMD queue read_ptr %d write_ptr %d\n", in iwl_pcie_gen2_send_hcmd_sync()
348 clear_bit(STATUS_SYNC_HCMD_ACTIVE, &trans->status); in iwl_pcie_gen2_send_hcmd_sync()
349 IWL_DEBUG_INFO(trans, "Clearing HCMD_ACTIVE for command %s\n", in iwl_pcie_gen2_send_hcmd_sync()
353 iwl_trans_pcie_sync_nmi(trans); in iwl_pcie_gen2_send_hcmd_sync()
357 if (test_bit(STATUS_FW_ERROR, &trans->status)) { in iwl_pcie_gen2_send_hcmd_sync()
358 IWL_ERR(trans, "FW error in SYNC CMD %s\n", cmd_str); in iwl_pcie_gen2_send_hcmd_sync()
365 test_bit(STATUS_RFKILL_OPMODE, &trans->status)) { in iwl_pcie_gen2_send_hcmd_sync()
366 IWL_DEBUG_RF_KILL(trans, "RFKILL in SYNC CMD... no rsp\n"); in iwl_pcie_gen2_send_hcmd_sync()
372 IWL_ERR(trans, "Error: Response NULL in '%s'\n", cmd_str); in iwl_pcie_gen2_send_hcmd_sync()
398 int iwl_trans_pcie_gen2_send_hcmd(struct iwl_trans *trans, in iwl_trans_pcie_gen2_send_hcmd() argument
402 test_bit(STATUS_RFKILL_OPMODE, &trans->status)) { in iwl_trans_pcie_gen2_send_hcmd()
403 IWL_DEBUG_RF_KILL(trans, "Dropping CMD 0x%x: RF KILL\n", in iwl_trans_pcie_gen2_send_hcmd()
415 ret = iwl_pcie_gen2_enqueue_hcmd(trans, cmd); in iwl_trans_pcie_gen2_send_hcmd()
417 IWL_ERR(trans, in iwl_trans_pcie_gen2_send_hcmd()
419 iwl_get_cmd_string(trans, cmd->id), ret); in iwl_trans_pcie_gen2_send_hcmd()
425 return iwl_pcie_gen2_send_hcmd_sync(trans, cmd); in iwl_trans_pcie_gen2_send_hcmd()