18 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20 #include <linux/types.h>
21 #include <linux/netdevice.h>
22 #include <linux/export.h>
23 #include <linux/pci.h>
25 #include <linux/sched.h>
40 #define SDIOH_API_ACCESS_RETRY_LIMIT 2
42 #ifdef CONFIG_BRCMFMAC_SDIO_OOB
53 if (sdiodev->irq_en) {
55 sdiodev->irq_en =
false;
72 ret =
request_irq(sdiodev->irq, brcmf_sdio_irqhandler,
73 sdiodev->irq_flags,
"brcmf_oob_intr",
74 &sdiodev->
func[1]->card->dev);
79 sdiodev->irq_en =
true;
80 spin_unlock_irqrestore(&sdiodev->irq_en_lock, flags);
82 ret = enable_irq_wake(sdiodev->irq);
85 sdiodev->irq_wake =
true;
108 if (sdiodev->irq_wake) {
109 disable_irq_wake(sdiodev->irq);
110 sdiodev->irq_wake =
false;
113 sdiodev->irq_en =
false;
128 static void brcmf_sdio_dummy_irqhandler(
struct sdio_func *
func)
168 for (
i = 0;
i < 3;
i++) {
190 void *data,
bool write)
192 u8 func_num, reg_size;
215 if (bar != sdiodev->
sbwad) {
218 memset(data, 0xFF, reg_size);
221 sdiodev->
sbwad = bar;
229 memset(data, 0, reg_size);
234 func_num, addr, data);
237 func_num, addr, data, 4);
318 if (bar0 != sdiodev->
sbwad) {
323 sdiodev->
sbwad = bar0;
370 err = brcmf_sdcard_recv_prepare(sdiodev, fn, flags, width, &addr);
392 fn, addr, pktq->
qlen);
397 err = brcmf_sdcard_recv_prepare(sdiodev, fn, flags, width, &addr);
446 if (flags & SDIO_REQ_ASYNC)
451 if (bar0 != sdiodev->
sbwad) {
456 sdiodev->
sbwad = bar0;
509 char t_func = (
char)fn;