Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 1 | #ifndef HOST_INT_H |
| 2 | #define HOST_INT_H |
| 3 | |
| 4 | #include "coreconfigurator.h" |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 5 | |
| 6 | #define IP_ALEN 4 |
| 7 | |
Johnny Kim | c590b9a | 2015-09-08 17:07:59 +0900 | [diff] [blame] | 8 | #define IDLE_MODE 0x00 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 9 | #define AP_MODE 0x01 |
| 10 | #define STATION_MODE 0x02 |
Chaehyun Lim | 568ab19 | 2015-09-15 14:06:22 +0900 | [diff] [blame] | 11 | #define GO_MODE 0x03 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 12 | #define CLIENT_MODE 0x04 |
Leo Kim | c81f7de | 2015-10-29 12:05:28 +0900 | [diff] [blame] | 13 | #define ACTION 0xD0 |
| 14 | #define PROBE_REQ 0x40 |
| 15 | #define PROBE_RESP 0x50 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 16 | |
Leo Kim | c81f7de | 2015-10-29 12:05:28 +0900 | [diff] [blame] | 17 | #define ACTION_FRM_IDX 0 |
| 18 | #define PROBE_REQ_IDX 1 |
Chaehyun Lim | 568ab19 | 2015-09-15 14:06:22 +0900 | [diff] [blame] | 19 | #define MAX_NUM_STA 9 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 20 | #define ACTIVE_SCAN_TIME 10 |
| 21 | #define PASSIVE_SCAN_TIME 1200 |
| 22 | #define MIN_SCAN_TIME 10 |
| 23 | #define MAX_SCAN_TIME 1200 |
| 24 | #define DEFAULT_SCAN 0 |
Chaehyun Lim | af080e0 | 2015-09-15 14:06:20 +0900 | [diff] [blame] | 25 | #define USER_SCAN BIT(0) |
| 26 | #define OBSS_PERIODIC_SCAN BIT(1) |
| 27 | #define OBSS_ONETIME_SCAN BIT(2) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 28 | #define GTK_RX_KEY_BUFF_LEN 24 |
Chaehyun Lim | 568ab19 | 2015-09-15 14:06:22 +0900 | [diff] [blame] | 29 | #define ADDKEY 0x1 |
| 30 | #define REMOVEKEY 0x2 |
| 31 | #define DEFAULTKEY 0x4 |
| 32 | #define ADDKEY_AP 0x8 |
Chaehyun Lim | 30b2ba09 | 2015-10-02 16:41:15 +0900 | [diff] [blame] | 33 | #define MAX_NUM_SCANNED_NETWORKS 100 |
Chaehyun Lim | 568ab19 | 2015-09-15 14:06:22 +0900 | [diff] [blame] | 34 | #define MAX_NUM_SCANNED_NETWORKS_SHADOW 130 |
Chaehyun Lim | 30b2ba09 | 2015-10-02 16:41:15 +0900 | [diff] [blame] | 35 | #define MAX_NUM_PROBED_SSID 10 |
| 36 | #define CHANNEL_SCAN_TIME 250 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 37 | |
| 38 | #define TX_MIC_KEY_LEN 8 |
| 39 | #define RX_MIC_KEY_LEN 8 |
Chaehyun Lim | 568ab19 | 2015-09-15 14:06:22 +0900 | [diff] [blame] | 40 | #define PTK_KEY_LEN 16 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 41 | |
| 42 | #define TX_MIC_KEY_MSG_LEN 26 |
| 43 | #define RX_MIC_KEY_MSG_LEN 48 |
| 44 | #define PTK_KEY_MSG_LEN 39 |
| 45 | |
| 46 | #define PMKSA_KEY_LEN 22 |
Chaehyun Lim | 568ab19 | 2015-09-15 14:06:22 +0900 | [diff] [blame] | 47 | #define ETH_ALEN 6 |
| 48 | #define PMKID_LEN 16 |
| 49 | #define WILC_MAX_NUM_PMKIDS 16 |
| 50 | #define WILC_SUPP_MCS_SET_SIZE 16 |
Chaehyun Lim | 30b2ba09 | 2015-10-02 16:41:15 +0900 | [diff] [blame] | 51 | #define WILC_ADD_STA_LENGTH 40 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 52 | #define SCAN_EVENT_DONE_ABORTED |
Chaehyun Lim | 568ab19 | 2015-09-15 14:06:22 +0900 | [diff] [blame] | 53 | #define NUM_CONCURRENT_IFC 2 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 54 | |
Leo Kim | 03e7b9c | 2015-10-12 16:55:58 +0900 | [diff] [blame] | 55 | struct rf_info { |
Leo Kim | 5babeec | 2015-10-29 12:05:29 +0900 | [diff] [blame] | 56 | u8 link_speed; |
Leo Kim | 00c8dfc | 2015-10-29 12:05:30 +0900 | [diff] [blame] | 57 | s8 rssi; |
Leo Kim | 7e84ff4 | 2015-10-29 12:05:31 +0900 | [diff] [blame] | 58 | u32 tx_cnt; |
Leo Kim | 9b99274 | 2015-10-29 12:05:32 +0900 | [diff] [blame] | 59 | u32 rx_cnt; |
Leo Kim | 5416037 | 2015-10-29 12:05:33 +0900 | [diff] [blame] | 60 | u32 tx_fail_cnt; |
Leo Kim | 03e7b9c | 2015-10-12 16:55:58 +0900 | [diff] [blame] | 61 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 62 | |
Leo Kim | db9f1b1 | 2015-10-12 16:55:53 +0900 | [diff] [blame] | 63 | enum host_if_state { |
Chaehyun Lim | df94ed25 | 2015-09-15 14:06:23 +0900 | [diff] [blame] | 64 | HOST_IF_IDLE = 0, |
| 65 | HOST_IF_SCANNING = 1, |
| 66 | HOST_IF_CONNECTING = 2, |
| 67 | HOST_IF_WAITING_CONN_RESP = 3, |
| 68 | HOST_IF_CONNECTED = 4, |
| 69 | HOST_IF_P2P_LISTEN = 5, |
| 70 | HOST_IF_FORCE_32BIT = 0xFFFFFFFF |
Leo Kim | db9f1b1 | 2015-10-12 16:55:53 +0900 | [diff] [blame] | 71 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 72 | |
Leo Kim | cd1e6cb | 2015-10-05 15:25:45 +0900 | [diff] [blame] | 73 | struct host_if_pmkid { |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 74 | u8 bssid[ETH_ALEN]; |
| 75 | u8 pmkid[PMKID_LEN]; |
Leo Kim | cd1e6cb | 2015-10-05 15:25:45 +0900 | [diff] [blame] | 76 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 77 | |
Leo Kim | a949f90 | 2015-10-05 15:25:44 +0900 | [diff] [blame] | 78 | struct host_if_pmkid_attr { |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 79 | u8 numpmkid; |
Leo Kim | cd1e6cb | 2015-10-05 15:25:45 +0900 | [diff] [blame] | 80 | struct host_if_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS]; |
Leo Kim | a949f90 | 2015-10-05 15:25:44 +0900 | [diff] [blame] | 81 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 82 | |
Leo Kim | 430a78c | 2015-10-05 15:25:48 +0900 | [diff] [blame] | 83 | enum CURRENT_TXRATE { |
Chaehyun Lim | df94ed25 | 2015-09-15 14:06:23 +0900 | [diff] [blame] | 84 | AUTORATE = 0, |
| 85 | MBPS_1 = 1, |
| 86 | MBPS_2 = 2, |
| 87 | MBPS_5_5 = 5, |
| 88 | MBPS_11 = 11, |
| 89 | MBPS_6 = 6, |
| 90 | MBPS_9 = 9, |
| 91 | MBPS_12 = 12, |
| 92 | MBPS_18 = 18, |
| 93 | MBPS_24 = 24, |
| 94 | MBPS_36 = 36, |
| 95 | MBPS_48 = 48, |
| 96 | MBPS_54 = 54 |
Leo Kim | 430a78c | 2015-10-05 15:25:48 +0900 | [diff] [blame] | 97 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 98 | |
Leo Kim | 9529650 | 2015-10-05 15:25:46 +0900 | [diff] [blame] | 99 | struct cfg_param_val { |
Tony Cho | 87c05b2 | 2015-10-12 16:56:07 +0900 | [diff] [blame] | 100 | u32 flag; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 101 | u8 ht_enable; |
| 102 | u8 bss_type; |
| 103 | u8 auth_type; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 104 | u16 auth_timeout; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 105 | u8 power_mgmt_mode; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 106 | u16 short_retry_limit; |
| 107 | u16 long_retry_limit; |
| 108 | u16 frag_threshold; |
| 109 | u16 rts_threshold; |
| 110 | u16 preamble_type; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 111 | u8 short_slot_allowed; |
| 112 | u8 txop_prot_disabled; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 113 | u16 beacon_interval; |
| 114 | u16 dtim_period; |
Leo Kim | 073b8d0 | 2015-10-05 15:25:47 +0900 | [diff] [blame] | 115 | enum SITESURVEY site_survey_enabled; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 116 | u16 site_survey_scan_time; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 117 | u8 scan_source; |
Chaehyun Lim | d85f532 | 2015-06-11 14:35:54 +0900 | [diff] [blame] | 118 | u16 active_scan_time; |
| 119 | u16 passive_scan_time; |
Leo Kim | 430a78c | 2015-10-05 15:25:48 +0900 | [diff] [blame] | 120 | enum CURRENT_TXRATE curr_tx_rate; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 121 | |
Leo Kim | 9529650 | 2015-10-05 15:25:46 +0900 | [diff] [blame] | 122 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 123 | |
Leo Kim | 200ac21 | 2015-10-12 16:56:00 +0900 | [diff] [blame] | 124 | enum cfg_param { |
Anish Bhatt | ffda203 | 2015-09-29 12:15:49 -0700 | [diff] [blame] | 125 | RETRY_SHORT = BIT(0), |
| 126 | RETRY_LONG = BIT(1), |
| 127 | FRAG_THRESHOLD = BIT(2), |
| 128 | RTS_THRESHOLD = BIT(3), |
| 129 | BSS_TYPE = BIT(4), |
| 130 | AUTH_TYPE = BIT(5), |
| 131 | AUTHEN_TIMEOUT = BIT(6), |
| 132 | POWER_MANAGEMENT = BIT(7), |
| 133 | PREAMBLE = BIT(8), |
| 134 | SHORT_SLOT_ALLOWED = BIT(9), |
| 135 | TXOP_PROT_DISABLE = BIT(10), |
| 136 | BEACON_INTERVAL = BIT(11), |
| 137 | DTIM_PERIOD = BIT(12), |
| 138 | SITE_SURVEY = BIT(13), |
| 139 | SITE_SURVEY_SCAN_TIME = BIT(14), |
| 140 | ACTIVE_SCANTIME = BIT(15), |
| 141 | PASSIVE_SCANTIME = BIT(16), |
| 142 | CURRENT_TX_RATE = BIT(17), |
| 143 | HT_ENABLE = BIT(18), |
Leo Kim | 200ac21 | 2015-10-12 16:56:00 +0900 | [diff] [blame] | 144 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 145 | |
Leo Kim | 73735e4 | 2015-10-12 16:55:54 +0900 | [diff] [blame] | 146 | struct found_net_info { |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 147 | u8 au8bssid[6]; |
Chaehyun Lim | ca356ad | 2015-06-11 14:35:57 +0900 | [diff] [blame] | 148 | s8 s8rssi; |
Leo Kim | 73735e4 | 2015-10-12 16:55:54 +0900 | [diff] [blame] | 149 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 150 | |
Leo Kim | 1ec3815 | 2015-10-12 16:55:59 +0900 | [diff] [blame] | 151 | enum scan_event { |
| 152 | SCAN_EVENT_NETWORK_FOUND = 0, |
| 153 | SCAN_EVENT_DONE = 1, |
| 154 | SCAN_EVENT_ABORTED = 2, |
| 155 | SCAN_EVENT_FORCE_32BIT = 0xFFFFFFFF |
| 156 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 157 | |
Leo Kim | ed3f037 | 2015-10-12 16:56:01 +0900 | [diff] [blame] | 158 | enum conn_event { |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 159 | CONN_DISCONN_EVENT_CONN_RESP = 0, |
| 160 | CONN_DISCONN_EVENT_DISCONN_NOTIF = 1, |
Chaehyun Lim | df94ed25 | 2015-09-15 14:06:23 +0900 | [diff] [blame] | 161 | CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF |
Leo Kim | ed3f037 | 2015-10-12 16:56:01 +0900 | [diff] [blame] | 162 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 163 | |
Leo Kim | b9d9633 | 2015-10-05 15:25:40 +0900 | [diff] [blame] | 164 | enum KEY_TYPE { |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 165 | WEP, |
Leo Kim | 5cd8f7a | 2015-10-29 12:05:34 +0900 | [diff] [blame] | 166 | WPA_RX_GTK, |
Leo Kim | 2141fe3 | 2015-10-29 12:05:35 +0900 | [diff] [blame] | 167 | WPA_PTK, |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 168 | PMKSA, |
Leo Kim | b9d9633 | 2015-10-05 15:25:40 +0900 | [diff] [blame] | 169 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 170 | |
Leo Kim | 1ec3815 | 2015-10-12 16:55:59 +0900 | [diff] [blame] | 171 | typedef void (*wilc_scan_result)(enum scan_event, tstrNetworkInfo *, |
| 172 | void *, void *); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 173 | |
Leo Kim | ed3f037 | 2015-10-12 16:56:01 +0900 | [diff] [blame] | 174 | typedef void (*wilc_connect_result)(enum conn_event, |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 175 | tstrConnectInfo *, |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 176 | u8, |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 177 | tstrDisconnectNotifInfo *, |
| 178 | void *); |
| 179 | |
Leo Kim | e3e7e8a | 2015-10-29 11:58:37 +0900 | [diff] [blame] | 180 | typedef void (*wilc_remain_on_chan_expired)(void *, u32); |
| 181 | typedef void (*wilc_remain_on_chan_ready)(void *); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 182 | |
Tony Cho | 3bbd59f | 2015-09-21 12:16:38 +0900 | [diff] [blame] | 183 | struct rcvd_net_info { |
Leo Kim | b021b80 | 2015-10-13 20:02:10 +0900 | [diff] [blame] | 184 | u8 *buffer; |
Leo Kim | 3bffac6 | 2015-10-13 20:02:11 +0900 | [diff] [blame] | 185 | u32 len; |
Tony Cho | 3bbd59f | 2015-09-21 12:16:38 +0900 | [diff] [blame] | 186 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 187 | |
Leo Kim | ad61fce | 2015-10-12 16:55:55 +0900 | [diff] [blame] | 188 | struct hidden_net_info { |
Chaehyun Lim | 8c6492a | 2016-01-05 13:26:30 +0900 | [diff] [blame] | 189 | u8 *ssid; |
Chaehyun Lim | a2d4969 | 2016-01-05 13:26:31 +0900 | [diff] [blame^] | 190 | u8 ssid_len; |
Leo Kim | ad61fce | 2015-10-12 16:55:55 +0900 | [diff] [blame] | 191 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 192 | |
Leo Kim | 607db44 | 2015-10-05 15:25:37 +0900 | [diff] [blame] | 193 | struct hidden_network { |
Leo Kim | ad61fce | 2015-10-12 16:55:55 +0900 | [diff] [blame] | 194 | struct hidden_net_info *pstrHiddenNetworkInfo; |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 195 | u8 u8ssidnum; |
Leo Kim | 607db44 | 2015-10-05 15:25:37 +0900 | [diff] [blame] | 196 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 197 | |
Leo Kim | b4fe59d | 2015-10-12 16:55:51 +0900 | [diff] [blame] | 198 | struct user_scan_req { |
Leo Kim | bc80185 | 2015-10-29 11:58:50 +0900 | [diff] [blame] | 199 | wilc_scan_result scan_result; |
Leo Kim | 66eaea3 | 2015-10-29 11:58:51 +0900 | [diff] [blame] | 200 | void *arg; |
Leo Kim | f79756e | 2015-10-29 12:05:36 +0900 | [diff] [blame] | 201 | u32 rcvd_ch_cnt; |
Leo Kim | af973f3 | 2015-10-29 11:58:52 +0900 | [diff] [blame] | 202 | struct found_net_info net_info[MAX_NUM_SCANNED_NETWORKS]; |
Leo Kim | b4fe59d | 2015-10-12 16:55:51 +0900 | [diff] [blame] | 203 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 204 | |
Leo Kim | c944a4e | 2015-10-12 16:55:52 +0900 | [diff] [blame] | 205 | struct user_conn_req { |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 206 | u8 *pu8bssid; |
| 207 | u8 *pu8ssid; |
| 208 | u8 u8security; |
Leo Kim | 7d06972 | 2015-10-29 12:05:37 +0900 | [diff] [blame] | 209 | enum AUTHTYPE auth_type; |
Leo Kim | 74ab5e4 | 2015-10-29 11:58:53 +0900 | [diff] [blame] | 210 | size_t ssid_len; |
Leo Kim | a3b2f4b | 2015-10-29 11:58:54 +0900 | [diff] [blame] | 211 | u8 *ies; |
Leo Kim | 331ed08 | 2015-10-29 11:58:55 +0900 | [diff] [blame] | 212 | size_t ies_len; |
Leo Kim | 33bfb19 | 2015-10-29 11:58:56 +0900 | [diff] [blame] | 213 | wilc_connect_result conn_result; |
Leo Kim | ff06982 | 2015-10-29 12:05:26 +0900 | [diff] [blame] | 214 | bool ht_capable; |
Leo Kim | 73abaa4 | 2015-10-29 12:05:27 +0900 | [diff] [blame] | 215 | void *arg; |
Leo Kim | c944a4e | 2015-10-12 16:55:52 +0900 | [diff] [blame] | 216 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 217 | |
Tony Cho | 127f9d9 | 2015-09-21 12:16:51 +0900 | [diff] [blame] | 218 | struct drv_handler { |
Leo Kim | a7f3b12 | 2015-10-28 15:59:29 +0900 | [diff] [blame] | 219 | u32 handler; |
Tony Cho | 127f9d9 | 2015-09-21 12:16:51 +0900 | [diff] [blame] | 220 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 221 | |
Tony Cho | 801bee5 | 2015-09-21 12:16:53 +0900 | [diff] [blame] | 222 | struct op_mode { |
Leo Kim | c96debf | 2015-10-28 15:59:30 +0900 | [diff] [blame] | 223 | u32 mode; |
Tony Cho | 801bee5 | 2015-09-21 12:16:53 +0900 | [diff] [blame] | 224 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 225 | |
Tony Cho | b7611a8 | 2015-09-21 12:16:54 +0900 | [diff] [blame] | 226 | struct set_mac_addr { |
Leo Kim | ae5e452 | 2015-10-28 15:59:31 +0900 | [diff] [blame] | 227 | u8 mac_addr[ETH_ALEN]; |
Tony Cho | b7611a8 | 2015-09-21 12:16:54 +0900 | [diff] [blame] | 228 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 229 | |
Tony Cho | fcd27c5 | 2015-09-21 12:16:55 +0900 | [diff] [blame] | 230 | struct get_mac_addr { |
Leo Kim | 6ceba0a | 2015-10-28 15:59:32 +0900 | [diff] [blame] | 231 | u8 *mac_addr; |
Tony Cho | fcd27c5 | 2015-09-21 12:16:55 +0900 | [diff] [blame] | 232 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 233 | |
Tony Cho | 5426547 | 2015-09-21 12:16:56 +0900 | [diff] [blame] | 234 | struct ba_session_info { |
Leo Kim | 3fc4999 | 2015-10-29 11:58:45 +0900 | [diff] [blame] | 235 | u8 bssid[ETH_ALEN]; |
Leo Kim | 16c9b39 | 2015-10-29 11:58:46 +0900 | [diff] [blame] | 236 | u8 tid; |
Leo Kim | 277c213 | 2015-10-29 11:58:47 +0900 | [diff] [blame] | 237 | u16 buf_size; |
Leo Kim | 23d0bfa | 2015-10-29 11:58:48 +0900 | [diff] [blame] | 238 | u16 time_out; |
Tony Cho | 5426547 | 2015-09-21 12:16:56 +0900 | [diff] [blame] | 239 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 240 | |
Tony Cho | 2f9c03f | 2015-09-21 12:16:58 +0900 | [diff] [blame] | 241 | struct remain_ch { |
Leo Kim | 839ab70 | 2015-10-29 11:58:41 +0900 | [diff] [blame] | 242 | u16 ch; |
Chaehyun Lim | fb6e068 | 2016-01-03 17:35:33 +0900 | [diff] [blame] | 243 | u32 duration; |
Leo Kim | bfb62ab | 2015-10-29 11:58:42 +0900 | [diff] [blame] | 244 | wilc_remain_on_chan_expired expired; |
Leo Kim | 5e5f791 | 2015-10-29 11:58:43 +0900 | [diff] [blame] | 245 | wilc_remain_on_chan_ready ready; |
Leo Kim | c5cc4b1 | 2015-10-29 11:58:44 +0900 | [diff] [blame] | 246 | void *arg; |
Leo Kim | 9d764e3 | 2015-10-29 12:05:38 +0900 | [diff] [blame] | 247 | u32 id; |
Tony Cho | 2f9c03f | 2015-09-21 12:16:58 +0900 | [diff] [blame] | 248 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 249 | |
Tony Cho | bc37c5d | 2015-09-21 12:16:59 +0900 | [diff] [blame] | 250 | struct reg_frame { |
Leo Kim | 6abf868 | 2015-10-29 11:58:38 +0900 | [diff] [blame] | 251 | bool reg; |
Leo Kim | d5f654c | 2015-10-29 11:58:39 +0900 | [diff] [blame] | 252 | u16 frame_type; |
Leo Kim | bcb410b | 2015-10-29 11:58:40 +0900 | [diff] [blame] | 253 | u8 reg_id; |
Tony Cho | bc37c5d | 2015-09-21 12:16:59 +0900 | [diff] [blame] | 254 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 255 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 256 | enum p2p_listen_state { |
| 257 | P2P_IDLE, |
| 258 | P2P_LISTEN, |
| 259 | P2P_GRP_FORMATION |
| 260 | }; |
| 261 | |
Glen Lee | b82d940 | 2015-11-18 15:11:32 +0900 | [diff] [blame] | 262 | struct wilc; |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 263 | struct host_if_drv { |
Leo Kim | 70793b2 | 2015-10-28 15:59:33 +0900 | [diff] [blame] | 264 | struct user_scan_req usr_scan_req; |
Leo Kim | f8b1713 | 2015-10-28 15:59:34 +0900 | [diff] [blame] | 265 | struct user_conn_req usr_conn_req; |
Leo Kim | d61f8e1 | 2015-10-28 15:59:35 +0900 | [diff] [blame] | 266 | struct remain_ch remain_on_ch; |
Leo Kim | 5beef2c | 2015-10-28 15:59:36 +0900 | [diff] [blame] | 267 | u8 remain_on_ch_pending; |
Leo Kim | 1229b1a | 2015-10-29 12:05:39 +0900 | [diff] [blame] | 268 | u64 p2p_timeout; |
Leo Kim | ab16ec0 | 2015-10-29 12:05:40 +0900 | [diff] [blame] | 269 | u8 p2p_connect; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 270 | |
Leo Kim | b60005a | 2015-10-29 11:58:24 +0900 | [diff] [blame] | 271 | enum host_if_state hif_state; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 272 | |
Leo Kim | 2a4eded | 2015-10-29 11:58:25 +0900 | [diff] [blame] | 273 | u8 assoc_bssid[ETH_ALEN]; |
Leo Kim | ace303f | 2015-10-29 11:58:26 +0900 | [diff] [blame] | 274 | struct cfg_param_val cfg_values; |
Leo Kim | 33110ad | 2015-10-29 11:58:27 +0900 | [diff] [blame] | 275 | |
| 276 | struct semaphore sem_cfg_values; |
Leo Kim | 9ea4713 | 2015-10-29 11:58:28 +0900 | [diff] [blame] | 277 | struct semaphore sem_test_key_block; |
Leo Kim | e55e496 | 2015-10-29 11:58:29 +0900 | [diff] [blame] | 278 | struct semaphore sem_test_disconn_block; |
Leo Kim | 7e111f9 | 2015-10-29 11:58:30 +0900 | [diff] [blame] | 279 | struct semaphore sem_get_rssi; |
Leo Kim | bc34da6 | 2015-10-29 11:58:31 +0900 | [diff] [blame] | 280 | struct semaphore sem_get_link_speed; |
Leo Kim | 4ea9000 | 2015-10-29 11:58:32 +0900 | [diff] [blame] | 281 | struct semaphore sem_get_chnl; |
Leo Kim | 569a3c6 | 2015-10-29 11:58:33 +0900 | [diff] [blame] | 282 | struct semaphore sem_inactive_time; |
Leo Kim | 13b313e | 2015-10-29 11:58:34 +0900 | [diff] [blame] | 283 | |
| 284 | struct timer_list scan_timer; |
Leo Kim | 81a5950 | 2015-10-29 11:58:35 +0900 | [diff] [blame] | 285 | struct timer_list connect_timer; |
Leo Kim | cc2d7e9 | 2015-10-29 11:58:36 +0900 | [diff] [blame] | 286 | struct timer_list remain_on_ch_timer; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 287 | |
Dean Lee | 72ed4dc | 2015-06-12 14:11:44 +0900 | [diff] [blame] | 288 | bool IFC_UP; |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 289 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 290 | |
Tony Cho | 6a89ba9 | 2015-09-21 12:16:46 +0900 | [diff] [blame] | 291 | struct add_sta_param { |
Leo Kim | 2353c38 | 2015-10-29 12:05:41 +0900 | [diff] [blame] | 292 | u8 bssid[ETH_ALEN]; |
Leo Kim | 4101eb8 | 2015-10-29 12:05:42 +0900 | [diff] [blame] | 293 | u16 aid; |
Leo Kim | e734223 | 2015-10-29 12:05:43 +0900 | [diff] [blame] | 294 | u8 rates_len; |
Leo Kim | a622e01 | 2015-10-29 12:05:44 +0900 | [diff] [blame] | 295 | const u8 *rates; |
Leo Kim | 2252012 | 2015-10-29 12:05:45 +0900 | [diff] [blame] | 296 | bool ht_supported; |
Leo Kim | 0d073f6 | 2015-10-29 12:05:46 +0900 | [diff] [blame] | 297 | u16 ht_capa_info; |
Leo Kim | fba1f2d | 2015-10-29 12:05:47 +0900 | [diff] [blame] | 298 | u8 ht_ampdu_params; |
Leo Kim | 5ebbf4f | 2015-10-29 12:05:48 +0900 | [diff] [blame] | 299 | u8 ht_supp_mcs_set[16]; |
Leo Kim | 223741d | 2015-10-29 12:05:49 +0900 | [diff] [blame] | 300 | u16 ht_ext_params; |
Leo Kim | 74fe73c | 2015-10-29 12:05:50 +0900 | [diff] [blame] | 301 | u32 ht_tx_bf_cap; |
Leo Kim | a486baf | 2015-10-29 12:05:51 +0900 | [diff] [blame] | 302 | u8 ht_ante_sel; |
Leo Kim | f676e17 | 2015-10-29 12:05:52 +0900 | [diff] [blame] | 303 | u16 flags_mask; |
Leo Kim | 67ab64e | 2015-10-29 12:05:53 +0900 | [diff] [blame] | 304 | u16 flags_set; |
Tony Cho | 6a89ba9 | 2015-09-21 12:16:46 +0900 | [diff] [blame] | 305 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 306 | |
Glen Lee | cf60106 | 2015-12-21 14:18:39 +0900 | [diff] [blame] | 307 | struct wilc_vif; |
Arnd Bergmann | 0e1af73 | 2015-11-16 15:04:54 +0100 | [diff] [blame] | 308 | s32 wilc_remove_key(struct host_if_drv *hWFIDrv, const u8 *pu8StaAddress); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 309 | int wilc_remove_wep_key(struct wilc_vif *vif, u8 index); |
| 310 | int wilc_set_wep_default_keyid(struct wilc_vif *vif, u8 index); |
| 311 | int wilc_add_wep_key_bss_sta(struct wilc_vif *vif, const u8 *key, u8 len, |
| 312 | u8 index); |
| 313 | int wilc_add_wep_key_bss_ap(struct wilc_vif *vif, const u8 *key, u8 len, |
| 314 | u8 index, u8 mode, enum AUTHTYPE auth_type); |
Chaehyun Lim | 961875e | 2015-12-22 09:48:58 +0900 | [diff] [blame] | 315 | int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len, |
| 316 | const u8 *mac_addr, const u8 *rx_mic, const u8 *tx_mic, |
| 317 | u8 mode, u8 cipher_mode, u8 index); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 318 | s32 wilc_get_inactive_time(struct wilc_vif *vif, const u8 *mac, |
| 319 | u32 *pu32InactiveTime); |
Chaehyun Lim | 9676108 | 2015-12-22 09:49:00 +0900 | [diff] [blame] | 320 | int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, |
| 321 | u8 index, u32 key_rsc_len, const u8 *key_rsc, |
| 322 | const u8 *rx_mic, const u8 *tx_mic, u8 mode, |
| 323 | u8 cipher_mode); |
Chaehyun Lim | 1ab5870 | 2015-12-22 09:49:03 +0900 | [diff] [blame] | 324 | int wilc_set_pmkid_info(struct wilc_vif *vif, |
Chaehyun Lim | 16c0cba | 2015-12-22 09:49:05 +0900 | [diff] [blame] | 325 | struct host_if_pmkid_attr *pmkid); |
Chaehyun Lim | 1eabfe3 | 2015-12-22 09:49:07 +0900 | [diff] [blame] | 326 | int wilc_get_mac_address(struct wilc_vif *vif, u8 *mac_addr); |
Chaehyun Lim | f95f480 | 2015-12-22 09:49:09 +0900 | [diff] [blame] | 327 | int wilc_set_mac_address(struct wilc_vif *vif, u8 *mac_addr); |
Arnd Bergmann | 0e1af73 | 2015-11-16 15:04:54 +0100 | [diff] [blame] | 328 | int wilc_wait_msg_queue_idle(void); |
Chaehyun Lim | f2cb5f3 | 2015-12-24 16:52:22 +0900 | [diff] [blame] | 329 | int wilc_set_join_req(struct wilc_vif *vif, u8 *bssid, const u8 *ssid, |
Chaehyun Lim | 8c38d96 | 2015-12-24 16:52:25 +0900 | [diff] [blame] | 330 | size_t ssid_len, const u8 *ies, size_t ies_len, |
Chaehyun Lim | 2ef2983 | 2015-12-24 16:52:27 +0900 | [diff] [blame] | 331 | wilc_connect_result connect_result, void *user_arg, |
Chaehyun Lim | 12a3b8b | 2015-12-24 16:52:29 +0900 | [diff] [blame] | 332 | u8 security, enum AUTHTYPE auth_type, |
Chaehyun Lim | f382b37 | 2015-12-24 16:52:31 +0900 | [diff] [blame] | 333 | u8 channel, void *join_params); |
Chaehyun Lim | 3020589 | 2015-12-24 16:52:19 +0900 | [diff] [blame] | 334 | int wilc_flush_join_req(struct wilc_vif *vif); |
Chaehyun Lim | 9f723fd | 2015-12-24 16:52:34 +0900 | [diff] [blame] | 335 | int wilc_disconnect(struct wilc_vif *vif, u16 reason_code); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 336 | int wilc_set_mac_chnl_num(struct wilc_vif *vif, u8 channel); |
Chaehyun Lim | 652bb5e | 2015-12-24 16:52:37 +0900 | [diff] [blame] | 337 | int wilc_get_rssi(struct wilc_vif *vif, s8 *rssi_level); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 338 | s32 wilc_scan(struct wilc_vif *vif, u8 u8ScanSource, u8 u8ScanType, |
| 339 | u8 *pu8ChnlFreqList, u8 u8ChnlListLen, const u8 *pu8IEs, |
| 340 | size_t IEsLen, wilc_scan_result ScanResult, void *pvUserArg, |
| 341 | struct hidden_network *pstrHiddenNetwork); |
| 342 | s32 wilc_hif_set_cfg(struct wilc_vif *vif, |
| 343 | struct cfg_param_val *pstrCfgParamVal); |
Arnd Bergmann | 0e1af73 | 2015-11-16 15:04:54 +0100 | [diff] [blame] | 344 | s32 wilc_init(struct net_device *dev, struct host_if_drv **phWFIDrv); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 345 | s32 wilc_deinit(struct wilc_vif *vif); |
Chaehyun Lim | 916935f | 2016-01-03 17:35:57 +0900 | [diff] [blame] | 346 | int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period, |
Chaehyun Lim | 733d103 | 2016-01-03 17:36:01 +0900 | [diff] [blame] | 347 | u32 head_len, u8 *head, u32 tail_len, u8 *tail); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 348 | int wilc_del_beacon(struct wilc_vif *vif); |
| 349 | int wilc_add_station(struct wilc_vif *vif, struct add_sta_param *sta_param); |
Chaehyun Lim | 2092374d | 2016-01-03 17:35:50 +0900 | [diff] [blame] | 350 | int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN]); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 351 | int wilc_del_station(struct wilc_vif *vif, const u8 *mac_addr); |
Chaehyun Lim | 4208e66 | 2016-01-03 17:35:44 +0900 | [diff] [blame] | 352 | int wilc_edit_station(struct wilc_vif *vif, |
Chaehyun Lim | 4c7abe1 | 2016-01-03 17:35:45 +0900 | [diff] [blame] | 353 | struct add_sta_param *sta_param); |
Chaehyun Lim | ecd2750 | 2015-12-30 21:15:32 +0900 | [diff] [blame] | 354 | int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout); |
Chaehyun Lim | b80c094 | 2015-12-30 21:15:35 +0900 | [diff] [blame] | 355 | int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled, |
Chaehyun Lim | 2dff2d4 | 2015-12-30 21:15:36 +0900 | [diff] [blame] | 356 | u32 count); |
Chaehyun Lim | 6964f08 | 2015-12-30 21:15:39 +0900 | [diff] [blame] | 357 | int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx); |
Chaehyun Lim | d795474 | 2016-01-03 17:35:42 +0900 | [diff] [blame] | 358 | int wilc_del_all_rx_ba_session(struct wilc_vif *vif, char *bssid, char tid); |
Chaehyun Lim | 6f7584b | 2016-01-03 17:35:35 +0900 | [diff] [blame] | 359 | int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id, |
Chaehyun Lim | d44cd45 | 2016-01-03 17:35:36 +0900 | [diff] [blame] | 360 | u32 duration, u16 chan, |
Chaehyun Lim | 95bfdd5 | 2016-01-03 17:35:37 +0900 | [diff] [blame] | 361 | wilc_remain_on_chan_expired expired, |
Chaehyun Lim | 1aae939 | 2016-01-03 17:35:38 +0900 | [diff] [blame] | 362 | wilc_remain_on_chan_ready ready, |
Chaehyun Lim | 482c433 | 2016-01-03 17:35:39 +0900 | [diff] [blame] | 363 | void *user_arg); |
Chaehyun Lim | 6b0f7cd | 2015-12-30 21:15:29 +0900 | [diff] [blame] | 364 | int wilc_listen_state_expired(struct wilc_vif *vif, u32 session_id); |
Chaehyun Lim | 8859fc2 | 2015-12-30 21:15:27 +0900 | [diff] [blame] | 365 | int wilc_frame_register(struct wilc_vif *vif, u16 frame_type, bool reg); |
Glen Lee | 31f0f69 | 2015-12-21 14:18:44 +0900 | [diff] [blame] | 366 | int wilc_set_wfi_drv_handler(struct wilc_vif *vif, int index); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 367 | int wilc_set_operation_mode(struct wilc_vif *vif, u32 mode); |
Chaehyun Lim | f70b25f | 2015-12-24 16:52:39 +0900 | [diff] [blame] | 368 | int wilc_get_statistics(struct wilc_vif *vif, struct rf_info *stats); |
Glen Lee | fbf5379 | 2015-12-21 14:18:40 +0900 | [diff] [blame] | 369 | void wilc_resolve_disconnect_aberration(struct wilc_vif *vif); |
Glen Lee | 31f0f69 | 2015-12-21 14:18:44 +0900 | [diff] [blame] | 370 | int wilc_get_vif_idx(struct wilc_vif *vif); |
Arnd Bergmann | 491880e | 2015-11-16 15:04:55 +0100 | [diff] [blame] | 371 | |
| 372 | extern bool wilc_optaining_ip; |
Leo Kim | e554a30 | 2015-11-19 15:56:21 +0900 | [diff] [blame] | 373 | extern u8 wilc_connected_ssid[6]; |
Arnd Bergmann | 491880e | 2015-11-16 15:04:55 +0100 | [diff] [blame] | 374 | extern u8 wilc_multicast_mac_addr_list[WILC_MULTICAST_TABLE_SIZE][ETH_ALEN]; |
| 375 | |
| 376 | extern int wilc_connecting; |
| 377 | extern u8 wilc_initialized; |
| 378 | extern struct timer_list wilc_during_ip_timer; |
| 379 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 380 | #endif |