WILC_WFI_p2p_rx(wilc->vif[1].ndev, buff, size);
}
-void wl_wlan_cleanup(struct wilc *wilc)
+void wilc_netdev_cleanup(struct wilc *wilc)
{
int i = 0;
perInterface_wlan_t *nic[NUM_CONCURRENT_IFC];
return 0;
}
-
-static int __init init_wilc_driver(void)
-{
-#ifdef WILC_SPI
- struct wilc *wilc;
-#endif
-
-#if defined(WILC_DEBUGFS)
- if (wilc_debugfs_init() < 0) {
- PRINT_D(GENERIC_DBG, "fail to create debugfs for wilc driver\n");
- return -1;
- }
-#endif
-
- printk("IN INIT FUNCTION\n");
- printk("*** WILC1000 driver VERSION=[10.2] FW_VER=[10.2] ***\n");
-
-#ifdef WILC_SDIO
- {
- int ret;
-
- ret = sdio_register_driver(&wilc_bus);
- if (ret < 0)
- PRINT_D(INIT_DBG, "init_wilc_driver: Failed register sdio driver\n");
-
- return ret;
- }
-#else
- PRINT_D(INIT_DBG, "Initializing netdev\n");
- if (wilc_netdev_init(&wilc))
- PRINT_ER("Couldn't initialize netdev\n");
- return 0;
-#endif
-}
-late_initcall(init_wilc_driver);
-
-static void __exit exit_wilc_driver(void)
-{
-#ifndef WILC_SDIO
- PRINT_D(INIT_DBG, "SPI unregister...\n");
- spi_unregister_driver(&wilc_bus);
-#else
- PRINT_D(INIT_DBG, "SDIO unregister...\n");
- sdio_unregister_driver(&wilc_bus);
-#endif
-}
-module_exit(exit_wilc_driver);
-
-MODULE_LICENSE("GPL");
printk("ERR [%s: %d]", __func__, __LINE__); \
printk(__VA_ARGS__); \
} while (0)
+
+static inline int wilc_debugfs_init(void)
+{
+ return 0;
+}
+
+static inline void wilc_debugfs_remove(void)
+{
+}
+
#endif
#define FN_IN /* PRINT_D(">>> \n") */
struct wilc_sdio *wl_sdio;
wl_sdio = sdio_get_drvdata(func);
- wl_wlan_cleanup(wl_sdio->wilc);
+ wilc_netdev_cleanup(wl_sdio->wilc);
kfree(wl_sdio);
}
-struct sdio_driver wilc_bus = {
+static struct sdio_driver wilc_bus = {
.name = SDIO_MODALIAS,
.id_table = wilc_sdio_ids,
.probe = linux_sdio_probe,
}
+static int __init init_wilc_sdio_driver(void)
+{
+ return sdio_register_driver(&wilc_bus);
+}
+late_initcall(init_wilc_sdio_driver);
+
+static void __exit exit_wilc_sdio_driver(void)
+{
+ sdio_unregister_driver(&wilc_bus);
+}
+module_exit(exit_wilc_sdio_driver);
+MODULE_LICENSE("GPL");
-extern struct sdio_func *wilc_sdio_func;
-extern struct sdio_driver wilc_bus;
-
#include <linux/mmc/sdio_func.h>
+extern struct sdio_func *wilc_sdio_func;
+
int wilc_sdio_init(void);
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_set_max_speed(void);
#include "linux_wlan_common.h"
#include "linux_wlan_spi.h"
+#include "wilc_wfi_netdevice.h"
#define USE_SPI_DMA 0 /* johnny add */
MODULE_DEVICE_TABLE(of, wilc1000_of_match);
#endif
-struct spi_driver wilc_bus __refdata = {
+static struct spi_driver wilc_bus __refdata = {
.driver = {
.name = MODALIAS,
#ifdef CONFIG_OF
PRINT_INFO(BUS_DBG, "@@@@@@@@@@@@ change SPI speed to %d @@@@@@@@@\n", SPEED);
return 1;
}
+
+static struct wilc *wilc;
+
+static int __init init_wilc_spi_driver(void)
+{
+ wilc_debugfs_init();
+ return wilc_netdev_init(&wilc);
+}
+late_initcall(init_wilc_spi_driver);
+
+static void __exit exit_wilc_spi_driver(void)
+{
+ if (wilc)
+ wilc_netdev_cleanup(wilc);
+ spi_unregister_driver(&wilc_bus);
+ wilc_debugfs_remove();
+}
+module_exit(exit_wilc_spi_driver);
+
+MODULE_LICENSE("GPL");
#define LINUX_WLAN_SPI_H
#include <linux/spi/spi.h>
-extern struct spi_device *wilc_spi_dev;
-extern struct spi_driver wilc_bus;
int wilc_spi_init(void);
int wilc_spi_write(u8 *b, u32 len);
int wilc_spi_read(u8 *rb, u32 rlen);
int wilc_spi_write_read(u8 *wb, u8 *rb, u32 rlen);
int wilc_spi_set_max_speed(void);
+
#endif
void linux_wlan_rx_complete(void);
void linux_wlan_dbg(u8 *buff);
int linux_wlan_lock_timeout(void *vp, u32 timeout);
-void wl_wlan_cleanup(struct wilc *wilc);
+void wilc_netdev_cleanup(struct wilc *wilc);
int wilc_netdev_init(struct wilc **wilc);
void wilc1000_wlan_deinit(struct net_device *dev);
void WILC_WFI_mgmt_rx(struct wilc *wilc, u8 *buff, u32 size);