Lines Matching full:trans
63 #define IWL_TRANS_FW_DBG_DOMAIN(trans) IWL_FW_INI_DOMAIN_ALWAYS_ON argument
116 * trans->system_pm_mode to IWL_PLAT_PM_MODE_D3.
174 #define IWL_TRANS_MAX_FRAGS(trans) ((trans)->txqs.tfd.max_tbs - 3) argument
302 * @STATUS_TRANS_GOING_IDLE: shutting down the trans, only special commands
304 * @STATUS_TRANS_IDLE: the trans is idle - general commands are not to be sent
305 * @STATUS_TRANS_DEAD: trans is dead - avoid any read/write operation
565 * of the trans debugfs
577 int (*start_fw)(struct iwl_trans *trans, const struct fw_img *fw,
579 void (*fw_alive)(struct iwl_trans *trans, u32 scd_addr);
580 void (*stop_device)(struct iwl_trans *trans);
582 int (*d3_suspend)(struct iwl_trans *trans, bool test, bool reset);
583 int (*d3_resume)(struct iwl_trans *trans, enum iwl_d3_status *status,
586 int (*send_cmd)(struct iwl_trans *trans, struct iwl_host_cmd *cmd);
588 int (*tx)(struct iwl_trans *trans, struct sk_buff *skb,
590 void (*reclaim)(struct iwl_trans *trans, int queue, int ssn,
593 void (*set_q_ptrs)(struct iwl_trans *trans, int queue, int ptr);
595 bool (*txq_enable)(struct iwl_trans *trans, int queue, u16 ssn,
598 void (*txq_disable)(struct iwl_trans *trans, int queue,
601 int (*txq_alloc)(struct iwl_trans *trans, u32 flags,
604 void (*txq_free)(struct iwl_trans *trans, int queue);
605 int (*rxq_dma_data)(struct iwl_trans *trans, int queue,
608 void (*txq_set_shared_mode)(struct iwl_trans *trans, u32 txq_id,
611 int (*wait_tx_queues_empty)(struct iwl_trans *trans, u32 txq_bm);
612 int (*wait_txq_empty)(struct iwl_trans *trans, int queue);
613 void (*freeze_txq_timer)(struct iwl_trans *trans, unsigned long txqs,
615 void (*block_txq_ptrs)(struct iwl_trans *trans, bool block);
617 void (*write8)(struct iwl_trans *trans, u32 ofs, u8 val);
618 void (*write32)(struct iwl_trans *trans, u32 ofs, u32 val);
619 u32 (*read32)(struct iwl_trans *trans, u32 ofs);
620 u32 (*read_prph)(struct iwl_trans *trans, u32 ofs);
621 void (*write_prph)(struct iwl_trans *trans, u32 ofs, u32 val);
622 int (*read_mem)(struct iwl_trans *trans, u32 addr,
624 int (*write_mem)(struct iwl_trans *trans, u32 addr,
626 int (*read_config32)(struct iwl_trans *trans, u32 ofs, u32 *val);
627 void (*configure)(struct iwl_trans *trans,
629 void (*set_pmi)(struct iwl_trans *trans, bool state);
630 int (*sw_reset)(struct iwl_trans *trans, bool retake_ownership);
631 bool (*grab_nic_access)(struct iwl_trans *trans);
632 void (*release_nic_access)(struct iwl_trans *trans);
633 void (*set_bits_mask)(struct iwl_trans *trans, u32 reg, u32 mask,
636 struct iwl_trans_dump_data *(*dump_data)(struct iwl_trans *trans,
640 void (*debugfs_cleanup)(struct iwl_trans *trans);
641 void (*sync_nmi)(struct iwl_trans *trans);
642 int (*load_pnvm)(struct iwl_trans *trans,
645 void (*set_pnvm)(struct iwl_trans *trans,
647 int (*load_reduce_power)(struct iwl_trans *trans,
650 void (*set_reduce_power)(struct iwl_trans *trans,
653 void (*interrupts)(struct iwl_trans *trans, bool enable);
654 int (*imr_dma_data)(struct iwl_trans *trans,
932 * @trans: pointer back to transport (for timer)
972 struct iwl_trans *trans; member
1037 * @trans_cfg: the trans-specific configuration part
1143 /* pointer to trans specific struct */
1148 const char *iwl_get_cmd_string(struct iwl_trans *trans, u32 id);
1149 int iwl_cmd_groups_verify_sorted(const struct iwl_trans_config *trans);
1151 static inline void iwl_trans_configure(struct iwl_trans *trans, in iwl_trans_configure() argument
1154 trans->op_mode = trans_cfg->op_mode; in iwl_trans_configure()
1156 trans->ops->configure(trans, trans_cfg); in iwl_trans_configure()
1160 static inline int iwl_trans_start_hw(struct iwl_trans *trans) in iwl_trans_start_hw() argument
1164 return trans->ops->start_hw(trans); in iwl_trans_start_hw()
1167 static inline void iwl_trans_op_mode_leave(struct iwl_trans *trans) in iwl_trans_op_mode_leave() argument
1171 if (trans->ops->op_mode_leave) in iwl_trans_op_mode_leave()
1172 trans->ops->op_mode_leave(trans); in iwl_trans_op_mode_leave()
1174 trans->op_mode = NULL; in iwl_trans_op_mode_leave()
1176 trans->state = IWL_TRANS_NO_FW; in iwl_trans_op_mode_leave()
1179 static inline void iwl_trans_fw_alive(struct iwl_trans *trans, u32 scd_addr) in iwl_trans_fw_alive() argument
1183 trans->state = IWL_TRANS_FW_ALIVE; in iwl_trans_fw_alive()
1185 trans->ops->fw_alive(trans, scd_addr); in iwl_trans_fw_alive()
1188 static inline int iwl_trans_start_fw(struct iwl_trans *trans, in iwl_trans_start_fw() argument
1196 WARN_ON_ONCE(!trans->rx_mpdu_cmd); in iwl_trans_start_fw()
1198 clear_bit(STATUS_FW_ERROR, &trans->status); in iwl_trans_start_fw()
1199 ret = trans->ops->start_fw(trans, fw, run_in_rfkill); in iwl_trans_start_fw()
1201 trans->state = IWL_TRANS_FW_STARTED; in iwl_trans_start_fw()
1206 static inline void iwl_trans_stop_device(struct iwl_trans *trans) in iwl_trans_stop_device() argument
1210 trans->ops->stop_device(trans); in iwl_trans_stop_device()
1212 trans->state = IWL_TRANS_NO_FW; in iwl_trans_stop_device()
1215 static inline int iwl_trans_d3_suspend(struct iwl_trans *trans, bool test, in iwl_trans_d3_suspend() argument
1219 if (!trans->ops->d3_suspend) in iwl_trans_d3_suspend()
1222 return trans->ops->d3_suspend(trans, test, reset); in iwl_trans_d3_suspend()
1225 static inline int iwl_trans_d3_resume(struct iwl_trans *trans, in iwl_trans_d3_resume() argument
1230 if (!trans->ops->d3_resume) in iwl_trans_d3_resume()
1233 return trans->ops->d3_resume(trans, status, test, reset); in iwl_trans_d3_resume()
1237 iwl_trans_dump_data(struct iwl_trans *trans, u32 dump_mask, in iwl_trans_dump_data() argument
1241 if (!trans->ops->dump_data) in iwl_trans_dump_data()
1243 return trans->ops->dump_data(trans, dump_mask, in iwl_trans_dump_data()
1248 iwl_trans_alloc_tx_cmd(struct iwl_trans *trans) in iwl_trans_alloc_tx_cmd() argument
1250 return kmem_cache_zalloc(trans->dev_cmd_pool, GFP_ATOMIC); in iwl_trans_alloc_tx_cmd()
1253 int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd);
1255 static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans, in iwl_trans_free_tx_cmd() argument
1258 kmem_cache_free(trans->dev_cmd_pool, dev_cmd); in iwl_trans_free_tx_cmd()
1261 static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb, in iwl_trans_tx() argument
1264 if (unlikely(test_bit(STATUS_FW_ERROR, &trans->status))) in iwl_trans_tx()
1267 if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_tx()
1268 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_tx()
1272 return trans->ops->tx(trans, skb, dev_cmd, queue); in iwl_trans_tx()
1275 static inline void iwl_trans_reclaim(struct iwl_trans *trans, int queue, in iwl_trans_reclaim() argument
1279 if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_reclaim()
1280 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_reclaim()
1284 trans->ops->reclaim(trans, queue, ssn, skbs, is_flush); in iwl_trans_reclaim()
1287 static inline void iwl_trans_set_q_ptrs(struct iwl_trans *trans, int queue, in iwl_trans_set_q_ptrs() argument
1290 if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_set_q_ptrs()
1291 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_set_q_ptrs()
1295 trans->ops->set_q_ptrs(trans, queue, ptr); in iwl_trans_set_q_ptrs()
1298 static inline void iwl_trans_txq_disable(struct iwl_trans *trans, int queue, in iwl_trans_txq_disable() argument
1301 trans->ops->txq_disable(trans, queue, configure_scd); in iwl_trans_txq_disable()
1305 iwl_trans_txq_enable_cfg(struct iwl_trans *trans, int queue, u16 ssn, in iwl_trans_txq_enable_cfg() argument
1311 if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_txq_enable_cfg()
1312 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_txq_enable_cfg()
1316 return trans->ops->txq_enable(trans, queue, ssn, in iwl_trans_txq_enable_cfg()
1321 iwl_trans_get_rxq_dma_data(struct iwl_trans *trans, int queue, in iwl_trans_get_rxq_dma_data() argument
1324 if (WARN_ON_ONCE(!trans->ops->rxq_dma_data)) in iwl_trans_get_rxq_dma_data()
1327 return trans->ops->rxq_dma_data(trans, queue, data); in iwl_trans_get_rxq_dma_data()
1331 iwl_trans_txq_free(struct iwl_trans *trans, int queue) in iwl_trans_txq_free() argument
1333 if (WARN_ON_ONCE(!trans->ops->txq_free)) in iwl_trans_txq_free()
1336 trans->ops->txq_free(trans, queue); in iwl_trans_txq_free()
1340 iwl_trans_txq_alloc(struct iwl_trans *trans, in iwl_trans_txq_alloc() argument
1346 if (WARN_ON_ONCE(!trans->ops->txq_alloc)) in iwl_trans_txq_alloc()
1349 if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_txq_alloc()
1350 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_txq_alloc()
1354 return trans->ops->txq_alloc(trans, flags, sta_mask, tid, in iwl_trans_txq_alloc()
1358 static inline void iwl_trans_txq_set_shared_mode(struct iwl_trans *trans, in iwl_trans_txq_set_shared_mode() argument
1361 if (trans->ops->txq_set_shared_mode) in iwl_trans_txq_set_shared_mode()
1362 trans->ops->txq_set_shared_mode(trans, queue, shared_mode); in iwl_trans_txq_set_shared_mode()
1365 static inline void iwl_trans_txq_enable(struct iwl_trans *trans, int queue, in iwl_trans_txq_enable() argument
1378 iwl_trans_txq_enable_cfg(trans, queue, ssn, &cfg, queue_wdg_timeout); in iwl_trans_txq_enable()
1382 void iwl_trans_ac_txq_enable(struct iwl_trans *trans, int queue, int fifo, in iwl_trans_ac_txq_enable() argument
1393 iwl_trans_txq_enable_cfg(trans, queue, 0, &cfg, queue_wdg_timeout); in iwl_trans_ac_txq_enable()
1396 static inline void iwl_trans_freeze_txq_timer(struct iwl_trans *trans, in iwl_trans_freeze_txq_timer() argument
1400 if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_freeze_txq_timer()
1401 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_freeze_txq_timer()
1405 if (trans->ops->freeze_txq_timer) in iwl_trans_freeze_txq_timer()
1406 trans->ops->freeze_txq_timer(trans, txqs, freeze); in iwl_trans_freeze_txq_timer()
1409 static inline void iwl_trans_block_txq_ptrs(struct iwl_trans *trans, in iwl_trans_block_txq_ptrs() argument
1412 if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_block_txq_ptrs()
1413 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_block_txq_ptrs()
1417 if (trans->ops->block_txq_ptrs) in iwl_trans_block_txq_ptrs()
1418 trans->ops->block_txq_ptrs(trans, block); in iwl_trans_block_txq_ptrs()
1421 static inline int iwl_trans_wait_tx_queues_empty(struct iwl_trans *trans, in iwl_trans_wait_tx_queues_empty() argument
1424 if (WARN_ON_ONCE(!trans->ops->wait_tx_queues_empty)) in iwl_trans_wait_tx_queues_empty()
1428 if (trans->state != IWL_TRANS_FW_ALIVE) { in iwl_trans_wait_tx_queues_empty()
1429 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_wait_tx_queues_empty()
1433 return trans->ops->wait_tx_queues_empty(trans, txqs); in iwl_trans_wait_tx_queues_empty()
1436 static inline int iwl_trans_wait_txq_empty(struct iwl_trans *trans, int queue) in iwl_trans_wait_txq_empty() argument
1438 if (WARN_ON_ONCE(!trans->ops->wait_txq_empty)) in iwl_trans_wait_txq_empty()
1441 if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_wait_txq_empty()
1442 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_wait_txq_empty()
1446 return trans->ops->wait_txq_empty(trans, queue); in iwl_trans_wait_txq_empty()
1449 static inline void iwl_trans_write8(struct iwl_trans *trans, u32 ofs, u8 val) in iwl_trans_write8() argument
1451 trans->ops->write8(trans, ofs, val); in iwl_trans_write8()
1454 static inline void iwl_trans_write32(struct iwl_trans *trans, u32 ofs, u32 val) in iwl_trans_write32() argument
1456 trans->ops->write32(trans, ofs, val); in iwl_trans_write32()
1459 static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs) in iwl_trans_read32() argument
1461 return trans->ops->read32(trans, ofs); in iwl_trans_read32()
1464 static inline u32 iwl_trans_read_prph(struct iwl_trans *trans, u32 ofs) in iwl_trans_read_prph() argument
1466 return trans->ops->read_prph(trans, ofs); in iwl_trans_read_prph()
1469 static inline void iwl_trans_write_prph(struct iwl_trans *trans, u32 ofs, in iwl_trans_write_prph() argument
1472 return trans->ops->write_prph(trans, ofs, val); in iwl_trans_write_prph()
1475 static inline int iwl_trans_read_mem(struct iwl_trans *trans, u32 addr, in iwl_trans_read_mem() argument
1478 return trans->ops->read_mem(trans, addr, buf, dwords); in iwl_trans_read_mem()
1481 #define iwl_trans_read_mem_bytes(trans, addr, buf, bufsize) \ argument
1485 iwl_trans_read_mem(trans, addr, buf, (bufsize) / sizeof(u32));\
1488 static inline int iwl_trans_write_imr_mem(struct iwl_trans *trans, in iwl_trans_write_imr_mem() argument
1492 if (trans->ops->imr_dma_data) in iwl_trans_write_imr_mem()
1493 return trans->ops->imr_dma_data(trans, dst_addr, src_addr, byte_cnt); in iwl_trans_write_imr_mem()
1497 static inline u32 iwl_trans_read_mem32(struct iwl_trans *trans, u32 addr) in iwl_trans_read_mem32() argument
1501 if (iwl_trans_read_mem(trans, addr, &value, 1)) in iwl_trans_read_mem32()
1507 static inline int iwl_trans_write_mem(struct iwl_trans *trans, u32 addr, in iwl_trans_write_mem() argument
1510 return trans->ops->write_mem(trans, addr, buf, dwords); in iwl_trans_write_mem()
1513 static inline u32 iwl_trans_write_mem32(struct iwl_trans *trans, u32 addr, in iwl_trans_write_mem32() argument
1516 return iwl_trans_write_mem(trans, addr, &val, 1); in iwl_trans_write_mem32()
1519 static inline void iwl_trans_set_pmi(struct iwl_trans *trans, bool state) in iwl_trans_set_pmi() argument
1521 if (trans->ops->set_pmi) in iwl_trans_set_pmi()
1522 trans->ops->set_pmi(trans, state); in iwl_trans_set_pmi()
1525 static inline int iwl_trans_sw_reset(struct iwl_trans *trans, in iwl_trans_sw_reset() argument
1528 if (trans->ops->sw_reset) in iwl_trans_sw_reset()
1529 return trans->ops->sw_reset(trans, retake_ownership); in iwl_trans_sw_reset()
1534 iwl_trans_set_bits_mask(struct iwl_trans *trans, u32 reg, u32 mask, u32 value) in iwl_trans_set_bits_mask() argument
1536 trans->ops->set_bits_mask(trans, reg, mask, value); in iwl_trans_set_bits_mask()
1539 #define iwl_trans_grab_nic_access(trans) \ argument
1541 likely((trans)->ops->grab_nic_access(trans)))
1544 iwl_trans_release_nic_access(struct iwl_trans *trans) in __releases()
1546 trans->ops->release_nic_access(trans); in __releases()
1550 static inline void iwl_trans_fw_error(struct iwl_trans *trans, bool sync) in iwl_trans_fw_error() argument
1552 if (WARN_ON_ONCE(!trans->op_mode)) in iwl_trans_fw_error()
1556 if (!test_and_set_bit(STATUS_FW_ERROR, &trans->status)) { in iwl_trans_fw_error()
1557 trans->state = IWL_TRANS_NO_FW; in iwl_trans_fw_error()
1558 iwl_op_mode_nic_error(trans->op_mode, sync); in iwl_trans_fw_error()
1562 static inline bool iwl_trans_fw_running(struct iwl_trans *trans) in iwl_trans_fw_running() argument
1564 return trans->state == IWL_TRANS_FW_ALIVE; in iwl_trans_fw_running()
1567 static inline void iwl_trans_sync_nmi(struct iwl_trans *trans) in iwl_trans_sync_nmi() argument
1569 if (trans->ops->sync_nmi) in iwl_trans_sync_nmi()
1570 trans->ops->sync_nmi(trans); in iwl_trans_sync_nmi()
1573 void iwl_trans_sync_nmi_with_addr(struct iwl_trans *trans, u32 inta_addr,
1576 static inline int iwl_trans_load_pnvm(struct iwl_trans *trans, in iwl_trans_load_pnvm() argument
1580 return trans->ops->load_pnvm(trans, pnvm_data, capa); in iwl_trans_load_pnvm()
1583 static inline void iwl_trans_set_pnvm(struct iwl_trans *trans, in iwl_trans_set_pnvm() argument
1586 if (trans->ops->set_pnvm) in iwl_trans_set_pnvm()
1587 trans->ops->set_pnvm(trans, capa); in iwl_trans_set_pnvm()
1591 (struct iwl_trans *trans, in iwl_trans_load_reduce_power() argument
1595 return trans->ops->load_reduce_power(trans, payloads, capa); in iwl_trans_load_reduce_power()
1599 iwl_trans_set_reduce_power(struct iwl_trans *trans, in iwl_trans_set_reduce_power() argument
1602 if (trans->ops->set_reduce_power) in iwl_trans_set_reduce_power()
1603 trans->ops->set_reduce_power(trans, capa); in iwl_trans_set_reduce_power()
1606 static inline bool iwl_trans_dbg_ini_valid(struct iwl_trans *trans) in iwl_trans_dbg_ini_valid() argument
1608 return trans->dbg.internal_ini_cfg != IWL_INI_CFG_STATE_NOT_LOADED || in iwl_trans_dbg_ini_valid()
1609 trans->dbg.external_ini_cfg != IWL_INI_CFG_STATE_NOT_LOADED; in iwl_trans_dbg_ini_valid()
1612 static inline void iwl_trans_interrupts(struct iwl_trans *trans, bool enable) in iwl_trans_interrupts() argument
1614 if (trans->ops->interrupts) in iwl_trans_interrupts()
1615 trans->ops->interrupts(trans, enable); in iwl_trans_interrupts()
1625 int iwl_trans_init(struct iwl_trans *trans);
1626 void iwl_trans_free(struct iwl_trans *trans);
1638 void iwl_trans_pcie_remove(struct iwl_trans *trans, bool rescan);