wl1271_conf.h 20 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. /*
  2. * This file is part of wl1271
  3. *
  4. * Copyright (C) 2009 Nokia Corporation
  5. *
  6. * Contact: Luciano Coelho <luciano.coelho@nokia.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. *
  22. */
  23. #ifndef __WL1271_CONF_H__
  24. #define __WL1271_CONF_H__
  25. enum {
  26. CONF_HW_BIT_RATE_1MBPS = BIT(0),
  27. CONF_HW_BIT_RATE_2MBPS = BIT(1),
  28. CONF_HW_BIT_RATE_5_5MBPS = BIT(2),
  29. CONF_HW_BIT_RATE_6MBPS = BIT(3),
  30. CONF_HW_BIT_RATE_9MBPS = BIT(4),
  31. CONF_HW_BIT_RATE_11MBPS = BIT(5),
  32. CONF_HW_BIT_RATE_12MBPS = BIT(6),
  33. CONF_HW_BIT_RATE_18MBPS = BIT(7),
  34. CONF_HW_BIT_RATE_22MBPS = BIT(8),
  35. CONF_HW_BIT_RATE_24MBPS = BIT(9),
  36. CONF_HW_BIT_RATE_36MBPS = BIT(10),
  37. CONF_HW_BIT_RATE_48MBPS = BIT(11),
  38. CONF_HW_BIT_RATE_54MBPS = BIT(12),
  39. CONF_HW_BIT_RATE_MCS_0 = BIT(13),
  40. CONF_HW_BIT_RATE_MCS_1 = BIT(14),
  41. CONF_HW_BIT_RATE_MCS_2 = BIT(15),
  42. CONF_HW_BIT_RATE_MCS_3 = BIT(16),
  43. CONF_HW_BIT_RATE_MCS_4 = BIT(17),
  44. CONF_HW_BIT_RATE_MCS_5 = BIT(18),
  45. CONF_HW_BIT_RATE_MCS_6 = BIT(19),
  46. CONF_HW_BIT_RATE_MCS_7 = BIT(20)
  47. };
  48. enum {
  49. CONF_HW_RATE_INDEX_1MBPS = 0,
  50. CONF_HW_RATE_INDEX_2MBPS = 1,
  51. CONF_HW_RATE_INDEX_5_5MBPS = 2,
  52. CONF_HW_RATE_INDEX_6MBPS = 3,
  53. CONF_HW_RATE_INDEX_9MBPS = 4,
  54. CONF_HW_RATE_INDEX_11MBPS = 5,
  55. CONF_HW_RATE_INDEX_12MBPS = 6,
  56. CONF_HW_RATE_INDEX_18MBPS = 7,
  57. CONF_HW_RATE_INDEX_22MBPS = 8,
  58. CONF_HW_RATE_INDEX_24MBPS = 9,
  59. CONF_HW_RATE_INDEX_36MBPS = 10,
  60. CONF_HW_RATE_INDEX_48MBPS = 11,
  61. CONF_HW_RATE_INDEX_54MBPS = 12,
  62. CONF_HW_RATE_INDEX_MAX = CONF_HW_RATE_INDEX_54MBPS,
  63. };
  64. enum {
  65. CONF_SG_DISABLE = 0,
  66. CONF_SG_PROTECTIVE,
  67. CONF_SG_OPPORTUNISTIC
  68. };
  69. enum {
  70. /*
  71. * PER threshold in PPM of the BT voice
  72. *
  73. * Range: 0 - 10000000
  74. */
  75. CONF_SG_BT_PER_THRESHOLD = 0,
  76. /*
  77. * Number of consequent RX_ACTIVE activities to override BT voice
  78. * frames to ensure WLAN connection
  79. *
  80. * Range: 0 - 100
  81. */
  82. CONF_SG_HV3_MAX_OVERRIDE,
  83. /*
  84. * Defines the PER threshold of the BT voice
  85. *
  86. * Range: 0 - 65000
  87. */
  88. CONF_SG_BT_NFS_SAMPLE_INTERVAL,
  89. /*
  90. * Defines the load ratio of BT
  91. *
  92. * Range: 0 - 100 (%)
  93. */
  94. CONF_SG_BT_LOAD_RATIO,
  95. /*
  96. * Defines whether the SG will force WLAN host to enter/exit PSM
  97. *
  98. * Range: 1 - SG can force, 0 - host handles PSM
  99. */
  100. CONF_SG_AUTO_PS_MODE,
  101. /*
  102. * Compensation percentage of probe requests when scan initiated
  103. * during BT voice/ACL link.
  104. *
  105. * Range: 0 - 255 (%)
  106. */
  107. CONF_SG_AUTO_SCAN_PROBE_REQ,
  108. /*
  109. * Compensation percentage of probe requests when active scan initiated
  110. * during BT voice
  111. *
  112. * Range: 0 - 255 (%)
  113. */
  114. CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3,
  115. /*
  116. * Defines antenna configuration (single/dual antenna)
  117. *
  118. * Range: 0 - single antenna, 1 - dual antenna
  119. */
  120. CONF_SG_ANTENNA_CONFIGURATION,
  121. /*
  122. * The threshold (percent) of max consequtive beacon misses before
  123. * increasing priority of beacon reception.
  124. *
  125. * Range: 0 - 100 (%)
  126. */
  127. CONF_SG_BEACON_MISS_PERCENT,
  128. /*
  129. * The rate threshold below which receiving a data frame from the AP
  130. * will increase the priority of the data frame above BT traffic.
  131. *
  132. * Range: 0,2, 5(=5.5), 6, 9, 11, 12, 18, 24, 36, 48, 54
  133. */
  134. CONF_SG_RATE_ADAPT_THRESH,
  135. /*
  136. * Not used currently.
  137. *
  138. * Range: 0
  139. */
  140. CONF_SG_RATE_ADAPT_SNR,
  141. /*
  142. * Configure the min and max time BT gains the antenna
  143. * in WLAN PSM / BT master basic rate
  144. *
  145. * Range: 0 - 255 (ms)
  146. */
  147. CONF_SG_WLAN_PS_BT_ACL_MASTER_MIN_BR,
  148. CONF_SG_WLAN_PS_BT_ACL_MASTER_MAX_BR,
  149. /*
  150. * The time after it expires no new WLAN trigger frame is trasmitted
  151. * in WLAN PSM / BT master basic rate
  152. *
  153. * Range: 0 - 255 (ms)
  154. */
  155. CONF_SG_WLAN_PS_MAX_BT_ACL_MASTER_BR,
  156. /*
  157. * Configure the min and max time BT gains the antenna
  158. * in WLAN PSM / BT slave basic rate
  159. *
  160. * Range: 0 - 255 (ms)
  161. */
  162. CONF_SG_WLAN_PS_BT_ACL_SLAVE_MIN_BR,
  163. CONF_SG_WLAN_PS_BT_ACL_SLAVE_MAX_BR,
  164. /*
  165. * The time after it expires no new WLAN trigger frame is trasmitted
  166. * in WLAN PSM / BT slave basic rate
  167. *
  168. * Range: 0 - 255 (ms)
  169. */
  170. CONF_SG_WLAN_PS_MAX_BT_ACL_SLAVE_BR,
  171. /*
  172. * Configure the min and max time BT gains the antenna
  173. * in WLAN PSM / BT master EDR
  174. *
  175. * Range: 0 - 255 (ms)
  176. */
  177. CONF_SG_WLAN_PS_BT_ACL_MASTER_MIN_EDR,
  178. CONF_SG_WLAN_PS_BT_ACL_MASTER_MAX_EDR,
  179. /*
  180. * The time after it expires no new WLAN trigger frame is trasmitted
  181. * in WLAN PSM / BT master EDR
  182. *
  183. * Range: 0 - 255 (ms)
  184. */
  185. CONF_SG_WLAN_PS_MAX_BT_ACL_MASTER_EDR,
  186. /*
  187. * Configure the min and max time BT gains the antenna
  188. * in WLAN PSM / BT slave EDR
  189. *
  190. * Range: 0 - 255 (ms)
  191. */
  192. CONF_SG_WLAN_PS_BT_ACL_SLAVE_MIN_EDR,
  193. CONF_SG_WLAN_PS_BT_ACL_SLAVE_MAX_EDR,
  194. /*
  195. * The time after it expires no new WLAN trigger frame is trasmitted
  196. * in WLAN PSM / BT slave EDR
  197. *
  198. * Range: 0 - 255 (ms)
  199. */
  200. CONF_SG_WLAN_PS_MAX_BT_ACL_SLAVE_EDR,
  201. /*
  202. * RX guard time before the beginning of a new BT voice frame during
  203. * which no new WLAN trigger frame is transmitted.
  204. *
  205. * Range: 0 - 100000 (us)
  206. */
  207. CONF_SG_RXT,
  208. /*
  209. * TX guard time before the beginning of a new BT voice frame during
  210. * which no new WLAN frame is transmitted.
  211. *
  212. * Range: 0 - 100000 (us)
  213. */
  214. CONF_SG_TXT,
  215. /*
  216. * Enable adaptive RXT/TXT algorithm. If disabled, the host values
  217. * will be utilized.
  218. *
  219. * Range: 0 - disable, 1 - enable
  220. */
  221. CONF_SG_ADAPTIVE_RXT_TXT,
  222. /*
  223. * The used WLAN legacy service period during active BT ACL link
  224. *
  225. * Range: 0 - 255 (ms)
  226. */
  227. CONF_SG_PS_POLL_TIMEOUT,
  228. /*
  229. * The used WLAN UPSD service period during active BT ACL link
  230. *
  231. * Range: 0 - 255 (ms)
  232. */
  233. CONF_SG_UPSD_TIMEOUT,
  234. /*
  235. * Configure the min and max time BT gains the antenna
  236. * in WLAN Active / BT master EDR
  237. *
  238. * Range: 0 - 255 (ms)
  239. */
  240. CONF_SG_WLAN_ACTIVE_BT_ACL_MASTER_MIN_EDR,
  241. CONF_SG_WLAN_ACTIVE_BT_ACL_MASTER_MAX_EDR,
  242. /*
  243. * The maximum time WLAN can gain the antenna for
  244. * in WLAN Active / BT master EDR
  245. *
  246. * Range: 0 - 255 (ms)
  247. */
  248. CONF_SG_WLAN_ACTIVE_MAX_BT_ACL_MASTER_EDR,
  249. /*
  250. * Configure the min and max time BT gains the antenna
  251. * in WLAN Active / BT slave EDR
  252. *
  253. * Range: 0 - 255 (ms)
  254. */
  255. CONF_SG_WLAN_ACTIVE_BT_ACL_SLAVE_MIN_EDR,
  256. CONF_SG_WLAN_ACTIVE_BT_ACL_SLAVE_MAX_EDR,
  257. /*
  258. * The maximum time WLAN can gain the antenna for
  259. * in WLAN Active / BT slave EDR
  260. *
  261. * Range: 0 - 255 (ms)
  262. */
  263. CONF_SG_WLAN_ACTIVE_MAX_BT_ACL_SLAVE_EDR,
  264. /*
  265. * Configure the min and max time BT gains the antenna
  266. * in WLAN Active / BT basic rate
  267. *
  268. * Range: 0 - 255 (ms)
  269. */
  270. CONF_SG_WLAN_ACTIVE_BT_ACL_MIN_BR,
  271. CONF_SG_WLAN_ACTIVE_BT_ACL_MAX_BR,
  272. /*
  273. * The maximum time WLAN can gain the antenna for
  274. * in WLAN Active / BT basic rate
  275. *
  276. * Range: 0 - 255 (ms)
  277. */
  278. CONF_SG_WLAN_ACTIVE_MAX_BT_ACL_BR,
  279. /*
  280. * Compensation percentage of WLAN passive scan window if initiated
  281. * during BT voice
  282. *
  283. * Range: 0 - 1000 (%)
  284. */
  285. CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3,
  286. /*
  287. * Compensation percentage of WLAN passive scan window if initiated
  288. * during BT A2DP
  289. *
  290. * Range: 0 - 1000 (%)
  291. */
  292. CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP,
  293. /*
  294. * Fixed time ensured for BT traffic to gain the antenna during WLAN
  295. * passive scan.
  296. *
  297. * Range: 0 - 1000 ms
  298. */
  299. CONF_SG_PASSIVE_SCAN_A2DP_BT_TIME,
  300. /*
  301. * Fixed time ensured for WLAN traffic to gain the antenna during WLAN
  302. * passive scan.
  303. *
  304. * Range: 0 - 1000 ms
  305. */
  306. CONF_SG_PASSIVE_SCAN_A2DP_WLAN_TIME,
  307. /*
  308. * Number of consequent BT voice frames not interrupted by WLAN
  309. *
  310. * Range: 0 - 100
  311. */
  312. CONF_SG_HV3_MAX_SERVED,
  313. /*
  314. * Protection time of the DHCP procedure.
  315. *
  316. * Range: 0 - 100000 (ms)
  317. */
  318. CONF_SG_DHCP_TIME,
  319. /*
  320. * Compensation percentage of WLAN active scan window if initiated
  321. * during BT A2DP
  322. *
  323. * Range: 0 - 1000 (%)
  324. */
  325. CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP,
  326. CONF_SG_TEMP_PARAM_1,
  327. CONF_SG_TEMP_PARAM_2,
  328. CONF_SG_TEMP_PARAM_3,
  329. CONF_SG_TEMP_PARAM_4,
  330. CONF_SG_TEMP_PARAM_5,
  331. CONF_SG_PARAMS_MAX,
  332. CONF_SG_PARAMS_ALL = 0xff
  333. };
  334. struct conf_sg_settings {
  335. __le32 params[CONF_SG_PARAMS_MAX];
  336. u8 state;
  337. };
  338. enum conf_rx_queue_type {
  339. CONF_RX_QUEUE_TYPE_LOW_PRIORITY, /* All except the high priority */
  340. CONF_RX_QUEUE_TYPE_HIGH_PRIORITY, /* Management and voice packets */
  341. };
  342. struct conf_rx_settings {
  343. /*
  344. * The maximum amount of time, in TU, before the
  345. * firmware discards the MSDU.
  346. *
  347. * Range: 0 - 0xFFFFFFFF
  348. */
  349. u32 rx_msdu_life_time;
  350. /*
  351. * Packet detection threshold in the PHY.
  352. *
  353. * FIXME: details unknown.
  354. */
  355. u32 packet_detection_threshold;
  356. /*
  357. * The longest time the STA will wait to receive traffic from the AP
  358. * after a PS-poll has been transmitted.
  359. *
  360. * Range: 0 - 200000
  361. */
  362. u16 ps_poll_timeout;
  363. /*
  364. * The longest time the STA will wait to receive traffic from the AP
  365. * after a frame has been sent from an UPSD enabled queue.
  366. *
  367. * Range: 0 - 200000
  368. */
  369. u16 upsd_timeout;
  370. /*
  371. * The number of octets in an MPDU, below which an RTS/CTS
  372. * handshake is not performed.
  373. *
  374. * Range: 0 - 4096
  375. */
  376. u16 rts_threshold;
  377. /*
  378. * The RX Clear Channel Assessment threshold in the PHY
  379. * (the energy threshold).
  380. *
  381. * Range: ENABLE_ENERGY_D == 0x140A
  382. * DISABLE_ENERGY_D == 0xFFEF
  383. */
  384. u16 rx_cca_threshold;
  385. /*
  386. * Occupied Rx mem-blocks number which requires interrupting the host
  387. * (0 = no buffering, 0xffff = disabled).
  388. *
  389. * Range: u16
  390. */
  391. u16 irq_blk_threshold;
  392. /*
  393. * Rx packets number which requires interrupting the host
  394. * (0 = no buffering).
  395. *
  396. * Range: u16
  397. */
  398. u16 irq_pkt_threshold;
  399. /*
  400. * Max time in msec the FW may delay RX-Complete interrupt.
  401. *
  402. * Range: 1 - 100
  403. */
  404. u16 irq_timeout;
  405. /*
  406. * The RX queue type.
  407. *
  408. * Range: RX_QUEUE_TYPE_RX_LOW_PRIORITY, RX_QUEUE_TYPE_RX_HIGH_PRIORITY,
  409. */
  410. u8 queue_type;
  411. };
  412. #define CONF_TX_MAX_RATE_CLASSES 8
  413. #define CONF_TX_RATE_MASK_UNSPECIFIED 0
  414. #define CONF_TX_RATE_MASK_BASIC (CONF_HW_BIT_RATE_1MBPS | \
  415. CONF_HW_BIT_RATE_2MBPS)
  416. #define CONF_TX_RATE_RETRY_LIMIT 10
  417. struct conf_tx_rate_class {
  418. /*
  419. * The rates enabled for this rate class.
  420. *
  421. * Range: CONF_HW_BIT_RATE_* bit mask
  422. */
  423. u32 enabled_rates;
  424. /*
  425. * The dot11 short retry limit used for TX retries.
  426. *
  427. * Range: u8
  428. */
  429. u8 short_retry_limit;
  430. /*
  431. * The dot11 long retry limit used for TX retries.
  432. *
  433. * Range: u8
  434. */
  435. u8 long_retry_limit;
  436. /*
  437. * Flags controlling the attributes of TX transmission.
  438. *
  439. * Range: bit 0: Truncate - when set, FW attempts to send a frame stop
  440. * when the total valid per-rate attempts have
  441. * been exhausted; otherwise transmissions
  442. * will continue at the lowest available rate
  443. * until the appropriate one of the
  444. * short_retry_limit, long_retry_limit,
  445. * dot11_max_transmit_msdu_life_time, or
  446. * max_tx_life_time, is exhausted.
  447. * 1: Preamble Override - indicates if the preamble type
  448. * should be used in TX.
  449. * 2: Preamble Type - the type of the preamble to be used by
  450. * the policy (0 - long preamble, 1 - short preamble.
  451. */
  452. u8 aflags;
  453. };
  454. #define CONF_TX_MAX_AC_COUNT 4
  455. /* Slot number setting to start transmission at PIFS interval */
  456. #define CONF_TX_AIFS_PIFS 1
  457. /* Slot number setting to start transmission at DIFS interval normal
  458. * DCF access */
  459. #define CONF_TX_AIFS_DIFS 2
  460. enum conf_tx_ac {
  461. CONF_TX_AC_BE = 0, /* best effort / legacy */
  462. CONF_TX_AC_BK = 1, /* background */
  463. CONF_TX_AC_VI = 2, /* video */
  464. CONF_TX_AC_VO = 3, /* voice */
  465. CONF_TX_AC_CTS2SELF = 4, /* fictious AC, follows AC_VO */
  466. CONF_TX_AC_ANY_TID = 0x1f
  467. };
  468. struct conf_tx_ac_category {
  469. /*
  470. * The AC class identifier.
  471. *
  472. * Range: enum conf_tx_ac
  473. */
  474. u8 ac;
  475. /*
  476. * The contention window minimum size (in slots) for the access
  477. * class.
  478. *
  479. * Range: u8
  480. */
  481. u8 cw_min;
  482. /*
  483. * The contention window maximum size (in slots) for the access
  484. * class.
  485. *
  486. * Range: u8
  487. */
  488. u16 cw_max;
  489. /*
  490. * The AIF value (in slots) for the access class.
  491. *
  492. * Range: u8
  493. */
  494. u8 aifsn;
  495. /*
  496. * The TX Op Limit (in microseconds) for the access class.
  497. *
  498. * Range: u16
  499. */
  500. u16 tx_op_limit;
  501. };
  502. #define CONF_TX_MAX_TID_COUNT 7
  503. enum {
  504. CONF_CHANNEL_TYPE_DCF = 0, /* DC/LEGACY*/
  505. CONF_CHANNEL_TYPE_EDCF = 1, /* EDCA*/
  506. CONF_CHANNEL_TYPE_HCCA = 2, /* HCCA*/
  507. };
  508. enum {
  509. CONF_PS_SCHEME_LEGACY = 0,
  510. CONF_PS_SCHEME_UPSD_TRIGGER = 1,
  511. CONF_PS_SCHEME_LEGACY_PSPOLL = 2,
  512. CONF_PS_SCHEME_SAPSD = 3,
  513. };
  514. enum {
  515. CONF_ACK_POLICY_LEGACY = 0,
  516. CONF_ACK_POLICY_NO_ACK = 1,
  517. CONF_ACK_POLICY_BLOCK = 2,
  518. };
  519. struct conf_tx_tid {
  520. u8 queue_id;
  521. u8 channel_type;
  522. u8 tsid;
  523. u8 ps_scheme;
  524. u8 ack_policy;
  525. u32 apsd_conf[2];
  526. };
  527. struct conf_tx_settings {
  528. /*
  529. * The TX ED value for TELEC Enable/Disable.
  530. *
  531. * Range: 0, 1
  532. */
  533. u8 tx_energy_detection;
  534. /*
  535. * Configuration for rate classes for TX (currently only one
  536. * rate class supported.)
  537. */
  538. struct conf_tx_rate_class rc_conf;
  539. /*
  540. * Configuration for access categories for TX rate control.
  541. */
  542. u8 ac_conf_count;
  543. struct conf_tx_ac_category ac_conf[CONF_TX_MAX_AC_COUNT];
  544. /*
  545. * Configuration for TID parameters.
  546. */
  547. u8 tid_conf_count;
  548. struct conf_tx_tid tid_conf[CONF_TX_MAX_TID_COUNT];
  549. /*
  550. * The TX fragmentation threshold.
  551. *
  552. * Range: u16
  553. */
  554. u16 frag_threshold;
  555. /*
  556. * Max time in msec the FW may delay frame TX-Complete interrupt.
  557. *
  558. * Range: u16
  559. */
  560. u16 tx_compl_timeout;
  561. /*
  562. * Completed TX packet count which requires to issue the TX-Complete
  563. * interrupt.
  564. *
  565. * Range: u16
  566. */
  567. u16 tx_compl_threshold;
  568. };
  569. enum {
  570. CONF_WAKE_UP_EVENT_BEACON = 0x01, /* Wake on every Beacon*/
  571. CONF_WAKE_UP_EVENT_DTIM = 0x02, /* Wake on every DTIM*/
  572. CONF_WAKE_UP_EVENT_N_DTIM = 0x04, /* Wake every Nth DTIM */
  573. CONF_WAKE_UP_EVENT_N_BEACONS = 0x08, /* Wake every Nth beacon */
  574. CONF_WAKE_UP_EVENT_BITS_MASK = 0x0F
  575. };
  576. #define CONF_MAX_BCN_FILT_IE_COUNT 32
  577. #define CONF_BCN_RULE_PASS_ON_CHANGE BIT(0)
  578. #define CONF_BCN_RULE_PASS_ON_APPEARANCE BIT(1)
  579. #define CONF_BCN_IE_OUI_LEN 3
  580. #define CONF_BCN_IE_VER_LEN 2
  581. struct conf_bcn_filt_rule {
  582. /*
  583. * IE number to which to associate a rule.
  584. *
  585. * Range: u8
  586. */
  587. u8 ie;
  588. /*
  589. * Rule to associate with the specific ie.
  590. *
  591. * Range: CONF_BCN_RULE_PASS_ON_*
  592. */
  593. u8 rule;
  594. /*
  595. * OUI for the vendor specifie IE (221)
  596. */
  597. u8 oui[CONF_BCN_IE_OUI_LEN];
  598. /*
  599. * Type for the vendor specifie IE (221)
  600. */
  601. u8 type;
  602. /*
  603. * Version for the vendor specifie IE (221)
  604. */
  605. u8 version[CONF_BCN_IE_VER_LEN];
  606. };
  607. #define CONF_MAX_RSSI_SNR_TRIGGERS 8
  608. enum {
  609. CONF_TRIG_METRIC_RSSI_BEACON = 0,
  610. CONF_TRIG_METRIC_RSSI_DATA,
  611. CONF_TRIG_METRIC_SNR_BEACON,
  612. CONF_TRIG_METRIC_SNR_DATA
  613. };
  614. enum {
  615. CONF_TRIG_EVENT_TYPE_LEVEL = 0,
  616. CONF_TRIG_EVENT_TYPE_EDGE
  617. };
  618. enum {
  619. CONF_TRIG_EVENT_DIR_LOW = 0,
  620. CONF_TRIG_EVENT_DIR_HIGH,
  621. CONF_TRIG_EVENT_DIR_BIDIR
  622. };
  623. struct conf_sig_trigger {
  624. /*
  625. * The RSSI / SNR threshold value.
  626. *
  627. * FIXME: what is the range?
  628. */
  629. s16 threshold;
  630. /*
  631. * Minimum delay between two trigger events for this trigger in ms.
  632. *
  633. * Range: 0 - 60000
  634. */
  635. u16 pacing;
  636. /*
  637. * The measurement data source for this trigger.
  638. *
  639. * Range: CONF_TRIG_METRIC_*
  640. */
  641. u8 metric;
  642. /*
  643. * The trigger type of this trigger.
  644. *
  645. * Range: CONF_TRIG_EVENT_TYPE_*
  646. */
  647. u8 type;
  648. /*
  649. * The direction of the trigger.
  650. *
  651. * Range: CONF_TRIG_EVENT_DIR_*
  652. */
  653. u8 direction;
  654. /*
  655. * Hysteresis range of the trigger around the threshold (in dB)
  656. *
  657. * Range: u8
  658. */
  659. u8 hysteresis;
  660. /*
  661. * Index of the trigger rule.
  662. *
  663. * Range: 0 - CONF_MAX_RSSI_SNR_TRIGGERS-1
  664. */
  665. u8 index;
  666. /*
  667. * Enable / disable this rule (to use for clearing rules.)
  668. *
  669. * Range: 1 - Enabled, 2 - Not enabled
  670. */
  671. u8 enable;
  672. };
  673. struct conf_sig_weights {
  674. /*
  675. * RSSI from beacons average weight.
  676. *
  677. * Range: u8
  678. */
  679. u8 rssi_bcn_avg_weight;
  680. /*
  681. * RSSI from data average weight.
  682. *
  683. * Range: u8
  684. */
  685. u8 rssi_pkt_avg_weight;
  686. /*
  687. * SNR from beacons average weight.
  688. *
  689. * Range: u8
  690. */
  691. u8 snr_bcn_avg_weight;
  692. /*
  693. * SNR from data average weight.
  694. *
  695. * Range: u8
  696. */
  697. u8 snr_pkt_avg_weight;
  698. };
  699. enum conf_bcn_filt_mode {
  700. CONF_BCN_FILT_MODE_DISABLED = 0,
  701. CONF_BCN_FILT_MODE_ENABLED = 1
  702. };
  703. enum conf_bet_mode {
  704. CONF_BET_MODE_DISABLE = 0,
  705. CONF_BET_MODE_ENABLE = 1,
  706. };
  707. struct conf_conn_settings {
  708. /*
  709. * Firmware wakeup conditions configuration. The host may set only
  710. * one bit.
  711. *
  712. * Range: CONF_WAKE_UP_EVENT_*
  713. */
  714. u8 wake_up_event;
  715. /*
  716. * Listen interval for beacons or Dtims.
  717. *
  718. * Range: 0 for beacon and Dtim wakeup
  719. * 1-10 for x Dtims
  720. * 1-255 for x beacons
  721. */
  722. u8 listen_interval;
  723. /*
  724. * Enable or disable the beacon filtering.
  725. *
  726. * Range: CONF_BCN_FILT_MODE_*
  727. */
  728. enum conf_bcn_filt_mode bcn_filt_mode;
  729. /*
  730. * Configure Beacon filter pass-thru rules.
  731. */
  732. u8 bcn_filt_ie_count;
  733. struct conf_bcn_filt_rule bcn_filt_ie[CONF_MAX_BCN_FILT_IE_COUNT];
  734. /*
  735. * The number of consequtive beacons to lose, before the firmware
  736. * becomes out of synch.
  737. *
  738. * Range: u32
  739. */
  740. u32 synch_fail_thold;
  741. /*
  742. * After out-of-synch, the number of TU's to wait without a further
  743. * received beacon (or probe response) before issuing the BSS_EVENT_LOSE
  744. * event.
  745. *
  746. * Range: u32
  747. */
  748. u32 bss_lose_timeout;
  749. /*
  750. * Beacon receive timeout.
  751. *
  752. * Range: u32
  753. */
  754. u32 beacon_rx_timeout;
  755. /*
  756. * Broadcast receive timeout.
  757. *
  758. * Range: u32
  759. */
  760. u32 broadcast_timeout;
  761. /*
  762. * Enable/disable reception of broadcast packets in power save mode
  763. *
  764. * Range: 1 - enable, 0 - disable
  765. */
  766. u8 rx_broadcast_in_ps;
  767. /*
  768. * Consequtive PS Poll failures before sending event to driver
  769. *
  770. * Range: u8
  771. */
  772. u8 ps_poll_threshold;
  773. /*
  774. * Configuration of signal (rssi/snr) triggers.
  775. */
  776. u8 sig_trigger_count;
  777. struct conf_sig_trigger sig_trigger[CONF_MAX_RSSI_SNR_TRIGGERS];
  778. /*
  779. * Configuration of signal average weights.
  780. */
  781. struct conf_sig_weights sig_weights;
  782. /*
  783. * Specifies if beacon early termination procedure is enabled or
  784. * disabled.
  785. *
  786. * Range: CONF_BET_MODE_*
  787. */
  788. u8 bet_enable;
  789. /*
  790. * Specifies the maximum number of consecutive beacons that may be
  791. * early terminated. After this number is reached at least one full
  792. * beacon must be correctly received in FW before beacon ET
  793. * resumes.
  794. *
  795. * Range 0 - 255
  796. */
  797. u8 bet_max_consecutive;
  798. /*
  799. * Specifies the maximum number of times to try PSM entry if it fails
  800. * (if sending the appropriate null-func message fails.)
  801. *
  802. * Range 0 - 255
  803. */
  804. u8 psm_entry_retries;
  805. };
  806. enum {
  807. CONF_REF_CLK_19_2_E,
  808. CONF_REF_CLK_26_E,
  809. CONF_REF_CLK_38_4_E,
  810. CONF_REF_CLK_52_E
  811. };
  812. enum single_dual_band_enum {
  813. CONF_SINGLE_BAND,
  814. CONF_DUAL_BAND
  815. };
  816. #define CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE 15
  817. #define CONF_NUMBER_OF_SUB_BANDS_5 7
  818. #define CONF_NUMBER_OF_RATE_GROUPS 6
  819. #define CONF_NUMBER_OF_CHANNELS_2_4 14
  820. #define CONF_NUMBER_OF_CHANNELS_5 35
  821. struct conf_radio_parms {
  822. /*
  823. * FEM parameter set to use
  824. *
  825. * Range: 0 or 1
  826. */
  827. u8 fem;
  828. };
  829. struct conf_init_settings {
  830. /*
  831. * Configure radio parameters.
  832. */
  833. struct conf_radio_parms radioparam;
  834. };
  835. struct conf_itrim_settings {
  836. /* enable dco itrim */
  837. u8 enable;
  838. /* moderation timeout in microsecs from the last TX */
  839. u32 timeout;
  840. };
  841. struct conf_pm_config_settings {
  842. /*
  843. * Host clock settling time
  844. *
  845. * Range: 0 - 30000 us
  846. */
  847. u32 host_clk_settling_time;
  848. /*
  849. * Host fast wakeup support
  850. *
  851. * Range: true, false
  852. */
  853. bool host_fast_wakeup_support;
  854. };
  855. struct conf_drv_settings {
  856. struct conf_sg_settings sg;
  857. struct conf_rx_settings rx;
  858. struct conf_tx_settings tx;
  859. struct conf_conn_settings conn;
  860. struct conf_init_settings init;
  861. struct conf_itrim_settings itrim;
  862. struct conf_pm_config_settings pm_config;
  863. };
  864. #endif