p54common.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. #ifndef P54COMMON_H
  2. #define P54COMMON_H
  3. /*
  4. * Common code specific definitions for mac80211 Prism54 drivers
  5. *
  6. * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
  7. * Copyright (c) 2007, Christian Lamparter <chunkeey@web.de>
  8. *
  9. * Based on:
  10. * - the islsm (softmac prism54) driver, which is:
  11. * Copyright 2004-2006 Jean-Baptiste Note <jbnote@gmail.com>, et al.
  12. *
  13. * - LMAC API interface header file for STLC4560 (lmac_longbow.h)
  14. * Copyright (C) 2007 Conexant Systems, Inc.
  15. *
  16. * This program is free software; you can redistribute it and/or modify
  17. * it under the terms of the GNU General Public License version 2 as
  18. * published by the Free Software Foundation.
  19. */
  20. struct bootrec {
  21. __le32 code;
  22. __le32 len;
  23. u32 data[10];
  24. } __attribute__((packed));
  25. #define PDR_SYNTH_FRONTEND_MASK 0x0007
  26. #define PDR_SYNTH_FRONTEND_DUETTE3 0x0001
  27. #define PDR_SYNTH_FRONTEND_DUETTE2 0x0002
  28. #define PDR_SYNTH_FRONTEND_FRISBEE 0x0003
  29. #define PDR_SYNTH_FRONTEND_XBOW 0x0004
  30. #define PDR_SYNTH_FRONTEND_LONGBOW 0x0005
  31. #define PDR_SYNTH_IQ_CAL_MASK 0x0018
  32. #define PDR_SYNTH_IQ_CAL_PA_DETECTOR 0x0000
  33. #define PDR_SYNTH_IQ_CAL_DISABLED 0x0008
  34. #define PDR_SYNTH_IQ_CAL_ZIF 0x0010
  35. #define PDR_SYNTH_FAA_SWITCH_MASK 0x0020
  36. #define PDR_SYNTH_FAA_SWITCH_ENABLED 0x0020
  37. #define PDR_SYNTH_24_GHZ_MASK 0x0040
  38. #define PDR_SYNTH_24_GHZ_DISABLED 0x0040
  39. #define PDR_SYNTH_5_GHZ_MASK 0x0080
  40. #define PDR_SYNTH_5_GHZ_DISABLED 0x0080
  41. #define PDR_SYNTH_RX_DIV_MASK 0x0100
  42. #define PDR_SYNTH_RX_DIV_SUPPORTED 0x0100
  43. #define PDR_SYNTH_TX_DIV_MASK 0x0200
  44. #define PDR_SYNTH_TX_DIV_SUPPORTED 0x0200
  45. struct bootrec_exp_if {
  46. __le16 role;
  47. __le16 if_id;
  48. __le16 variant;
  49. __le16 btm_compat;
  50. __le16 top_compat;
  51. } __attribute__((packed));
  52. #define BR_DESC_PRIV_CAP_WEP BIT(0)
  53. #define BR_DESC_PRIV_CAP_TKIP BIT(1)
  54. #define BR_DESC_PRIV_CAP_MICHAEL BIT(2)
  55. #define BR_DESC_PRIV_CAP_CCX_CP BIT(3)
  56. #define BR_DESC_PRIV_CAP_CCX_MIC BIT(4)
  57. #define BR_DESC_PRIV_CAP_AESCCMP BIT(5)
  58. struct bootrec_desc {
  59. __le16 modes;
  60. __le16 flags;
  61. __le32 rx_start;
  62. __le32 rx_end;
  63. u8 headroom;
  64. u8 tailroom;
  65. u8 tx_queues;
  66. u8 tx_depth;
  67. u8 privacy_caps;
  68. u8 rx_keycache_size;
  69. u8 time_size;
  70. u8 padding;
  71. u8 rates[16];
  72. u8 padding2[4];
  73. __le16 rx_mtu;
  74. } __attribute__((packed));
  75. #define BR_CODE_MIN 0x80000000
  76. #define BR_CODE_COMPONENT_ID 0x80000001
  77. #define BR_CODE_COMPONENT_VERSION 0x80000002
  78. #define BR_CODE_DEPENDENT_IF 0x80000003
  79. #define BR_CODE_EXPOSED_IF 0x80000004
  80. #define BR_CODE_DESCR 0x80000101
  81. #define BR_CODE_MAX 0x8FFFFFFF
  82. #define BR_CODE_END_OF_BRA 0xFF0000FF
  83. #define LEGACY_BR_CODE_END_OF_BRA 0xFFFFFFFF
  84. #define P54_HDR_FLAG_DATA_ALIGN BIT(14)
  85. #define P54_HDR_FLAG_DATA_OUT_PROMISC BIT(0)
  86. #define P54_HDR_FLAG_DATA_OUT_TIMESTAMP BIT(1)
  87. #define P54_HDR_FLAG_DATA_OUT_SEQNR BIT(2)
  88. #define P54_HDR_FLAG_DATA_OUT_BIT3 BIT(3)
  89. #define P54_HDR_FLAG_DATA_OUT_BURST BIT(4)
  90. #define P54_HDR_FLAG_DATA_OUT_NOCANCEL BIT(5)
  91. #define P54_HDR_FLAG_DATA_OUT_CLEARTIM BIT(6)
  92. #define P54_HDR_FLAG_DATA_OUT_HITCHHIKE BIT(7)
  93. #define P54_HDR_FLAG_DATA_OUT_COMPRESS BIT(8)
  94. #define P54_HDR_FLAG_DATA_OUT_CONCAT BIT(9)
  95. #define P54_HDR_FLAG_DATA_OUT_PCS_ACCEPT BIT(10)
  96. #define P54_HDR_FLAG_DATA_OUT_WAITEOSP BIT(11)
  97. #define P54_HDR_FLAG_DATA_IN_FCS_GOOD BIT(0)
  98. #define P54_HDR_FLAG_DATA_IN_MATCH_MAC BIT(1)
  99. #define P54_HDR_FLAG_DATA_IN_MCBC BIT(2)
  100. #define P54_HDR_FLAG_DATA_IN_BEACON BIT(3)
  101. #define P54_HDR_FLAG_DATA_IN_MATCH_BSS BIT(4)
  102. #define P54_HDR_FLAG_DATA_IN_BCAST_BSS BIT(5)
  103. #define P54_HDR_FLAG_DATA_IN_DATA BIT(6)
  104. #define P54_HDR_FLAG_DATA_IN_TRUNCATED BIT(7)
  105. #define P54_HDR_FLAG_DATA_IN_BIT8 BIT(8)
  106. #define P54_HDR_FLAG_DATA_IN_TRANSPARENT BIT(9)
  107. /* PDA defines are Copyright (C) 2005 Nokia Corporation (taken from islsm_pda.h) */
  108. struct pda_entry {
  109. __le16 len; /* includes both code and data */
  110. __le16 code;
  111. u8 data[0];
  112. } __attribute__ ((packed));
  113. struct eeprom_pda_wrap {
  114. __le32 magic;
  115. __le16 pad;
  116. __le16 len;
  117. __le32 arm_opcode;
  118. u8 data[0];
  119. } __attribute__ ((packed));
  120. struct p54_iq_autocal_entry {
  121. __le16 iq_param[4];
  122. } __attribute__ ((packed));
  123. struct pda_iq_autocal_entry {
  124. __le16 freq;
  125. struct p54_iq_autocal_entry params;
  126. } __attribute__ ((packed));
  127. struct pda_channel_output_limit {
  128. __le16 freq;
  129. u8 val_bpsk;
  130. u8 val_qpsk;
  131. u8 val_16qam;
  132. u8 val_64qam;
  133. u8 rate_set_mask;
  134. u8 rate_set_size;
  135. } __attribute__ ((packed));
  136. struct pda_pa_curve_data_sample_rev0 {
  137. u8 rf_power;
  138. u8 pa_detector;
  139. u8 pcv;
  140. } __attribute__ ((packed));
  141. struct pda_pa_curve_data_sample_rev1 {
  142. u8 rf_power;
  143. u8 pa_detector;
  144. u8 data_barker;
  145. u8 data_bpsk;
  146. u8 data_qpsk;
  147. u8 data_16qam;
  148. u8 data_64qam;
  149. } __attribute__ ((packed));
  150. struct p54_pa_curve_data_sample {
  151. u8 rf_power;
  152. u8 pa_detector;
  153. u8 data_barker;
  154. u8 data_bpsk;
  155. u8 data_qpsk;
  156. u8 data_16qam;
  157. u8 data_64qam;
  158. u8 padding;
  159. } __attribute__ ((packed));
  160. struct pda_pa_curve_data {
  161. u8 cal_method_rev;
  162. u8 channels;
  163. u8 points_per_channel;
  164. u8 padding;
  165. u8 data[0];
  166. } __attribute__ ((packed));
  167. struct pda_rssi_cal_entry {
  168. __le16 mul;
  169. __le16 add;
  170. } __attribute__ ((packed));
  171. struct pda_country {
  172. u8 regdomain;
  173. u8 alpha2[2];
  174. u8 flags;
  175. } __attribute__ ((packed));
  176. /*
  177. * Warning: Longbow's structures are bogus.
  178. */
  179. struct p54_channel_output_limit_longbow {
  180. __le16 rf_power_points[12];
  181. } __attribute__ ((packed));
  182. struct p54_pa_curve_data_sample_longbow {
  183. __le16 rf_power;
  184. __le16 pa_detector;
  185. struct {
  186. __le16 data[4];
  187. } points[3] __attribute__ ((packed));
  188. } __attribute__ ((packed));
  189. struct pda_custom_wrapper {
  190. __le16 entries;
  191. __le16 entry_size;
  192. __le16 offset;
  193. __le16 len;
  194. u8 data[0];
  195. } __attribute__ ((packed));
  196. /*
  197. * this defines the PDR codes used to build PDAs as defined in document
  198. * number 553155. The current implementation mirrors version 1.1 of the
  199. * document and lists only PDRs supported by the ARM platform.
  200. */
  201. /* common and choice range (0x0000 - 0x0fff) */
  202. #define PDR_END 0x0000
  203. #define PDR_MANUFACTURING_PART_NUMBER 0x0001
  204. #define PDR_PDA_VERSION 0x0002
  205. #define PDR_NIC_SERIAL_NUMBER 0x0003
  206. #define PDR_MAC_ADDRESS 0x0101
  207. #define PDR_REGULATORY_DOMAIN_LIST 0x0103
  208. #define PDR_TEMPERATURE_TYPE 0x0107
  209. #define PDR_PRISM_PCI_IDENTIFIER 0x0402
  210. /* ARM range (0x1000 - 0x1fff) */
  211. #define PDR_COUNTRY_INFORMATION 0x1000
  212. #define PDR_INTERFACE_LIST 0x1001
  213. #define PDR_HARDWARE_PLATFORM_COMPONENT_ID 0x1002
  214. #define PDR_OEM_NAME 0x1003
  215. #define PDR_PRODUCT_NAME 0x1004
  216. #define PDR_UTF8_OEM_NAME 0x1005
  217. #define PDR_UTF8_PRODUCT_NAME 0x1006
  218. #define PDR_COUNTRY_LIST 0x1007
  219. #define PDR_DEFAULT_COUNTRY 0x1008
  220. #define PDR_ANTENNA_GAIN 0x1100
  221. #define PDR_PRISM_INDIGO_PA_CALIBRATION_DATA 0x1901
  222. #define PDR_RSSI_LINEAR_APPROXIMATION 0x1902
  223. #define PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS 0x1903
  224. #define PDR_PRISM_PA_CAL_CURVE_DATA 0x1904
  225. #define PDR_RSSI_LINEAR_APPROXIMATION_DUAL_BAND 0x1905
  226. #define PDR_PRISM_ZIF_TX_IQ_CALIBRATION 0x1906
  227. #define PDR_REGULATORY_POWER_LIMITS 0x1907
  228. #define PDR_RSSI_LINEAR_APPROXIMATION_EXTENDED 0x1908
  229. #define PDR_RADIATED_TRANSMISSION_CORRECTION 0x1909
  230. #define PDR_PRISM_TX_IQ_CALIBRATION 0x190a
  231. /* reserved range (0x2000 - 0x7fff) */
  232. /* customer range (0x8000 - 0xffff) */
  233. #define PDR_BASEBAND_REGISTERS 0x8000
  234. #define PDR_PER_CHANNEL_BASEBAND_REGISTERS 0x8001
  235. /* used by our modificated eeprom image */
  236. #define PDR_RSSI_LINEAR_APPROXIMATION_CUSTOM 0xDEAD
  237. #define PDR_PRISM_PA_CAL_OUTPUT_POWER_LIMITS_CUSTOM 0xBEEF
  238. #define PDR_PRISM_PA_CAL_CURVE_DATA_CUSTOM 0xB05D
  239. /* PDR definitions for default country & country list */
  240. #define PDR_COUNTRY_CERT_CODE 0x80
  241. #define PDR_COUNTRY_CERT_CODE_REAL 0x00
  242. #define PDR_COUNTRY_CERT_CODE_PSEUDO 0x80
  243. #define PDR_COUNTRY_CERT_BAND 0x40
  244. #define PDR_COUNTRY_CERT_BAND_2GHZ 0x00
  245. #define PDR_COUNTRY_CERT_BAND_5GHZ 0x40
  246. #define PDR_COUNTRY_CERT_IODOOR 0x30
  247. #define PDR_COUNTRY_CERT_IODOOR_BOTH 0x00
  248. #define PDR_COUNTRY_CERT_IODOOR_INDOOR 0x20
  249. #define PDR_COUNTRY_CERT_IODOOR_OUTDOOR 0x30
  250. #define PDR_COUNTRY_CERT_INDEX 0x0F
  251. struct p54_eeprom_lm86 {
  252. union {
  253. struct {
  254. __le16 offset;
  255. __le16 len;
  256. u8 data[0];
  257. } v1;
  258. struct {
  259. __le32 offset;
  260. __le16 len;
  261. u8 magic2;
  262. u8 pad;
  263. u8 magic[4];
  264. u8 data[0];
  265. } v2;
  266. } __attribute__ ((packed));
  267. } __attribute__ ((packed));
  268. enum p54_rx_decrypt_status {
  269. P54_DECRYPT_NONE = 0,
  270. P54_DECRYPT_OK,
  271. P54_DECRYPT_NOKEY,
  272. P54_DECRYPT_NOMICHAEL,
  273. P54_DECRYPT_NOCKIPMIC,
  274. P54_DECRYPT_FAIL_WEP,
  275. P54_DECRYPT_FAIL_TKIP,
  276. P54_DECRYPT_FAIL_MICHAEL,
  277. P54_DECRYPT_FAIL_CKIPKP,
  278. P54_DECRYPT_FAIL_CKIPMIC,
  279. P54_DECRYPT_FAIL_AESCCMP
  280. };
  281. struct p54_rx_data {
  282. __le16 flags;
  283. __le16 len;
  284. __le16 freq;
  285. u8 antenna;
  286. u8 rate;
  287. u8 rssi;
  288. u8 quality;
  289. u8 decrypt_status;
  290. u8 rssi_raw;
  291. __le32 tsf32;
  292. __le32 unalloc0;
  293. u8 align[0];
  294. } __attribute__ ((packed));
  295. enum p54_trap_type {
  296. P54_TRAP_SCAN = 0,
  297. P54_TRAP_TIMER,
  298. P54_TRAP_BEACON_TX,
  299. P54_TRAP_FAA_RADIO_ON,
  300. P54_TRAP_FAA_RADIO_OFF,
  301. P54_TRAP_RADAR,
  302. P54_TRAP_NO_BEACON,
  303. P54_TRAP_TBTT,
  304. P54_TRAP_SCO_ENTER,
  305. P54_TRAP_SCO_EXIT
  306. };
  307. struct p54_trap {
  308. __le16 event;
  309. __le16 frequency;
  310. } __attribute__ ((packed));
  311. enum p54_frame_sent_status {
  312. P54_TX_OK = 0,
  313. P54_TX_FAILED,
  314. P54_TX_PSM,
  315. P54_TX_PSM_CANCELLED = 4
  316. };
  317. struct p54_frame_sent {
  318. u8 status;
  319. u8 tries;
  320. u8 ack_rssi;
  321. u8 quality;
  322. __le16 seq;
  323. u8 antenna;
  324. u8 padding;
  325. } __attribute__ ((packed));
  326. enum p54_tx_data_crypt {
  327. P54_CRYPTO_NONE = 0,
  328. P54_CRYPTO_WEP,
  329. P54_CRYPTO_TKIP,
  330. P54_CRYPTO_TKIPMICHAEL,
  331. P54_CRYPTO_CCX_WEPMIC,
  332. P54_CRYPTO_CCX_KPMIC,
  333. P54_CRYPTO_CCX_KP,
  334. P54_CRYPTO_AESCCMP
  335. };
  336. enum p54_tx_data_queue {
  337. P54_QUEUE_BEACON = 0,
  338. P54_QUEUE_FWSCAN = 1,
  339. P54_QUEUE_MGMT = 2,
  340. P54_QUEUE_CAB = 3,
  341. P54_QUEUE_DATA = 4,
  342. P54_QUEUE_AC_NUM = 4,
  343. P54_QUEUE_AC_VO = 4,
  344. P54_QUEUE_AC_VI = 5,
  345. P54_QUEUE_AC_BE = 6,
  346. P54_QUEUE_AC_BK = 7,
  347. /* keep last */
  348. P54_QUEUE_NUM = 8,
  349. };
  350. struct p54_tx_data {
  351. u8 rateset[8];
  352. u8 rts_rate_idx;
  353. u8 crypt_offset;
  354. u8 key_type;
  355. u8 key_len;
  356. u8 key[16];
  357. u8 hw_queue;
  358. u8 backlog;
  359. __le16 durations[4];
  360. u8 tx_antenna;
  361. union {
  362. struct {
  363. u8 cts_rate;
  364. __le16 output_power;
  365. } __attribute__((packed)) longbow;
  366. struct {
  367. u8 output_power;
  368. u8 cts_rate;
  369. u8 unalloc;
  370. } __attribute__ ((packed)) normal;
  371. } __attribute__ ((packed));
  372. u8 unalloc2[2];
  373. u8 align[0];
  374. } __attribute__ ((packed));
  375. /* unit is ms */
  376. #define P54_TX_FRAME_LIFETIME 2000
  377. #define P54_TX_TIMEOUT 4000
  378. #define P54_STATISTICS_UPDATE 5000
  379. #define P54_FILTER_TYPE_NONE 0
  380. #define P54_FILTER_TYPE_STATION BIT(0)
  381. #define P54_FILTER_TYPE_IBSS BIT(1)
  382. #define P54_FILTER_TYPE_AP BIT(2)
  383. #define P54_FILTER_TYPE_TRANSPARENT BIT(3)
  384. #define P54_FILTER_TYPE_PROMISCUOUS BIT(4)
  385. #define P54_FILTER_TYPE_HIBERNATE BIT(5)
  386. #define P54_FILTER_TYPE_NOACK BIT(6)
  387. #define P54_FILTER_TYPE_RX_DISABLED BIT(7)
  388. struct p54_setup_mac {
  389. __le16 mac_mode;
  390. u8 mac_addr[ETH_ALEN];
  391. u8 bssid[ETH_ALEN];
  392. u8 rx_antenna;
  393. u8 rx_align;
  394. union {
  395. struct {
  396. __le32 basic_rate_mask;
  397. u8 rts_rates[8];
  398. __le32 rx_addr;
  399. __le16 max_rx;
  400. __le16 rxhw;
  401. __le16 wakeup_timer;
  402. __le16 unalloc0;
  403. } v1 __attribute__ ((packed));
  404. struct {
  405. __le32 rx_addr;
  406. __le16 max_rx;
  407. __le16 rxhw;
  408. __le16 timer;
  409. __le16 truncate;
  410. __le32 basic_rate_mask;
  411. u8 sbss_offset;
  412. u8 mcast_window;
  413. u8 rx_rssi_threshold;
  414. u8 rx_ed_threshold;
  415. __le32 ref_clock;
  416. __le16 lpf_bandwidth;
  417. __le16 osc_start_delay;
  418. } v2 __attribute__ ((packed));
  419. } __attribute__ ((packed));
  420. } __attribute__ ((packed));
  421. #define P54_SETUP_V1_LEN 40
  422. #define P54_SETUP_V2_LEN (sizeof(struct p54_setup_mac))
  423. #define P54_SCAN_EXIT BIT(0)
  424. #define P54_SCAN_TRAP BIT(1)
  425. #define P54_SCAN_ACTIVE BIT(2)
  426. #define P54_SCAN_FILTER BIT(3)
  427. struct p54_scan_head {
  428. __le16 mode;
  429. __le16 dwell;
  430. u8 scan_params[20];
  431. __le16 freq;
  432. } __attribute__ ((packed));
  433. struct p54_scan_body {
  434. u8 pa_points_per_curve;
  435. u8 val_barker;
  436. u8 val_bpsk;
  437. u8 val_qpsk;
  438. u8 val_16qam;
  439. u8 val_64qam;
  440. struct p54_pa_curve_data_sample curve_data[8];
  441. u8 dup_bpsk;
  442. u8 dup_qpsk;
  443. u8 dup_16qam;
  444. u8 dup_64qam;
  445. } __attribute__ ((packed));
  446. struct p54_scan_body_longbow {
  447. struct p54_channel_output_limit_longbow power_limits;
  448. struct p54_pa_curve_data_sample_longbow curve_data[8];
  449. __le16 unkn[6]; /* maybe more power_limits or rate_mask */
  450. } __attribute__ ((packed));
  451. union p54_scan_body_union {
  452. struct p54_scan_body normal;
  453. struct p54_scan_body_longbow longbow;
  454. } __attribute__ ((packed));
  455. struct p54_scan_tail_rate {
  456. __le32 basic_rate_mask;
  457. u8 rts_rates[8];
  458. } __attribute__ ((packed));
  459. struct p54_led {
  460. __le16 flags;
  461. __le16 mask[2];
  462. __le16 delay[2];
  463. } __attribute__ ((packed));
  464. struct p54_edcf {
  465. u8 flags;
  466. u8 slottime;
  467. u8 sifs;
  468. u8 eofpad;
  469. struct p54_edcf_queue_param queue[8];
  470. u8 mapping[4];
  471. __le16 frameburst;
  472. __le16 round_trip_delay;
  473. } __attribute__ ((packed));
  474. struct p54_statistics {
  475. __le32 rx_success;
  476. __le32 rx_bad_fcs;
  477. __le32 rx_abort;
  478. __le32 rx_abort_phy;
  479. __le32 rts_success;
  480. __le32 rts_fail;
  481. __le32 tsf32;
  482. __le32 airtime;
  483. __le32 noise;
  484. __le32 sample_noise[8];
  485. __le32 sample_cca;
  486. __le32 sample_tx;
  487. } __attribute__ ((packed));
  488. struct p54_xbow_synth {
  489. __le16 magic1;
  490. __le16 magic2;
  491. __le16 freq;
  492. u32 padding[5];
  493. } __attribute__ ((packed));
  494. struct p54_timer {
  495. __le32 interval;
  496. } __attribute__ ((packed));
  497. struct p54_keycache {
  498. u8 entry;
  499. u8 key_id;
  500. u8 mac[ETH_ALEN];
  501. u8 padding[2];
  502. u8 key_type;
  503. u8 key_len;
  504. u8 key[24];
  505. } __attribute__ ((packed));
  506. struct p54_burst {
  507. u8 flags;
  508. u8 queue;
  509. u8 backlog;
  510. u8 pad;
  511. __le16 durations[32];
  512. } __attribute__ ((packed));
  513. struct p54_psm_interval {
  514. __le16 interval;
  515. __le16 periods;
  516. } __attribute__ ((packed));
  517. #define P54_PSM_CAM 0
  518. #define P54_PSM BIT(0)
  519. #define P54_PSM_DTIM BIT(1)
  520. #define P54_PSM_MCBC BIT(2)
  521. #define P54_PSM_CHECKSUM BIT(3)
  522. #define P54_PSM_SKIP_MORE_DATA BIT(4)
  523. #define P54_PSM_BEACON_TIMEOUT BIT(5)
  524. #define P54_PSM_HFOSLEEP BIT(6)
  525. #define P54_PSM_AUTOSWITCH_SLEEP BIT(7)
  526. #define P54_PSM_LPIT BIT(8)
  527. #define P54_PSM_BF_UCAST_SKIP BIT(9)
  528. #define P54_PSM_BF_MCAST_SKIP BIT(10)
  529. struct p54_psm {
  530. __le16 mode;
  531. __le16 aid;
  532. struct p54_psm_interval intervals[4];
  533. u8 beacon_rssi_skip_max;
  534. u8 rssi_delta_threshold;
  535. u8 nr;
  536. u8 exclude[1];
  537. } __attribute__ ((packed));
  538. #define MC_FILTER_ADDRESS_NUM 4
  539. struct p54_group_address_table {
  540. __le16 filter_enable;
  541. __le16 num_address;
  542. u8 mac_list[MC_FILTER_ADDRESS_NUM][ETH_ALEN];
  543. } __attribute__ ((packed));
  544. struct p54_txcancel {
  545. __le32 req_id;
  546. } __attribute__ ((packed));
  547. struct p54_sta_unlock {
  548. u8 addr[ETH_ALEN];
  549. u16 padding;
  550. } __attribute__ ((packed));
  551. #define P54_TIM_CLEAR BIT(15)
  552. struct p54_tim {
  553. u8 count;
  554. u8 padding[3];
  555. __le16 entry[8];
  556. } __attribute__ ((packed));
  557. struct p54_cce_quiet {
  558. __le32 period;
  559. } __attribute__ ((packed));
  560. struct p54_bt_balancer {
  561. __le16 prio_thresh;
  562. __le16 acl_thresh;
  563. } __attribute__ ((packed));
  564. struct p54_arp_table {
  565. __le16 filter_enable;
  566. u8 ipv4_addr[4];
  567. } __attribute__ ((packed));
  568. #endif /* P54COMMON_H */