Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 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 | #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 Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 71 | static 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 Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 78 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 79 | static const struct ieee80211_txrx_stypes |
Sasha Levin | adf1b35 | 2015-05-28 11:03:56 -0400 | [diff] [blame] | 80 | wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES] = { |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 81 | [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 Bergmann | e5af056 | 2015-05-29 22:52:12 +0200 | [diff] [blame] | 108 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 109 | /* Time to stay on the channel */ |
| 110 | #define WILC_WFI_DWELL_PASSIVE 100 |
| 111 | #define WILC_WFI_DWELL_ACTIVE 40 |
| 112 | |
| 113 | struct wireless_dev *WILC_WFI_CfgAlloc(void); |
| 114 | struct wireless_dev *WILC_WFI_WiphyRegister(struct net_device *net); |
| 115 | void WILC_WFI_WiphyFree(struct net_device *net); |
| 116 | int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed); |
| 117 | int WILC_WFI_DeInitHostInt(struct net_device *net); |
| 118 | int WILC_WFI_InitHostInt(struct net_device *net); |
| 119 | void WILC_WFI_monitor_rx(uint8_t *buff, uint32_t size); |
| 120 | int WILC_WFI_deinit_mon_interface(void); |
Arnd Bergmann | 057d1e9 | 2015-06-01 21:06:44 +0200 | [diff] [blame] | 121 | struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 122 | |
| 123 | #ifdef TCP_ENHANCEMENTS |
| 124 | #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54 |
| 125 | #define DEFAULT_LINK_SPEED 72 |
Joe Perches | b3ff291 | 2015-08-10 14:51:33 -0700 | [diff] [blame] | 126 | void Enable_TCP_ACK_Filter(bool value); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 127 | #endif |
| 128 | |
| 129 | #endif |