staging/wilc1000: use proper naming for global symbols
[linux-2.6-block.git] / drivers / staging / wilc1000 / host_interface.h
CommitLineData
c5c77ba1
JK
1#ifndef HOST_INT_H
2#define HOST_INT_H
3
4#include "coreconfigurator.h"
c5c77ba1
JK
5
6#define IP_ALEN 4
7
c590b9a4 8#define IDLE_MODE 0x00
c5c77ba1
JK
9#define AP_MODE 0x01
10#define STATION_MODE 0x02
568ab197 11#define GO_MODE 0x03
c5c77ba1 12#define CLIENT_MODE 0x04
c81f7de8
LK
13#define ACTION 0xD0
14#define PROBE_REQ 0x40
15#define PROBE_RESP 0x50
c5c77ba1 16
c81f7de8
LK
17#define ACTION_FRM_IDX 0
18#define PROBE_REQ_IDX 1
568ab197 19#define MAX_NUM_STA 9
c5c77ba1
JK
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
af080e04
CL
25#define USER_SCAN BIT(0)
26#define OBSS_PERIODIC_SCAN BIT(1)
27#define OBSS_ONETIME_SCAN BIT(2)
c5c77ba1 28#define GTK_RX_KEY_BUFF_LEN 24
568ab197
CL
29#define ADDKEY 0x1
30#define REMOVEKEY 0x2
31#define DEFAULTKEY 0x4
32#define ADDKEY_AP 0x8
30b2ba09 33#define MAX_NUM_SCANNED_NETWORKS 100
568ab197 34#define MAX_NUM_SCANNED_NETWORKS_SHADOW 130
30b2ba09
CL
35#define MAX_NUM_PROBED_SSID 10
36#define CHANNEL_SCAN_TIME 250
c5c77ba1
JK
37
38#define TX_MIC_KEY_LEN 8
39#define RX_MIC_KEY_LEN 8
568ab197 40#define PTK_KEY_LEN 16
c5c77ba1
JK
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
568ab197
CL
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
30b2ba09 51#define WILC_ADD_STA_LENGTH 40
c5c77ba1 52#define SCAN_EVENT_DONE_ABORTED
568ab197 53#define NUM_CONCURRENT_IFC 2
c5c77ba1 54
03e7b9c4 55struct rf_info {
5babeecb 56 u8 link_speed;
00c8dfcf 57 s8 rssi;
7e84ff4e 58 u32 tx_cnt;
9b99274a 59 u32 rx_cnt;
54160376 60 u32 tx_fail_cnt;
03e7b9c4 61};
c5c77ba1 62
db9f1b12 63enum host_if_state {
df94ed25
CL
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
db9f1b12 71};
c5c77ba1 72
cd1e6cb4 73struct host_if_pmkid {
63d03e47
GKH
74 u8 bssid[ETH_ALEN];
75 u8 pmkid[PMKID_LEN];
cd1e6cb4 76};
c5c77ba1 77
a949f909 78struct host_if_pmkid_attr {
63d03e47 79 u8 numpmkid;
cd1e6cb4 80 struct host_if_pmkid pmkidlist[WILC_MAX_NUM_PMKIDS];
a949f909 81};
61500fbd 82
430a78cf 83enum CURRENT_TXRATE {
df94ed25
CL
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
430a78cf 97};
c5c77ba1 98
9529650a 99struct cfg_param_val {
87c05b28 100 u32 flag;
63d03e47
GKH
101 u8 ht_enable;
102 u8 bss_type;
103 u8 auth_type;
d85f5326 104 u16 auth_timeout;
63d03e47 105 u8 power_mgmt_mode;
d85f5326
CL
106 u16 short_retry_limit;
107 u16 long_retry_limit;
108 u16 frag_threshold;
109 u16 rts_threshold;
110 u16 preamble_type;
63d03e47
GKH
111 u8 short_slot_allowed;
112 u8 txop_prot_disabled;
d85f5326
CL
113 u16 beacon_interval;
114 u16 dtim_period;
073b8d0c 115 enum SITESURVEY site_survey_enabled;
d85f5326 116 u16 site_survey_scan_time;
63d03e47 117 u8 scan_source;
d85f5326
CL
118 u16 active_scan_time;
119 u16 passive_scan_time;
430a78cf 120 enum CURRENT_TXRATE curr_tx_rate;
c5c77ba1 121
9529650a 122};
c5c77ba1 123
200ac21b 124enum cfg_param {
ffda203c
AB
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),
200ac21b 144};
c5c77ba1 145
73735e49 146struct found_net_info {
63d03e47 147 u8 au8bssid[6];
ca356ada 148 s8 s8rssi;
73735e49 149};
c5c77ba1 150
1ec3815f
LK
151enum 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};
c5c77ba1 157
ed3f0379 158enum conn_event {
c5c77ba1
JK
159 CONN_DISCONN_EVENT_CONN_RESP = 0,
160 CONN_DISCONN_EVENT_DISCONN_NOTIF = 1,
df94ed25 161 CONN_DISCONN_EVENT_FORCE_32BIT = 0xFFFFFFFF
ed3f0379 162};
c5c77ba1 163
b9d96333 164enum KEY_TYPE {
c5c77ba1 165 WEP,
5cd8f7ae 166 WPA_RX_GTK,
2141fe39 167 WPA_PTK,
c5c77ba1 168 PMKSA,
b9d96333 169};
c5c77ba1 170
1ec3815f
LK
171typedef void (*wilc_scan_result)(enum scan_event, tstrNetworkInfo *,
172 void *, void *);
c5c77ba1 173
ed3f0379 174typedef void (*wilc_connect_result)(enum conn_event,
c5c77ba1 175 tstrConnectInfo *,
63d03e47 176 u8,
c5c77ba1
JK
177 tstrDisconnectNotifInfo *,
178 void *);
179
e3e7e8ac
LK
180typedef void (*wilc_remain_on_chan_expired)(void *, u32);
181typedef void (*wilc_remain_on_chan_ready)(void *);
c5c77ba1 182
3bbd59f5 183struct rcvd_net_info {
b021b80b 184 u8 *buffer;
3bffac68 185 u32 len;
3bbd59f5 186};
c5c77ba1 187
ad61fcea 188struct hidden_net_info {
63d03e47
GKH
189 u8 *pu8ssid;
190 u8 u8ssidlen;
ad61fcea 191};
c5c77ba1 192
607db447 193struct hidden_network {
ad61fcea 194 struct hidden_net_info *pstrHiddenNetworkInfo;
63d03e47 195 u8 u8ssidnum;
607db447 196};
c5c77ba1 197
b4fe59d8 198struct user_scan_req {
bc801855 199 wilc_scan_result scan_result;
66eaea30 200 void *arg;
f79756ee 201 u32 rcvd_ch_cnt;
af973f30 202 struct found_net_info net_info[MAX_NUM_SCANNED_NETWORKS];
b4fe59d8 203};
c5c77ba1 204
c944a4e8 205struct user_conn_req {
63d03e47
GKH
206 u8 *pu8bssid;
207 u8 *pu8ssid;
208 u8 u8security;
7d069728 209 enum AUTHTYPE auth_type;
74ab5e45 210 size_t ssid_len;
a3b2f4b9 211 u8 *ies;
331ed080 212 size_t ies_len;
33bfb198 213 wilc_connect_result conn_result;
ff06982c 214 bool ht_capable;
73abaa49 215 void *arg;
c944a4e8 216};
c5c77ba1 217
127f9d94 218struct drv_handler {
a7f3b12f 219 u32 handler;
127f9d94 220};
c5c77ba1 221
801bee52 222struct op_mode {
c96debf1 223 u32 mode;
801bee52 224};
c5c77ba1 225
b7611a87 226struct set_mac_addr {
ae5e4522 227 u8 mac_addr[ETH_ALEN];
b7611a87 228};
c5c77ba1 229
fcd27c5f 230struct get_mac_addr {
6ceba0af 231 u8 *mac_addr;
fcd27c5f 232};
c5c77ba1 233
54265472 234struct ba_session_info {
3fc4999e 235 u8 bssid[ETH_ALEN];
16c9b391 236 u8 tid;
277c2130 237 u16 buf_size;
23d0bfaa 238 u16 time_out;
54265472 239};
c5c77ba1 240
2f9c03f5 241struct remain_ch {
839ab709 242 u16 ch;
4e4467fd 243 u32 u32duration;
bfb62abc 244 wilc_remain_on_chan_expired expired;
5e5f7916 245 wilc_remain_on_chan_ready ready;
c5cc4b12 246 void *arg;
9d764e38 247 u32 id;
2f9c03f5 248};
c5c77ba1 249
bc37c5df 250struct reg_frame {
6abf8681 251 bool reg;
d5f654ca 252 u16 frame_type;
bcb410bb 253 u8 reg_id;
bc37c5df 254};
c5c77ba1 255
c5c77ba1
JK
256enum p2p_listen_state {
257 P2P_IDLE,
258 P2P_LISTEN,
259 P2P_GRP_FORMATION
260};
261
441dc609 262struct host_if_drv {
70793b2a 263 struct user_scan_req usr_scan_req;
f8b17132 264 struct user_conn_req usr_conn_req;
d61f8e1e 265 struct remain_ch remain_on_ch;
5beef2ca 266 u8 remain_on_ch_pending;
1229b1ab 267 u64 p2p_timeout;
ab16ec0b 268 u8 p2p_connect;
c5c77ba1 269
b60005a8 270 enum host_if_state hif_state;
c5c77ba1 271
2a4eded9 272 u8 assoc_bssid[ETH_ALEN];
ace303f0 273 struct cfg_param_val cfg_values;
33110ad7
LK
274
275 struct semaphore sem_cfg_values;
9ea47133 276 struct semaphore sem_test_key_block;
e55e4967 277 struct semaphore sem_test_disconn_block;
7e111f9e 278 struct semaphore sem_get_rssi;
bc34da66 279 struct semaphore sem_get_link_speed;
4ea90008 280 struct semaphore sem_get_chnl;
569a3c67 281 struct semaphore sem_inactive_time;
13b313e4
LK
282
283 struct timer_list scan_timer;
81a59506 284 struct timer_list connect_timer;
cc2d7e9e 285 struct timer_list remain_on_ch_timer;
c5c77ba1 286
72ed4dc7 287 bool IFC_UP;
441dc609 288};
c5c77ba1 289
6a89ba9c 290struct add_sta_param {
2353c388 291 u8 bssid[ETH_ALEN];
4101eb8a 292 u16 aid;
e734223c 293 u8 rates_len;
a622e016 294 const u8 *rates;
22520120 295 bool ht_supported;
0d073f69 296 u16 ht_capa_info;
fba1f2d2 297 u8 ht_ampdu_params;
5ebbf4f7 298 u8 ht_supp_mcs_set[16];
223741d7 299 u16 ht_ext_params;
74fe73cf 300 u32 ht_tx_bf_cap;
a486baff 301 u8 ht_ante_sel;
f676e17a 302 u16 flags_mask;
67ab64e4 303 u16 flags_set;
6a89ba9c 304};
c5c77ba1 305
0e1af73d
AB
306s32 wilc_remove_key(struct host_if_drv *hWFIDrv, const u8 *pu8StaAddress);
307int wilc_remove_wep_key(struct host_if_drv *wfi_drv, u8 index);
308int wilc_set_wep_default_keyid(struct host_if_drv *hif_drv, u8 index);
309int wilc_add_wep_key_bss_sta(struct host_if_drv *hif_drv,
cf491d93 310 const u8 *key, u8 len, u8 index);
0e1af73d 311int wilc_add_wep_key_bss_ap(struct host_if_drv *hif_drv,
0d21ad20
CL
312 const u8 *key, u8 len, u8 index, u8 mode,
313 enum AUTHTYPE auth_type);
0e1af73d 314s32 wilc_add_ptk(struct host_if_drv *hWFIDrv, const u8 *pu8Ptk,
6bd77755
LK
315 u8 u8PtkKeylen, const u8 *mac_addr,
316 const u8 *pu8RxMic, const u8 *pu8TxMic,
317 u8 mode, u8 u8Ciphermode, u8 u8Idx);
0e1af73d 318s32 wilc_get_inactive_time(struct host_if_drv *hWFIDrv, const u8 *mac,
6bd77755 319 u32 *pu32InactiveTime);
0e1af73d 320s32 wilc_add_rx_gtk(struct host_if_drv *hWFIDrv, const u8 *pu8RxGtk,
6bd77755
LK
321 u8 u8GtkKeylen, u8 u8KeyIdx,
322 u32 u32KeyRSClen, const u8 *KeyRSC,
323 const u8 *pu8RxMic, const u8 *pu8TxMic,
324 u8 mode, u8 u8Ciphermode);
0e1af73d 325s32 wilc_add_tx_gtk(struct host_if_drv *hWFIDrv, u8 u8KeyLen,
6bd77755 326 u8 *pu8TxGtk, u8 u8KeyIdx);
0e1af73d 327s32 wilc_set_pmkid_info(struct host_if_drv *hWFIDrv,
6bd77755 328 struct host_if_pmkid_attr *pu8PmkidInfoArray);
0e1af73d
AB
329s32 wilc_get_mac_address(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
330s32 wilc_set_mac_address(struct host_if_drv *hWFIDrv, u8 *pu8MacAddress);
331int wilc_wait_msg_queue_idle(void);
332s32 wilc_set_start_scan_req(struct host_if_drv *hWFIDrv, u8 scanSource);
333s32 wilc_set_join_req(struct host_if_drv *hWFIDrv, u8 *pu8bssid,
6bd77755
LK
334 const u8 *pu8ssid, size_t ssidLen,
335 const u8 *pu8IEs, size_t IEsLen,
336 wilc_connect_result pfConnectResult, void *pvUserArg,
337 u8 u8security, enum AUTHTYPE tenuAuth_type,
338 u8 u8channel, void *pJoinParams);
0e1af73d
AB
339s32 wilc_flush_join_req(struct host_if_drv *hWFIDrv);
340s32 wilc_disconnect(struct host_if_drv *hWFIDrv, u16 u16ReasonCode);
341int wilc_set_mac_chnl_num(struct host_if_drv *wfi_drv, u8 channel);
342s32 wilc_get_rssi(struct host_if_drv *hWFIDrv, s8 *ps8Rssi);
343s32 wilc_scan(struct host_if_drv *hWFIDrv, u8 u8ScanSource,
6bd77755
LK
344 u8 u8ScanType, u8 *pu8ChnlFreqList,
345 u8 u8ChnlListLen, const u8 *pu8IEs,
346 size_t IEsLen, wilc_scan_result ScanResult,
347 void *pvUserArg, struct hidden_network *pstrHiddenNetwork);
0e1af73d 348s32 wilc_hif_set_cfg(struct host_if_drv *hWFIDrv,
6bd77755 349 struct cfg_param_val *pstrCfgParamVal);
0e1af73d
AB
350s32 wilc_init(struct net_device *dev, struct host_if_drv **phWFIDrv);
351s32 wilc_deinit(struct host_if_drv *hWFIDrv);
352s32 wilc_add_beacon(struct host_if_drv *hWFIDrv, u32 u32Interval,
6bd77755
LK
353 u32 u32DTIMPeriod,
354 u32 u32HeadLen,
355 u8 *pu8Head,
356 u32 u32TailLen,
357 u8 *pu8tail);
0e1af73d
AB
358int wilc_del_beacon(struct host_if_drv *hif_drv);
359int wilc_add_station(struct host_if_drv *hif_drv,
e3378547 360 struct add_sta_param *sta_param);
0e1af73d 361s32 wilc_del_allstation(struct host_if_drv *hWFIDrv,
6bd77755 362 u8 pu8MacAddr[][ETH_ALEN]);
0e1af73d
AB
363int wilc_del_station(struct host_if_drv *hif_drv, const u8 *mac_addr);
364s32 wilc_edit_station(struct host_if_drv *hWFIDrv,
6a89ba9c 365 struct add_sta_param *pstrStaParams);
0e1af73d 366s32 wilc_set_power_mgmt(struct host_if_drv *hWFIDrv,
6bd77755
LK
367 bool bIsEnabled,
368 u32 u32Timeout);
0e1af73d 369s32 wilc_setup_multicast_filter(struct host_if_drv *hWFIDrv,
6bd77755
LK
370 bool bIsEnabled,
371 u32 u32count);
0e1af73d 372s32 wilc_setup_ipaddress(struct host_if_drv *hWFIDrv,
6bd77755
LK
373 u8 *pu8IPAddr,
374 u8 idx);
0e1af73d 375s32 wilc_del_all_rx_ba_session(struct host_if_drv *hWFIDrv,
6bd77755
LK
376 char *pBSSID,
377 char TID);
0e1af73d 378s32 wilc_remain_on_channel(struct host_if_drv *hWFIDrv,
6bd77755
LK
379 u32 u32SessionID,
380 u32 u32duration,
381 u16 chan,
382 wilc_remain_on_chan_expired RemainOnChanExpired,
383 wilc_remain_on_chan_ready RemainOnChanReady,
384 void *pvUserArg);
0e1af73d
AB
385s32 wilc_listen_state_expired(struct host_if_drv *hWFIDrv, u32 u32SessionID);
386s32 wilc_frame_register(struct host_if_drv *hWFIDrv,
6bd77755
LK
387 u16 u16FrameType,
388 bool bReg);
0e1af73d
AB
389int wilc_set_wfi_drv_handler(struct host_if_drv *address);
390int wilc_set_operation_mode(struct host_if_drv *wfi_drv, u32 mode);
c5c77ba1 391
0e1af73d 392void wilc_free_join_params(void *pJoinParams);
c5c77ba1 393
0e1af73d 394s32 wilc_get_statistics(struct host_if_drv *hWFIDrv,
6bd77755 395 struct rf_info *pstrStatistics);
0e1af73d 396void wilc_resolve_disconnect_aberration(struct host_if_drv *hif_drv);
c5c77ba1 397#endif