wl1271_conf.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450
  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 __WL1271_CONF_H__
  24. #define __WL1271_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. struct conf_sg_settings {
  65. /*
  66. * Defines the PER threshold in PPM of the BT voice of which reaching
  67. * this value will trigger raising the priority of the BT voice by
  68. * the BT IP until next NFS sample interval time as defined in
  69. * nfs_sample_interval.
  70. *
  71. * Unit: PER value in PPM (parts per million)
  72. * #Error_packets / #Total_packets
  73. * Range: u32
  74. */
  75. u32 per_threshold;
  76. /*
  77. * This value is an absolute time in micro-seconds to limit the
  78. * maximum scan duration compensation while in SG
  79. */
  80. u32 max_scan_compensation_time;
  81. /* Defines the PER threshold of the BT voice of which reaching this
  82. * value will trigger raising the priority of the BT voice until next
  83. * NFS sample interval time as defined in sample_interval.
  84. *
  85. * Unit: msec
  86. * Range: 1-65000
  87. */
  88. u16 nfs_sample_interval;
  89. /*
  90. * Defines the load ratio for the BT.
  91. * The WLAN ratio is: 100 - load_ratio
  92. *
  93. * Unit: Percent
  94. * Range: 0-100
  95. */
  96. u8 load_ratio;
  97. /*
  98. * true - Co-ex is allowed to enter/exit P.S automatically and
  99. * transparently to the host
  100. *
  101. * false - Co-ex is disallowed to enter/exit P.S and will trigger an
  102. * event to the host to notify for the need to enter/exit P.S
  103. * due to BT change state
  104. *
  105. */
  106. u8 auto_ps_mode;
  107. /*
  108. * This parameter defines the compensation percentage of num of probe
  109. * requests in case scan is initiated during BT voice/BT ACL
  110. * guaranteed link.
  111. *
  112. * Unit: Percent
  113. * Range: 0-255 (0 - No compensation)
  114. */
  115. u8 probe_req_compensation;
  116. /*
  117. * This parameter defines the compensation percentage of scan window
  118. * size in case scan is initiated during BT voice/BT ACL Guaranteed
  119. * link.
  120. *
  121. * Unit: Percent
  122. * Range: 0-255 (0 - No compensation)
  123. */
  124. u8 scan_window_compensation;
  125. /*
  126. * Defines the antenna configuration.
  127. *
  128. * Range: 0 - Single Antenna; 1 - Dual Antenna
  129. */
  130. u8 antenna_config;
  131. /*
  132. * The percent out of the Max consecutive beacon miss roaming trigger
  133. * which is the threshold for raising the priority of beacon
  134. * reception.
  135. *
  136. * Range: 1-100
  137. * N = MaxConsecutiveBeaconMiss
  138. * P = coexMaxConsecutiveBeaconMissPrecent
  139. * Threshold = MIN( N-1, round(N * P / 100))
  140. */
  141. u8 beacon_miss_threshold;
  142. /*
  143. * The RX rate threshold below which rate adaptation is assumed to be
  144. * occurring at the AP which will raise priority for ACTIVE_RX and RX
  145. * SP.
  146. *
  147. * Range: HW_BIT_RATE_*
  148. */
  149. u32 rate_adaptation_threshold;
  150. /*
  151. * The SNR above which the RX rate threshold indicating AP rate
  152. * adaptation is valid
  153. *
  154. * Range: -128 - 127
  155. */
  156. s8 rate_adaptation_snr;
  157. };
  158. enum conf_rx_queue_type {
  159. CONF_RX_QUEUE_TYPE_LOW_PRIORITY, /* All except the high priority */
  160. CONF_RX_QUEUE_TYPE_HIGH_PRIORITY, /* Management and voice packets */
  161. };
  162. struct conf_rx_settings {
  163. /*
  164. * The maximum amount of time, in TU, before the
  165. * firmware discards the MSDU.
  166. *
  167. * Range: 0 - 0xFFFFFFFF
  168. */
  169. u32 rx_msdu_life_time;
  170. /*
  171. * Packet detection threshold in the PHY.
  172. *
  173. * FIXME: details unknown.
  174. */
  175. u32 packet_detection_threshold;
  176. /*
  177. * The longest time the STA will wait to receive traffic from the AP
  178. * after a PS-poll has been transmitted.
  179. *
  180. * Range: 0 - 200000
  181. */
  182. u16 ps_poll_timeout;
  183. /*
  184. * The longest time the STA will wait to receive traffic from the AP
  185. * after a frame has been sent from an UPSD enabled queue.
  186. *
  187. * Range: 0 - 200000
  188. */
  189. u16 upsd_timeout;
  190. /*
  191. * The number of octets in an MPDU, below which an RTS/CTS
  192. * handshake is not performed.
  193. *
  194. * Range: 0 - 4096
  195. */
  196. u16 rts_threshold;
  197. /*
  198. * The RX Clear Channel Assessment threshold in the PHY
  199. * (the energy threshold).
  200. *
  201. * Range: ENABLE_ENERGY_D == 0x140A
  202. * DISABLE_ENERGY_D == 0xFFEF
  203. */
  204. u16 rx_cca_threshold;
  205. /*
  206. * Occupied Rx mem-blocks number which requires interrupting the host
  207. * (0 = no buffering, 0xffff = disabled).
  208. *
  209. * Range: u16
  210. */
  211. u16 irq_blk_threshold;
  212. /*
  213. * Rx packets number which requires interrupting the host
  214. * (0 = no buffering).
  215. *
  216. * Range: u16
  217. */
  218. u16 irq_pkt_threshold;
  219. /*
  220. * Max time in msec the FW may delay RX-Complete interrupt.
  221. *
  222. * Range: 1 - 100
  223. */
  224. u16 irq_timeout;
  225. /*
  226. * The RX queue type.
  227. *
  228. * Range: RX_QUEUE_TYPE_RX_LOW_PRIORITY, RX_QUEUE_TYPE_RX_HIGH_PRIORITY,
  229. */
  230. u8 queue_type;
  231. };
  232. #define CONF_TX_MAX_RATE_CLASSES 8
  233. #define CONF_TX_RATE_MASK_UNSPECIFIED 0
  234. #define CONF_TX_RATE_MASK_ALL 0x1eff
  235. #define CONF_TX_RATE_RETRY_LIMIT 10
  236. struct conf_tx_rate_class {
  237. /*
  238. * The rates enabled for this rate class.
  239. *
  240. * Range: CONF_HW_BIT_RATE_* bit mask
  241. */
  242. u32 enabled_rates;
  243. /*
  244. * The dot11 short retry limit used for TX retries.
  245. *
  246. * Range: u8
  247. */
  248. u8 short_retry_limit;
  249. /*
  250. * The dot11 long retry limit used for TX retries.
  251. *
  252. * Range: u8
  253. */
  254. u8 long_retry_limit;
  255. /*
  256. * Flags controlling the attributes of TX transmission.
  257. *
  258. * Range: bit 0: Truncate - when set, FW attempts to send a frame stop
  259. * when the total valid per-rate attempts have
  260. * been exhausted; otherwise transmissions
  261. * will continue at the lowest available rate
  262. * until the appropriate one of the
  263. * short_retry_limit, long_retry_limit,
  264. * dot11_max_transmit_msdu_life_time, or
  265. * max_tx_life_time, is exhausted.
  266. * 1: Preamble Override - indicates if the preamble type
  267. * should be used in TX.
  268. * 2: Preamble Type - the type of the preamble to be used by
  269. * the policy (0 - long preamble, 1 - short preamble.
  270. */
  271. u8 aflags;
  272. };
  273. #define CONF_TX_MAX_AC_COUNT 4
  274. /* Slot number setting to start transmission at PIFS interval */
  275. #define CONF_TX_AIFS_PIFS 1
  276. /* Slot number setting to start transmission at DIFS interval normal
  277. * DCF access */
  278. #define CONF_TX_AIFS_DIFS 2
  279. enum conf_tx_ac {
  280. CONF_TX_AC_BE = 0, /* best effort / legacy */
  281. CONF_TX_AC_BK = 1, /* background */
  282. CONF_TX_AC_VI = 2, /* video */
  283. CONF_TX_AC_VO = 3, /* voice */
  284. CONF_TX_AC_CTS2SELF = 4, /* fictious AC, follows AC_VO */
  285. CONF_TX_AC_ANY_TID = 0x1f
  286. };
  287. struct conf_tx_ac_category {
  288. /*
  289. * The AC class identifier.
  290. *
  291. * Range: enum conf_tx_ac
  292. */
  293. u8 ac;
  294. /*
  295. * The contention window minimum size (in slots) for the access
  296. * class.
  297. *
  298. * Range: u8
  299. */
  300. u8 cw_min;
  301. /*
  302. * The contention window maximum size (in slots) for the access
  303. * class.
  304. *
  305. * Range: u8
  306. */
  307. u16 cw_max;
  308. /*
  309. * The AIF value (in slots) for the access class.
  310. *
  311. * Range: u8
  312. */
  313. u8 aifsn;
  314. /*
  315. * The TX Op Limit (in microseconds) for the access class.
  316. *
  317. * Range: u16
  318. */
  319. u16 tx_op_limit;
  320. };
  321. #define CONF_TX_MAX_TID_COUNT 7
  322. enum {
  323. CONF_CHANNEL_TYPE_DCF = 0, /* DC/LEGACY*/
  324. CONF_CHANNEL_TYPE_EDCF = 1, /* EDCA*/
  325. CONF_CHANNEL_TYPE_HCCA = 2, /* HCCA*/
  326. };
  327. enum {
  328. CONF_PS_SCHEME_LEGACY = 0,
  329. CONF_PS_SCHEME_UPSD_TRIGGER = 1,
  330. CONF_PS_SCHEME_LEGACY_PSPOLL = 2,
  331. CONF_PS_SCHEME_SAPSD = 3,
  332. };
  333. enum {
  334. CONF_ACK_POLICY_LEGACY = 0,
  335. CONF_ACK_POLICY_NO_ACK = 1,
  336. CONF_ACK_POLICY_BLOCK = 2,
  337. };
  338. struct conf_tx_tid {
  339. u8 queue_id;
  340. u8 channel_type;
  341. u8 tsid;
  342. u8 ps_scheme;
  343. u8 ack_policy;
  344. u32 apsd_conf[2];
  345. };
  346. struct conf_tx_settings {
  347. /*
  348. * The TX ED value for TELEC Enable/Disable.
  349. *
  350. * Range: 0, 1
  351. */
  352. u8 tx_energy_detection;
  353. /*
  354. * Configuration for rate classes for TX (currently only one
  355. * rate class supported.)
  356. */
  357. struct conf_tx_rate_class rc_conf;
  358. /*
  359. * Configuration for access categories for TX rate control.
  360. */
  361. u8 ac_conf_count;
  362. struct conf_tx_ac_category ac_conf[CONF_TX_MAX_AC_COUNT];
  363. /*
  364. * Configuration for TID parameters.
  365. */
  366. u8 tid_conf_count;
  367. struct conf_tx_tid tid_conf[CONF_TX_MAX_TID_COUNT];
  368. /*
  369. * The TX fragmentation threshold.
  370. *
  371. * Range: u16
  372. */
  373. u16 frag_threshold;
  374. /*
  375. * Max time in msec the FW may delay frame TX-Complete interrupt.
  376. *
  377. * Range: u16
  378. */
  379. u16 tx_compl_timeout;
  380. /*
  381. * Completed TX packet count which requires to issue the TX-Complete
  382. * interrupt.
  383. *
  384. * Range: u16
  385. */
  386. u16 tx_compl_threshold;
  387. };
  388. struct conf_drv_settings {
  389. struct conf_sg_settings sg;
  390. struct conf_rx_settings rx;
  391. struct conf_tx_settings tx;
  392. };
  393. #endif