conf.h 27 KB

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