staging: wilc1000: use u8 instead of uint8_t
[firefly-linux-kernel-4.4.55.git] / drivers / staging / wilc1000 / wilc_wfi_cfgoperations.h
1 /*!
2  *  @file       wilc_wfi_cfgoperations.h
3  *  @brief      Definitions for the network module
4  *  @author     syounan
5  *  @sa         wilc_oswrapper.h top level OS wrapper file
6  *  @date       31 Aug 2010
7  *  @version    1.0
8  */
9 #ifndef NM_WFI_CFGOPERATIONS
10 #define NM_WFI_CFGOPERATIONS
11 #include "wilc_wfi_netdevice.h"
12
13 /* The following macros describe the bitfield map used by the firmware to determine its 11i mode */
14 #define NO_ENCRYPT                      0
15 #define ENCRYPT_ENABLED (1 << 0)
16 #define WEP                                     (1 << 1)
17 #define WEP_EXTENDED            (1 << 2)
18 #define WPA                                     (1 << 3)
19 #define WPA2                            (1 << 4)
20 #define AES                                     (1 << 5)
21 #define TKIP                                    (1 << 6)
22
23 #ifdef WILC_P2P
24 /* #define      USE_SUPPLICANT_GO_INTENT */
25
26 /*Public action frame index IDs*/
27 #define         FRAME_TYPE_ID                                   0
28 #define         ACTION_CAT_ID                                   24
29 #define         ACTION_SUBTYPE_ID                               25
30 #define         P2P_PUB_ACTION_SUBTYPE          30
31
32 /*Public action frame Attribute IDs*/
33 #define         ACTION_FRAME                                    0xd0
34 #define         GO_INTENT_ATTR_ID                       0x04
35 #define         CHANLIST_ATTR_ID                0x0b
36 #define         OPERCHAN_ATTR_ID                0x11
37 #ifdef  USE_SUPPLICANT_GO_INTENT
38 #define GROUP_BSSID_ATTR_ID                     0x07
39 #endif
40 #define         PUB_ACTION_ATTR_ID                      0x04
41 #define         P2PELEM_ATTR_ID                     0xdd
42
43 /*Public action subtype values*/
44 #define         GO_NEG_REQ                                      0x00
45 #define         GO_NEG_RSP                                      0x01
46 #define         GO_NEG_CONF                                     0x02
47 #define         P2P_INV_REQ                         0x03
48 #define         P2P_INV_RSP                             0x04
49 #define         PUBLIC_ACT_VENDORSPEC           0x09
50 #define         GAS_INTIAL_REQ                                  0x0a
51 #define         GAS_INTIAL_RSP                                  0x0b
52
53 #define         INVALID_CHANNEL                                 0
54 #ifdef  USE_SUPPLICANT_GO_INTENT
55 #define         SUPPLICANT_GO_INTENT                    6
56 #define         GET_GO_INTENT(a)                                (((a) >> 1) & 0x0f)
57 #define         GET_TIE_BREAKER(a)                      (((a)) & 0x01)
58 #else
59 /* #define FORCE_P2P_CLIENT */
60 #endif
61 #endif
62
63 #define nl80211_SCAN_RESULT_EXPIRE      (3 * HZ)
64 #define SCAN_RESULT_EXPIRE                              (40 * HZ)
65
66 static const u32 cipher_suites[] = {
67         WLAN_CIPHER_SUITE_WEP40,
68         WLAN_CIPHER_SUITE_WEP104,
69         WLAN_CIPHER_SUITE_TKIP,
70         WLAN_CIPHER_SUITE_CCMP,
71         WLAN_CIPHER_SUITE_AES_CMAC,
72 };
73
74 static const struct ieee80211_txrx_stypes
75         wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES] = {
76         [NL80211_IFTYPE_STATION] = {
77                 .tx = 0xffff,
78                 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
79                         BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
80         },
81         [NL80211_IFTYPE_AP] = {
82                 .tx = 0xffff,
83                 .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
84                         BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
85                         BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
86                         BIT(IEEE80211_STYPE_DISASSOC >> 4) |
87                         BIT(IEEE80211_STYPE_AUTH >> 4) |
88                         BIT(IEEE80211_STYPE_DEAUTH >> 4) |
89                         BIT(IEEE80211_STYPE_ACTION >> 4)
90         },
91         [NL80211_IFTYPE_P2P_CLIENT] = {
92                 .tx = 0xffff,
93                 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
94                         BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
95                         BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
96                         BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
97                         BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
98                         BIT(IEEE80211_STYPE_DISASSOC >> 4) |
99                         BIT(IEEE80211_STYPE_AUTH >> 4) |
100                         BIT(IEEE80211_STYPE_DEAUTH >> 4)
101         }
102 };
103
104 /* Time to stay on the channel */
105 #define WILC_WFI_DWELL_PASSIVE 100
106 #define WILC_WFI_DWELL_ACTIVE  40
107
108 struct wireless_dev *WILC_WFI_CfgAlloc(void);
109 struct wireless_dev *WILC_WFI_WiphyRegister(struct net_device *net);
110 void WILC_WFI_WiphyFree(struct net_device *net);
111 int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed);
112 int WILC_WFI_DeInitHostInt(struct net_device *net);
113 int WILC_WFI_InitHostInt(struct net_device *net);
114 void WILC_WFI_monitor_rx(u8 *buff, uint32_t size);
115 int WILC_WFI_deinit_mon_interface(void);
116 struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev);
117
118 #ifdef TCP_ENHANCEMENTS
119 #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54
120 #define DEFAULT_LINK_SPEED 72
121 void Enable_TCP_ACK_Filter(bool value);
122 #endif
123
124 #endif