blob: 97b663b7fd1496952097ddab1d053342c33298bf [file] [log] [blame]
Johnny Kimc5c77ba2015-05-11 14:30:56 +09001/*!
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#ifdef WILC_FULLY_HOSTING_AP
14#include "wilc_host_ap.h"
15#endif
16
17
18/* The following macros describe the bitfield map used by the firmware to determine its 11i mode */
19#define NO_ENCRYPT 0
20#define ENCRYPT_ENABLED (1 << 0)
21#define WEP (1 << 1)
22#define WEP_EXTENDED (1 << 2)
23#define WPA (1 << 3)
24#define WPA2 (1 << 4)
25#define AES (1 << 5)
26#define TKIP (1 << 6)
27
28#ifdef WILC_P2P
29/* #define USE_SUPPLICANT_GO_INTENT */
30
31/*Public action frame index IDs*/
32#define FRAME_TYPE_ID 0
33#define ACTION_CAT_ID 24
34#define ACTION_SUBTYPE_ID 25
35#define P2P_PUB_ACTION_SUBTYPE 30
36
37/*Public action frame Attribute IDs*/
38#define ACTION_FRAME 0xd0
39#define GO_INTENT_ATTR_ID 0x04
40#define CHANLIST_ATTR_ID 0x0b
41#define OPERCHAN_ATTR_ID 0x11
42#ifdef USE_SUPPLICANT_GO_INTENT
43#define GROUP_BSSID_ATTR_ID 0x07
44#endif
45#define PUB_ACTION_ATTR_ID 0x04
46#define P2PELEM_ATTR_ID 0xdd
47
48/*Public action subtype values*/
49#define GO_NEG_REQ 0x00
50#define GO_NEG_RSP 0x01
51#define GO_NEG_CONF 0x02
52#define P2P_INV_REQ 0x03
53#define P2P_INV_RSP 0x04
54#define PUBLIC_ACT_VENDORSPEC 0x09
55#define GAS_INTIAL_REQ 0x0a
56#define GAS_INTIAL_RSP 0x0b
57
58#define INVALID_CHANNEL 0
59#ifdef USE_SUPPLICANT_GO_INTENT
60#define SUPPLICANT_GO_INTENT 6
61#define GET_GO_INTENT(a) (((a) >> 1) & 0x0f)
62#define GET_TIE_BREAKER(a) (((a)) & 0x01)
63#else
64/* #define FORCE_P2P_CLIENT */
65#endif
66#endif
67
68#define nl80211_SCAN_RESULT_EXPIRE (3 * HZ)
69#define SCAN_RESULT_EXPIRE (40 * HZ)
70
Johnny Kimc5c77ba2015-05-11 14:30:56 +090071static const u32 cipher_suites[] = {
72 WLAN_CIPHER_SUITE_WEP40,
73 WLAN_CIPHER_SUITE_WEP104,
74 WLAN_CIPHER_SUITE_TKIP,
75 WLAN_CIPHER_SUITE_CCMP,
76 WLAN_CIPHER_SUITE_AES_CMAC,
77};
Johnny Kimc5c77ba2015-05-11 14:30:56 +090078
Johnny Kimc5c77ba2015-05-11 14:30:56 +090079static const struct ieee80211_txrx_stypes
Sasha Levinadf1b352015-05-28 11:03:56 -040080 wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES] = {
Johnny Kimc5c77ba2015-05-11 14:30:56 +090081 [NL80211_IFTYPE_STATION] = {
82 .tx = 0xffff,
83 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
84 BIT(IEEE80211_STYPE_PROBE_REQ >> 4)
85 },
86 [NL80211_IFTYPE_AP] = {
87 .tx = 0xffff,
88 .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
89 BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
90 BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
91 BIT(IEEE80211_STYPE_DISASSOC >> 4) |
92 BIT(IEEE80211_STYPE_AUTH >> 4) |
93 BIT(IEEE80211_STYPE_DEAUTH >> 4) |
94 BIT(IEEE80211_STYPE_ACTION >> 4)
95 },
96 [NL80211_IFTYPE_P2P_CLIENT] = {
97 .tx = 0xffff,
98 .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
99 BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
100 BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) |
101 BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) |
102 BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
103 BIT(IEEE80211_STYPE_DISASSOC >> 4) |
104 BIT(IEEE80211_STYPE_AUTH >> 4) |
105 BIT(IEEE80211_STYPE_DEAUTH >> 4)
106 }
107};
Arnd Bergmanne5af0562015-05-29 22:52:12 +0200108
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900109/* Time to stay on the channel */
110#define WILC_WFI_DWELL_PASSIVE 100
111#define WILC_WFI_DWELL_ACTIVE 40
112
113struct wireless_dev *WILC_WFI_CfgAlloc(void);
114struct wireless_dev *WILC_WFI_WiphyRegister(struct net_device *net);
115void WILC_WFI_WiphyFree(struct net_device *net);
116int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed);
117int WILC_WFI_DeInitHostInt(struct net_device *net);
118int WILC_WFI_InitHostInt(struct net_device *net);
119void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size);
120int WILC_WFI_deinit_mon_interface(void);
Arnd Bergmann057d1e92015-06-01 21:06:44 +0200121struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev);
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900122
123#ifdef TCP_ENHANCEMENTS
124#define TCP_ACK_FILTER_LINK_SPEED_THRESH 54
125#define DEFAULT_LINK_SPEED 72
Joe Perchesb3ff2912015-08-10 14:51:33 -0700126void Enable_TCP_ACK_Filter(bool value);
Johnny Kimc5c77ba2015-05-11 14:30:56 +0900127#endif
128
129#endif