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 { |
Greg Kroah-Hartman | 63d03e4 | 2015-06-02 14:16:04 +0900 | [diff] [blame] | 189 | u8 *pu8ssid; |
| 190 | u8 u8ssidlen; |
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 | 4e4467f | 2015-06-11 14:35:55 +0900 | [diff] [blame] | 243 | u32 u32duration; |
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 | |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 262 | struct host_if_drv { |
Leo Kim | 70793b2 | 2015-10-28 15:59:33 +0900 | [diff] [blame] | 263 | struct user_scan_req usr_scan_req; |
Leo Kim | f8b1713 | 2015-10-28 15:59:34 +0900 | [diff] [blame] | 264 | struct user_conn_req usr_conn_req; |
Leo Kim | d61f8e1 | 2015-10-28 15:59:35 +0900 | [diff] [blame] | 265 | struct remain_ch remain_on_ch; |
Leo Kim | 5beef2c | 2015-10-28 15:59:36 +0900 | [diff] [blame] | 266 | u8 remain_on_ch_pending; |
Leo Kim | 1229b1a | 2015-10-29 12:05:39 +0900 | [diff] [blame] | 267 | u64 p2p_timeout; |
Leo Kim | ab16ec0 | 2015-10-29 12:05:40 +0900 | [diff] [blame] | 268 | u8 p2p_connect; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 269 | |
Leo Kim | b60005a | 2015-10-29 11:58:24 +0900 | [diff] [blame] | 270 | enum host_if_state hif_state; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 271 | |
Leo Kim | 2a4eded | 2015-10-29 11:58:25 +0900 | [diff] [blame] | 272 | u8 assoc_bssid[ETH_ALEN]; |
Leo Kim | ace303f | 2015-10-29 11:58:26 +0900 | [diff] [blame] | 273 | struct cfg_param_val cfg_values; |
Leo Kim | 33110ad | 2015-10-29 11:58:27 +0900 | [diff] [blame] | 274 | |
| 275 | struct semaphore sem_cfg_values; |
Leo Kim | 9ea4713 | 2015-10-29 11:58:28 +0900 | [diff] [blame] | 276 | struct semaphore sem_test_key_block; |
Leo Kim | e55e496 | 2015-10-29 11:58:29 +0900 | [diff] [blame] | 277 | struct semaphore sem_test_disconn_block; |
Leo Kim | 7e111f9 | 2015-10-29 11:58:30 +0900 | [diff] [blame] | 278 | struct semaphore sem_get_rssi; |
Leo Kim | bc34da6 | 2015-10-29 11:58:31 +0900 | [diff] [blame] | 279 | struct semaphore sem_get_link_speed; |
Leo Kim | 4ea9000 | 2015-10-29 11:58:32 +0900 | [diff] [blame] | 280 | struct semaphore sem_get_chnl; |
Leo Kim | 569a3c6 | 2015-10-29 11:58:33 +0900 | [diff] [blame] | 281 | struct semaphore sem_inactive_time; |
Leo Kim | 13b313e | 2015-10-29 11:58:34 +0900 | [diff] [blame] | 282 | |
| 283 | struct timer_list scan_timer; |
Leo Kim | 81a5950 | 2015-10-29 11:58:35 +0900 | [diff] [blame] | 284 | struct timer_list connect_timer; |
Leo Kim | cc2d7e9 | 2015-10-29 11:58:36 +0900 | [diff] [blame] | 285 | struct timer_list remain_on_ch_timer; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 286 | |
Dean Lee | 72ed4dc | 2015-06-12 14:11:44 +0900 | [diff] [blame] | 287 | bool IFC_UP; |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 288 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 289 | |
Tony Cho | 6a89ba9 | 2015-09-21 12:16:46 +0900 | [diff] [blame] | 290 | struct add_sta_param { |
Leo Kim | 2353c38 | 2015-10-29 12:05:41 +0900 | [diff] [blame] | 291 | u8 bssid[ETH_ALEN]; |
Leo Kim | 4101eb8 | 2015-10-29 12:05:42 +0900 | [diff] [blame] | 292 | u16 aid; |
Leo Kim | e734223 | 2015-10-29 12:05:43 +0900 | [diff] [blame] | 293 | u8 rates_len; |
Leo Kim | a622e01 | 2015-10-29 12:05:44 +0900 | [diff] [blame] | 294 | const u8 *rates; |
Leo Kim | 2252012 | 2015-10-29 12:05:45 +0900 | [diff] [blame] | 295 | bool ht_supported; |
Leo Kim | 0d073f6 | 2015-10-29 12:05:46 +0900 | [diff] [blame] | 296 | u16 ht_capa_info; |
Leo Kim | fba1f2d | 2015-10-29 12:05:47 +0900 | [diff] [blame] | 297 | u8 ht_ampdu_params; |
Leo Kim | 5ebbf4f | 2015-10-29 12:05:48 +0900 | [diff] [blame] | 298 | u8 ht_supp_mcs_set[16]; |
Leo Kim | 223741d | 2015-10-29 12:05:49 +0900 | [diff] [blame] | 299 | u16 ht_ext_params; |
Leo Kim | 74fe73c | 2015-10-29 12:05:50 +0900 | [diff] [blame] | 300 | u32 ht_tx_bf_cap; |
Leo Kim | a486baf | 2015-10-29 12:05:51 +0900 | [diff] [blame] | 301 | u8 ht_ante_sel; |
Leo Kim | f676e17 | 2015-10-29 12:05:52 +0900 | [diff] [blame] | 302 | u16 flags_mask; |
Leo Kim | 67ab64e | 2015-10-29 12:05:53 +0900 | [diff] [blame] | 303 | u16 flags_set; |
Tony Cho | 6a89ba9 | 2015-09-21 12:16:46 +0900 | [diff] [blame] | 304 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 305 | |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 306 | s32 host_int_remove_key(struct host_if_drv *hWFIDrv, const u8 *pu8StaAddress); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 307 | int host_int_remove_wep_key(struct host_if_drv *wfi_drv, u8 index); |
Chaehyun Lim | df8b483 | 2015-10-26 09:44:45 +0900 | [diff] [blame] | 308 | int host_int_set_wep_default_key(struct host_if_drv *hif_drv, u8 index); |
Chaehyun Lim | cf491d9 | 2015-10-27 20:40:38 +0900 | [diff] [blame] | 309 | int host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv, |
| 310 | const u8 *key, u8 len, u8 index); |
Chaehyun Lim | 0d21ad2 | 2015-10-28 08:19:28 +0900 | [diff] [blame] | 311 | int host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv, |
| 312 | const u8 *key, u8 len, u8 index, u8 mode, |
| 313 | enum AUTHTYPE auth_type); |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 314 | s32 host_int_add_ptk(struct host_if_drv *hWFIDrv, const u8 *pu8Ptk, |
| 315 | u8 u8PtkKeylen, const u8 *mac_addr, |
| 316 | const u8 *pu8RxMic, const u8 *pu8TxMic, |
| 317 | u8 mode, u8 u8Ciphermode, u8 u8Idx); |
| 318 | s32 host_int_get_inactive_time(struct host_if_drv *hWFIDrv, const u8 *mac, |
| 319 | u32 *pu32InactiveTime); |
| 320 | s32 host_int_add_rx_gtk(struct host_if_drv *hWFIDrv, const u8 *pu8RxGtk, |
| 321 | u8 u8GtkKeylen, u8 u8KeyIdx, |
| 322 | u32 u32KeyRSClen, const u8 *KeyRSC, |
| 323 | const u8 *pu8RxMic, const u8 *pu8TxMic, |
| 324 | u8 mode, u8 u8Ciphermode); |
| 325 | s32 host_int_add_tx_gtk(struct host_if_drv *hWFIDrv, u8 u8KeyLen, |
| 326 | u8 *pu8TxGtk, u8 u8KeyIdx); |
| 327 | s32 host_int_set_pmkid_info(struct host_if_drv *hWFIDrv, |
| 328 | struct host_if_pmkid_attr *pu8PmkidInfoArray); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 329 | s32 host_int_get_pmkid_info(struct host_if_drv *hWFIDrv, u8 *pu8PmkidInfoArray, |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 330 | u32 u32PmkidInfoLen); |
| 331 | s32 host_int_set_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv, |
| 332 | u8 *pu8PassPhrase, |
| 333 | u8 u8Psklength); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 334 | s32 host_int_get_RSNAConfigPSKPassPhrase(struct host_if_drv *hWFIDrv, |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 335 | u8 *pu8PassPhrase, u8 u8Psklength); |
Leo Kim | e5f3524 | 2015-11-05 14:36:36 +0900 | [diff] [blame] | 336 | s32 hif_get_mac_address(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 337 | s32 host_int_set_MacAddress(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress); |
Chaehyun Lim | 244efb1 | 2015-10-02 21:44:53 +0900 | [diff] [blame] | 338 | int host_int_wait_msg_queue_idle(void); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 339 | s32 host_int_set_start_scan_req(struct host_if_drv *hWFIDrv, u8 scanSource); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 340 | s32 host_int_get_start_scan_req(struct host_if_drv *hWFIDrv, u8 *pu8ScanSource); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 341 | s32 host_int_set_join_req(struct host_if_drv *hWFIDrv, u8 *pu8bssid, |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 342 | const u8 *pu8ssid, size_t ssidLen, |
| 343 | const u8 *pu8IEs, size_t IEsLen, |
| 344 | wilc_connect_result pfConnectResult, void *pvUserArg, |
| 345 | u8 u8security, enum AUTHTYPE tenuAuth_type, |
| 346 | u8 u8channel, void *pJoinParams); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 347 | s32 host_int_flush_join_req(struct host_if_drv *hWFIDrv); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 348 | s32 host_int_disconnect(struct host_if_drv *hWFIDrv, u16 u16ReasonCode); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 349 | s32 host_int_disconnect_station(struct host_if_drv *hWFIDrv, u8 assoc_id); |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 350 | s32 host_int_get_assoc_req_info(struct host_if_drv *hWFIDrv, |
| 351 | u8 *pu8AssocReqInfo, |
| 352 | u32 u32AssocReqInfoLen); |
| 353 | s32 host_int_get_assoc_res_info(struct host_if_drv *hWFIDrv, |
| 354 | u8 *pu8AssocRespInfo, |
| 355 | u32 u32MaxAssocRespInfoLen, |
| 356 | u32 *pu32RcvdAssocRespInfoLen); |
| 357 | s32 host_int_get_rx_power_level(struct host_if_drv *hWFIDrv, |
| 358 | u8 *pu8RxPowerLevel, |
| 359 | u32 u32RxPowerLevelLen); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 360 | int host_int_set_mac_chnl_num(struct host_if_drv *wfi_drv, u8 channel); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 361 | s32 host_int_get_host_chnl_num(struct host_if_drv *hWFIDrv, u8 *pu8ChNo); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 362 | s32 host_int_get_rssi(struct host_if_drv *hWFIDrv, s8 *ps8Rssi); |
| 363 | s32 host_int_get_link_speed(struct host_if_drv *hWFIDrv, s8 *ps8lnkspd); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 364 | s32 host_int_scan(struct host_if_drv *hWFIDrv, u8 u8ScanSource, |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 365 | u8 u8ScanType, u8 *pu8ChnlFreqList, |
| 366 | u8 u8ChnlListLen, const u8 *pu8IEs, |
| 367 | size_t IEsLen, wilc_scan_result ScanResult, |
| 368 | void *pvUserArg, struct hidden_network *pstrHiddenNetwork); |
| 369 | s32 hif_set_cfg(struct host_if_drv *hWFIDrv, |
| 370 | struct cfg_param_val *pstrCfgParamVal); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 371 | s32 hif_get_cfg(struct host_if_drv *hWFIDrv, u16 u16WID, u16 *pu16WID_Value); |
Glen Lee | d5382219 | 2015-10-27 18:27:49 +0900 | [diff] [blame] | 372 | s32 host_int_init(struct net_device *dev, struct host_if_drv **phWFIDrv); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 373 | s32 host_int_deinit(struct host_if_drv *hWFIDrv); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 374 | s32 host_int_add_beacon(struct host_if_drv *hWFIDrv, u32 u32Interval, |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 375 | u32 u32DTIMPeriod, |
| 376 | u32 u32HeadLen, |
| 377 | u8 *pu8Head, |
| 378 | u32 u32TailLen, |
| 379 | u8 *pu8tail); |
Chaehyun Lim | b6694df | 2015-11-06 19:11:11 +0900 | [diff] [blame] | 380 | int host_int_del_beacon(struct host_if_drv *hif_drv); |
Chaehyun Lim | 261de71 | 2015-11-06 19:11:17 +0900 | [diff] [blame] | 381 | int host_int_add_station(struct host_if_drv *hif_drv, |
Chaehyun Lim | e337854 | 2015-11-06 19:11:18 +0900 | [diff] [blame^] | 382 | struct add_sta_param *sta_param); |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 383 | s32 host_int_del_allstation(struct host_if_drv *hWFIDrv, |
| 384 | u8 pu8MacAddr[][ETH_ALEN]); |
Chaehyun Lim | c9c4eb4 | 2015-11-06 19:11:14 +0900 | [diff] [blame] | 385 | int host_int_del_station(struct host_if_drv *hif_drv, const u8 *mac_addr); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 386 | s32 host_int_edit_station(struct host_if_drv *hWFIDrv, |
Tony Cho | 6a89ba9 | 2015-09-21 12:16:46 +0900 | [diff] [blame] | 387 | struct add_sta_param *pstrStaParams); |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 388 | s32 host_int_set_power_mgmt(struct host_if_drv *hWFIDrv, |
| 389 | bool bIsEnabled, |
| 390 | u32 u32Timeout); |
| 391 | s32 host_int_setup_multicast_filter(struct host_if_drv *hWFIDrv, |
| 392 | bool bIsEnabled, |
| 393 | u32 u32count); |
| 394 | s32 host_int_setup_ipaddress(struct host_if_drv *hWFIDrv, |
| 395 | u8 *pu8IPAddr, |
| 396 | u8 idx); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 397 | s32 host_int_delBASession(struct host_if_drv *hWFIDrv, char *pBSSID, char TID); |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 398 | s32 host_int_del_All_Rx_BASession(struct host_if_drv *hWFIDrv, |
| 399 | char *pBSSID, |
| 400 | char TID); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 401 | s32 host_int_get_ipaddress(struct host_if_drv *hWFIDrv, u8 *pu8IPAddr, u8 idx); |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 402 | s32 host_int_remain_on_channel(struct host_if_drv *hWFIDrv, |
| 403 | u32 u32SessionID, |
| 404 | u32 u32duration, |
| 405 | u16 chan, |
| 406 | wilc_remain_on_chan_expired RemainOnChanExpired, |
| 407 | wilc_remain_on_chan_ready RemainOnChanReady, |
| 408 | void *pvUserArg); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 409 | s32 host_int_ListenStateExpired(struct host_if_drv *hWFIDrv, u32 u32SessionID); |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 410 | s32 host_int_frame_register(struct host_if_drv *hWFIDrv, |
| 411 | u16 u16FrameType, |
| 412 | bool bReg); |
Leo Kim | 441dc60 | 2015-10-12 16:55:35 +0900 | [diff] [blame] | 413 | int host_int_set_wfi_drv_handler(struct host_if_drv *address); |
| 414 | int host_int_set_operation_mode(struct host_if_drv *wfi_drv, u32 mode); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 415 | |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 416 | static s32 Handle_ScanDone(struct host_if_drv *drvHandler, |
| 417 | enum scan_event enuEvent); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 418 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 419 | void host_int_freeJoinParams(void *pJoinParams); |
| 420 | |
Leo Kim | 6bd7775 | 2015-10-29 11:58:49 +0900 | [diff] [blame] | 421 | s32 host_int_get_statistics(struct host_if_drv *hWFIDrv, |
| 422 | struct rf_info *pstrStatistics); |
Leo Kim | 7df0011 | 2015-11-05 14:36:20 +0900 | [diff] [blame] | 423 | void resolve_disconnect_aberration(struct host_if_drv *hif_drv); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 424 | #endif |