wl3501.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __WL3501_H__
  3. #define __WL3501_H__
  4. #include <linux/spinlock.h>
  5. #include <linux/ieee80211.h>
  6. /* define for WLA 2.0 */
  7. #define WL3501_BLKSZ 256
  8. /*
  9. * ID for input Signals of DRIVER block
  10. * bit[7-5] is block ID: 000
  11. * bit[4-0] is signal ID
  12. */
  13. enum wl3501_signals {
  14. WL3501_SIG_ALARM,
  15. WL3501_SIG_MD_CONFIRM,
  16. WL3501_SIG_MD_IND,
  17. WL3501_SIG_ASSOC_CONFIRM,
  18. WL3501_SIG_ASSOC_IND,
  19. WL3501_SIG_AUTH_CONFIRM,
  20. WL3501_SIG_AUTH_IND,
  21. WL3501_SIG_DEAUTH_CONFIRM,
  22. WL3501_SIG_DEAUTH_IND,
  23. WL3501_SIG_DISASSOC_CONFIRM,
  24. WL3501_SIG_DISASSOC_IND,
  25. WL3501_SIG_GET_CONFIRM,
  26. WL3501_SIG_JOIN_CONFIRM,
  27. WL3501_SIG_PWR_MGMT_CONFIRM,
  28. WL3501_SIG_REASSOC_CONFIRM,
  29. WL3501_SIG_REASSOC_IND,
  30. WL3501_SIG_SCAN_CONFIRM,
  31. WL3501_SIG_SET_CONFIRM,
  32. WL3501_SIG_START_CONFIRM,
  33. WL3501_SIG_RESYNC_CONFIRM,
  34. WL3501_SIG_SITE_CONFIRM,
  35. WL3501_SIG_SAVE_CONFIRM,
  36. WL3501_SIG_RFTEST_CONFIRM,
  37. /*
  38. * ID for input Signals of MLME block
  39. * bit[7-5] is block ID: 010
  40. * bit[4-0] is signal ID
  41. */
  42. WL3501_SIG_ASSOC_REQ = 0x20,
  43. WL3501_SIG_AUTH_REQ,
  44. WL3501_SIG_DEAUTH_REQ,
  45. WL3501_SIG_DISASSOC_REQ,
  46. WL3501_SIG_GET_REQ,
  47. WL3501_SIG_JOIN_REQ,
  48. WL3501_SIG_PWR_MGMT_REQ,
  49. WL3501_SIG_REASSOC_REQ,
  50. WL3501_SIG_SCAN_REQ,
  51. WL3501_SIG_SET_REQ,
  52. WL3501_SIG_START_REQ,
  53. WL3501_SIG_MD_REQ,
  54. WL3501_SIG_RESYNC_REQ,
  55. WL3501_SIG_SITE_REQ,
  56. WL3501_SIG_SAVE_REQ,
  57. WL3501_SIG_RF_TEST_REQ,
  58. WL3501_SIG_MM_CONFIRM = 0x60,
  59. WL3501_SIG_MM_IND,
  60. };
  61. enum wl3501_mib_attribs {
  62. WL3501_MIB_ATTR_STATION_ID,
  63. WL3501_MIB_ATTR_AUTH_ALGORITHMS,
  64. WL3501_MIB_ATTR_AUTH_TYPE,
  65. WL3501_MIB_ATTR_MEDIUM_OCCUPANCY_LIMIT,
  66. WL3501_MIB_ATTR_CF_POLLABLE,
  67. WL3501_MIB_ATTR_CFP_PERIOD,
  68. WL3501_MIB_ATTR_CFPMAX_DURATION,
  69. WL3501_MIB_ATTR_AUTH_RESP_TMOUT,
  70. WL3501_MIB_ATTR_RX_DTIMS,
  71. WL3501_MIB_ATTR_PRIV_OPT_IMPLEMENTED,
  72. WL3501_MIB_ATTR_PRIV_INVOKED,
  73. WL3501_MIB_ATTR_WEP_DEFAULT_KEYS,
  74. WL3501_MIB_ATTR_WEP_DEFAULT_KEY_ID,
  75. WL3501_MIB_ATTR_WEP_KEY_MAPPINGS,
  76. WL3501_MIB_ATTR_WEP_KEY_MAPPINGS_LEN,
  77. WL3501_MIB_ATTR_EXCLUDE_UNENCRYPTED,
  78. WL3501_MIB_ATTR_WEP_ICV_ERROR_COUNT,
  79. WL3501_MIB_ATTR_WEP_UNDECRYPTABLE_COUNT,
  80. WL3501_MIB_ATTR_WEP_EXCLUDED_COUNT,
  81. WL3501_MIB_ATTR_MAC_ADDR,
  82. WL3501_MIB_ATTR_GROUP_ADDRS,
  83. WL3501_MIB_ATTR_RTS_THRESHOLD,
  84. WL3501_MIB_ATTR_SHORT_RETRY_LIMIT,
  85. WL3501_MIB_ATTR_LONG_RETRY_LIMIT,
  86. WL3501_MIB_ATTR_FRAG_THRESHOLD,
  87. WL3501_MIB_ATTR_MAX_TX_MSDU_LIFETIME,
  88. WL3501_MIB_ATTR_MAX_RX_LIFETIME,
  89. WL3501_MIB_ATTR_MANUFACTURER_ID,
  90. WL3501_MIB_ATTR_PRODUCT_ID,
  91. WL3501_MIB_ATTR_TX_FRAG_COUNT,
  92. WL3501_MIB_ATTR_MULTICAST_TX_FRAME_COUNT,
  93. WL3501_MIB_ATTR_FAILED_COUNT,
  94. WL3501_MIB_ATTR_RX_FRAG_COUNT,
  95. WL3501_MIB_ATTR_MULTICAST_RX_COUNT,
  96. WL3501_MIB_ATTR_FCS_ERROR_COUNT,
  97. WL3501_MIB_ATTR_RETRY_COUNT,
  98. WL3501_MIB_ATTR_MULTIPLE_RETRY_COUNT,
  99. WL3501_MIB_ATTR_RTS_SUCCESS_COUNT,
  100. WL3501_MIB_ATTR_RTS_FAILURE_COUNT,
  101. WL3501_MIB_ATTR_ACK_FAILURE_COUNT,
  102. WL3501_MIB_ATTR_FRAME_DUPLICATE_COUNT,
  103. WL3501_MIB_ATTR_PHY_TYPE,
  104. WL3501_MIB_ATTR_REG_DOMAINS_SUPPORT,
  105. WL3501_MIB_ATTR_CURRENT_REG_DOMAIN,
  106. WL3501_MIB_ATTR_SLOT_TIME,
  107. WL3501_MIB_ATTR_CCA_TIME,
  108. WL3501_MIB_ATTR_RX_TX_TURNAROUND_TIME,
  109. WL3501_MIB_ATTR_TX_PLCP_DELAY,
  110. WL3501_MIB_ATTR_RX_TX_SWITCH_TIME,
  111. WL3501_MIB_ATTR_TX_RAMP_ON_TIME,
  112. WL3501_MIB_ATTR_TX_RF_DELAY,
  113. WL3501_MIB_ATTR_SIFS_TIME,
  114. WL3501_MIB_ATTR_RX_RF_DELAY,
  115. WL3501_MIB_ATTR_RX_PLCP_DELAY,
  116. WL3501_MIB_ATTR_MAC_PROCESSING_DELAY,
  117. WL3501_MIB_ATTR_TX_RAMP_OFF_TIME,
  118. WL3501_MIB_ATTR_PREAMBLE_LEN,
  119. WL3501_MIB_ATTR_PLCP_HEADER_LEN,
  120. WL3501_MIB_ATTR_MPDU_DURATION_FACTOR,
  121. WL3501_MIB_ATTR_AIR_PROPAGATION_TIME,
  122. WL3501_MIB_ATTR_TEMP_TYPE,
  123. WL3501_MIB_ATTR_CW_MIN,
  124. WL3501_MIB_ATTR_CW_MAX,
  125. WL3501_MIB_ATTR_SUPPORT_DATA_RATES_TX,
  126. WL3501_MIB_ATTR_SUPPORT_DATA_RATES_RX,
  127. WL3501_MIB_ATTR_MPDU_MAX_LEN,
  128. WL3501_MIB_ATTR_SUPPORT_TX_ANTENNAS,
  129. WL3501_MIB_ATTR_CURRENT_TX_ANTENNA,
  130. WL3501_MIB_ATTR_SUPPORT_RX_ANTENNAS,
  131. WL3501_MIB_ATTR_DIVERSITY_SUPPORT,
  132. WL3501_MIB_ATTR_DIVERSITY_SELECTION_RS,
  133. WL3501_MIB_ATTR_NR_SUPPORTED_PWR_LEVELS,
  134. WL3501_MIB_ATTR_TX_PWR_LEVEL1,
  135. WL3501_MIB_ATTR_TX_PWR_LEVEL2,
  136. WL3501_MIB_ATTR_TX_PWR_LEVEL3,
  137. WL3501_MIB_ATTR_TX_PWR_LEVEL4,
  138. WL3501_MIB_ATTR_TX_PWR_LEVEL5,
  139. WL3501_MIB_ATTR_TX_PWR_LEVEL6,
  140. WL3501_MIB_ATTR_TX_PWR_LEVEL7,
  141. WL3501_MIB_ATTR_TX_PWR_LEVEL8,
  142. WL3501_MIB_ATTR_CURRENT_TX_PWR_LEVEL,
  143. WL3501_MIB_ATTR_CURRENT_CHAN,
  144. WL3501_MIB_ATTR_CCA_MODE_SUPPORTED,
  145. WL3501_MIB_ATTR_CURRENT_CCA_MODE,
  146. WL3501_MIB_ATTR_ED_THRESHOLD,
  147. WL3501_MIB_ATTR_SINTHESIZER_LOCKED,
  148. WL3501_MIB_ATTR_CURRENT_PWR_STATE,
  149. WL3501_MIB_ATTR_DOZE_TURNON_TIME,
  150. WL3501_MIB_ATTR_RCR33,
  151. WL3501_MIB_ATTR_DEFAULT_CHAN,
  152. WL3501_MIB_ATTR_SSID,
  153. WL3501_MIB_ATTR_PWR_MGMT_ENABLE,
  154. WL3501_MIB_ATTR_NET_CAPABILITY,
  155. WL3501_MIB_ATTR_ROUTING,
  156. };
  157. enum wl3501_net_type {
  158. WL3501_NET_TYPE_INFRA,
  159. WL3501_NET_TYPE_ADHOC,
  160. WL3501_NET_TYPE_ANY_BSS,
  161. };
  162. enum wl3501_scan_type {
  163. WL3501_SCAN_TYPE_ACTIVE,
  164. WL3501_SCAN_TYPE_PASSIVE,
  165. };
  166. enum wl3501_tx_result {
  167. WL3501_TX_RESULT_SUCCESS,
  168. WL3501_TX_RESULT_NO_BSS,
  169. WL3501_TX_RESULT_RETRY_LIMIT,
  170. };
  171. enum wl3501_sys_type {
  172. WL3501_SYS_TYPE_OPEN,
  173. WL3501_SYS_TYPE_SHARE_KEY,
  174. };
  175. enum wl3501_status {
  176. WL3501_STATUS_SUCCESS,
  177. WL3501_STATUS_INVALID,
  178. WL3501_STATUS_TIMEOUT,
  179. WL3501_STATUS_REFUSED,
  180. WL3501_STATUS_MANY_REQ,
  181. WL3501_STATUS_ALREADY_BSS,
  182. };
  183. #define WL3501_MGMT_CAPABILITY_ESS 0x0001 /* see 802.11 p.58 */
  184. #define WL3501_MGMT_CAPABILITY_IBSS 0x0002 /* - " - */
  185. #define WL3501_MGMT_CAPABILITY_CF_POLLABLE 0x0004 /* - " - */
  186. #define WL3501_MGMT_CAPABILITY_CF_POLL_REQUEST 0x0008 /* - " - */
  187. #define WL3501_MGMT_CAPABILITY_PRIVACY 0x0010 /* - " - */
  188. #define IW_REG_DOMAIN_FCC 0x10 /* Channel 1 to 11 USA */
  189. #define IW_REG_DOMAIN_DOC 0x20 /* Channel 1 to 11 Canada */
  190. #define IW_REG_DOMAIN_ETSI 0x30 /* Channel 1 to 13 Europe */
  191. #define IW_REG_DOMAIN_SPAIN 0x31 /* Channel 10 to 11 Spain */
  192. #define IW_REG_DOMAIN_FRANCE 0x32 /* Channel 10 to 13 France */
  193. #define IW_REG_DOMAIN_MKK 0x40 /* Channel 14 Japan */
  194. #define IW_REG_DOMAIN_MKK1 0x41 /* Channel 1-14 Japan */
  195. #define IW_REG_DOMAIN_ISRAEL 0x50 /* Channel 3 - 9 Israel */
  196. #define IW_MGMT_RATE_LABEL_MANDATORY 128 /* MSB */
  197. enum iw_mgmt_rate_labels {
  198. IW_MGMT_RATE_LABEL_1MBIT = 2,
  199. IW_MGMT_RATE_LABEL_2MBIT = 4,
  200. IW_MGMT_RATE_LABEL_5_5MBIT = 11,
  201. IW_MGMT_RATE_LABEL_11MBIT = 22,
  202. };
  203. enum iw_mgmt_info_element_ids {
  204. IW_MGMT_INFO_ELEMENT_SSID, /* Service Set Identity */
  205. IW_MGMT_INFO_ELEMENT_SUPPORTED_RATES,
  206. IW_MGMT_INFO_ELEMENT_FH_PARAMETER_SET,
  207. IW_MGMT_INFO_ELEMENT_DS_PARAMETER_SET,
  208. IW_MGMT_INFO_ELEMENT_CS_PARAMETER_SET,
  209. IW_MGMT_INFO_ELEMENT_CS_TIM, /* Traffic Information Map */
  210. IW_MGMT_INFO_ELEMENT_IBSS_PARAMETER_SET,
  211. /* 7-15: Reserved, unused */
  212. IW_MGMT_INFO_ELEMENT_CHALLENGE_TEXT = 16,
  213. /* 17-31 Reserved for challenge text extension */
  214. /* 32-255 Reserved, unused */
  215. };
  216. struct iw_mgmt_info_element {
  217. u8 id; /* one of enum iw_mgmt_info_element_ids,
  218. but sizeof(enum) > sizeof(u8) :-( */
  219. u8 len;
  220. u8 data[0];
  221. } __packed;
  222. struct iw_mgmt_essid_pset {
  223. struct iw_mgmt_info_element el;
  224. u8 essid[IW_ESSID_MAX_SIZE];
  225. } __packed;
  226. /*
  227. * According to 802.11 Wireless Netowors, the definitive guide - O'Reilly
  228. * Pg 75
  229. */
  230. #define IW_DATA_RATE_MAX_LABELS 8
  231. struct iw_mgmt_data_rset {
  232. struct iw_mgmt_info_element el;
  233. u8 data_rate_labels[IW_DATA_RATE_MAX_LABELS];
  234. } __packed;
  235. struct iw_mgmt_ds_pset {
  236. struct iw_mgmt_info_element el;
  237. u8 chan;
  238. } __packed;
  239. struct iw_mgmt_cf_pset {
  240. struct iw_mgmt_info_element el;
  241. u8 cfp_count;
  242. u8 cfp_period;
  243. u16 cfp_max_duration;
  244. u16 cfp_dur_remaining;
  245. } __packed;
  246. struct iw_mgmt_ibss_pset {
  247. struct iw_mgmt_info_element el;
  248. u16 atim_window;
  249. } __packed;
  250. struct wl3501_tx_hdr {
  251. u16 tx_cnt;
  252. u8 sync[16];
  253. u16 sfd;
  254. u8 signal;
  255. u8 service;
  256. u16 len;
  257. u16 crc16;
  258. u16 frame_ctrl;
  259. u16 duration_id;
  260. u8 addr1[ETH_ALEN];
  261. u8 addr2[ETH_ALEN];
  262. u8 addr3[ETH_ALEN];
  263. u16 seq_ctrl;
  264. u8 addr4[ETH_ALEN];
  265. };
  266. struct wl3501_rx_hdr {
  267. u16 rx_next_blk;
  268. u16 rc_next_frame_blk;
  269. u8 rx_blk_ctrl;
  270. u8 rx_next_frame;
  271. u8 rx_next_frame1;
  272. u8 rssi;
  273. char time[8];
  274. u8 signal;
  275. u8 service;
  276. u16 len;
  277. u16 crc16;
  278. u16 frame_ctrl;
  279. u16 duration;
  280. u8 addr1[ETH_ALEN];
  281. u8 addr2[ETH_ALEN];
  282. u8 addr3[ETH_ALEN];
  283. u16 seq;
  284. u8 addr4[ETH_ALEN];
  285. };
  286. struct wl3501_start_req {
  287. u16 next_blk;
  288. u8 sig_id;
  289. u8 bss_type;
  290. u16 beacon_period;
  291. u16 dtim_period;
  292. u16 probe_delay;
  293. u16 cap_info;
  294. struct iw_mgmt_essid_pset ssid;
  295. struct iw_mgmt_data_rset bss_basic_rset;
  296. struct iw_mgmt_data_rset operational_rset;
  297. struct iw_mgmt_cf_pset cf_pset;
  298. struct iw_mgmt_ds_pset ds_pset;
  299. struct iw_mgmt_ibss_pset ibss_pset;
  300. };
  301. struct wl3501_assoc_req {
  302. u16 next_blk;
  303. u8 sig_id;
  304. u8 reserved;
  305. u16 timeout;
  306. u16 cap_info;
  307. u16 listen_interval;
  308. u8 mac_addr[ETH_ALEN];
  309. };
  310. struct wl3501_assoc_confirm {
  311. u16 next_blk;
  312. u8 sig_id;
  313. u8 reserved;
  314. u16 status;
  315. };
  316. struct wl3501_assoc_ind {
  317. u16 next_blk;
  318. u8 sig_id;
  319. u8 mac_addr[ETH_ALEN];
  320. };
  321. struct wl3501_auth_req {
  322. u16 next_blk;
  323. u8 sig_id;
  324. u8 reserved;
  325. u16 type;
  326. u16 timeout;
  327. u8 mac_addr[ETH_ALEN];
  328. };
  329. struct wl3501_auth_confirm {
  330. u16 next_blk;
  331. u8 sig_id;
  332. u8 reserved;
  333. u16 type;
  334. u16 status;
  335. u8 mac_addr[ETH_ALEN];
  336. };
  337. struct wl3501_get_req {
  338. u16 next_blk;
  339. u8 sig_id;
  340. u8 reserved;
  341. u16 mib_attrib;
  342. };
  343. struct wl3501_get_confirm {
  344. u16 next_blk;
  345. u8 sig_id;
  346. u8 reserved;
  347. u16 mib_status;
  348. u16 mib_attrib;
  349. u8 mib_value[100];
  350. };
  351. struct wl3501_req {
  352. u16 beacon_period;
  353. u16 dtim_period;
  354. u16 cap_info;
  355. u8 bss_type;
  356. u8 bssid[ETH_ALEN];
  357. struct iw_mgmt_essid_pset ssid;
  358. struct iw_mgmt_ds_pset ds_pset;
  359. struct iw_mgmt_cf_pset cf_pset;
  360. struct iw_mgmt_ibss_pset ibss_pset;
  361. struct iw_mgmt_data_rset bss_basic_rset;
  362. };
  363. struct wl3501_join_req {
  364. u16 next_blk;
  365. u8 sig_id;
  366. u8 reserved;
  367. struct iw_mgmt_data_rset operational_rset;
  368. u16 reserved2;
  369. u16 timeout;
  370. u16 probe_delay;
  371. u8 timestamp[8];
  372. u8 local_time[8];
  373. struct wl3501_req req;
  374. };
  375. struct wl3501_join_confirm {
  376. u16 next_blk;
  377. u8 sig_id;
  378. u8 reserved;
  379. u16 status;
  380. };
  381. struct wl3501_pwr_mgmt_req {
  382. u16 next_blk;
  383. u8 sig_id;
  384. u8 pwr_save;
  385. u8 wake_up;
  386. u8 receive_dtims;
  387. };
  388. struct wl3501_pwr_mgmt_confirm {
  389. u16 next_blk;
  390. u8 sig_id;
  391. u8 reserved;
  392. u16 status;
  393. };
  394. struct wl3501_scan_req {
  395. u16 next_blk;
  396. u8 sig_id;
  397. u8 bss_type;
  398. u16 probe_delay;
  399. u16 min_chan_time;
  400. u16 max_chan_time;
  401. u8 chan_list[14];
  402. u8 bssid[ETH_ALEN];
  403. struct iw_mgmt_essid_pset ssid;
  404. enum wl3501_scan_type scan_type;
  405. };
  406. struct wl3501_scan_confirm {
  407. u16 next_blk;
  408. u8 sig_id;
  409. u8 reserved;
  410. u16 status;
  411. char timestamp[8];
  412. char localtime[8];
  413. struct wl3501_req req;
  414. u8 rssi;
  415. };
  416. struct wl3501_start_confirm {
  417. u16 next_blk;
  418. u8 sig_id;
  419. u8 reserved;
  420. u16 status;
  421. };
  422. struct wl3501_md_req {
  423. u16 next_blk;
  424. u8 sig_id;
  425. u8 routing;
  426. u16 data;
  427. u16 size;
  428. u8 pri;
  429. u8 service_class;
  430. struct {
  431. u8 daddr[ETH_ALEN];
  432. u8 saddr[ETH_ALEN];
  433. } addr;
  434. };
  435. struct wl3501_md_ind {
  436. u16 next_blk;
  437. u8 sig_id;
  438. u8 routing;
  439. u16 data;
  440. u16 size;
  441. u8 reception;
  442. u8 pri;
  443. u8 service_class;
  444. struct {
  445. u8 daddr[ETH_ALEN];
  446. u8 saddr[ETH_ALEN];
  447. } addr;
  448. };
  449. struct wl3501_md_confirm {
  450. u16 next_blk;
  451. u8 sig_id;
  452. u8 reserved;
  453. u16 data;
  454. u8 status;
  455. u8 pri;
  456. u8 service_class;
  457. };
  458. struct wl3501_resync_req {
  459. u16 next_blk;
  460. u8 sig_id;
  461. };
  462. /* Definitions for supporting clone adapters. */
  463. /* System Interface Registers (SIR space) */
  464. #define WL3501_NIC_GCR ((u8)0x00) /* SIR0 - General Conf Register */
  465. #define WL3501_NIC_BSS ((u8)0x01) /* SIR1 - Bank Switching Select Reg */
  466. #define WL3501_NIC_LMAL ((u8)0x02) /* SIR2 - Local Mem addr Reg [7:0] */
  467. #define WL3501_NIC_LMAH ((u8)0x03) /* SIR3 - Local Mem addr Reg [14:8] */
  468. #define WL3501_NIC_IODPA ((u8)0x04) /* SIR4 - I/O Data Port A */
  469. #define WL3501_NIC_IODPB ((u8)0x05) /* SIR5 - I/O Data Port B */
  470. #define WL3501_NIC_IODPC ((u8)0x06) /* SIR6 - I/O Data Port C */
  471. #define WL3501_NIC_IODPD ((u8)0x07) /* SIR7 - I/O Data Port D */
  472. /* Bits in GCR */
  473. #define WL3501_GCR_SWRESET ((u8)0x80)
  474. #define WL3501_GCR_CORESET ((u8)0x40)
  475. #define WL3501_GCR_DISPWDN ((u8)0x20)
  476. #define WL3501_GCR_ECWAIT ((u8)0x10)
  477. #define WL3501_GCR_ECINT ((u8)0x08)
  478. #define WL3501_GCR_INT2EC ((u8)0x04)
  479. #define WL3501_GCR_ENECINT ((u8)0x02)
  480. #define WL3501_GCR_DAM ((u8)0x01)
  481. /* Bits in BSS (Bank Switching Select Register) */
  482. #define WL3501_BSS_FPAGE0 ((u8)0x20) /* Flash memory page0 */
  483. #define WL3501_BSS_FPAGE1 ((u8)0x28)
  484. #define WL3501_BSS_FPAGE2 ((u8)0x30)
  485. #define WL3501_BSS_FPAGE3 ((u8)0x38)
  486. #define WL3501_BSS_SPAGE0 ((u8)0x00) /* SRAM page0 */
  487. #define WL3501_BSS_SPAGE1 ((u8)0x08)
  488. #define WL3501_BSS_SPAGE2 ((u8)0x10)
  489. #define WL3501_BSS_SPAGE3 ((u8)0x18)
  490. /* Define Driver Interface */
  491. /* Refer IEEE 802.11 */
  492. /* Tx packet header, include PLCP and MPDU */
  493. /* Tx PLCP Header */
  494. struct wl3501_80211_tx_plcp_hdr {
  495. u8 sync[16];
  496. u16 sfd;
  497. u8 signal;
  498. u8 service;
  499. u16 len;
  500. u16 crc16;
  501. } __packed;
  502. struct wl3501_80211_tx_hdr {
  503. struct wl3501_80211_tx_plcp_hdr pclp_hdr;
  504. struct ieee80211_hdr mac_hdr;
  505. } __packed;
  506. /*
  507. Reserve the beginning Tx space for descriptor use.
  508. TxBlockOffset --> *----*----*----*----* \
  509. (TxFreeDesc) | 0 | 1 | 2 | 3 | \
  510. | 4 | 5 | 6 | 7 | |
  511. | 8 | 9 | 10 | 11 | TX_DESC * 20
  512. | 12 | 13 | 14 | 15 | |
  513. | 16 | 17 | 18 | 19 | /
  514. TxBufferBegin --> *----*----*----*----* /
  515. (TxBufferHead) | |
  516. (TxBufferTail) | |
  517. | Send Buffer |
  518. | |
  519. | |
  520. *-------------------*
  521. TxBufferEnd -------------------------/
  522. */
  523. struct wl3501_card {
  524. int base_addr;
  525. u8 mac_addr[ETH_ALEN];
  526. spinlock_t lock;
  527. wait_queue_head_t wait;
  528. struct wl3501_get_confirm sig_get_confirm;
  529. struct wl3501_pwr_mgmt_confirm sig_pwr_mgmt_confirm;
  530. u16 tx_buffer_size;
  531. u16 tx_buffer_head;
  532. u16 tx_buffer_tail;
  533. u16 tx_buffer_cnt;
  534. u16 esbq_req_start;
  535. u16 esbq_req_end;
  536. u16 esbq_req_head;
  537. u16 esbq_req_tail;
  538. u16 esbq_confirm_start;
  539. u16 esbq_confirm_end;
  540. u16 esbq_confirm;
  541. struct iw_mgmt_essid_pset essid;
  542. struct iw_mgmt_essid_pset keep_essid;
  543. u8 bssid[ETH_ALEN];
  544. int net_type;
  545. char nick[32];
  546. char card_name[32];
  547. char firmware_date[32];
  548. u8 chan;
  549. u8 cap_info;
  550. u16 start_seg;
  551. u16 bss_cnt;
  552. u16 join_sta_bss;
  553. u8 rssi;
  554. u8 adhoc_times;
  555. u8 reg_domain;
  556. u8 version[2];
  557. struct wl3501_scan_confirm bss_set[20];
  558. struct iw_statistics wstats;
  559. struct iw_spy_data spy_data;
  560. struct iw_public_data wireless_data;
  561. struct pcmcia_device *p_dev;
  562. };
  563. #endif