conf.h 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275
  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 __CONF_H__
  24. #define __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. #define CONF_HW_RXTX_RATE_UNSUPPORTED 0xff
  65. enum {
  66. CONF_SG_DISABLE = 0,
  67. CONF_SG_PROTECTIVE,
  68. CONF_SG_OPPORTUNISTIC
  69. };
  70. enum {
  71. /*
  72. * Configure the min and max time BT gains the antenna
  73. * in WLAN / BT master basic rate
  74. *
  75. * Range: 0 - 255 (ms)
  76. */
  77. CONF_SG_ACL_BT_MASTER_MIN_BR = 0,
  78. CONF_SG_ACL_BT_MASTER_MAX_BR,
  79. /*
  80. * Configure the min and max time BT gains the antenna
  81. * in WLAN / BT slave basic rate
  82. *
  83. * Range: 0 - 255 (ms)
  84. */
  85. CONF_SG_ACL_BT_SLAVE_MIN_BR,
  86. CONF_SG_ACL_BT_SLAVE_MAX_BR,
  87. /*
  88. * Configure the min and max time BT gains the antenna
  89. * in WLAN / BT master EDR
  90. *
  91. * Range: 0 - 255 (ms)
  92. */
  93. CONF_SG_ACL_BT_MASTER_MIN_EDR,
  94. CONF_SG_ACL_BT_MASTER_MAX_EDR,
  95. /*
  96. * Configure the min and max time BT gains the antenna
  97. * in WLAN / BT slave EDR
  98. *
  99. * Range: 0 - 255 (ms)
  100. */
  101. CONF_SG_ACL_BT_SLAVE_MIN_EDR,
  102. CONF_SG_ACL_BT_SLAVE_MAX_EDR,
  103. /*
  104. * The maximum time WLAN can gain the antenna
  105. * in WLAN PSM / BT master/slave BR
  106. *
  107. * Range: 0 - 255 (ms)
  108. */
  109. CONF_SG_ACL_WLAN_PS_MASTER_BR,
  110. CONF_SG_ACL_WLAN_PS_SLAVE_BR,
  111. /*
  112. * The maximum time WLAN can gain the antenna
  113. * in WLAN PSM / BT master/slave EDR
  114. *
  115. * Range: 0 - 255 (ms)
  116. */
  117. CONF_SG_ACL_WLAN_PS_MASTER_EDR,
  118. CONF_SG_ACL_WLAN_PS_SLAVE_EDR,
  119. /* TODO: explain these values */
  120. CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_BR,
  121. CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_BR,
  122. CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_BR,
  123. CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_BR,
  124. CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_EDR,
  125. CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_EDR,
  126. CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_EDR,
  127. CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_EDR,
  128. CONF_SG_ACL_ACTIVE_SCAN_WLAN_BR,
  129. CONF_SG_ACL_ACTIVE_SCAN_WLAN_EDR,
  130. CONF_SG_ACL_PASSIVE_SCAN_BT_BR,
  131. CONF_SG_ACL_PASSIVE_SCAN_WLAN_BR,
  132. CONF_SG_ACL_PASSIVE_SCAN_BT_EDR,
  133. CONF_SG_ACL_PASSIVE_SCAN_WLAN_EDR,
  134. /*
  135. * Compensation percentage of probe requests when scan initiated
  136. * during BT voice/ACL link.
  137. *
  138. * Range: 0 - 255 (%)
  139. */
  140. CONF_SG_AUTO_SCAN_PROBE_REQ,
  141. /*
  142. * Compensation percentage of probe requests when active scan initiated
  143. * during BT voice
  144. *
  145. * Range: 0 - 255 (%)
  146. */
  147. CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3,
  148. /*
  149. * Compensation percentage of WLAN active scan window if initiated
  150. * during BT A2DP
  151. *
  152. * Range: 0 - 1000 (%)
  153. */
  154. CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP,
  155. /*
  156. * Compensation percentage of WLAN passive scan window if initiated
  157. * during BT A2DP BR
  158. *
  159. * Range: 0 - 1000 (%)
  160. */
  161. CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_BR,
  162. /*
  163. * Compensation percentage of WLAN passive scan window if initiated
  164. * during BT A2DP EDR
  165. *
  166. * Range: 0 - 1000 (%)
  167. */
  168. CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_EDR,
  169. /*
  170. * Compensation percentage of WLAN passive scan window if initiated
  171. * during BT voice
  172. *
  173. * Range: 0 - 1000 (%)
  174. */
  175. CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3,
  176. /* TODO: explain these values */
  177. CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN,
  178. CONF_SG_BCN_HV3_COLLISION_THRESH_IN_PASSIVE_SCAN,
  179. CONF_SG_TX_RX_PROTECTION_BWIDTH_IN_PASSIVE_SCAN,
  180. /*
  181. * Defines whether the SG will force WLAN host to enter/exit PSM
  182. *
  183. * Range: 1 - SG can force, 0 - host handles PSM
  184. */
  185. CONF_SG_STA_FORCE_PS_IN_BT_SCO,
  186. /*
  187. * Defines antenna configuration (single/dual antenna)
  188. *
  189. * Range: 0 - single antenna, 1 - dual antenna
  190. */
  191. CONF_SG_ANTENNA_CONFIGURATION,
  192. /*
  193. * The threshold (percent) of max consecutive beacon misses before
  194. * increasing priority of beacon reception.
  195. *
  196. * Range: 0 - 100 (%)
  197. */
  198. CONF_SG_BEACON_MISS_PERCENT,
  199. /*
  200. * Protection time of the DHCP procedure.
  201. *
  202. * Range: 0 - 100000 (ms)
  203. */
  204. CONF_SG_DHCP_TIME,
  205. /*
  206. * RX guard time before the beginning of a new BT voice frame during
  207. * which no new WLAN trigger frame is transmitted.
  208. *
  209. * Range: 0 - 100000 (us)
  210. */
  211. CONF_SG_RXT,
  212. /*
  213. * TX guard time before the beginning of a new BT voice frame during
  214. * which no new WLAN frame is transmitted.
  215. *
  216. * Range: 0 - 100000 (us)
  217. */
  218. CONF_SG_TXT,
  219. /*
  220. * Enable adaptive RXT/TXT algorithm. If disabled, the host values
  221. * will be utilized.
  222. *
  223. * Range: 0 - disable, 1 - enable
  224. */
  225. CONF_SG_ADAPTIVE_RXT_TXT,
  226. /* TODO: explain this value */
  227. CONF_SG_GENERAL_USAGE_BIT_MAP,
  228. /*
  229. * Number of consecutive BT voice frames not interrupted by WLAN
  230. *
  231. * Range: 0 - 100
  232. */
  233. CONF_SG_HV3_MAX_SERVED,
  234. /*
  235. * The used WLAN legacy service period during active BT ACL link
  236. *
  237. * Range: 0 - 255 (ms)
  238. */
  239. CONF_SG_PS_POLL_TIMEOUT,
  240. /*
  241. * The used WLAN UPSD service period during active BT ACL link
  242. *
  243. * Range: 0 - 255 (ms)
  244. */
  245. CONF_SG_UPSD_TIMEOUT,
  246. CONF_SG_CONSECUTIVE_CTS_THRESHOLD,
  247. CONF_SG_STA_RX_WINDOW_AFTER_DTIM,
  248. CONF_SG_STA_CONNECTION_PROTECTION_TIME,
  249. /* AP params */
  250. CONF_AP_BEACON_MISS_TX,
  251. CONF_AP_RX_WINDOW_AFTER_BEACON,
  252. CONF_AP_BEACON_WINDOW_INTERVAL,
  253. CONF_AP_CONNECTION_PROTECTION_TIME,
  254. CONF_AP_BT_ACL_VAL_BT_SERVE_TIME,
  255. CONF_AP_BT_ACL_VAL_WL_SERVE_TIME,
  256. /* CTS Diluting params */
  257. CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH,
  258. CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER,
  259. CONF_SG_TEMP_PARAM_1,
  260. CONF_SG_TEMP_PARAM_2,
  261. CONF_SG_TEMP_PARAM_3,
  262. CONF_SG_TEMP_PARAM_4,
  263. CONF_SG_TEMP_PARAM_5,
  264. CONF_SG_TEMP_PARAM_6,
  265. CONF_SG_TEMP_PARAM_7,
  266. CONF_SG_TEMP_PARAM_8,
  267. CONF_SG_TEMP_PARAM_9,
  268. CONF_SG_TEMP_PARAM_10,
  269. CONF_SG_PARAMS_MAX,
  270. CONF_SG_PARAMS_ALL = 0xff
  271. };
  272. struct conf_sg_settings {
  273. u32 params[CONF_SG_PARAMS_MAX];
  274. u8 state;
  275. };
  276. enum conf_rx_queue_type {
  277. CONF_RX_QUEUE_TYPE_LOW_PRIORITY, /* All except the high priority */
  278. CONF_RX_QUEUE_TYPE_HIGH_PRIORITY, /* Management and voice packets */
  279. };
  280. struct conf_rx_settings {
  281. /*
  282. * The maximum amount of time, in TU, before the
  283. * firmware discards the MSDU.
  284. *
  285. * Range: 0 - 0xFFFFFFFF
  286. */
  287. u32 rx_msdu_life_time;
  288. /*
  289. * Packet detection threshold in the PHY.
  290. *
  291. * FIXME: details unknown.
  292. */
  293. u32 packet_detection_threshold;
  294. /*
  295. * The longest time the STA will wait to receive traffic from the AP
  296. * after a PS-poll has been transmitted.
  297. *
  298. * Range: 0 - 200000
  299. */
  300. u16 ps_poll_timeout;
  301. /*
  302. * The longest time the STA will wait to receive traffic from the AP
  303. * after a frame has been sent from an UPSD enabled queue.
  304. *
  305. * Range: 0 - 200000
  306. */
  307. u16 upsd_timeout;
  308. /*
  309. * The number of octets in an MPDU, below which an RTS/CTS
  310. * handshake is not performed.
  311. *
  312. * Range: 0 - 4096
  313. */
  314. u16 rts_threshold;
  315. /*
  316. * The RX Clear Channel Assessment threshold in the PHY
  317. * (the energy threshold).
  318. *
  319. * Range: ENABLE_ENERGY_D == 0x140A
  320. * DISABLE_ENERGY_D == 0xFFEF
  321. */
  322. u16 rx_cca_threshold;
  323. /*
  324. * Occupied Rx mem-blocks number which requires interrupting the host
  325. * (0 = no buffering, 0xffff = disabled).
  326. *
  327. * Range: u16
  328. */
  329. u16 irq_blk_threshold;
  330. /*
  331. * Rx packets number which requires interrupting the host
  332. * (0 = no buffering).
  333. *
  334. * Range: u16
  335. */
  336. u16 irq_pkt_threshold;
  337. /*
  338. * Max time in msec the FW may delay RX-Complete interrupt.
  339. *
  340. * Range: 1 - 100
  341. */
  342. u16 irq_timeout;
  343. /*
  344. * The RX queue type.
  345. *
  346. * Range: RX_QUEUE_TYPE_RX_LOW_PRIORITY, RX_QUEUE_TYPE_RX_HIGH_PRIORITY,
  347. */
  348. u8 queue_type;
  349. };
  350. #define CONF_TX_MAX_RATE_CLASSES 10
  351. #define CONF_TX_RATE_MASK_UNSPECIFIED 0
  352. #define CONF_TX_RATE_MASK_BASIC (CONF_HW_BIT_RATE_1MBPS | \
  353. CONF_HW_BIT_RATE_2MBPS)
  354. #define CONF_TX_RATE_RETRY_LIMIT 10
  355. /* basic rates for p2p operations (probe req/resp, etc.) */
  356. #define CONF_TX_RATE_MASK_BASIC_P2P (CONF_HW_BIT_RATE_6MBPS | \
  357. CONF_HW_BIT_RATE_12MBPS | CONF_HW_BIT_RATE_24MBPS)
  358. /*
  359. * Rates supported for data packets when operating as AP. Note the absence
  360. * of the 22Mbps rate. There is a FW limitation on 12 rates so we must drop
  361. * one. The rate dropped is not mandatory under any operating mode.
  362. */
  363. #define CONF_TX_AP_ENABLED_RATES (CONF_HW_BIT_RATE_1MBPS | \
  364. CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
  365. CONF_HW_BIT_RATE_6MBPS | CONF_HW_BIT_RATE_9MBPS | \
  366. CONF_HW_BIT_RATE_11MBPS | CONF_HW_BIT_RATE_12MBPS | \
  367. CONF_HW_BIT_RATE_18MBPS | CONF_HW_BIT_RATE_24MBPS | \
  368. CONF_HW_BIT_RATE_36MBPS | CONF_HW_BIT_RATE_48MBPS | \
  369. CONF_HW_BIT_RATE_54MBPS)
  370. #define CONF_TX_CCK_RATES (CONF_HW_BIT_RATE_1MBPS | \
  371. CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
  372. CONF_HW_BIT_RATE_11MBPS)
  373. #define CONF_TX_OFDM_RATES (CONF_HW_BIT_RATE_6MBPS | \
  374. CONF_HW_BIT_RATE_12MBPS | CONF_HW_BIT_RATE_24MBPS | \
  375. CONF_HW_BIT_RATE_36MBPS | CONF_HW_BIT_RATE_48MBPS | \
  376. CONF_HW_BIT_RATE_54MBPS)
  377. #define CONF_TX_MCS_RATES (CONF_HW_BIT_RATE_MCS_0 | \
  378. CONF_HW_BIT_RATE_MCS_1 | CONF_HW_BIT_RATE_MCS_2 | \
  379. CONF_HW_BIT_RATE_MCS_3 | CONF_HW_BIT_RATE_MCS_4 | \
  380. CONF_HW_BIT_RATE_MCS_5 | CONF_HW_BIT_RATE_MCS_6 | \
  381. CONF_HW_BIT_RATE_MCS_7)
  382. /*
  383. * Default rates for management traffic when operating in AP mode. This
  384. * should be configured according to the basic rate set of the AP
  385. */
  386. #define CONF_TX_AP_DEFAULT_MGMT_RATES (CONF_HW_BIT_RATE_1MBPS | \
  387. CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS)
  388. /* default rates for working as IBSS (11b and OFDM) */
  389. #define CONF_TX_IBSS_DEFAULT_RATES (CONF_HW_BIT_RATE_1MBPS | \
  390. CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
  391. CONF_HW_BIT_RATE_11MBPS | CONF_TX_OFDM_RATES);
  392. struct conf_tx_rate_class {
  393. /*
  394. * The rates enabled for this rate class.
  395. *
  396. * Range: CONF_HW_BIT_RATE_* bit mask
  397. */
  398. u32 enabled_rates;
  399. /*
  400. * The dot11 short retry limit used for TX retries.
  401. *
  402. * Range: u8
  403. */
  404. u8 short_retry_limit;
  405. /*
  406. * The dot11 long retry limit used for TX retries.
  407. *
  408. * Range: u8
  409. */
  410. u8 long_retry_limit;
  411. /*
  412. * Flags controlling the attributes of TX transmission.
  413. *
  414. * Range: bit 0: Truncate - when set, FW attempts to send a frame stop
  415. * when the total valid per-rate attempts have
  416. * been exhausted; otherwise transmissions
  417. * will continue at the lowest available rate
  418. * until the appropriate one of the
  419. * short_retry_limit, long_retry_limit,
  420. * dot11_max_transmit_msdu_life_time, or
  421. * max_tx_life_time, is exhausted.
  422. * 1: Preamble Override - indicates if the preamble type
  423. * should be used in TX.
  424. * 2: Preamble Type - the type of the preamble to be used by
  425. * the policy (0 - long preamble, 1 - short preamble.
  426. */
  427. u8 aflags;
  428. };
  429. #define CONF_TX_MAX_AC_COUNT 4
  430. /* Slot number setting to start transmission at PIFS interval */
  431. #define CONF_TX_AIFS_PIFS 1
  432. /* Slot number setting to start transmission at DIFS interval normal
  433. * DCF access */
  434. #define CONF_TX_AIFS_DIFS 2
  435. enum conf_tx_ac {
  436. CONF_TX_AC_BE = 0, /* best effort / legacy */
  437. CONF_TX_AC_BK = 1, /* background */
  438. CONF_TX_AC_VI = 2, /* video */
  439. CONF_TX_AC_VO = 3, /* voice */
  440. CONF_TX_AC_CTS2SELF = 4, /* fictitious AC, follows AC_VO */
  441. CONF_TX_AC_ANY_TID = 0x1f
  442. };
  443. struct conf_tx_ac_category {
  444. /*
  445. * The AC class identifier.
  446. *
  447. * Range: enum conf_tx_ac
  448. */
  449. u8 ac;
  450. /*
  451. * The contention window minimum size (in slots) for the access
  452. * class.
  453. *
  454. * Range: u8
  455. */
  456. u8 cw_min;
  457. /*
  458. * The contention window maximum size (in slots) for the access
  459. * class.
  460. *
  461. * Range: u8
  462. */
  463. u16 cw_max;
  464. /*
  465. * The AIF value (in slots) for the access class.
  466. *
  467. * Range: u8
  468. */
  469. u8 aifsn;
  470. /*
  471. * The TX Op Limit (in microseconds) for the access class.
  472. *
  473. * Range: u16
  474. */
  475. u16 tx_op_limit;
  476. };
  477. #define CONF_TX_MAX_TID_COUNT 8
  478. /* Allow TX BA on all TIDs but 6,7. These are currently reserved in the FW */
  479. #define CONF_TX_BA_ENABLED_TID_BITMAP 0x3F
  480. enum {
  481. CONF_CHANNEL_TYPE_DCF = 0, /* DC/LEGACY*/
  482. CONF_CHANNEL_TYPE_EDCF = 1, /* EDCA*/
  483. CONF_CHANNEL_TYPE_HCCA = 2, /* HCCA*/
  484. };
  485. enum {
  486. CONF_PS_SCHEME_LEGACY = 0,
  487. CONF_PS_SCHEME_UPSD_TRIGGER = 1,
  488. CONF_PS_SCHEME_LEGACY_PSPOLL = 2,
  489. CONF_PS_SCHEME_SAPSD = 3,
  490. };
  491. enum {
  492. CONF_ACK_POLICY_LEGACY = 0,
  493. CONF_ACK_POLICY_NO_ACK = 1,
  494. CONF_ACK_POLICY_BLOCK = 2,
  495. };
  496. struct conf_tx_tid {
  497. u8 queue_id;
  498. u8 channel_type;
  499. u8 tsid;
  500. u8 ps_scheme;
  501. u8 ack_policy;
  502. u32 apsd_conf[2];
  503. };
  504. struct conf_tx_settings {
  505. /*
  506. * The TX ED value for TELEC Enable/Disable.
  507. *
  508. * Range: 0, 1
  509. */
  510. u8 tx_energy_detection;
  511. /*
  512. * Configuration for rate classes for TX (currently only one
  513. * rate class supported). Used in non-AP mode.
  514. */
  515. struct conf_tx_rate_class sta_rc_conf;
  516. /*
  517. * Configuration for access categories for TX rate control.
  518. */
  519. u8 ac_conf_count;
  520. struct conf_tx_ac_category ac_conf[CONF_TX_MAX_AC_COUNT];
  521. /*
  522. * AP-mode - allow this number of TX retries to a station before an
  523. * event is triggered from FW.
  524. * In AP-mode the hlids of unreachable stations are given in the
  525. * "sta_tx_retry_exceeded" member in the event mailbox.
  526. */
  527. u8 max_tx_retries;
  528. /*
  529. * AP-mode - after this number of seconds a connected station is
  530. * considered inactive.
  531. */
  532. u16 ap_aging_period;
  533. /*
  534. * Configuration for TID parameters.
  535. */
  536. u8 tid_conf_count;
  537. struct conf_tx_tid tid_conf[CONF_TX_MAX_TID_COUNT];
  538. /*
  539. * The TX fragmentation threshold.
  540. *
  541. * Range: u16
  542. */
  543. u16 frag_threshold;
  544. /*
  545. * Max time in msec the FW may delay frame TX-Complete interrupt.
  546. *
  547. * Range: u16
  548. */
  549. u16 tx_compl_timeout;
  550. /*
  551. * Completed TX packet count which requires to issue the TX-Complete
  552. * interrupt.
  553. *
  554. * Range: u16
  555. */
  556. u16 tx_compl_threshold;
  557. /*
  558. * The rate used for control messages and scanning on the 2.4GHz band
  559. *
  560. * Range: CONF_HW_BIT_RATE_* bit mask
  561. */
  562. u32 basic_rate;
  563. /*
  564. * The rate used for control messages and scanning on the 5GHz band
  565. *
  566. * Range: CONF_HW_BIT_RATE_* bit mask
  567. */
  568. u32 basic_rate_5;
  569. /*
  570. * TX retry limits for templates
  571. */
  572. u8 tmpl_short_retry_limit;
  573. u8 tmpl_long_retry_limit;
  574. /* Time in ms for Tx watchdog timer to expire */
  575. u32 tx_watchdog_timeout;
  576. };
  577. enum {
  578. CONF_WAKE_UP_EVENT_BEACON = 0x01, /* Wake on every Beacon*/
  579. CONF_WAKE_UP_EVENT_DTIM = 0x02, /* Wake on every DTIM*/
  580. CONF_WAKE_UP_EVENT_N_DTIM = 0x04, /* Wake every Nth DTIM */
  581. CONF_WAKE_UP_EVENT_N_BEACONS = 0x08, /* Wake every Nth beacon */
  582. CONF_WAKE_UP_EVENT_BITS_MASK = 0x0F
  583. };
  584. #define CONF_MAX_BCN_FILT_IE_COUNT 32
  585. #define CONF_BCN_RULE_PASS_ON_CHANGE BIT(0)
  586. #define CONF_BCN_RULE_PASS_ON_APPEARANCE BIT(1)
  587. #define CONF_BCN_IE_OUI_LEN 3
  588. #define CONF_BCN_IE_VER_LEN 2
  589. struct conf_bcn_filt_rule {
  590. /*
  591. * IE number to which to associate a rule.
  592. *
  593. * Range: u8
  594. */
  595. u8 ie;
  596. /*
  597. * Rule to associate with the specific ie.
  598. *
  599. * Range: CONF_BCN_RULE_PASS_ON_*
  600. */
  601. u8 rule;
  602. /*
  603. * OUI for the vendor specifie IE (221)
  604. */
  605. u8 oui[CONF_BCN_IE_OUI_LEN];
  606. /*
  607. * Type for the vendor specifie IE (221)
  608. */
  609. u8 type;
  610. /*
  611. * Version for the vendor specifie IE (221)
  612. */
  613. u8 version[CONF_BCN_IE_VER_LEN];
  614. };
  615. #define CONF_MAX_RSSI_SNR_TRIGGERS 8
  616. enum {
  617. CONF_TRIG_METRIC_RSSI_BEACON = 0,
  618. CONF_TRIG_METRIC_RSSI_DATA,
  619. CONF_TRIG_METRIC_SNR_BEACON,
  620. CONF_TRIG_METRIC_SNR_DATA
  621. };
  622. enum {
  623. CONF_TRIG_EVENT_TYPE_LEVEL = 0,
  624. CONF_TRIG_EVENT_TYPE_EDGE
  625. };
  626. enum {
  627. CONF_TRIG_EVENT_DIR_LOW = 0,
  628. CONF_TRIG_EVENT_DIR_HIGH,
  629. CONF_TRIG_EVENT_DIR_BIDIR
  630. };
  631. struct conf_sig_weights {
  632. /*
  633. * RSSI from beacons average weight.
  634. *
  635. * Range: u8
  636. */
  637. u8 rssi_bcn_avg_weight;
  638. /*
  639. * RSSI from data average weight.
  640. *
  641. * Range: u8
  642. */
  643. u8 rssi_pkt_avg_weight;
  644. /*
  645. * SNR from beacons average weight.
  646. *
  647. * Range: u8
  648. */
  649. u8 snr_bcn_avg_weight;
  650. /*
  651. * SNR from data average weight.
  652. *
  653. * Range: u8
  654. */
  655. u8 snr_pkt_avg_weight;
  656. };
  657. enum conf_bcn_filt_mode {
  658. CONF_BCN_FILT_MODE_DISABLED = 0,
  659. CONF_BCN_FILT_MODE_ENABLED = 1
  660. };
  661. enum conf_bet_mode {
  662. CONF_BET_MODE_DISABLE = 0,
  663. CONF_BET_MODE_ENABLE = 1,
  664. };
  665. struct conf_conn_settings {
  666. /*
  667. * Firmware wakeup conditions configuration. The host may set only
  668. * one bit.
  669. *
  670. * Range: CONF_WAKE_UP_EVENT_*
  671. */
  672. u8 wake_up_event;
  673. /*
  674. * Listen interval for beacons or Dtims.
  675. *
  676. * Range: 0 for beacon and Dtim wakeup
  677. * 1-10 for x Dtims
  678. * 1-255 for x beacons
  679. */
  680. u8 listen_interval;
  681. /*
  682. * Firmware wakeup conditions during suspend
  683. * Range: CONF_WAKE_UP_EVENT_*
  684. */
  685. u8 suspend_wake_up_event;
  686. /*
  687. * Listen interval during suspend.
  688. * Currently will be in DTIMs (1-10)
  689. *
  690. */
  691. u8 suspend_listen_interval;
  692. /*
  693. * Enable or disable the beacon filtering.
  694. *
  695. * Range: CONF_BCN_FILT_MODE_*
  696. */
  697. enum conf_bcn_filt_mode bcn_filt_mode;
  698. /*
  699. * Configure Beacon filter pass-thru rules.
  700. */
  701. u8 bcn_filt_ie_count;
  702. struct conf_bcn_filt_rule bcn_filt_ie[CONF_MAX_BCN_FILT_IE_COUNT];
  703. /*
  704. * The number of consecutive beacons to lose, before the firmware
  705. * becomes out of synch.
  706. *
  707. * Range: u32
  708. */
  709. u32 synch_fail_thold;
  710. /*
  711. * After out-of-synch, the number of TU's to wait without a further
  712. * received beacon (or probe response) before issuing the BSS_EVENT_LOSE
  713. * event.
  714. *
  715. * Range: u32
  716. */
  717. u32 bss_lose_timeout;
  718. /*
  719. * Beacon receive timeout.
  720. *
  721. * Range: u32
  722. */
  723. u32 beacon_rx_timeout;
  724. /*
  725. * Broadcast receive timeout.
  726. *
  727. * Range: u32
  728. */
  729. u32 broadcast_timeout;
  730. /*
  731. * Enable/disable reception of broadcast packets in power save mode
  732. *
  733. * Range: 1 - enable, 0 - disable
  734. */
  735. u8 rx_broadcast_in_ps;
  736. /*
  737. * Consecutive PS Poll failures before sending event to driver
  738. *
  739. * Range: u8
  740. */
  741. u8 ps_poll_threshold;
  742. /*
  743. * Configuration of signal average weights.
  744. */
  745. struct conf_sig_weights sig_weights;
  746. /*
  747. * Specifies if beacon early termination procedure is enabled or
  748. * disabled.
  749. *
  750. * Range: CONF_BET_MODE_*
  751. */
  752. u8 bet_enable;
  753. /*
  754. * Specifies the maximum number of consecutive beacons that may be
  755. * early terminated. After this number is reached at least one full
  756. * beacon must be correctly received in FW before beacon ET
  757. * resumes.
  758. *
  759. * Range 0 - 255
  760. */
  761. u8 bet_max_consecutive;
  762. /*
  763. * Specifies the maximum number of times to try PSM entry if it fails
  764. * (if sending the appropriate null-func message fails.)
  765. *
  766. * Range 0 - 255
  767. */
  768. u8 psm_entry_retries;
  769. /*
  770. * Specifies the maximum number of times to try PSM exit if it fails
  771. * (if sending the appropriate null-func message fails.)
  772. *
  773. * Range 0 - 255
  774. */
  775. u8 psm_exit_retries;
  776. /*
  777. * Specifies the maximum number of times to try transmit the PSM entry
  778. * null-func frame for each PSM entry attempt
  779. *
  780. * Range 0 - 255
  781. */
  782. u8 psm_entry_nullfunc_retries;
  783. /*
  784. * Specifies the dynamic PS timeout in ms that will be used
  785. * by the FW when in AUTO_PS mode
  786. */
  787. u16 dynamic_ps_timeout;
  788. /*
  789. * Specifies whether dynamic PS should be disabled and PSM forced.
  790. * This is required for certain WiFi certification tests.
  791. */
  792. u8 forced_ps;
  793. /*
  794. *
  795. * Specifies the interval of the connection keep-alive null-func
  796. * frame in ms.
  797. *
  798. * Range: 1000 - 3600000
  799. */
  800. u32 keep_alive_interval;
  801. /*
  802. * Maximum listen interval supported by the driver in units of beacons.
  803. *
  804. * Range: u16
  805. */
  806. u8 max_listen_interval;
  807. };
  808. enum {
  809. CONF_REF_CLK_19_2_E,
  810. CONF_REF_CLK_26_E,
  811. CONF_REF_CLK_38_4_E,
  812. CONF_REF_CLK_52_E,
  813. CONF_REF_CLK_38_4_M_XTAL,
  814. CONF_REF_CLK_26_M_XTAL,
  815. };
  816. enum single_dual_band_enum {
  817. CONF_SINGLE_BAND,
  818. CONF_DUAL_BAND
  819. };
  820. #define CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE 15
  821. #define CONF_NUMBER_OF_SUB_BANDS_5 7
  822. #define CONF_NUMBER_OF_RATE_GROUPS 6
  823. #define CONF_NUMBER_OF_CHANNELS_2_4 14
  824. #define CONF_NUMBER_OF_CHANNELS_5 35
  825. struct conf_itrim_settings {
  826. /* enable dco itrim */
  827. u8 enable;
  828. /* moderation timeout in microsecs from the last TX */
  829. u32 timeout;
  830. };
  831. struct conf_pm_config_settings {
  832. /*
  833. * Host clock settling time
  834. *
  835. * Range: 0 - 30000 us
  836. */
  837. u32 host_clk_settling_time;
  838. /*
  839. * Host fast wakeup support
  840. *
  841. * Range: true, false
  842. */
  843. bool host_fast_wakeup_support;
  844. };
  845. struct conf_roam_trigger_settings {
  846. /*
  847. * The minimum interval between two trigger events.
  848. *
  849. * Range: 0 - 60000 ms
  850. */
  851. u16 trigger_pacing;
  852. /*
  853. * The weight for rssi/beacon average calculation
  854. *
  855. * Range: 0 - 255
  856. */
  857. u8 avg_weight_rssi_beacon;
  858. /*
  859. * The weight for rssi/data frame average calculation
  860. *
  861. * Range: 0 - 255
  862. */
  863. u8 avg_weight_rssi_data;
  864. /*
  865. * The weight for snr/beacon average calculation
  866. *
  867. * Range: 0 - 255
  868. */
  869. u8 avg_weight_snr_beacon;
  870. /*
  871. * The weight for snr/data frame average calculation
  872. *
  873. * Range: 0 - 255
  874. */
  875. u8 avg_weight_snr_data;
  876. };
  877. struct conf_scan_settings {
  878. /*
  879. * The minimum time to wait on each channel for active scans
  880. *
  881. * Range: u32 tu/1000
  882. */
  883. u32 min_dwell_time_active;
  884. /*
  885. * The maximum time to wait on each channel for active scans
  886. *
  887. * Range: u32 tu/1000
  888. */
  889. u32 max_dwell_time_active;
  890. /*
  891. * The minimum time to wait on each channel for passive scans
  892. *
  893. * Range: u32 tu/1000
  894. */
  895. u32 min_dwell_time_passive;
  896. /*
  897. * The maximum time to wait on each channel for passive scans
  898. *
  899. * Range: u32 tu/1000
  900. */
  901. u32 max_dwell_time_passive;
  902. /*
  903. * Number of probe requests to transmit on each active scan channel
  904. *
  905. * Range: u8
  906. */
  907. u16 num_probe_reqs;
  908. /*
  909. * Scan trigger (split scan) timeout. The FW will split the scan
  910. * operation into slices of the given time and allow the FW to schedule
  911. * other tasks in between.
  912. *
  913. * Range: u32 Microsecs
  914. */
  915. u32 split_scan_timeout;
  916. };
  917. struct conf_sched_scan_settings {
  918. /*
  919. * The base time to wait on the channel for active scans (in TU/1000).
  920. * The minimum dwell time is calculated according to this:
  921. * min_dwell_time = base + num_of_probes_to_be_sent * delta_per_probe
  922. * The maximum dwell time is calculated according to this:
  923. * max_dwell_time = min_dwell_time + max_dwell_time_delta
  924. */
  925. u32 base_dwell_time;
  926. /* The delta between the min dwell time and max dwell time for
  927. * active scans (in TU/1000s). The max dwell time is used by the FW once
  928. * traffic is detected on the channel.
  929. */
  930. u32 max_dwell_time_delta;
  931. /* Delta added to min dwell time per each probe in 2.4 GHz (TU/1000) */
  932. u32 dwell_time_delta_per_probe;
  933. /* Delta added to min dwell time per each probe in 5 GHz (TU/1000) */
  934. u32 dwell_time_delta_per_probe_5;
  935. /* time to wait on the channel for passive scans (in TU/1000) */
  936. u32 dwell_time_passive;
  937. /* time to wait on the channel for DFS scans (in TU/1000) */
  938. u32 dwell_time_dfs;
  939. /* number of probe requests to send on each channel in active scans */
  940. u8 num_probe_reqs;
  941. /* RSSI threshold to be used for filtering */
  942. s8 rssi_threshold;
  943. /* SNR threshold to be used for filtering */
  944. s8 snr_threshold;
  945. };
  946. struct conf_ht_setting {
  947. u8 rx_ba_win_size;
  948. u8 tx_ba_win_size;
  949. u16 inactivity_timeout;
  950. /* bitmap of enabled TIDs for TX BA sessions */
  951. u8 tx_ba_tid_bitmap;
  952. };
  953. struct conf_memory_settings {
  954. /* Number of stations supported in IBSS mode */
  955. u8 num_stations;
  956. /* Number of ssid profiles used in IBSS mode */
  957. u8 ssid_profiles;
  958. /* Number of memory buffers allocated to rx pool */
  959. u8 rx_block_num;
  960. /* Minimum number of blocks allocated to tx pool */
  961. u8 tx_min_block_num;
  962. /* Disable/Enable dynamic memory */
  963. u8 dynamic_memory;
  964. /*
  965. * Minimum required free tx memory blocks in order to assure optimum
  966. * performance
  967. *
  968. * Range: 0-120
  969. */
  970. u8 min_req_tx_blocks;
  971. /*
  972. * Minimum required free rx memory blocks in order to assure optimum
  973. * performance
  974. *
  975. * Range: 0-120
  976. */
  977. u8 min_req_rx_blocks;
  978. /*
  979. * Minimum number of mem blocks (free+used) guaranteed for TX
  980. *
  981. * Range: 0-120
  982. */
  983. u8 tx_min;
  984. };
  985. struct conf_fm_coex {
  986. u8 enable;
  987. u8 swallow_period;
  988. u8 n_divider_fref_set_1;
  989. u8 n_divider_fref_set_2;
  990. u16 m_divider_fref_set_1;
  991. u16 m_divider_fref_set_2;
  992. u32 coex_pll_stabilization_time;
  993. u16 ldo_stabilization_time;
  994. u8 fm_disturbed_band_margin;
  995. u8 swallow_clk_diff;
  996. };
  997. struct conf_rx_streaming_settings {
  998. /*
  999. * RX Streaming duration (in msec) from last tx/rx
  1000. *
  1001. * Range: u32
  1002. */
  1003. u32 duration;
  1004. /*
  1005. * Bitmap of tids to be polled during RX streaming.
  1006. * (Note: it doesn't look like it really matters)
  1007. *
  1008. * Range: 0x1-0xff
  1009. */
  1010. u8 queues;
  1011. /*
  1012. * RX Streaming interval.
  1013. * (Note:this value is also used as the rx streaming timeout)
  1014. * Range: 0 (disabled), 10 - 100
  1015. */
  1016. u8 interval;
  1017. /*
  1018. * enable rx streaming also when there is no coex activity
  1019. */
  1020. u8 always;
  1021. };
  1022. struct conf_fwlog {
  1023. /* Continuous or on-demand */
  1024. u8 mode;
  1025. /*
  1026. * Number of memory blocks dedicated for the FW logger
  1027. *
  1028. * Range: 1-3, or 0 to disable the FW logger
  1029. */
  1030. u8 mem_blocks;
  1031. /* Minimum log level threshold */
  1032. u8 severity;
  1033. /* Include/exclude timestamps from the log messages */
  1034. u8 timestamp;
  1035. /* See enum wl1271_fwlogger_output */
  1036. u8 output;
  1037. /* Regulates the frequency of log messages */
  1038. u8 threshold;
  1039. };
  1040. #define ACX_RATE_MGMT_NUM_OF_RATES 13
  1041. struct conf_rate_policy_settings {
  1042. u16 rate_retry_score;
  1043. u16 per_add;
  1044. u16 per_th1;
  1045. u16 per_th2;
  1046. u16 max_per;
  1047. u8 inverse_curiosity_factor;
  1048. u8 tx_fail_low_th;
  1049. u8 tx_fail_high_th;
  1050. u8 per_alpha_shift;
  1051. u8 per_add_shift;
  1052. u8 per_beta1_shift;
  1053. u8 per_beta2_shift;
  1054. u8 rate_check_up;
  1055. u8 rate_check_down;
  1056. u8 rate_retry_policy[ACX_RATE_MGMT_NUM_OF_RATES];
  1057. };
  1058. struct conf_hangover_settings {
  1059. u32 recover_time;
  1060. u8 hangover_period;
  1061. u8 dynamic_mode;
  1062. u8 early_termination_mode;
  1063. u8 max_period;
  1064. u8 min_period;
  1065. u8 increase_delta;
  1066. u8 decrease_delta;
  1067. u8 quiet_time;
  1068. u8 increase_time;
  1069. u8 window_size;
  1070. };
  1071. struct wlcore_conf {
  1072. struct conf_sg_settings sg;
  1073. struct conf_rx_settings rx;
  1074. struct conf_tx_settings tx;
  1075. struct conf_conn_settings conn;
  1076. struct conf_itrim_settings itrim;
  1077. struct conf_pm_config_settings pm_config;
  1078. struct conf_roam_trigger_settings roam_trigger;
  1079. struct conf_scan_settings scan;
  1080. struct conf_sched_scan_settings sched_scan;
  1081. struct conf_ht_setting ht;
  1082. struct conf_memory_settings mem_wl127x;
  1083. struct conf_memory_settings mem_wl128x;
  1084. struct conf_fm_coex fm_coex;
  1085. struct conf_rx_streaming_settings rx_streaming;
  1086. struct conf_fwlog fwlog;
  1087. struct conf_rate_policy_settings rate;
  1088. struct conf_hangover_settings hangover;
  1089. };
  1090. #endif