len, set);
}
-int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev,
- void (*fn)(void *), void *argh)
+int brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev)
{
- return brcmf_sdioh_interrupt_register(sdiodev->sdioh, fn, argh);
+ return brcmf_sdioh_interrupt_register(sdiodev->sdioh);
}
int brcmf_sdcard_intr_dereg(struct brcmf_sdio_dev *sdiodev)
/* Configure callback to client when we receive client interrupt */
extern int
-brcmf_sdioh_interrupt_register(struct sdioh_info *sd, void (*fn)(void *),
- void *argh)
+brcmf_sdioh_interrupt_register(struct sdioh_info *sd)
{
BRCMF_TRACE(("%s: Entering\n", __func__));
- if (fn == NULL) {
- BRCMF_ERROR(("%s: interrupt handler is NULL, not registering\n",
- __func__));
- return -EINVAL;
- }
-
- sd->intr_handler = fn;
- sd->intr_handler_arg = argh;
- sd->intr_handler_valid = true;
/* register and unmask irq */
if (gInstance->func[2]) {
sdio_release_host(gInstance->func[2]);
}
- sd->intr_handler_valid = false;
- sd->intr_handler = NULL;
- sd->intr_handler_arg = NULL;
-
return 0;
}
static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{
struct sdioh_info *sd;
+ struct brcmf_sdio_dev *sdiodev = dev_get_drvdata(&func->card->dev);
BRCMF_TRACE(("brcmf: ***IRQHandler\n"));
sd = gInstance->sd;
sdio_release_host(gInstance->func[0]);
sd->intrcount++;
- (sd->intr_handler) (sd->intr_handler_arg);
+ brcmf_sdbrcm_isr(sdiodev->bus);
sdio_claim_host(gInstance->func[0]);
}
goto fail;
}
bus->sdiodev = sdiodev;
+ sdiodev->bus = bus;
bus->bus = BRCMF_BUS;
bus->tx_seq = SDPCM_SEQUENCE_WRAP - 1;
bus->usebufpool = false; /* Use bufpool if allocated,
/* Register interrupt callback, but mask it (not operational yet). */
BRCMF_INTR(("%s: disable SDIO interrupts (not interested yet)\n",
__func__));
- ret = brcmf_sdcard_intr_reg(bus->sdiodev, brcmf_sdbrcm_isr, bus);
+ ret = brcmf_sdcard_intr_reg(bus->sdiodev);
if (ret != 0) {
BRCMF_ERROR(("%s: FAILED: sdcard_intr_reg returned %d\n",
__func__, ret));
struct sdioh_info {
struct osl_info *osh; /* osh handler */
- bool intr_handler_valid; /* client driver interrupt handler valid */
- void (*intr_handler)(void *); /* registered interrupt handler */
- void *intr_handler_arg; /* argument to call interrupt handler */
uint irq; /* Client irq */
int intrcount; /* Client interrupts */
/* Register/deregister device interrupt handler. */
extern int
-brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev,
- void (*fn)(void *), void *argh);
+brcmf_sdcard_intr_reg(struct brcmf_sdio_dev *sdiodev);
extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_dev *sdiodev);
extern int brcmf_sdioh_detach(struct sdioh_info *si);
extern int
-brcmf_sdioh_interrupt_register(struct sdioh_info *si,
- void (*sdioh_cb_fn)(void *), void *argh);
+brcmf_sdioh_interrupt_register(struct sdioh_info *si);
extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
extern void *brcmf_sdbrcm_probe(u16 bus_no, u16 slot, u16 func, uint bustype,
u32 regsva, struct brcmf_sdio_dev *sdiodev);
extern void brcmf_sdbrcm_disconnect(void *ptr);
+extern void brcmf_sdbrcm_isr(void *arg);
#endif /* _BRCM_SDH_H_ */