Lines Matching refs:trans
73 void iwl_write8(struct iwl_trans *trans, u32 ofs, u8 val)
75 trace_iwlwifi_dev_iowrite8(trans->dev, ofs, val);
76 iwl_trans_write8(trans, ofs, val);
80 void iwl_write32(struct iwl_trans *trans, u32 ofs, u32 val)
82 trace_iwlwifi_dev_iowrite32(trans->dev, ofs, val);
83 iwl_trans_write32(trans, ofs, val);
87 void iwl_write64(struct iwl_trans *trans, u64 ofs, u64 val)
89 trace_iwlwifi_dev_iowrite64(trans->dev, ofs, val);
90 iwl_trans_write32(trans, ofs, lower_32_bits(val));
91 iwl_trans_write32(trans, ofs + 4, upper_32_bits(val));
95 u32 iwl_read32(struct iwl_trans *trans, u32 ofs)
97 u32 val = iwl_trans_read32(trans, ofs);
99 trace_iwlwifi_dev_ioread32(trans->dev, ofs, val);
106 int iwl_poll_bit(struct iwl_trans *trans, u32 addr,
112 if ((iwl_read32(trans, addr) & mask) == (bits & mask))
122 u32 iwl_read_direct32(struct iwl_trans *trans, u32 reg)
126 if (iwl_trans_grab_nic_access(trans, &flags)) {
127 value = iwl_read32(trans, reg);
128 iwl_trans_release_nic_access(trans, &flags);
135 void iwl_write_direct32(struct iwl_trans *trans, u32 reg, u32 value)
139 if (iwl_trans_grab_nic_access(trans, &flags)) {
140 iwl_write32(trans, reg, value);
141 iwl_trans_release_nic_access(trans, &flags);
146 void iwl_write_direct64(struct iwl_trans *trans, u64 reg, u64 value)
150 if (iwl_trans_grab_nic_access(trans, &flags)) {
151 iwl_write64(trans, reg, value);
152 iwl_trans_release_nic_access(trans, &flags);
157 int iwl_poll_direct_bit(struct iwl_trans *trans, u32 addr, u32 mask,
163 if ((iwl_read_direct32(trans, addr) & mask) == mask)
173 u32 iwl_read_prph_no_grab(struct iwl_trans *trans, u32 ofs)
175 u32 val = iwl_trans_read_prph(trans, ofs);
176 trace_iwlwifi_dev_ioread_prph32(trans->dev, ofs, val);
181 void iwl_write_prph_no_grab(struct iwl_trans *trans, u32 ofs, u32 val)
183 trace_iwlwifi_dev_iowrite_prph32(trans->dev, ofs, val);
184 iwl_trans_write_prph(trans, ofs, val);
188 void iwl_write_prph64_no_grab(struct iwl_trans *trans, u64 ofs, u64 val)
190 trace_iwlwifi_dev_iowrite_prph64(trans->dev, ofs, val);
191 iwl_write_prph_no_grab(trans, ofs, val & 0xffffffff);
192 iwl_write_prph_no_grab(trans, ofs + 4, val >> 32);
196 u32 iwl_read_prph(struct iwl_trans *trans, u32 ofs)
201 if (iwl_trans_grab_nic_access(trans, &flags)) {
202 val = iwl_read_prph_no_grab(trans, ofs);
203 iwl_trans_release_nic_access(trans, &flags);
209 void iwl_write_prph(struct iwl_trans *trans, u32 ofs, u32 val)
213 if (iwl_trans_grab_nic_access(trans, &flags)) {
214 iwl_write_prph_no_grab(trans, ofs, val);
215 iwl_trans_release_nic_access(trans, &flags);
220 int iwl_poll_prph_bit(struct iwl_trans *trans, u32 addr,
226 if ((iwl_read_prph(trans, addr) & mask) == (bits & mask))
235 void iwl_set_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask)
239 if (iwl_trans_grab_nic_access(trans, &flags)) {
240 iwl_write_prph_no_grab(trans, ofs,
241 iwl_read_prph_no_grab(trans, ofs) |
243 iwl_trans_release_nic_access(trans, &flags);
248 void iwl_set_bits_mask_prph(struct iwl_trans *trans, u32 ofs,
253 if (iwl_trans_grab_nic_access(trans, &flags)) {
254 iwl_write_prph_no_grab(trans, ofs,
255 (iwl_read_prph_no_grab(trans, ofs) &
257 iwl_trans_release_nic_access(trans, &flags);
262 void iwl_clear_bits_prph(struct iwl_trans *trans, u32 ofs, u32 mask)
267 if (iwl_trans_grab_nic_access(trans, &flags)) {
268 val = iwl_read_prph_no_grab(trans, ofs);
269 iwl_write_prph_no_grab(trans, ofs, (val & ~mask));
270 iwl_trans_release_nic_access(trans, &flags);
275 void iwl_force_nmi(struct iwl_trans *trans)
277 if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_9000)
278 iwl_write_prph(trans, DEVICE_SET_NMI_REG,
280 else if (trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_AX210)
281 iwl_write_umac_prph(trans, UREG_NIC_SET_NMI_DRIVER,
284 iwl_write_umac_prph(trans, UREG_DOORBELL_TO_ISR6,
320 static int iwl_dump_rfh(struct iwl_trans *trans, char **buf)
323 int num_q = trans->num_rx_queues;
362 iwl_read_prph(trans, rfh_tbl[i]));
372 iwl_read_prph(trans, addr));
379 IWL_ERR(trans, "RFH register values:\n");
381 IWL_ERR(trans, " %34s: 0X%08x\n",
383 iwl_read_prph(trans, rfh_tbl[i]));
390 IWL_ERR(trans, " %34s(q %d): 0X%08x\n",
392 iwl_read_prph(trans, addr));
416 int iwl_dump_fh(struct iwl_trans *trans, char **buf)
431 if (trans->trans_cfg->mq_rx_supported)
432 return iwl_dump_rfh(trans, buf);
450 iwl_read_direct32(trans, fh_tbl[i]));
456 IWL_ERR(trans, "FH register values:\n");
458 IWL_ERR(trans, " %34s: 0X%08x\n",
460 iwl_read_direct32(trans, fh_tbl[i]));
465 int iwl_finish_nic_init(struct iwl_trans *trans,
479 iwl_set_bit(trans, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
489 err = iwl_poll_bit(trans, CSR_GP_CNTRL,
494 IWL_DEBUG_INFO(trans, "Failed to wake NIC\n");