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 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 13 | /* The following macros describe the bitfield map used by the firmware to determine its 11i mode */ |
Chaehyun Lim | f57fb21 | 2015-09-15 14:06:19 +0900 | [diff] [blame] | 14 | #define NO_ENCRYPT 0 |
| 15 | #define ENCRYPT_ENABLED BIT(0) |
| 16 | #define WEP BIT(1) |
| 17 | #define WEP_EXTENDED BIT(2) |
| 18 | #define WPA BIT(3) |
| 19 | #define WPA2 BIT(4) |
| 20 | #define AES BIT(5) |
| 21 | #define TKIP BIT(6) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 22 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 23 | /*Public action frame index IDs*/ |
Chaehyun Lim | 1130fec | 2015-09-15 14:06:28 +0900 | [diff] [blame] | 24 | #define FRAME_TYPE_ID 0 |
| 25 | #define ACTION_CAT_ID 24 |
| 26 | #define ACTION_SUBTYPE_ID 25 |
| 27 | #define P2P_PUB_ACTION_SUBTYPE 30 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 28 | |
| 29 | /*Public action frame Attribute IDs*/ |
Chaehyun Lim | 1130fec | 2015-09-15 14:06:28 +0900 | [diff] [blame] | 30 | #define ACTION_FRAME 0xd0 |
| 31 | #define GO_INTENT_ATTR_ID 0x04 |
| 32 | #define CHANLIST_ATTR_ID 0x0b |
| 33 | #define OPERCHAN_ATTR_ID 0x11 |
| 34 | #define PUB_ACTION_ATTR_ID 0x04 |
| 35 | #define P2PELEM_ATTR_ID 0xdd |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 36 | |
| 37 | /*Public action subtype values*/ |
Chaehyun Lim | 1130fec | 2015-09-15 14:06:28 +0900 | [diff] [blame] | 38 | #define GO_NEG_REQ 0x00 |
| 39 | #define GO_NEG_RSP 0x01 |
| 40 | #define GO_NEG_CONF 0x02 |
| 41 | #define P2P_INV_REQ 0x03 |
| 42 | #define P2P_INV_RSP 0x04 |
| 43 | #define PUBLIC_ACT_VENDORSPEC 0x09 |
| 44 | #define GAS_INTIAL_REQ 0x0a |
| 45 | #define GAS_INTIAL_RSP 0x0b |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 46 | |
Chaehyun Lim | 1130fec | 2015-09-15 14:06:28 +0900 | [diff] [blame] | 47 | #define INVALID_CHANNEL 0 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 48 | |
| 49 | #define nl80211_SCAN_RESULT_EXPIRE (3 * HZ) |
Chaehyun Lim | 1130fec | 2015-09-15 14:06:28 +0900 | [diff] [blame] | 50 | #define SCAN_RESULT_EXPIRE (40 * HZ) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 51 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 52 | static const u32 cipher_suites[] = { |
| 53 | WLAN_CIPHER_SUITE_WEP40, |
| 54 | WLAN_CIPHER_SUITE_WEP104, |
| 55 | WLAN_CIPHER_SUITE_TKIP, |
| 56 | WLAN_CIPHER_SUITE_CCMP, |
| 57 | WLAN_CIPHER_SUITE_AES_CMAC, |
| 58 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 59 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 60 | static const struct ieee80211_txrx_stypes |
Sasha Levin | adf1b35 | 2015-05-28 11:03:56 -0400 | [diff] [blame] | 61 | wilc_wfi_cfg80211_mgmt_types[NUM_NL80211_IFTYPES] = { |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 62 | [NL80211_IFTYPE_STATION] = { |
| 63 | .tx = 0xffff, |
| 64 | .rx = BIT(IEEE80211_STYPE_ACTION >> 4) | |
| 65 | BIT(IEEE80211_STYPE_PROBE_REQ >> 4) |
| 66 | }, |
| 67 | [NL80211_IFTYPE_AP] = { |
| 68 | .tx = 0xffff, |
| 69 | .rx = BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) | |
| 70 | BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) | |
| 71 | BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | |
| 72 | BIT(IEEE80211_STYPE_DISASSOC >> 4) | |
| 73 | BIT(IEEE80211_STYPE_AUTH >> 4) | |
| 74 | BIT(IEEE80211_STYPE_DEAUTH >> 4) | |
| 75 | BIT(IEEE80211_STYPE_ACTION >> 4) |
| 76 | }, |
| 77 | [NL80211_IFTYPE_P2P_CLIENT] = { |
| 78 | .tx = 0xffff, |
| 79 | .rx = BIT(IEEE80211_STYPE_ACTION >> 4) | |
| 80 | BIT(IEEE80211_STYPE_PROBE_REQ >> 4) | |
| 81 | BIT(IEEE80211_STYPE_ASSOC_REQ >> 4) | |
| 82 | BIT(IEEE80211_STYPE_REASSOC_REQ >> 4) | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 83 | BIT(IEEE80211_STYPE_DISASSOC >> 4) | |
| 84 | BIT(IEEE80211_STYPE_AUTH >> 4) | |
| 85 | BIT(IEEE80211_STYPE_DEAUTH >> 4) |
| 86 | } |
| 87 | }; |
Arnd Bergmann | e5af056 | 2015-05-29 22:52:12 +0200 | [diff] [blame] | 88 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 89 | /* Time to stay on the channel */ |
| 90 | #define WILC_WFI_DWELL_PASSIVE 100 |
| 91 | #define WILC_WFI_DWELL_ACTIVE 40 |
| 92 | |
| 93 | struct wireless_dev *WILC_WFI_CfgAlloc(void); |
Chaehyun Lim | 8459fd5 | 2015-09-20 15:51:09 +0900 | [diff] [blame] | 94 | struct wireless_dev *wilc_create_wiphy(struct net_device *net); |
Chaehyun Lim | 96da20a | 2015-09-20 15:51:08 +0900 | [diff] [blame] | 95 | void wilc_free_wiphy(struct net_device *net); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 96 | int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed); |
Chaehyun Lim | a9a1682 | 2015-09-20 15:51:24 +0900 | [diff] [blame] | 97 | int wilc_deinit_host_int(struct net_device *net); |
Chaehyun Lim | dd4b6a8 | 2015-09-20 15:51:25 +0900 | [diff] [blame] | 98 | int wilc_init_host_int(struct net_device *net); |
Chaehyun Lim | fbc2fe1 | 2015-09-15 14:06:16 +0900 | [diff] [blame] | 99 | void WILC_WFI_monitor_rx(u8 *buff, u32 size); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 100 | int WILC_WFI_deinit_mon_interface(void); |
Arnd Bergmann | 057d1e9 | 2015-06-01 21:06:44 +0200 | [diff] [blame] | 101 | struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev); |
Chaehyun Lim | 8e0735c | 2015-09-20 15:51:16 +0900 | [diff] [blame] | 102 | void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 103 | u16 frame_type, bool reg); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 104 | |
Chaehyun Lim | 1130fec | 2015-09-15 14:06:28 +0900 | [diff] [blame] | 105 | #define TCP_ACK_FILTER_LINK_SPEED_THRESH 54 |
| 106 | #define DEFAULT_LINK_SPEED 72 |
Joe Perches | b3ff291 | 2015-08-10 14:51:33 -0700 | [diff] [blame] | 107 | void Enable_TCP_ACK_Filter(bool value); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 108 | |
| 109 | #endif |