Lines Matching full:trans

66 #include "iwl-trans.h"
77 struct iwl_trans *trans; in iwl_trans_alloc() local
83 trans = devm_kzalloc(dev, sizeof(*trans) + priv_size, GFP_KERNEL); in iwl_trans_alloc()
84 if (!trans) in iwl_trans_alloc()
87 trans->trans_cfg = cfg_trans; in iwl_trans_alloc()
107 lockdep_init_map(&trans->sync_cmd_lockdep_map, "sync_cmd_lockdep_map", in iwl_trans_alloc()
111 trans->dev = dev; in iwl_trans_alloc()
112 trans->ops = ops; in iwl_trans_alloc()
113 trans->num_rx_queues = 1; in iwl_trans_alloc()
115 if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) in iwl_trans_alloc()
116 trans->txqs.bc_tbl_size = sizeof(struct iwl_gen3_bc_tbl); in iwl_trans_alloc()
118 trans->txqs.bc_tbl_size = sizeof(struct iwlagn_scd_bc_tbl); in iwl_trans_alloc()
124 if (trans->trans_cfg->gen2) { in iwl_trans_alloc()
125 trans->txqs.bc_pool = dmam_pool_create("iwlwifi:bc", dev, in iwl_trans_alloc()
126 trans->txqs.bc_tbl_size, in iwl_trans_alloc()
128 if (!trans->txqs.bc_pool) in iwl_trans_alloc()
132 if (trans->trans_cfg->use_tfh) { in iwl_trans_alloc()
133 trans->txqs.tfd.addr_size = 64; in iwl_trans_alloc()
134 trans->txqs.tfd.max_tbs = IWL_TFH_NUM_TBS; in iwl_trans_alloc()
135 trans->txqs.tfd.size = sizeof(struct iwl_tfh_tfd); in iwl_trans_alloc()
137 trans->txqs.tfd.addr_size = 36; in iwl_trans_alloc()
138 trans->txqs.tfd.max_tbs = IWL_NUM_OF_TBS; in iwl_trans_alloc()
139 trans->txqs.tfd.size = sizeof(struct iwl_tfd); in iwl_trans_alloc()
141 trans->max_skb_frags = IWL_TRANS_MAX_FRAGS(trans); in iwl_trans_alloc()
143 snprintf(trans->dev_cmd_pool_name, sizeof(trans->dev_cmd_pool_name), in iwl_trans_alloc()
144 "iwl_cmd_pool:%s", dev_name(trans->dev)); in iwl_trans_alloc()
145 trans->dev_cmd_pool = in iwl_trans_alloc()
146 kmem_cache_create(trans->dev_cmd_pool_name, in iwl_trans_alloc()
149 if (!trans->dev_cmd_pool) in iwl_trans_alloc()
154 trans->txqs.tso_hdr_page = alloc_percpu(struct iwl_tso_hdr_page); in iwl_trans_alloc()
155 if (!trans->txqs.tso_hdr_page) { in iwl_trans_alloc()
156 kmem_cache_destroy(trans->dev_cmd_pool); in iwl_trans_alloc()
160 return trans; in iwl_trans_alloc()
163 void iwl_trans_free(struct iwl_trans *trans) in iwl_trans_free() argument
169 per_cpu_ptr(trans->txqs.tso_hdr_page, i); in iwl_trans_free()
175 free_percpu(trans->txqs.tso_hdr_page); in iwl_trans_free()
177 kmem_cache_destroy(trans->dev_cmd_pool); in iwl_trans_free()
180 int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) in iwl_trans_send_cmd() argument
185 test_bit(STATUS_RFKILL_OPMODE, &trans->status))) in iwl_trans_send_cmd()
188 if (unlikely(test_bit(STATUS_FW_ERROR, &trans->status))) in iwl_trans_send_cmd()
191 if (unlikely(trans->state != IWL_TRANS_FW_ALIVE)) { in iwl_trans_send_cmd()
192 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); in iwl_trans_send_cmd()
201 lock_map_acquire_read(&trans->sync_cmd_lockdep_map); in iwl_trans_send_cmd()
203 if (trans->wide_cmd_header && !iwl_cmd_groupid(cmd->id)) in iwl_trans_send_cmd()
206 ret = trans->ops->send_cmd(trans, cmd); in iwl_trans_send_cmd()
209 lock_map_release(&trans->sync_cmd_lockdep_map); in iwl_trans_send_cmd()
235 const char *iwl_get_cmd_string(struct iwl_trans *trans, u32 id) in iwl_get_cmd_string() argument
245 if (!trans->command_groups || grp >= trans->command_groups_size || in iwl_get_cmd_string()
246 !trans->command_groups[grp].arr) in iwl_get_cmd_string()
249 arr = &trans->command_groups[grp]; in iwl_get_cmd_string()
257 int iwl_cmd_groups_verify_sorted(const struct iwl_trans_config *trans) in iwl_cmd_groups_verify_sorted() argument
262 for (i = 0; i < trans->command_groups_size; i++) { in iwl_cmd_groups_verify_sorted()
263 arr = &trans->command_groups[i]; in iwl_cmd_groups_verify_sorted()