Staging: wilc1000: coreconfigurator: Remove trailing whitespace
[firefly-linux-kernel-4.4.55.git] / drivers / staging / wilc1000 / wilc_wfi_netdevice.h
index ca9572814608238d0d98d947699c818b594c54e9..0bfe7626ad2d22a5f0db9007d3700b6e8511c5ed 100644 (file)
@@ -8,12 +8,10 @@
 #ifndef WILC_WFI_NETDEVICE
 #define WILC_WFI_NETDEVICE
 
-/* These are the flags in the statusword */
 #define WILC_WFI_RX_INTR 0x0001
 #define WILC_WFI_TX_INTR 0x0002
 
-/* Default timeout period */
-#define WILC_WFI_TIMEOUT 5   /* In jiffies */
+#define WILC_WFI_TIMEOUT 5
 #define WILC_MAX_NUM_PMKIDS  16
 #define PMKID_LEN  16
 #define PMKID_FOUND 1
 #include <linux/moduleparam.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
-#include <linux/slab.h> /* kmalloc() */
-#include <linux/errno.h>  /* error codes */
-#include <linux/types.h>  /* size_t */
-#include <linux/interrupt.h> /* mark_bh */
+#include <linux/slab.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
 #include <linux/time.h>
 #include <linux/in.h>
-#include <linux/netdevice.h>   /* struct device, and other headers */
-#include <linux/etherdevice.h> /* eth_type_trans */
-#include <linux/ip.h>          /* struct iphdr */
-#include <linux/tcp.h>         /* struct tcphdr */
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/ip.h>
+#include <linux/tcp.h>
 #include <linux/skbuff.h>
 #include <linux/ieee80211.h>
 #include <net/cfg80211.h>
 #include <asm/checksum.h>
 #include "host_interface.h"
 #include "wilc_wlan.h"
-#include <linux/wireless.h>     /* tony, 2013-06-12 */
+#include <linux/wireless.h>
 
 #define FLOW_CONTROL_LOWER_THRESHOLD   128
 #define FLOW_CONTROL_UPPER_THRESHOLD   256
 
-/*iftype*/
 enum stats_flags {
-       WILC_WFI_RX_PKT = 1 << 0,
-       WILC_WFI_TX_PKT = 1 << 1,
+       WILC_WFI_RX_PKT = BIT(0),
+       WILC_WFI_TX_PKT = BIT(1),
 };
 
 struct WILC_WFI_stats {
@@ -124,9 +121,8 @@ struct wilc_priv {
        spinlock_t lock;
        struct net_device *dev;
        struct napi_struct napi;
-       tstrWILC_WFIDrv *hWILCWFIDrv;
-       WILC_WFIDrvHandle hWILCWFIDrv_2;
-       tstrHostIFpmkidAttr pmkid_list;
+       struct host_if_drv *hWILCWFIDrv;
+       struct host_if_pmkid_attr pmkid_list;
        struct WILC_WFI_stats netstats;
        u8 WILC_WFI_wep_default;
        u8 WILC_WFI_wep_key[4][WLAN_KEY_LEN_WEP104];
@@ -152,24 +148,23 @@ typedef struct {
 
 } struct_frame_reg;
 
-typedef struct {
-       u8 aSrcAddress[ETH_ALEN];
-       u8 aBSSID[ETH_ALEN];
-       tstrWILC_WFIDrv *drvHandler;
-       struct net_device *wilc_netdev;
-} tstrInterfaceInfo;
-typedef struct {
+struct wilc_vif {
+       u8 src_addr[ETH_ALEN];
+       u8 bssid[ETH_ALEN];
+       struct host_if_drv *hif_drv;
+       struct net_device *ndev;
+};
+
+struct wilc {
        int mac_status;
-       int wilc1000_initialized;
+       bool initialized;
        #if (!defined WILC_SDIO) || (defined WILC_SDIO_IRQ_GPIO)
        unsigned short dev_irq_num;
        #endif
-       wilc_wlan_oup_t oup;
        int close;
-       u8 u8NoIfcs;
-       tstrInterfaceInfo strInterfaceInfo[NUM_CONCURRENT_IFC];
+       u8 vif_num;
+       struct wilc_vif vif[NUM_CONCURRENT_IFC];
        u8 open_ifcs;
-       struct mutex txq_cs;
 
        struct semaphore txq_add_to_head_cs;
        spinlock_t txq_spinlock;
@@ -186,19 +181,15 @@ typedef struct {
        struct task_struct *txq_thread;
 
        unsigned char eth_src_address[NUM_CONCURRENT_IFC][6];
-       /* unsigned char eth_dst_address[6]; */
 
-       const struct firmware *wilc_firmware; /* Bug 4703 */
+       const struct firmware *firmware;
 
-       struct net_device *real_ndev;
 #ifdef WILC_SDIO
-       int already_claim;
        struct sdio_func *wilc_sdio_func;
 #else
        struct spi_device *wilc_spidev;
 #endif
-
-} linux_wlan_t;
+};
 
 typedef struct {
        u8 u8IfIdx;
@@ -208,13 +199,23 @@ typedef struct {
        struct_frame_reg g_struct_frame_reg[num_reg_frame];
        struct net_device *wilc_netdev;
        struct net_device_stats netstats;
-
+       struct wilc *wilc;
 } perInterface_wlan_t;
 
 struct WILC_WFI_mon_priv {
        struct net_device *real_ndev;
 };
 
+extern struct wilc *g_linux_wlan;
 extern struct net_device *WILC_WFI_devs[];
-
+void frmw_to_linux(struct wilc *wilc, u8 *buff, u32 size, u32 pkt_offset);
+void linux_wlan_mac_indicate(struct wilc *wilc, int flag);
+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(void);
+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);
+u16 Set_machw_change_vir_if(struct net_device *dev, bool bValue);
 #endif