conf.h 27 KB

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