#include <linux/semaphore.h>
-#include "linux_wlan_sdio.h"
-
static int dev_state_ev_handler(struct notifier_block *this, unsigned long event, void *ptr);
static struct notifier_block g_dev_notifier = {
#endif
PRINT_D(INIT_DBG, "Disabling IRQ\n");
- if (!wl->dev_irq_num) {
+ if (!wl->dev_irq_num &&
+ wl->ops->disable_interrupt) {
mutex_lock(&wl->hif_cs);
- wilc_sdio_disable_interrupt();
+ wl->ops->disable_interrupt(wl);
mutex_unlock(&wl->hif_cs);
}
if (&wl->txq_event)
PRINT_D(INIT_DBG, "Deinitializing WILC Wlan\n");
wilc_wlan_cleanup(dev);
#if defined(PLAT_ALLWINNER_A20) || defined(PLAT_ALLWINNER_A23) || defined(PLAT_ALLWINNER_A31)
- if (!wl->dev_irq_num) {
+ if (!wl->dev_irq_num &&
+ wl->ops->disable_interrupt) {
+
PRINT_D(INIT_DBG, "Disabling IRQ 2\n");
mutex_lock(&wl->hif_cs);
- wilc_sdio_disable_interrupt();
+ wl->ops->disable_interrupt(wl);
mutex_unlock(&wl->hif_cs);
}
#endif
goto _fail_wilc_wlan_;
}
- if (!wl->dev_irq_num && wilc_sdio_enable_interrupt()) {
+ if (!wl->dev_irq_num &&
+ wl->ops->enable_interrupt &&
+ wl->ops->enable_interrupt(wl)) {
PRINT_ER("couldn't initialize IRQ\n");
ret = -EIO;
goto _fail_irq_init_;
wilc_wlan_stop();
_fail_irq_enable_:
- if (!wl->dev_irq_num)
- wilc_sdio_disable_interrupt();
+ if (!wl->dev_irq_num &&
+ wl->ops->disable_interrupt)
+ wl->ops->disable_interrupt(wl);
_fail_irq_init_:
if (wl->dev_irq_num)
deinit_irq(dev);
#include "wilc_wfi_netdevice.h"
-#include "linux_wlan_sdio.h"
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/of_gpio.h>
-
+#include "linux_wlan_sdio.h"
#define SDIO_MODALIAS "wilc1000_sdio"
.remove = linux_sdio_remove,
};
-int wilc_sdio_enable_interrupt(void)
+int wilc_sdio_enable_interrupt(struct wilc *dev)
{
+ struct sdio_func *func = container_of(dev->dev, struct sdio_func, dev);
int ret = 0;
- sdio_claim_host(wilc_sdio_func);
- ret = sdio_claim_irq(wilc_sdio_func, wilc_sdio_interrupt);
- sdio_release_host(wilc_sdio_func);
+ sdio_claim_host(func);
+ ret = sdio_claim_irq(func, wilc_sdio_interrupt);
+ sdio_release_host(func);
if (ret < 0) {
PRINT_ER("can't claim sdio_irq, err(%d)\n", ret);
return ret;
}
-void wilc_sdio_disable_interrupt(void)
+void wilc_sdio_disable_interrupt(struct wilc *dev)
{
+ struct sdio_func *func = container_of(dev->dev, struct sdio_func, dev);
int ret;
PRINT_D(INIT_DBG, "wilc_sdio_disable_interrupt IN\n");
- sdio_claim_host(wilc_sdio_func);
- ret = sdio_release_irq(wilc_sdio_func);
+ sdio_claim_host(func);
+ ret = sdio_release_irq(func);
if (ret < 0) {
PRINT_ER("can't release sdio_irq, err(%d)\n", ret);
}
- sdio_release_host(wilc_sdio_func);
+ sdio_release_host(func);
PRINT_D(INIT_DBG, "wilc_sdio_disable_interrupt OUT\n");
}
int wilc_sdio_cmd52(sdio_cmd52_t *cmd);
int wilc_sdio_cmd53(sdio_cmd53_t *cmd);
-int wilc_sdio_enable_interrupt(void);
-void wilc_sdio_disable_interrupt(void);
+int wilc_sdio_enable_interrupt(struct wilc *);
+void wilc_sdio_disable_interrupt(struct wilc *);
int wilc_sdio_set_max_speed(void);
int wilc_sdio_set_default_speed(void);
.hif_sync_ext = sdio_sync_ext,
.hif_set_max_bus_speed = sdio_set_max_speed,
.hif_set_default_bus_speed = sdio_set_default_speed,
+ .enable_interrupt = wilc_sdio_enable_interrupt,
+ .disable_interrupt = wilc_sdio_disable_interrupt,
};
int (*hif_sync_ext)(int);
void (*hif_set_max_bus_speed)(void);
void (*hif_set_default_bus_speed)(void);
+ int (*enable_interrupt)(struct wilc *nic);
+ void (*disable_interrupt)(struct wilc *nic);
};
extern const struct wilc_hif_func wilc_hif_spi;