conf.h 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208
  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. CONF_SG_PARAMS_MAX,
  357. CONF_SG_PARAMS_ALL = 0xff
  358. };
  359. struct conf_sg_settings {
  360. u32 params[CONF_SG_PARAMS_MAX];
  361. u8 state;
  362. };
  363. enum conf_rx_queue_type {
  364. CONF_RX_QUEUE_TYPE_LOW_PRIORITY, /* All except the high priority */
  365. CONF_RX_QUEUE_TYPE_HIGH_PRIORITY, /* Management and voice packets */
  366. };
  367. struct conf_rx_settings {
  368. /*
  369. * The maximum amount of time, in TU, before the
  370. * firmware discards the MSDU.
  371. *
  372. * Range: 0 - 0xFFFFFFFF
  373. */
  374. u32 rx_msdu_life_time;
  375. /*
  376. * Packet detection threshold in the PHY.
  377. *
  378. * FIXME: details unknown.
  379. */
  380. u32 packet_detection_threshold;
  381. /*
  382. * The longest time the STA will wait to receive traffic from the AP
  383. * after a PS-poll has been transmitted.
  384. *
  385. * Range: 0 - 200000
  386. */
  387. u16 ps_poll_timeout;
  388. /*
  389. * The longest time the STA will wait to receive traffic from the AP
  390. * after a frame has been sent from an UPSD enabled queue.
  391. *
  392. * Range: 0 - 200000
  393. */
  394. u16 upsd_timeout;
  395. /*
  396. * The number of octets in an MPDU, below which an RTS/CTS
  397. * handshake is not performed.
  398. *
  399. * Range: 0 - 4096
  400. */
  401. u16 rts_threshold;
  402. /*
  403. * The RX Clear Channel Assessment threshold in the PHY
  404. * (the energy threshold).
  405. *
  406. * Range: ENABLE_ENERGY_D == 0x140A
  407. * DISABLE_ENERGY_D == 0xFFEF
  408. */
  409. u16 rx_cca_threshold;
  410. /*
  411. * Occupied Rx mem-blocks number which requires interrupting the host
  412. * (0 = no buffering, 0xffff = disabled).
  413. *
  414. * Range: u16
  415. */
  416. u16 irq_blk_threshold;
  417. /*
  418. * Rx packets number which requires interrupting the host
  419. * (0 = no buffering).
  420. *
  421. * Range: u16
  422. */
  423. u16 irq_pkt_threshold;
  424. /*
  425. * Max time in msec the FW may delay RX-Complete interrupt.
  426. *
  427. * Range: 1 - 100
  428. */
  429. u16 irq_timeout;
  430. /*
  431. * The RX queue type.
  432. *
  433. * Range: RX_QUEUE_TYPE_RX_LOW_PRIORITY, RX_QUEUE_TYPE_RX_HIGH_PRIORITY,
  434. */
  435. u8 queue_type;
  436. };
  437. #define CONF_TX_MAX_RATE_CLASSES 8
  438. #define CONF_TX_RATE_MASK_UNSPECIFIED 0
  439. #define CONF_TX_RATE_MASK_BASIC (CONF_HW_BIT_RATE_1MBPS | \
  440. CONF_HW_BIT_RATE_2MBPS)
  441. #define CONF_TX_RATE_RETRY_LIMIT 10
  442. /*
  443. * Rates supported for data packets when operating as AP. Note the absense
  444. * of the 22Mbps rate. There is a FW limitation on 12 rates so we must drop
  445. * one. The rate dropped is not mandatory under any operating mode.
  446. */
  447. #define CONF_TX_AP_ENABLED_RATES (CONF_HW_BIT_RATE_1MBPS | \
  448. CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS | \
  449. CONF_HW_BIT_RATE_6MBPS | CONF_HW_BIT_RATE_9MBPS | \
  450. CONF_HW_BIT_RATE_11MBPS | CONF_HW_BIT_RATE_12MBPS | \
  451. CONF_HW_BIT_RATE_18MBPS | CONF_HW_BIT_RATE_24MBPS | \
  452. CONF_HW_BIT_RATE_36MBPS | CONF_HW_BIT_RATE_48MBPS | \
  453. CONF_HW_BIT_RATE_54MBPS)
  454. /*
  455. * Default rates for management traffic when operating in AP mode. This
  456. * should be configured according to the basic rate set of the AP
  457. */
  458. #define CONF_TX_AP_DEFAULT_MGMT_RATES (CONF_HW_BIT_RATE_1MBPS | \
  459. CONF_HW_BIT_RATE_2MBPS | CONF_HW_BIT_RATE_5_5MBPS)
  460. struct conf_tx_rate_class {
  461. /*
  462. * The rates enabled for this rate class.
  463. *
  464. * Range: CONF_HW_BIT_RATE_* bit mask
  465. */
  466. u32 enabled_rates;
  467. /*
  468. * The dot11 short retry limit used for TX retries.
  469. *
  470. * Range: u8
  471. */
  472. u8 short_retry_limit;
  473. /*
  474. * The dot11 long retry limit used for TX retries.
  475. *
  476. * Range: u8
  477. */
  478. u8 long_retry_limit;
  479. /*
  480. * Flags controlling the attributes of TX transmission.
  481. *
  482. * Range: bit 0: Truncate - when set, FW attempts to send a frame stop
  483. * when the total valid per-rate attempts have
  484. * been exhausted; otherwise transmissions
  485. * will continue at the lowest available rate
  486. * until the appropriate one of the
  487. * short_retry_limit, long_retry_limit,
  488. * dot11_max_transmit_msdu_life_time, or
  489. * max_tx_life_time, is exhausted.
  490. * 1: Preamble Override - indicates if the preamble type
  491. * should be used in TX.
  492. * 2: Preamble Type - the type of the preamble to be used by
  493. * the policy (0 - long preamble, 1 - short preamble.
  494. */
  495. u8 aflags;
  496. };
  497. #define CONF_TX_MAX_AC_COUNT 4
  498. /* Slot number setting to start transmission at PIFS interval */
  499. #define CONF_TX_AIFS_PIFS 1
  500. /* Slot number setting to start transmission at DIFS interval normal
  501. * DCF access */
  502. #define CONF_TX_AIFS_DIFS 2
  503. enum conf_tx_ac {
  504. CONF_TX_AC_BE = 0, /* best effort / legacy */
  505. CONF_TX_AC_BK = 1, /* background */
  506. CONF_TX_AC_VI = 2, /* video */
  507. CONF_TX_AC_VO = 3, /* voice */
  508. CONF_TX_AC_CTS2SELF = 4, /* fictious AC, follows AC_VO */
  509. CONF_TX_AC_ANY_TID = 0x1f
  510. };
  511. struct conf_tx_ac_category {
  512. /*
  513. * The AC class identifier.
  514. *
  515. * Range: enum conf_tx_ac
  516. */
  517. u8 ac;
  518. /*
  519. * The contention window minimum size (in slots) for the access
  520. * class.
  521. *
  522. * Range: u8
  523. */
  524. u8 cw_min;
  525. /*
  526. * The contention window maximum size (in slots) for the access
  527. * class.
  528. *
  529. * Range: u8
  530. */
  531. u16 cw_max;
  532. /*
  533. * The AIF value (in slots) for the access class.
  534. *
  535. * Range: u8
  536. */
  537. u8 aifsn;
  538. /*
  539. * The TX Op Limit (in microseconds) for the access class.
  540. *
  541. * Range: u16
  542. */
  543. u16 tx_op_limit;
  544. };
  545. #define CONF_TX_MAX_TID_COUNT 8
  546. enum {
  547. CONF_CHANNEL_TYPE_DCF = 0, /* DC/LEGACY*/
  548. CONF_CHANNEL_TYPE_EDCF = 1, /* EDCA*/
  549. CONF_CHANNEL_TYPE_HCCA = 2, /* HCCA*/
  550. };
  551. enum {
  552. CONF_PS_SCHEME_LEGACY = 0,
  553. CONF_PS_SCHEME_UPSD_TRIGGER = 1,
  554. CONF_PS_SCHEME_LEGACY_PSPOLL = 2,
  555. CONF_PS_SCHEME_SAPSD = 3,
  556. };
  557. enum {
  558. CONF_ACK_POLICY_LEGACY = 0,
  559. CONF_ACK_POLICY_NO_ACK = 1,
  560. CONF_ACK_POLICY_BLOCK = 2,
  561. };
  562. struct conf_tx_tid {
  563. u8 queue_id;
  564. u8 channel_type;
  565. u8 tsid;
  566. u8 ps_scheme;
  567. u8 ack_policy;
  568. u32 apsd_conf[2];
  569. };
  570. struct conf_tx_settings {
  571. /*
  572. * The TX ED value for TELEC Enable/Disable.
  573. *
  574. * Range: 0, 1
  575. */
  576. u8 tx_energy_detection;
  577. /*
  578. * Configuration for rate classes for TX (currently only one
  579. * rate class supported). Used in non-AP mode.
  580. */
  581. struct conf_tx_rate_class sta_rc_conf;
  582. /*
  583. * Configuration for access categories for TX rate control.
  584. */
  585. u8 ac_conf_count;
  586. struct conf_tx_ac_category ac_conf[CONF_TX_MAX_AC_COUNT];
  587. /*
  588. * Configuration for rate classes in AP-mode. These rate classes
  589. * are for the AC TX queues
  590. */
  591. struct conf_tx_rate_class ap_rc_conf[CONF_TX_MAX_AC_COUNT];
  592. /*
  593. * Management TX rate class for AP-mode.
  594. */
  595. struct conf_tx_rate_class ap_mgmt_conf;
  596. /*
  597. * Broadcast TX rate class for AP-mode.
  598. */
  599. struct conf_tx_rate_class ap_bcst_conf;
  600. /*
  601. * AP-mode - allow this number of TX retries to a station before an
  602. * event is triggered from FW.
  603. */
  604. u16 ap_max_tx_retries;
  605. /*
  606. * Configuration for TID parameters.
  607. */
  608. u8 tid_conf_count;
  609. struct conf_tx_tid tid_conf[CONF_TX_MAX_TID_COUNT];
  610. /*
  611. * The TX fragmentation threshold.
  612. *
  613. * Range: u16
  614. */
  615. u16 frag_threshold;
  616. /*
  617. * Max time in msec the FW may delay frame TX-Complete interrupt.
  618. *
  619. * Range: u16
  620. */
  621. u16 tx_compl_timeout;
  622. /*
  623. * Completed TX packet count which requires to issue the TX-Complete
  624. * interrupt.
  625. *
  626. * Range: u16
  627. */
  628. u16 tx_compl_threshold;
  629. /*
  630. * The rate used for control messages and scanning on the 2.4GHz band
  631. *
  632. * Range: CONF_HW_BIT_RATE_* bit mask
  633. */
  634. u32 basic_rate;
  635. /*
  636. * The rate used for control messages and scanning on the 5GHz band
  637. *
  638. * Range: CONF_HW_BIT_RATE_* bit mask
  639. */
  640. u32 basic_rate_5;
  641. /*
  642. * TX retry limits for templates
  643. */
  644. u8 tmpl_short_retry_limit;
  645. u8 tmpl_long_retry_limit;
  646. };
  647. enum {
  648. CONF_WAKE_UP_EVENT_BEACON = 0x01, /* Wake on every Beacon*/
  649. CONF_WAKE_UP_EVENT_DTIM = 0x02, /* Wake on every DTIM*/
  650. CONF_WAKE_UP_EVENT_N_DTIM = 0x04, /* Wake every Nth DTIM */
  651. CONF_WAKE_UP_EVENT_N_BEACONS = 0x08, /* Wake every Nth beacon */
  652. CONF_WAKE_UP_EVENT_BITS_MASK = 0x0F
  653. };
  654. #define CONF_MAX_BCN_FILT_IE_COUNT 32
  655. #define CONF_BCN_RULE_PASS_ON_CHANGE BIT(0)
  656. #define CONF_BCN_RULE_PASS_ON_APPEARANCE BIT(1)
  657. #define CONF_BCN_IE_OUI_LEN 3
  658. #define CONF_BCN_IE_VER_LEN 2
  659. struct conf_bcn_filt_rule {
  660. /*
  661. * IE number to which to associate a rule.
  662. *
  663. * Range: u8
  664. */
  665. u8 ie;
  666. /*
  667. * Rule to associate with the specific ie.
  668. *
  669. * Range: CONF_BCN_RULE_PASS_ON_*
  670. */
  671. u8 rule;
  672. /*
  673. * OUI for the vendor specifie IE (221)
  674. */
  675. u8 oui[CONF_BCN_IE_OUI_LEN];
  676. /*
  677. * Type for the vendor specifie IE (221)
  678. */
  679. u8 type;
  680. /*
  681. * Version for the vendor specifie IE (221)
  682. */
  683. u8 version[CONF_BCN_IE_VER_LEN];
  684. };
  685. #define CONF_MAX_RSSI_SNR_TRIGGERS 8
  686. enum {
  687. CONF_TRIG_METRIC_RSSI_BEACON = 0,
  688. CONF_TRIG_METRIC_RSSI_DATA,
  689. CONF_TRIG_METRIC_SNR_BEACON,
  690. CONF_TRIG_METRIC_SNR_DATA
  691. };
  692. enum {
  693. CONF_TRIG_EVENT_TYPE_LEVEL = 0,
  694. CONF_TRIG_EVENT_TYPE_EDGE
  695. };
  696. enum {
  697. CONF_TRIG_EVENT_DIR_LOW = 0,
  698. CONF_TRIG_EVENT_DIR_HIGH,
  699. CONF_TRIG_EVENT_DIR_BIDIR
  700. };
  701. struct conf_sig_weights {
  702. /*
  703. * RSSI from beacons average weight.
  704. *
  705. * Range: u8
  706. */
  707. u8 rssi_bcn_avg_weight;
  708. /*
  709. * RSSI from data average weight.
  710. *
  711. * Range: u8
  712. */
  713. u8 rssi_pkt_avg_weight;
  714. /*
  715. * SNR from beacons average weight.
  716. *
  717. * Range: u8
  718. */
  719. u8 snr_bcn_avg_weight;
  720. /*
  721. * SNR from data average weight.
  722. *
  723. * Range: u8
  724. */
  725. u8 snr_pkt_avg_weight;
  726. };
  727. enum conf_bcn_filt_mode {
  728. CONF_BCN_FILT_MODE_DISABLED = 0,
  729. CONF_BCN_FILT_MODE_ENABLED = 1
  730. };
  731. enum conf_bet_mode {
  732. CONF_BET_MODE_DISABLE = 0,
  733. CONF_BET_MODE_ENABLE = 1,
  734. };
  735. struct conf_conn_settings {
  736. /*
  737. * Firmware wakeup conditions configuration. The host may set only
  738. * one bit.
  739. *
  740. * Range: CONF_WAKE_UP_EVENT_*
  741. */
  742. u8 wake_up_event;
  743. /*
  744. * Listen interval for beacons or Dtims.
  745. *
  746. * Range: 0 for beacon and Dtim wakeup
  747. * 1-10 for x Dtims
  748. * 1-255 for x beacons
  749. */
  750. u8 listen_interval;
  751. /*
  752. * Enable or disable the beacon filtering.
  753. *
  754. * Range: CONF_BCN_FILT_MODE_*
  755. */
  756. enum conf_bcn_filt_mode bcn_filt_mode;
  757. /*
  758. * Configure Beacon filter pass-thru rules.
  759. */
  760. u8 bcn_filt_ie_count;
  761. struct conf_bcn_filt_rule bcn_filt_ie[CONF_MAX_BCN_FILT_IE_COUNT];
  762. /*
  763. * The number of consequtive beacons to lose, before the firmware
  764. * becomes out of synch.
  765. *
  766. * Range: u32
  767. */
  768. u32 synch_fail_thold;
  769. /*
  770. * After out-of-synch, the number of TU's to wait without a further
  771. * received beacon (or probe response) before issuing the BSS_EVENT_LOSE
  772. * event.
  773. *
  774. * Range: u32
  775. */
  776. u32 bss_lose_timeout;
  777. /*
  778. * Beacon receive timeout.
  779. *
  780. * Range: u32
  781. */
  782. u32 beacon_rx_timeout;
  783. /*
  784. * Broadcast receive timeout.
  785. *
  786. * Range: u32
  787. */
  788. u32 broadcast_timeout;
  789. /*
  790. * Enable/disable reception of broadcast packets in power save mode
  791. *
  792. * Range: 1 - enable, 0 - disable
  793. */
  794. u8 rx_broadcast_in_ps;
  795. /*
  796. * Consequtive PS Poll failures before sending event to driver
  797. *
  798. * Range: u8
  799. */
  800. u8 ps_poll_threshold;
  801. /*
  802. * PS Poll failure recovery ACTIVE period length
  803. *
  804. * Range: u32 (ms)
  805. */
  806. u32 ps_poll_recovery_period;
  807. /*
  808. * Configuration of signal average weights.
  809. */
  810. struct conf_sig_weights sig_weights;
  811. /*
  812. * Specifies if beacon early termination procedure is enabled or
  813. * disabled.
  814. *
  815. * Range: CONF_BET_MODE_*
  816. */
  817. u8 bet_enable;
  818. /*
  819. * Specifies the maximum number of consecutive beacons that may be
  820. * early terminated. After this number is reached at least one full
  821. * beacon must be correctly received in FW before beacon ET
  822. * resumes.
  823. *
  824. * Range 0 - 255
  825. */
  826. u8 bet_max_consecutive;
  827. /*
  828. * Specifies the maximum number of times to try PSM entry if it fails
  829. * (if sending the appropriate null-func message fails.)
  830. *
  831. * Range 0 - 255
  832. */
  833. u8 psm_entry_retries;
  834. /*
  835. * Specifies the maximum number of times to try PSM exit if it fails
  836. * (if sending the appropriate null-func message fails.)
  837. *
  838. * Range 0 - 255
  839. */
  840. u8 psm_exit_retries;
  841. /*
  842. * Specifies the maximum number of times to try transmit the PSM entry
  843. * null-func frame for each PSM entry attempt
  844. *
  845. * Range 0 - 255
  846. */
  847. u8 psm_entry_nullfunc_retries;
  848. /*
  849. * Specifies the time to linger in active mode after successfully
  850. * transmitting the PSM entry null-func frame.
  851. *
  852. * Range 0 - 255 TU's
  853. */
  854. u8 psm_entry_hangover_period;
  855. /*
  856. *
  857. * Specifies the interval of the connection keep-alive null-func
  858. * frame in ms.
  859. *
  860. * Range: 1000 - 3600000
  861. */
  862. u32 keep_alive_interval;
  863. /*
  864. * Maximum listen interval supported by the driver in units of beacons.
  865. *
  866. * Range: u16
  867. */
  868. u8 max_listen_interval;
  869. };
  870. enum {
  871. CONF_REF_CLK_19_2_E,
  872. CONF_REF_CLK_26_E,
  873. CONF_REF_CLK_38_4_E,
  874. CONF_REF_CLK_52_E
  875. };
  876. enum single_dual_band_enum {
  877. CONF_SINGLE_BAND,
  878. CONF_DUAL_BAND
  879. };
  880. #define CONF_RSSI_AND_PROCESS_COMPENSATION_SIZE 15
  881. #define CONF_NUMBER_OF_SUB_BANDS_5 7
  882. #define CONF_NUMBER_OF_RATE_GROUPS 6
  883. #define CONF_NUMBER_OF_CHANNELS_2_4 14
  884. #define CONF_NUMBER_OF_CHANNELS_5 35
  885. struct conf_radio_parms {
  886. /*
  887. * FEM parameter set to use
  888. *
  889. * Range: 0 or 1
  890. */
  891. u8 fem;
  892. };
  893. struct conf_itrim_settings {
  894. /* enable dco itrim */
  895. u8 enable;
  896. /* moderation timeout in microsecs from the last TX */
  897. u32 timeout;
  898. };
  899. struct conf_pm_config_settings {
  900. /*
  901. * Host clock settling time
  902. *
  903. * Range: 0 - 30000 us
  904. */
  905. u32 host_clk_settling_time;
  906. /*
  907. * Host fast wakeup support
  908. *
  909. * Range: true, false
  910. */
  911. bool host_fast_wakeup_support;
  912. };
  913. struct conf_roam_trigger_settings {
  914. /*
  915. * The minimum interval between two trigger events.
  916. *
  917. * Range: 0 - 60000 ms
  918. */
  919. u16 trigger_pacing;
  920. /*
  921. * The weight for rssi/beacon average calculation
  922. *
  923. * Range: 0 - 255
  924. */
  925. u8 avg_weight_rssi_beacon;
  926. /*
  927. * The weight for rssi/data frame average calculation
  928. *
  929. * Range: 0 - 255
  930. */
  931. u8 avg_weight_rssi_data;
  932. /*
  933. * The weight for snr/beacon average calculation
  934. *
  935. * Range: 0 - 255
  936. */
  937. u8 avg_weight_snr_beacon;
  938. /*
  939. * The weight for snr/data frame average calculation
  940. *
  941. * Range: 0 - 255
  942. */
  943. u8 avg_weight_snr_data;
  944. };
  945. struct conf_scan_settings {
  946. /*
  947. * The minimum time to wait on each channel for active scans
  948. *
  949. * Range: u32 tu/1000
  950. */
  951. u32 min_dwell_time_active;
  952. /*
  953. * The maximum time to wait on each channel for active scans
  954. *
  955. * Range: u32 tu/1000
  956. */
  957. u32 max_dwell_time_active;
  958. /*
  959. * The minimum time to wait on each channel for passive scans
  960. *
  961. * Range: u32 tu/1000
  962. */
  963. u32 min_dwell_time_passive;
  964. /*
  965. * The maximum time to wait on each channel for passive scans
  966. *
  967. * Range: u32 tu/1000
  968. */
  969. u32 max_dwell_time_passive;
  970. /*
  971. * Number of probe requests to transmit on each active scan channel
  972. *
  973. * Range: u8
  974. */
  975. u16 num_probe_reqs;
  976. };
  977. /* these are number of channels on the band divided by two, rounded up */
  978. #define CONF_TX_PWR_COMPENSATION_LEN_2 7
  979. #define CONF_TX_PWR_COMPENSATION_LEN_5 18
  980. struct conf_rf_settings {
  981. /*
  982. * Per channel power compensation for 2.4GHz
  983. *
  984. * Range: s8
  985. */
  986. u8 tx_per_channel_power_compensation_2[CONF_TX_PWR_COMPENSATION_LEN_2];
  987. /*
  988. * Per channel power compensation for 5GHz
  989. *
  990. * Range: s8
  991. */
  992. u8 tx_per_channel_power_compensation_5[CONF_TX_PWR_COMPENSATION_LEN_5];
  993. };
  994. struct conf_ht_setting {
  995. u16 tx_ba_win_size;
  996. u16 inactivity_timeout;
  997. };
  998. struct conf_memory_settings {
  999. /* Number of stations supported in IBSS mode */
  1000. u8 num_stations;
  1001. /* Number of ssid profiles used in IBSS mode */
  1002. u8 ssid_profiles;
  1003. /* Number of memory buffers allocated to rx pool */
  1004. u8 rx_block_num;
  1005. /* Minimum number of blocks allocated to tx pool */
  1006. u8 tx_min_block_num;
  1007. /* Disable/Enable dynamic memory */
  1008. u8 dynamic_memory;
  1009. /*
  1010. * Minimum required free tx memory blocks in order to assure optimum
  1011. * performence
  1012. *
  1013. * Range: 0-120
  1014. */
  1015. u8 min_req_tx_blocks;
  1016. /*
  1017. * Minimum required free rx memory blocks in order to assure optimum
  1018. * performence
  1019. *
  1020. * Range: 0-120
  1021. */
  1022. u8 min_req_rx_blocks;
  1023. /*
  1024. * Minimum number of mem blocks (free+used) guaranteed for TX
  1025. *
  1026. * Range: 0-120
  1027. */
  1028. u8 tx_min;
  1029. };
  1030. struct conf_drv_settings {
  1031. struct conf_sg_settings sg;
  1032. struct conf_rx_settings rx;
  1033. struct conf_tx_settings tx;
  1034. struct conf_conn_settings conn;
  1035. struct conf_itrim_settings itrim;
  1036. struct conf_pm_config_settings pm_config;
  1037. struct conf_roam_trigger_settings roam_trigger;
  1038. struct conf_scan_settings scan;
  1039. struct conf_rf_settings rf;
  1040. struct conf_ht_setting ht;
  1041. struct conf_memory_settings mem;
  1042. };
  1043. #endif