conf.h 26 KB

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