#include <linux/semaphore.h>
-#ifdef WILC_SDIO
#include "linux_wlan_sdio.h"
-#else
-#include "linux_wlan_spi.h"
-#endif
static int dev_state_ev_handler(struct notifier_block *this, unsigned long event, void *ptr);
wlan_init_locks(dev);
-#ifdef WILC_SDIO
- wl->io_type = HIF_SDIO;
-#else
- wl->io_type = HIF_SPI;
-#endif
ret = wilc_wlan_init(dev);
if (ret < 0) {
PRINT_ER("Initializing WILC_Wlan FAILED\n");
#endif
}
-int wilc_netdev_init(struct wilc **wilc)
+int wilc_netdev_init(struct wilc **wilc, struct device *dev, int io_type)
{
int i;
perInterface_wlan_t *nic;
return -ENOMEM;
*wilc = wilc_dev;
-
+ wilc_dev->io_type = io_type;
register_inetaddr_notifier(&g_dev_notifier);
for (i = 0; i < NUM_CONCURRENT_IFC; i++) {
struct wireless_dev *wdev;
wdev = wilc_create_wiphy(ndev);
- #ifdef WILC_SDIO
- SET_NETDEV_DEV(ndev, &wilc_sdio_func->dev);
- #endif
+ if (dev)
+ SET_NETDEV_DEV(ndev, dev);
if (!wdev) {
PRINT_ER("Can't register WILC Wiphy\n");
#include "wilc_wfi_netdevice.h"
+#include "linux_wlan_sdio.h"
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
PRINT_D(INIT_DBG, "Initializing netdev\n");
wilc_sdio_func = func;
- if (wilc_netdev_init(&wilc)) {
+ if (wilc_netdev_init(&wilc, &func->dev, HIF_SDIO)) {
PRINT_ER("Couldn't initialize netdev\n");
return -1;
}
return linux_sdio_set_speed(sdio_default_speed);
}
-
static int __init init_wilc_sdio_driver(void)
{
return sdio_register_driver(&wilc_bus);
#include <linux/device.h>
#include <linux/spi/spi.h>
+#include "linux_wlan_spi.h"
#include "wilc_wfi_netdevice.h"
#include "linux_wlan_common.h"
-#include "linux_wlan_spi.h"
#include "wilc_wlan_if.h"
#define USE_SPI_DMA 0 /* johnny add */
wilc_debugfs_init();
- ret = wilc_netdev_init(&wilc);
+ ret = wilc_netdev_init(&wilc, NULL, HIF_SPI);
if (ret) {
wilc_debugfs_remove();
return ret;
void linux_wlan_dbg(u8 *buff);
int linux_wlan_lock_timeout(void *vp, u32 timeout);
void wilc_netdev_cleanup(struct wilc *wilc);
-int wilc_netdev_init(struct wilc **wilc);
+int wilc_netdev_init(struct wilc **wilc, struct device *, int io_type);
void wilc1000_wlan_deinit(struct net_device *dev);
void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);
u16 wilc_set_machw_change_vir_if(struct net_device *dev, bool value);