Lines Matching refs:dev
117 static int ath6kl_hif_proc_dbg_intr(struct ath6kl_device *dev) in ath6kl_hif_proc_dbg_intr() argument
128 ret = hif_read_write_sync(dev->ar, COUNT_DEC_ADDRESS, in ath6kl_hif_proc_dbg_intr()
133 ath6kl_hif_dump_fw_crash(dev->ar); in ath6kl_hif_proc_dbg_intr()
134 ath6kl_read_fwlogs(dev->ar); in ath6kl_hif_proc_dbg_intr()
135 ath6kl_recovery_err_notify(dev->ar, ATH6KL_FW_ASSERT); in ath6kl_hif_proc_dbg_intr()
141 int ath6kl_hif_poll_mboxmsg_rx(struct ath6kl_device *dev, u32 *lk_ahd, in ath6kl_hif_poll_mboxmsg_rx() argument
150 status = hif_read_write_sync(dev->ar, HOST_INT_STATUS_ADDRESS, in ath6kl_hif_poll_mboxmsg_rx()
151 (u8 *) &dev->irq_proc_reg, in ath6kl_hif_poll_mboxmsg_rx()
152 sizeof(dev->irq_proc_reg), in ath6kl_hif_poll_mboxmsg_rx()
161 if (dev->irq_proc_reg.host_int_status & htc_mbox) { in ath6kl_hif_poll_mboxmsg_rx()
162 if (dev->irq_proc_reg.rx_lkahd_valid & in ath6kl_hif_poll_mboxmsg_rx()
168 rg = &dev->irq_proc_reg; in ath6kl_hif_poll_mboxmsg_rx()
184 if (dev->irq_proc_reg.counter_int_status & in ath6kl_hif_poll_mboxmsg_rx()
190 ath6kl_hif_proc_dbg_intr(dev); in ath6kl_hif_poll_mboxmsg_rx()
200 int ath6kl_hif_rx_control(struct ath6kl_device *dev, bool enable_rx) in ath6kl_hif_rx_control() argument
209 spin_lock_bh(&dev->lock); in ath6kl_hif_rx_control()
212 dev->irq_en_reg.int_status_en |= in ath6kl_hif_rx_control()
215 dev->irq_en_reg.int_status_en &= in ath6kl_hif_rx_control()
218 memcpy(®s, &dev->irq_en_reg, sizeof(regs)); in ath6kl_hif_rx_control()
220 spin_unlock_bh(&dev->lock); in ath6kl_hif_rx_control()
222 status = hif_read_write_sync(dev->ar, INT_STATUS_ENABLE_ADDRESS, in ath6kl_hif_rx_control()
230 int ath6kl_hif_submit_scat_req(struct ath6kl_device *dev, in ath6kl_hif_submit_scat_req() argument
237 scat_req->addr = dev->ar->mbox_info.htc_addr; in ath6kl_hif_submit_scat_req()
243 dev->ar->mbox_info.htc_ext_addr : in ath6kl_hif_submit_scat_req()
244 dev->ar->mbox_info.htc_addr; in ath6kl_hif_submit_scat_req()
257 scat_req->complete(dev->ar->htc_target, scat_req); in ath6kl_hif_submit_scat_req()
262 status = ath6kl_hif_scat_req_rw(dev->ar, scat_req); in ath6kl_hif_submit_scat_req()
275 static int ath6kl_hif_proc_counter_intr(struct ath6kl_device *dev) in ath6kl_hif_proc_counter_intr() argument
281 counter_int_status = dev->irq_proc_reg.counter_int_status & in ath6kl_hif_proc_counter_intr()
282 dev->irq_en_reg.cntr_int_status_en; in ath6kl_hif_proc_counter_intr()
294 return ath6kl_hif_proc_dbg_intr(dev); in ath6kl_hif_proc_counter_intr()
299 static int ath6kl_hif_proc_err_intr(struct ath6kl_device *dev) in ath6kl_hif_proc_err_intr() argument
307 error_int_status = dev->irq_proc_reg.error_int_status & 0x0F; in ath6kl_hif_proc_err_intr()
327 dev->irq_proc_reg.error_int_status &= ~error_int_status; in ath6kl_hif_proc_err_intr()
335 status = hif_read_write_sync(dev->ar, ERROR_INT_STATUS_ADDRESS, in ath6kl_hif_proc_err_intr()
343 static int ath6kl_hif_proc_cpu_intr(struct ath6kl_device *dev) in ath6kl_hif_proc_cpu_intr() argument
351 cpu_int_status = dev->irq_proc_reg.cpu_int_status & in ath6kl_hif_proc_cpu_intr()
352 dev->irq_en_reg.cpu_int_status_en; in ath6kl_hif_proc_cpu_intr()
363 dev->irq_proc_reg.cpu_int_status &= ~cpu_int_status; in ath6kl_hif_proc_cpu_intr()
379 status = hif_read_write_sync(dev->ar, CPU_INT_STATUS_ADDRESS, in ath6kl_hif_proc_cpu_intr()
388 static int proc_pending_irqs(struct ath6kl_device *dev, bool *done) in proc_pending_irqs() argument
396 ath6kl_dbg(ATH6KL_DBG_IRQ, "proc_pending_irqs: (dev: 0x%p)\n", dev); in proc_pending_irqs()
410 if (dev->irq_en_reg.int_status_en) { in proc_pending_irqs()
426 status = hif_read_write_sync(dev->ar, HOST_INT_STATUS_ADDRESS, in proc_pending_irqs()
427 (u8 *) &dev->irq_proc_reg, in proc_pending_irqs()
428 sizeof(dev->irq_proc_reg), in proc_pending_irqs()
433 ath6kl_dump_registers(dev, &dev->irq_proc_reg, in proc_pending_irqs()
434 &dev->irq_en_reg); in proc_pending_irqs()
435 trace_ath6kl_sdio_irq(&dev->irq_en_reg, in proc_pending_irqs()
436 sizeof(dev->irq_en_reg)); in proc_pending_irqs()
439 host_int_status = dev->irq_proc_reg.host_int_status & in proc_pending_irqs()
440 dev->irq_en_reg.int_status_en; in proc_pending_irqs()
449 if (dev->irq_proc_reg.rx_lkahd_valid & in proc_pending_irqs()
451 rg = &dev->irq_proc_reg; in proc_pending_irqs()
477 status = ath6kl_htc_rxmsg_pending_handler(dev->htc_cnxt, in proc_pending_irqs()
487 dev->htc_cnxt->chk_irq_status_cnt = 0; in proc_pending_irqs()
497 status = ath6kl_hif_proc_cpu_intr(dev); in proc_pending_irqs()
504 status = ath6kl_hif_proc_err_intr(dev); in proc_pending_irqs()
511 status = ath6kl_hif_proc_counter_intr(dev); in proc_pending_irqs()
530 if (!dev->htc_cnxt->chk_irq_status_cnt) in proc_pending_irqs()
542 struct ath6kl_device *dev = ar->htc_target->dev; in ath6kl_hif_intr_bh_handler() local
551 dev->htc_cnxt->chk_irq_status_cnt = 0; in ath6kl_hif_intr_bh_handler()
559 status = proc_pending_irqs(dev, &done); in ath6kl_hif_intr_bh_handler()
568 static int ath6kl_hif_enable_intrs(struct ath6kl_device *dev) in ath6kl_hif_enable_intrs() argument
573 spin_lock_bh(&dev->lock); in ath6kl_hif_enable_intrs()
576 dev->irq_en_reg.int_status_en = in ath6kl_hif_enable_intrs()
585 dev->irq_en_reg.int_status_en |= SM(INT_STATUS_ENABLE_MBOX_DATA, 0x01); in ath6kl_hif_enable_intrs()
588 dev->irq_en_reg.cpu_int_status_en = 0; in ath6kl_hif_enable_intrs()
591 dev->irq_en_reg.err_int_status_en = in ath6kl_hif_enable_intrs()
599 dev->irq_en_reg.cntr_int_status_en = SM(COUNTER_INT_STATUS_ENABLE_BIT, in ath6kl_hif_enable_intrs()
601 memcpy(®s, &dev->irq_en_reg, sizeof(regs)); in ath6kl_hif_enable_intrs()
603 spin_unlock_bh(&dev->lock); in ath6kl_hif_enable_intrs()
605 status = hif_read_write_sync(dev->ar, INT_STATUS_ENABLE_ADDRESS, in ath6kl_hif_enable_intrs()
616 int ath6kl_hif_disable_intrs(struct ath6kl_device *dev) in ath6kl_hif_disable_intrs() argument
620 spin_lock_bh(&dev->lock); in ath6kl_hif_disable_intrs()
622 dev->irq_en_reg.int_status_en = 0; in ath6kl_hif_disable_intrs()
623 dev->irq_en_reg.cpu_int_status_en = 0; in ath6kl_hif_disable_intrs()
624 dev->irq_en_reg.err_int_status_en = 0; in ath6kl_hif_disable_intrs()
625 dev->irq_en_reg.cntr_int_status_en = 0; in ath6kl_hif_disable_intrs()
626 memcpy(®s, &dev->irq_en_reg, sizeof(regs)); in ath6kl_hif_disable_intrs()
627 spin_unlock_bh(&dev->lock); in ath6kl_hif_disable_intrs()
629 return hif_read_write_sync(dev->ar, INT_STATUS_ENABLE_ADDRESS, in ath6kl_hif_disable_intrs()
635 int ath6kl_hif_unmask_intrs(struct ath6kl_device *dev) in ath6kl_hif_unmask_intrs() argument
647 ath6kl_hif_disable_intrs(dev); in ath6kl_hif_unmask_intrs()
650 ath6kl_hif_irq_enable(dev->ar); in ath6kl_hif_unmask_intrs()
651 status = ath6kl_hif_enable_intrs(dev); in ath6kl_hif_unmask_intrs()
657 int ath6kl_hif_mask_intrs(struct ath6kl_device *dev) in ath6kl_hif_mask_intrs() argument
664 ath6kl_hif_irq_disable(dev->ar); in ath6kl_hif_mask_intrs()
666 return ath6kl_hif_disable_intrs(dev); in ath6kl_hif_mask_intrs()
669 int ath6kl_hif_setup(struct ath6kl_device *dev) in ath6kl_hif_setup() argument
673 spin_lock_init(&dev->lock); in ath6kl_hif_setup()
680 dev->htc_cnxt->block_sz = dev->ar->mbox_info.block_size; in ath6kl_hif_setup()
683 if ((dev->htc_cnxt->block_sz & (dev->htc_cnxt->block_sz - 1)) != 0) { in ath6kl_hif_setup()
690 dev->htc_cnxt->block_mask = dev->htc_cnxt->block_sz - 1; in ath6kl_hif_setup()
693 dev->htc_cnxt->block_sz, dev->ar->mbox_info.htc_addr); in ath6kl_hif_setup()
695 status = ath6kl_hif_disable_intrs(dev); in ath6kl_hif_setup()