From b4b7ff4b08e691656c9d77c758fc355833128ac0 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Wed, 20 Jan 2016 14:01:31 -0300 Subject: Linux-libre 4.4-gnu --- drivers/staging/wilc1000/wilc_wfi_netdevice.h | 121 +++++++++----------------- 1 file changed, 43 insertions(+), 78 deletions(-) (limited to 'drivers/staging/wilc1000/wilc_wfi_netdevice.h') diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h index 77f320d12..0bfe7626a 100644 --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h @@ -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 @@ -24,16 +22,16 @@ #include #include #include -#include /* kmalloc() */ -#include /* error codes */ -#include /* size_t */ -#include /* mark_bh */ +#include +#include +#include +#include #include #include -#include /* struct device, and other headers */ -#include /* eth_type_trans */ -#include /* struct iphdr */ -#include /* struct tcphdr */ +#include +#include +#include +#include #include #include #include @@ -45,15 +43,14 @@ #include #include "host_interface.h" #include "wilc_wlan.h" -#include /* tony, 2013-06-12 */ +#include #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 { @@ -71,22 +68,7 @@ struct WILC_WFI_stats { * packets in and out, so there is place for a packet */ -#define RX_BH_KTHREAD 0 -#define RX_BH_WORK_QUEUE 1 -#define RX_BH_THREADED_IRQ 2 #define num_reg_frame 2 -/* - * If you use RX_BH_WORK_QUEUE on LPC3131: You may lose the first interrupt on - * LPC3131 which is important to get the MAC start status when you are blocked - * inside linux_wlan_firmware_download() which blocks mac_open(). - */ -#if defined(NM73131_0_BOARD) - #define RX_BH_TYPE RX_BH_KTHREAD -#elif defined(PANDA_BOARD) - #define RX_BH_TYPE RX_BH_THREADED_IRQ -#else - #define RX_BH_TYPE RX_BH_KTHREAD -#endif struct wilc_wfi_key { u8 *key; @@ -106,7 +88,6 @@ struct sta_info { u8 au8Sta_AssociatedBss[MAX_NUM_STA][ETH_ALEN]; }; -#ifdef WILC_P2P /*Parameters needed for host interface for remaining on channel*/ struct wilc_wfi_p2pListenParams { struct ieee80211_channel *pstrListenChan; @@ -116,16 +97,12 @@ struct wilc_wfi_p2pListenParams { u32 u32ListenSessionID; }; -#endif /*WILC_P2P*/ - -struct WILC_WFI_priv { +struct wilc_priv { struct wireless_dev *wdev; struct cfg80211_scan_request *pstrScanReq; - #ifdef WILC_P2P struct wilc_wfi_p2pListenParams strRemainOnChanParams; u64 u64tx_cookie; - #endif bool bCfgScanning; u32 u32RcvdChCount; @@ -144,9 +121,8 @@ struct WILC_WFI_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]; @@ -172,85 +148,74 @@ typedef struct { } struct_frame_reg; -#define NUM_CONCURRENT_IFC 2 -typedef struct { - uint8_t aSrcAddress[ETH_ALEN]; - uint8_t 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; - uint8_t u8NoIfcs; - tstrInterfaceInfo strInterfaceInfo[NUM_CONCURRENT_IFC]; - uint8_t open_ifcs; - struct mutex txq_cs; + u8 vif_num; + struct wilc_vif vif[NUM_CONCURRENT_IFC]; + u8 open_ifcs; - /*Added by Amr - BugID_4720*/ - struct mutex txq_add_to_head_cs; + struct semaphore txq_add_to_head_cs; spinlock_t txq_spinlock; struct mutex rxq_cs; struct mutex hif_cs; - /* struct mutex txq_event; */ - struct semaphore rxq_event; struct semaphore cfg_event; struct semaphore sync_event; - struct semaphore txq_event; - /* struct completion txq_event; */ -#if (RX_BH_TYPE == RX_BH_WORK_QUEUE) - struct work_struct rx_work_queue; -#elif (RX_BH_TYPE == RX_BH_KTHREAD) - struct task_struct *rx_bh_thread; - struct semaphore rx_sem; -#endif - struct semaphore rxq_thread_started; struct semaphore txq_thread_started; - struct task_struct *rxq_thread; 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 { - uint8_t u8IfIdx; + u8 u8IfIdx; u8 iftype; int monitor_flag; int mac_opened; - #ifdef WILC_P2P struct_frame_reg g_struct_frame_reg[num_reg_frame]; - #endif 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 -- cgit v1.2.3-54-g00ecf