main.c 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451
  1. /*
  2. * This file is part of wl18xx
  3. *
  4. * Copyright (C) 2011 Texas Instruments
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * version 2 as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  18. * 02110-1301 USA
  19. *
  20. */
  21. #include <linux/module.h>
  22. #include <linux/platform_device.h>
  23. #include <linux/ip.h>
  24. #include "../wlcore/wlcore.h"
  25. #include "../wlcore/debug.h"
  26. #include "../wlcore/io.h"
  27. #include "../wlcore/acx.h"
  28. #include "../wlcore/tx.h"
  29. #include "../wlcore/rx.h"
  30. #include "../wlcore/io.h"
  31. #include "../wlcore/boot.h"
  32. #include "reg.h"
  33. #include "conf.h"
  34. #include "acx.h"
  35. #include "tx.h"
  36. #include "wl18xx.h"
  37. #include "io.h"
  38. #include "debugfs.h"
  39. #define WL18XX_RX_CHECKSUM_MASK 0x40
  40. static char *ht_mode_param = "wide";
  41. static char *board_type_param = "hdk";
  42. static bool dc2dc_param = false;
  43. static int n_antennas_2_param = 1;
  44. static int n_antennas_5_param = 1;
  45. static bool checksum_param = false;
  46. static bool enable_11a_param = true;
  47. static int low_band_component = -1;
  48. static int low_band_component_type = -1;
  49. static int high_band_component = -1;
  50. static int high_band_component_type = -1;
  51. static int pwr_limit_reference_11_abg = -1;
  52. static const u8 wl18xx_rate_to_idx_2ghz[] = {
  53. /* MCS rates are used only with 11n */
  54. 15, /* WL18XX_CONF_HW_RXTX_RATE_MCS15 */
  55. 14, /* WL18XX_CONF_HW_RXTX_RATE_MCS14 */
  56. 13, /* WL18XX_CONF_HW_RXTX_RATE_MCS13 */
  57. 12, /* WL18XX_CONF_HW_RXTX_RATE_MCS12 */
  58. 11, /* WL18XX_CONF_HW_RXTX_RATE_MCS11 */
  59. 10, /* WL18XX_CONF_HW_RXTX_RATE_MCS10 */
  60. 9, /* WL18XX_CONF_HW_RXTX_RATE_MCS9 */
  61. 8, /* WL18XX_CONF_HW_RXTX_RATE_MCS8 */
  62. 7, /* WL18XX_CONF_HW_RXTX_RATE_MCS7 */
  63. 6, /* WL18XX_CONF_HW_RXTX_RATE_MCS6 */
  64. 5, /* WL18XX_CONF_HW_RXTX_RATE_MCS5 */
  65. 4, /* WL18XX_CONF_HW_RXTX_RATE_MCS4 */
  66. 3, /* WL18XX_CONF_HW_RXTX_RATE_MCS3 */
  67. 2, /* WL18XX_CONF_HW_RXTX_RATE_MCS2 */
  68. 1, /* WL18XX_CONF_HW_RXTX_RATE_MCS1 */
  69. 0, /* WL18XX_CONF_HW_RXTX_RATE_MCS0 */
  70. 11, /* WL18XX_CONF_HW_RXTX_RATE_54 */
  71. 10, /* WL18XX_CONF_HW_RXTX_RATE_48 */
  72. 9, /* WL18XX_CONF_HW_RXTX_RATE_36 */
  73. 8, /* WL18XX_CONF_HW_RXTX_RATE_24 */
  74. /* TI-specific rate */
  75. CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_22 */
  76. 7, /* WL18XX_CONF_HW_RXTX_RATE_18 */
  77. 6, /* WL18XX_CONF_HW_RXTX_RATE_12 */
  78. 3, /* WL18XX_CONF_HW_RXTX_RATE_11 */
  79. 5, /* WL18XX_CONF_HW_RXTX_RATE_9 */
  80. 4, /* WL18XX_CONF_HW_RXTX_RATE_6 */
  81. 2, /* WL18XX_CONF_HW_RXTX_RATE_5_5 */
  82. 1, /* WL18XX_CONF_HW_RXTX_RATE_2 */
  83. 0 /* WL18XX_CONF_HW_RXTX_RATE_1 */
  84. };
  85. static const u8 wl18xx_rate_to_idx_5ghz[] = {
  86. /* MCS rates are used only with 11n */
  87. 15, /* WL18XX_CONF_HW_RXTX_RATE_MCS15 */
  88. 14, /* WL18XX_CONF_HW_RXTX_RATE_MCS14 */
  89. 13, /* WL18XX_CONF_HW_RXTX_RATE_MCS13 */
  90. 12, /* WL18XX_CONF_HW_RXTX_RATE_MCS12 */
  91. 11, /* WL18XX_CONF_HW_RXTX_RATE_MCS11 */
  92. 10, /* WL18XX_CONF_HW_RXTX_RATE_MCS10 */
  93. 9, /* WL18XX_CONF_HW_RXTX_RATE_MCS9 */
  94. 8, /* WL18XX_CONF_HW_RXTX_RATE_MCS8 */
  95. 7, /* WL18XX_CONF_HW_RXTX_RATE_MCS7 */
  96. 6, /* WL18XX_CONF_HW_RXTX_RATE_MCS6 */
  97. 5, /* WL18XX_CONF_HW_RXTX_RATE_MCS5 */
  98. 4, /* WL18XX_CONF_HW_RXTX_RATE_MCS4 */
  99. 3, /* WL18XX_CONF_HW_RXTX_RATE_MCS3 */
  100. 2, /* WL18XX_CONF_HW_RXTX_RATE_MCS2 */
  101. 1, /* WL18XX_CONF_HW_RXTX_RATE_MCS1 */
  102. 0, /* WL18XX_CONF_HW_RXTX_RATE_MCS0 */
  103. 7, /* WL18XX_CONF_HW_RXTX_RATE_54 */
  104. 6, /* WL18XX_CONF_HW_RXTX_RATE_48 */
  105. 5, /* WL18XX_CONF_HW_RXTX_RATE_36 */
  106. 4, /* WL18XX_CONF_HW_RXTX_RATE_24 */
  107. /* TI-specific rate */
  108. CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_22 */
  109. 3, /* WL18XX_CONF_HW_RXTX_RATE_18 */
  110. 2, /* WL18XX_CONF_HW_RXTX_RATE_12 */
  111. CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_11 */
  112. 1, /* WL18XX_CONF_HW_RXTX_RATE_9 */
  113. 0, /* WL18XX_CONF_HW_RXTX_RATE_6 */
  114. CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_5_5 */
  115. CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_2 */
  116. CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_1 */
  117. };
  118. static const u8 *wl18xx_band_rate_to_idx[] = {
  119. [IEEE80211_BAND_2GHZ] = wl18xx_rate_to_idx_2ghz,
  120. [IEEE80211_BAND_5GHZ] = wl18xx_rate_to_idx_5ghz
  121. };
  122. enum wl18xx_hw_rates {
  123. WL18XX_CONF_HW_RXTX_RATE_MCS15 = 0,
  124. WL18XX_CONF_HW_RXTX_RATE_MCS14,
  125. WL18XX_CONF_HW_RXTX_RATE_MCS13,
  126. WL18XX_CONF_HW_RXTX_RATE_MCS12,
  127. WL18XX_CONF_HW_RXTX_RATE_MCS11,
  128. WL18XX_CONF_HW_RXTX_RATE_MCS10,
  129. WL18XX_CONF_HW_RXTX_RATE_MCS9,
  130. WL18XX_CONF_HW_RXTX_RATE_MCS8,
  131. WL18XX_CONF_HW_RXTX_RATE_MCS7,
  132. WL18XX_CONF_HW_RXTX_RATE_MCS6,
  133. WL18XX_CONF_HW_RXTX_RATE_MCS5,
  134. WL18XX_CONF_HW_RXTX_RATE_MCS4,
  135. WL18XX_CONF_HW_RXTX_RATE_MCS3,
  136. WL18XX_CONF_HW_RXTX_RATE_MCS2,
  137. WL18XX_CONF_HW_RXTX_RATE_MCS1,
  138. WL18XX_CONF_HW_RXTX_RATE_MCS0,
  139. WL18XX_CONF_HW_RXTX_RATE_54,
  140. WL18XX_CONF_HW_RXTX_RATE_48,
  141. WL18XX_CONF_HW_RXTX_RATE_36,
  142. WL18XX_CONF_HW_RXTX_RATE_24,
  143. WL18XX_CONF_HW_RXTX_RATE_22,
  144. WL18XX_CONF_HW_RXTX_RATE_18,
  145. WL18XX_CONF_HW_RXTX_RATE_12,
  146. WL18XX_CONF_HW_RXTX_RATE_11,
  147. WL18XX_CONF_HW_RXTX_RATE_9,
  148. WL18XX_CONF_HW_RXTX_RATE_6,
  149. WL18XX_CONF_HW_RXTX_RATE_5_5,
  150. WL18XX_CONF_HW_RXTX_RATE_2,
  151. WL18XX_CONF_HW_RXTX_RATE_1,
  152. WL18XX_CONF_HW_RXTX_RATE_MAX,
  153. };
  154. static struct wlcore_conf wl18xx_conf = {
  155. .sg = {
  156. .params = {
  157. [CONF_SG_ACL_BT_MASTER_MIN_BR] = 10,
  158. [CONF_SG_ACL_BT_MASTER_MAX_BR] = 180,
  159. [CONF_SG_ACL_BT_SLAVE_MIN_BR] = 10,
  160. [CONF_SG_ACL_BT_SLAVE_MAX_BR] = 180,
  161. [CONF_SG_ACL_BT_MASTER_MIN_EDR] = 10,
  162. [CONF_SG_ACL_BT_MASTER_MAX_EDR] = 80,
  163. [CONF_SG_ACL_BT_SLAVE_MIN_EDR] = 10,
  164. [CONF_SG_ACL_BT_SLAVE_MAX_EDR] = 80,
  165. [CONF_SG_ACL_WLAN_PS_MASTER_BR] = 8,
  166. [CONF_SG_ACL_WLAN_PS_SLAVE_BR] = 8,
  167. [CONF_SG_ACL_WLAN_PS_MASTER_EDR] = 20,
  168. [CONF_SG_ACL_WLAN_PS_SLAVE_EDR] = 20,
  169. [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_BR] = 20,
  170. [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_BR] = 35,
  171. [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_BR] = 16,
  172. [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_BR] = 35,
  173. [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_EDR] = 32,
  174. [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_EDR] = 50,
  175. [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_EDR] = 28,
  176. [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_EDR] = 50,
  177. [CONF_SG_ACL_ACTIVE_SCAN_WLAN_BR] = 10,
  178. [CONF_SG_ACL_ACTIVE_SCAN_WLAN_EDR] = 20,
  179. [CONF_SG_ACL_PASSIVE_SCAN_BT_BR] = 75,
  180. [CONF_SG_ACL_PASSIVE_SCAN_WLAN_BR] = 15,
  181. [CONF_SG_ACL_PASSIVE_SCAN_BT_EDR] = 27,
  182. [CONF_SG_ACL_PASSIVE_SCAN_WLAN_EDR] = 17,
  183. /* active scan params */
  184. [CONF_SG_AUTO_SCAN_PROBE_REQ] = 170,
  185. [CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3] = 50,
  186. [CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP] = 100,
  187. /* passive scan params */
  188. [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_BR] = 800,
  189. [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_EDR] = 200,
  190. [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3] = 200,
  191. /* passive scan in dual antenna params */
  192. [CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN] = 0,
  193. [CONF_SG_BCN_HV3_COLLISION_THRESH_IN_PASSIVE_SCAN] = 0,
  194. [CONF_SG_TX_RX_PROTECTION_BWIDTH_IN_PASSIVE_SCAN] = 0,
  195. /* general params */
  196. [CONF_SG_STA_FORCE_PS_IN_BT_SCO] = 1,
  197. [CONF_SG_ANTENNA_CONFIGURATION] = 0,
  198. [CONF_SG_BEACON_MISS_PERCENT] = 60,
  199. [CONF_SG_DHCP_TIME] = 5000,
  200. [CONF_SG_RXT] = 1200,
  201. [CONF_SG_TXT] = 1000,
  202. [CONF_SG_ADAPTIVE_RXT_TXT] = 1,
  203. [CONF_SG_GENERAL_USAGE_BIT_MAP] = 3,
  204. [CONF_SG_HV3_MAX_SERVED] = 6,
  205. [CONF_SG_PS_POLL_TIMEOUT] = 10,
  206. [CONF_SG_UPSD_TIMEOUT] = 10,
  207. [CONF_SG_CONSECUTIVE_CTS_THRESHOLD] = 2,
  208. [CONF_SG_STA_RX_WINDOW_AFTER_DTIM] = 5,
  209. [CONF_SG_STA_CONNECTION_PROTECTION_TIME] = 30,
  210. /* AP params */
  211. [CONF_AP_BEACON_MISS_TX] = 3,
  212. [CONF_AP_RX_WINDOW_AFTER_BEACON] = 10,
  213. [CONF_AP_BEACON_WINDOW_INTERVAL] = 2,
  214. [CONF_AP_CONNECTION_PROTECTION_TIME] = 0,
  215. [CONF_AP_BT_ACL_VAL_BT_SERVE_TIME] = 25,
  216. [CONF_AP_BT_ACL_VAL_WL_SERVE_TIME] = 25,
  217. /* CTS Diluting params */
  218. [CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH] = 0,
  219. [CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER] = 0,
  220. },
  221. .state = CONF_SG_PROTECTIVE,
  222. },
  223. .rx = {
  224. .rx_msdu_life_time = 512000,
  225. .packet_detection_threshold = 0,
  226. .ps_poll_timeout = 15,
  227. .upsd_timeout = 15,
  228. .rts_threshold = IEEE80211_MAX_RTS_THRESHOLD,
  229. .rx_cca_threshold = 0,
  230. .irq_blk_threshold = 0xFFFF,
  231. .irq_pkt_threshold = 0,
  232. .irq_timeout = 600,
  233. .queue_type = CONF_RX_QUEUE_TYPE_LOW_PRIORITY,
  234. },
  235. .tx = {
  236. .tx_energy_detection = 0,
  237. .sta_rc_conf = {
  238. .enabled_rates = 0,
  239. .short_retry_limit = 10,
  240. .long_retry_limit = 10,
  241. .aflags = 0,
  242. },
  243. .ac_conf_count = 4,
  244. .ac_conf = {
  245. [CONF_TX_AC_BE] = {
  246. .ac = CONF_TX_AC_BE,
  247. .cw_min = 15,
  248. .cw_max = 63,
  249. .aifsn = 3,
  250. .tx_op_limit = 0,
  251. },
  252. [CONF_TX_AC_BK] = {
  253. .ac = CONF_TX_AC_BK,
  254. .cw_min = 15,
  255. .cw_max = 63,
  256. .aifsn = 7,
  257. .tx_op_limit = 0,
  258. },
  259. [CONF_TX_AC_VI] = {
  260. .ac = CONF_TX_AC_VI,
  261. .cw_min = 15,
  262. .cw_max = 63,
  263. .aifsn = CONF_TX_AIFS_PIFS,
  264. .tx_op_limit = 3008,
  265. },
  266. [CONF_TX_AC_VO] = {
  267. .ac = CONF_TX_AC_VO,
  268. .cw_min = 15,
  269. .cw_max = 63,
  270. .aifsn = CONF_TX_AIFS_PIFS,
  271. .tx_op_limit = 1504,
  272. },
  273. },
  274. .max_tx_retries = 100,
  275. .ap_aging_period = 300,
  276. .tid_conf_count = 4,
  277. .tid_conf = {
  278. [CONF_TX_AC_BE] = {
  279. .queue_id = CONF_TX_AC_BE,
  280. .channel_type = CONF_CHANNEL_TYPE_EDCF,
  281. .tsid = CONF_TX_AC_BE,
  282. .ps_scheme = CONF_PS_SCHEME_LEGACY,
  283. .ack_policy = CONF_ACK_POLICY_LEGACY,
  284. .apsd_conf = {0, 0},
  285. },
  286. [CONF_TX_AC_BK] = {
  287. .queue_id = CONF_TX_AC_BK,
  288. .channel_type = CONF_CHANNEL_TYPE_EDCF,
  289. .tsid = CONF_TX_AC_BK,
  290. .ps_scheme = CONF_PS_SCHEME_LEGACY,
  291. .ack_policy = CONF_ACK_POLICY_LEGACY,
  292. .apsd_conf = {0, 0},
  293. },
  294. [CONF_TX_AC_VI] = {
  295. .queue_id = CONF_TX_AC_VI,
  296. .channel_type = CONF_CHANNEL_TYPE_EDCF,
  297. .tsid = CONF_TX_AC_VI,
  298. .ps_scheme = CONF_PS_SCHEME_LEGACY,
  299. .ack_policy = CONF_ACK_POLICY_LEGACY,
  300. .apsd_conf = {0, 0},
  301. },
  302. [CONF_TX_AC_VO] = {
  303. .queue_id = CONF_TX_AC_VO,
  304. .channel_type = CONF_CHANNEL_TYPE_EDCF,
  305. .tsid = CONF_TX_AC_VO,
  306. .ps_scheme = CONF_PS_SCHEME_LEGACY,
  307. .ack_policy = CONF_ACK_POLICY_LEGACY,
  308. .apsd_conf = {0, 0},
  309. },
  310. },
  311. .frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD,
  312. .tx_compl_timeout = 350,
  313. .tx_compl_threshold = 10,
  314. .basic_rate = CONF_HW_BIT_RATE_1MBPS,
  315. .basic_rate_5 = CONF_HW_BIT_RATE_6MBPS,
  316. .tmpl_short_retry_limit = 10,
  317. .tmpl_long_retry_limit = 10,
  318. .tx_watchdog_timeout = 5000,
  319. },
  320. .conn = {
  321. .wake_up_event = CONF_WAKE_UP_EVENT_DTIM,
  322. .listen_interval = 1,
  323. .suspend_wake_up_event = CONF_WAKE_UP_EVENT_N_DTIM,
  324. .suspend_listen_interval = 3,
  325. .bcn_filt_mode = CONF_BCN_FILT_MODE_ENABLED,
  326. .bcn_filt_ie_count = 3,
  327. .bcn_filt_ie = {
  328. [0] = {
  329. .ie = WLAN_EID_CHANNEL_SWITCH,
  330. .rule = CONF_BCN_RULE_PASS_ON_APPEARANCE,
  331. },
  332. [1] = {
  333. .ie = WLAN_EID_HT_OPERATION,
  334. .rule = CONF_BCN_RULE_PASS_ON_CHANGE,
  335. },
  336. [2] = {
  337. .ie = WLAN_EID_ERP_INFO,
  338. .rule = CONF_BCN_RULE_PASS_ON_CHANGE,
  339. },
  340. },
  341. .synch_fail_thold = 12,
  342. .bss_lose_timeout = 400,
  343. .beacon_rx_timeout = 10000,
  344. .broadcast_timeout = 20000,
  345. .rx_broadcast_in_ps = 1,
  346. .ps_poll_threshold = 10,
  347. .bet_enable = CONF_BET_MODE_ENABLE,
  348. .bet_max_consecutive = 50,
  349. .psm_entry_retries = 8,
  350. .psm_exit_retries = 16,
  351. .psm_entry_nullfunc_retries = 3,
  352. .dynamic_ps_timeout = 200,
  353. .forced_ps = false,
  354. .keep_alive_interval = 55000,
  355. .max_listen_interval = 20,
  356. },
  357. .itrim = {
  358. .enable = false,
  359. .timeout = 50000,
  360. },
  361. .pm_config = {
  362. .host_clk_settling_time = 5000,
  363. .host_fast_wakeup_support = CONF_FAST_WAKEUP_DISABLE,
  364. },
  365. .roam_trigger = {
  366. .trigger_pacing = 1,
  367. .avg_weight_rssi_beacon = 20,
  368. .avg_weight_rssi_data = 10,
  369. .avg_weight_snr_beacon = 20,
  370. .avg_weight_snr_data = 10,
  371. },
  372. .scan = {
  373. .min_dwell_time_active = 7500,
  374. .max_dwell_time_active = 30000,
  375. .min_dwell_time_passive = 100000,
  376. .max_dwell_time_passive = 100000,
  377. .num_probe_reqs = 2,
  378. .split_scan_timeout = 50000,
  379. },
  380. .sched_scan = {
  381. /*
  382. * Values are in TU/1000 but since sched scan FW command
  383. * params are in TUs rounding up may occur.
  384. */
  385. .base_dwell_time = 7500,
  386. .max_dwell_time_delta = 22500,
  387. /* based on 250bits per probe @1Mbps */
  388. .dwell_time_delta_per_probe = 2000,
  389. /* based on 250bits per probe @6Mbps (plus a bit more) */
  390. .dwell_time_delta_per_probe_5 = 350,
  391. .dwell_time_passive = 100000,
  392. .dwell_time_dfs = 150000,
  393. .num_probe_reqs = 2,
  394. .rssi_threshold = -90,
  395. .snr_threshold = 0,
  396. },
  397. .ht = {
  398. .rx_ba_win_size = 10,
  399. .tx_ba_win_size = 64,
  400. .inactivity_timeout = 10000,
  401. .tx_ba_tid_bitmap = CONF_TX_BA_ENABLED_TID_BITMAP,
  402. },
  403. .mem = {
  404. .num_stations = 1,
  405. .ssid_profiles = 1,
  406. .rx_block_num = 40,
  407. .tx_min_block_num = 40,
  408. .dynamic_memory = 1,
  409. .min_req_tx_blocks = 45,
  410. .min_req_rx_blocks = 22,
  411. .tx_min = 27,
  412. },
  413. .fm_coex = {
  414. .enable = true,
  415. .swallow_period = 5,
  416. .n_divider_fref_set_1 = 0xff, /* default */
  417. .n_divider_fref_set_2 = 12,
  418. .m_divider_fref_set_1 = 0xffff,
  419. .m_divider_fref_set_2 = 148, /* default */
  420. .coex_pll_stabilization_time = 0xffffffff, /* default */
  421. .ldo_stabilization_time = 0xffff, /* default */
  422. .fm_disturbed_band_margin = 0xff, /* default */
  423. .swallow_clk_diff = 0xff, /* default */
  424. },
  425. .rx_streaming = {
  426. .duration = 150,
  427. .queues = 0x1,
  428. .interval = 20,
  429. .always = 0,
  430. },
  431. .fwlog = {
  432. .mode = WL12XX_FWLOG_ON_DEMAND,
  433. .mem_blocks = 2,
  434. .severity = 0,
  435. .timestamp = WL12XX_FWLOG_TIMESTAMP_DISABLED,
  436. .output = WL12XX_FWLOG_OUTPUT_HOST,
  437. .threshold = 0,
  438. },
  439. .rate = {
  440. .rate_retry_score = 32000,
  441. .per_add = 8192,
  442. .per_th1 = 2048,
  443. .per_th2 = 4096,
  444. .max_per = 8100,
  445. .inverse_curiosity_factor = 5,
  446. .tx_fail_low_th = 4,
  447. .tx_fail_high_th = 10,
  448. .per_alpha_shift = 4,
  449. .per_add_shift = 13,
  450. .per_beta1_shift = 10,
  451. .per_beta2_shift = 8,
  452. .rate_check_up = 2,
  453. .rate_check_down = 12,
  454. .rate_retry_policy = {
  455. 0x00, 0x00, 0x00, 0x00, 0x00,
  456. 0x00, 0x00, 0x00, 0x00, 0x00,
  457. 0x00, 0x00, 0x00,
  458. },
  459. },
  460. .hangover = {
  461. .recover_time = 0,
  462. .hangover_period = 20,
  463. .dynamic_mode = 1,
  464. .early_termination_mode = 1,
  465. .max_period = 20,
  466. .min_period = 1,
  467. .increase_delta = 1,
  468. .decrease_delta = 2,
  469. .quiet_time = 4,
  470. .increase_time = 1,
  471. .window_size = 16,
  472. },
  473. };
  474. static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
  475. .phy = {
  476. .phy_standalone = 0x00,
  477. .primary_clock_setting_time = 0x05,
  478. .clock_valid_on_wake_up = 0x00,
  479. .secondary_clock_setting_time = 0x05,
  480. .rdl = 0x01,
  481. .auto_detect = 0x00,
  482. .dedicated_fem = FEM_NONE,
  483. .low_band_component = COMPONENT_2_WAY_SWITCH,
  484. .low_band_component_type = 0x05,
  485. .high_band_component = COMPONENT_2_WAY_SWITCH,
  486. .high_band_component_type = 0x09,
  487. .tcxo_ldo_voltage = 0x00,
  488. .xtal_itrim_val = 0x04,
  489. .srf_state = 0x00,
  490. .io_configuration = 0x01,
  491. .sdio_configuration = 0x00,
  492. .settings = 0x00,
  493. .enable_clpc = 0x00,
  494. .enable_tx_low_pwr_on_siso_rdl = 0x00,
  495. .rx_profile = 0x00,
  496. .pwr_limit_reference_11_abg = 0xc8,
  497. .psat = 0,
  498. .low_power_val = 0x00,
  499. .med_power_val = 0x0a,
  500. .high_power_val = 0x1e,
  501. },
  502. };
  503. static const struct wlcore_partition_set wl18xx_ptable[PART_TABLE_LEN] = {
  504. [PART_TOP_PRCM_ELP_SOC] = {
  505. .mem = { .start = 0x00A02000, .size = 0x00010000 },
  506. .reg = { .start = 0x00807000, .size = 0x00005000 },
  507. .mem2 = { .start = 0x00800000, .size = 0x0000B000 },
  508. .mem3 = { .start = 0x00000000, .size = 0x00000000 },
  509. },
  510. [PART_DOWN] = {
  511. .mem = { .start = 0x00000000, .size = 0x00014000 },
  512. .reg = { .start = 0x00810000, .size = 0x0000BFFF },
  513. .mem2 = { .start = 0x00000000, .size = 0x00000000 },
  514. .mem3 = { .start = 0x00000000, .size = 0x00000000 },
  515. },
  516. [PART_BOOT] = {
  517. .mem = { .start = 0x00700000, .size = 0x0000030c },
  518. .reg = { .start = 0x00802000, .size = 0x00014578 },
  519. .mem2 = { .start = 0x00B00404, .size = 0x00001000 },
  520. .mem3 = { .start = 0x00C00000, .size = 0x00000400 },
  521. },
  522. [PART_WORK] = {
  523. .mem = { .start = 0x00800000, .size = 0x000050FC },
  524. .reg = { .start = 0x00B00404, .size = 0x00001000 },
  525. .mem2 = { .start = 0x00C00000, .size = 0x00000400 },
  526. .mem3 = { .start = 0x00000000, .size = 0x00000000 },
  527. },
  528. [PART_PHY_INIT] = {
  529. .mem = { .start = 0x80926000,
  530. .size = sizeof(struct wl18xx_mac_and_phy_params) },
  531. .reg = { .start = 0x00000000, .size = 0x00000000 },
  532. .mem2 = { .start = 0x00000000, .size = 0x00000000 },
  533. .mem3 = { .start = 0x00000000, .size = 0x00000000 },
  534. },
  535. };
  536. static const int wl18xx_rtable[REG_TABLE_LEN] = {
  537. [REG_ECPU_CONTROL] = WL18XX_REG_ECPU_CONTROL,
  538. [REG_INTERRUPT_NO_CLEAR] = WL18XX_REG_INTERRUPT_NO_CLEAR,
  539. [REG_INTERRUPT_ACK] = WL18XX_REG_INTERRUPT_ACK,
  540. [REG_COMMAND_MAILBOX_PTR] = WL18XX_REG_COMMAND_MAILBOX_PTR,
  541. [REG_EVENT_MAILBOX_PTR] = WL18XX_REG_EVENT_MAILBOX_PTR,
  542. [REG_INTERRUPT_TRIG] = WL18XX_REG_INTERRUPT_TRIG_H,
  543. [REG_INTERRUPT_MASK] = WL18XX_REG_INTERRUPT_MASK,
  544. [REG_PC_ON_RECOVERY] = WL18XX_SCR_PAD4,
  545. [REG_CHIP_ID_B] = WL18XX_REG_CHIP_ID_B,
  546. [REG_CMD_MBOX_ADDRESS] = WL18XX_CMD_MBOX_ADDRESS,
  547. /* data access memory addresses, used with partition translation */
  548. [REG_SLV_MEM_DATA] = WL18XX_SLV_MEM_DATA,
  549. [REG_SLV_REG_DATA] = WL18XX_SLV_REG_DATA,
  550. /* raw data access memory addresses */
  551. [REG_RAW_FW_STATUS_ADDR] = WL18XX_FW_STATUS_ADDR,
  552. };
  553. static const struct wl18xx_clk_cfg wl18xx_clk_table[NUM_CLOCK_CONFIGS] = {
  554. [CLOCK_CONFIG_16_2_M] = { 7, 104, 801, 4, true },
  555. [CLOCK_CONFIG_16_368_M] = { 9, 132, 3751, 4, true },
  556. [CLOCK_CONFIG_16_8_M] = { 7, 100, 0, 0, false },
  557. [CLOCK_CONFIG_19_2_M] = { 8, 100, 0, 0, false },
  558. [CLOCK_CONFIG_26_M] = { 13, 120, 0, 0, false },
  559. [CLOCK_CONFIG_32_736_M] = { 9, 132, 3751, 4, true },
  560. [CLOCK_CONFIG_33_6_M] = { 7, 100, 0, 0, false },
  561. [CLOCK_CONFIG_38_468_M] = { 8, 100, 0, 0, false },
  562. [CLOCK_CONFIG_52_M] = { 13, 120, 0, 0, false },
  563. };
  564. /* TODO: maybe move to a new header file? */
  565. #define WL18XX_FW_NAME "ti-connectivity/wl18xx-fw.bin"
  566. static int wl18xx_identify_chip(struct wl1271 *wl)
  567. {
  568. int ret = 0;
  569. switch (wl->chip.id) {
  570. case CHIP_ID_185x_PG20:
  571. wl1271_debug(DEBUG_BOOT, "chip id 0x%x (185x PG20)",
  572. wl->chip.id);
  573. wl->sr_fw_name = WL18XX_FW_NAME;
  574. /* wl18xx uses the same firmware for PLT */
  575. wl->plt_fw_name = WL18XX_FW_NAME;
  576. wl->quirks |= WLCORE_QUIRK_NO_ELP |
  577. WLCORE_QUIRK_FWLOG_NOT_IMPLEMENTED |
  578. WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN |
  579. WLCORE_QUIRK_TX_PAD_LAST_FRAME;
  580. break;
  581. case CHIP_ID_185x_PG10:
  582. wl1271_debug(DEBUG_BOOT, "chip id 0x%x (185x PG10)",
  583. wl->chip.id);
  584. wl->sr_fw_name = WL18XX_FW_NAME;
  585. /* wl18xx uses the same firmware for PLT */
  586. wl->plt_fw_name = WL18XX_FW_NAME;
  587. wl->quirks |= WLCORE_QUIRK_NO_ELP |
  588. WLCORE_QUIRK_FWLOG_NOT_IMPLEMENTED |
  589. WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN |
  590. WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN;
  591. /* PG 1.0 has some problems with MCS_13, so disable it */
  592. wl->ht_cap[IEEE80211_BAND_2GHZ].mcs.rx_mask[1] &= ~BIT(5);
  593. break;
  594. default:
  595. wl1271_warning("unsupported chip id: 0x%x", wl->chip.id);
  596. ret = -ENODEV;
  597. goto out;
  598. }
  599. out:
  600. return ret;
  601. }
  602. static void wl18xx_set_clk(struct wl1271 *wl)
  603. {
  604. u32 clk_freq;
  605. wlcore_set_partition(wl, &wl->ptable[PART_TOP_PRCM_ELP_SOC]);
  606. /* TODO: PG2: apparently we need to read the clk type */
  607. clk_freq = wl18xx_top_reg_read(wl, PRIMARY_CLK_DETECT);
  608. wl1271_debug(DEBUG_BOOT, "clock freq %d (%d, %d, %d, %d, %s)", clk_freq,
  609. wl18xx_clk_table[clk_freq].n, wl18xx_clk_table[clk_freq].m,
  610. wl18xx_clk_table[clk_freq].p, wl18xx_clk_table[clk_freq].q,
  611. wl18xx_clk_table[clk_freq].swallow ? "swallow" : "spit");
  612. wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_N, wl18xx_clk_table[clk_freq].n);
  613. wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_M, wl18xx_clk_table[clk_freq].m);
  614. if (wl18xx_clk_table[clk_freq].swallow) {
  615. /* first the 16 lower bits */
  616. wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_Q_FACTOR_CFG_1,
  617. wl18xx_clk_table[clk_freq].q &
  618. PLLSH_WCS_PLL_Q_FACTOR_CFG_1_MASK);
  619. /* then the 16 higher bits, masked out */
  620. wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_Q_FACTOR_CFG_2,
  621. (wl18xx_clk_table[clk_freq].q >> 16) &
  622. PLLSH_WCS_PLL_Q_FACTOR_CFG_2_MASK);
  623. /* first the 16 lower bits */
  624. wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_P_FACTOR_CFG_1,
  625. wl18xx_clk_table[clk_freq].p &
  626. PLLSH_WCS_PLL_P_FACTOR_CFG_1_MASK);
  627. /* then the 16 higher bits, masked out */
  628. wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_P_FACTOR_CFG_2,
  629. (wl18xx_clk_table[clk_freq].p >> 16) &
  630. PLLSH_WCS_PLL_P_FACTOR_CFG_2_MASK);
  631. } else {
  632. wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_SWALLOW_EN,
  633. PLLSH_WCS_PLL_SWALLOW_EN_VAL2);
  634. }
  635. }
  636. static void wl18xx_boot_soft_reset(struct wl1271 *wl)
  637. {
  638. /* disable Rx/Tx */
  639. wl1271_write32(wl, WL18XX_ENABLE, 0x0);
  640. /* disable auto calibration on start*/
  641. wl1271_write32(wl, WL18XX_SPARE_A2, 0xffff);
  642. }
  643. static int wl18xx_pre_boot(struct wl1271 *wl)
  644. {
  645. wl18xx_set_clk(wl);
  646. /* Continue the ELP wake up sequence */
  647. wl1271_write32(wl, WL18XX_WELP_ARM_COMMAND, WELP_ARM_COMMAND_VAL);
  648. udelay(500);
  649. wlcore_set_partition(wl, &wl->ptable[PART_BOOT]);
  650. /* Disable interrupts */
  651. wlcore_write_reg(wl, REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL);
  652. wl18xx_boot_soft_reset(wl);
  653. return 0;
  654. }
  655. static void wl18xx_pre_upload(struct wl1271 *wl)
  656. {
  657. u32 tmp;
  658. wlcore_set_partition(wl, &wl->ptable[PART_BOOT]);
  659. /* TODO: check if this is all needed */
  660. wl1271_write32(wl, WL18XX_EEPROMLESS_IND, WL18XX_EEPROMLESS_IND);
  661. tmp = wlcore_read_reg(wl, REG_CHIP_ID_B);
  662. wl1271_debug(DEBUG_BOOT, "chip id 0x%x", tmp);
  663. tmp = wl1271_read32(wl, WL18XX_SCR_PAD2);
  664. }
  665. static void wl18xx_set_mac_and_phy(struct wl1271 *wl)
  666. {
  667. struct wl18xx_priv *priv = wl->priv;
  668. struct wl18xx_conf_phy *phy = &priv->conf.phy;
  669. struct wl18xx_mac_and_phy_params params;
  670. size_t len;
  671. memset(&params, 0, sizeof(params));
  672. params.phy_standalone = phy->phy_standalone;
  673. params.rdl = phy->rdl;
  674. params.enable_clpc = phy->enable_clpc;
  675. params.enable_tx_low_pwr_on_siso_rdl =
  676. phy->enable_tx_low_pwr_on_siso_rdl;
  677. params.auto_detect = phy->auto_detect;
  678. params.dedicated_fem = phy->dedicated_fem;
  679. params.low_band_component = phy->low_band_component;
  680. params.low_band_component_type =
  681. phy->low_band_component_type;
  682. params.high_band_component = phy->high_band_component;
  683. params.high_band_component_type =
  684. phy->high_band_component_type;
  685. params.number_of_assembled_ant2_4 =
  686. n_antennas_2_param;
  687. params.number_of_assembled_ant5 =
  688. n_antennas_5_param;
  689. params.external_pa_dc2dc = dc2dc_param;
  690. params.tcxo_ldo_voltage = phy->tcxo_ldo_voltage;
  691. params.xtal_itrim_val = phy->xtal_itrim_val;
  692. params.srf_state = phy->srf_state;
  693. params.io_configuration = phy->io_configuration;
  694. params.sdio_configuration = phy->sdio_configuration;
  695. params.settings = phy->settings;
  696. params.rx_profile = phy->rx_profile;
  697. params.primary_clock_setting_time =
  698. phy->primary_clock_setting_time;
  699. params.clock_valid_on_wake_up =
  700. phy->clock_valid_on_wake_up;
  701. params.secondary_clock_setting_time =
  702. phy->secondary_clock_setting_time;
  703. params.pwr_limit_reference_11_abg =
  704. phy->pwr_limit_reference_11_abg;
  705. params.board_type = priv->board_type;
  706. /* for PG2 only */
  707. params.psat = phy->psat;
  708. params.low_power_val = phy->low_power_val;
  709. params.med_power_val = phy->med_power_val;
  710. params.high_power_val = phy->high_power_val;
  711. /* the parameters struct is smaller for PG1 */
  712. if (wl->chip.id == CHIP_ID_185x_PG10)
  713. len = offsetof(struct wl18xx_mac_and_phy_params, psat) + 1;
  714. else
  715. len = sizeof(params);
  716. wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]);
  717. wl1271_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&params,
  718. len, false);
  719. }
  720. static void wl18xx_enable_interrupts(struct wl1271 *wl)
  721. {
  722. u32 event_mask, intr_mask;
  723. if (wl->chip.id == CHIP_ID_185x_PG10) {
  724. event_mask = WL18XX_ACX_EVENTS_VECTOR_PG1;
  725. intr_mask = WL18XX_INTR_MASK_PG1;
  726. } else {
  727. event_mask = WL18XX_ACX_EVENTS_VECTOR_PG2;
  728. intr_mask = WL18XX_INTR_MASK_PG2;
  729. }
  730. wlcore_write_reg(wl, REG_INTERRUPT_MASK, event_mask);
  731. wlcore_enable_interrupts(wl);
  732. wlcore_write_reg(wl, REG_INTERRUPT_MASK,
  733. WL1271_ACX_INTR_ALL & ~intr_mask);
  734. }
  735. static int wl18xx_boot(struct wl1271 *wl)
  736. {
  737. int ret;
  738. ret = wl18xx_pre_boot(wl);
  739. if (ret < 0)
  740. goto out;
  741. wl18xx_pre_upload(wl);
  742. ret = wlcore_boot_upload_firmware(wl);
  743. if (ret < 0)
  744. goto out;
  745. wl18xx_set_mac_and_phy(wl);
  746. ret = wlcore_boot_run_firmware(wl);
  747. if (ret < 0)
  748. goto out;
  749. wl18xx_enable_interrupts(wl);
  750. out:
  751. return ret;
  752. }
  753. static void wl18xx_trigger_cmd(struct wl1271 *wl, int cmd_box_addr,
  754. void *buf, size_t len)
  755. {
  756. struct wl18xx_priv *priv = wl->priv;
  757. memcpy(priv->cmd_buf, buf, len);
  758. memset(priv->cmd_buf + len, 0, WL18XX_CMD_MAX_SIZE - len);
  759. wl1271_write(wl, cmd_box_addr, priv->cmd_buf, WL18XX_CMD_MAX_SIZE,
  760. false);
  761. }
  762. static void wl18xx_ack_event(struct wl1271 *wl)
  763. {
  764. wlcore_write_reg(wl, REG_INTERRUPT_TRIG, WL18XX_INTR_TRIG_EVENT_ACK);
  765. }
  766. static u32 wl18xx_calc_tx_blocks(struct wl1271 *wl, u32 len, u32 spare_blks)
  767. {
  768. u32 blk_size = WL18XX_TX_HW_BLOCK_SIZE;
  769. return (len + blk_size - 1) / blk_size + spare_blks;
  770. }
  771. static void
  772. wl18xx_set_tx_desc_blocks(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
  773. u32 blks, u32 spare_blks)
  774. {
  775. desc->wl18xx_mem.total_mem_blocks = blks;
  776. }
  777. static void
  778. wl18xx_set_tx_desc_data_len(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
  779. struct sk_buff *skb)
  780. {
  781. desc->length = cpu_to_le16(skb->len);
  782. /* if only the last frame is to be padded, we unset this bit on Tx */
  783. if (wl->quirks & WLCORE_QUIRK_TX_PAD_LAST_FRAME)
  784. desc->wl18xx_mem.ctrl = WL18XX_TX_CTRL_NOT_PADDED;
  785. else
  786. desc->wl18xx_mem.ctrl = 0;
  787. wl1271_debug(DEBUG_TX, "tx_fill_hdr: hlid: %d "
  788. "len: %d life: %d mem: %d", desc->hlid,
  789. le16_to_cpu(desc->length),
  790. le16_to_cpu(desc->life_time),
  791. desc->wl18xx_mem.total_mem_blocks);
  792. }
  793. static enum wl_rx_buf_align
  794. wl18xx_get_rx_buf_align(struct wl1271 *wl, u32 rx_desc)
  795. {
  796. if (rx_desc & RX_BUF_PADDED_PAYLOAD)
  797. return WLCORE_RX_BUF_PADDED;
  798. return WLCORE_RX_BUF_ALIGNED;
  799. }
  800. static u32 wl18xx_get_rx_packet_len(struct wl1271 *wl, void *rx_data,
  801. u32 data_len)
  802. {
  803. struct wl1271_rx_descriptor *desc = rx_data;
  804. /* invalid packet */
  805. if (data_len < sizeof(*desc))
  806. return 0;
  807. return data_len - sizeof(*desc);
  808. }
  809. static void wl18xx_tx_immediate_completion(struct wl1271 *wl)
  810. {
  811. wl18xx_tx_immediate_complete(wl);
  812. }
  813. static int wl18xx_set_host_cfg_bitmap(struct wl1271 *wl, u32 extra_mem_blk)
  814. {
  815. int ret;
  816. u32 sdio_align_size = 0;
  817. u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE |
  818. HOST_IF_CFG_ADD_RX_ALIGNMENT;
  819. /* Enable Tx SDIO padding */
  820. if (wl->quirks & WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN) {
  821. host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK;
  822. sdio_align_size = WL12XX_BUS_BLOCK_SIZE;
  823. }
  824. /* Enable Rx SDIO padding */
  825. if (wl->quirks & WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN) {
  826. host_cfg_bitmap |= HOST_IF_CFG_RX_PAD_TO_SDIO_BLK;
  827. sdio_align_size = WL12XX_BUS_BLOCK_SIZE;
  828. }
  829. ret = wl18xx_acx_host_if_cfg_bitmap(wl, host_cfg_bitmap,
  830. sdio_align_size, extra_mem_blk,
  831. WL18XX_HOST_IF_LEN_SIZE_FIELD);
  832. if (ret < 0)
  833. return ret;
  834. return 0;
  835. }
  836. static int wl18xx_hw_init(struct wl1271 *wl)
  837. {
  838. int ret;
  839. struct wl18xx_priv *priv = wl->priv;
  840. /* (re)init private structures. Relevant on recovery as well. */
  841. priv->last_fw_rls_idx = 0;
  842. priv->extra_spare_vif_count = 0;
  843. /* set the default amount of spare blocks in the bitmap */
  844. ret = wl18xx_set_host_cfg_bitmap(wl, WL18XX_TX_HW_BLOCK_SPARE);
  845. if (ret < 0)
  846. return ret;
  847. if (checksum_param) {
  848. ret = wl18xx_acx_set_checksum_state(wl);
  849. if (ret != 0)
  850. return ret;
  851. }
  852. return ret;
  853. }
  854. static void wl18xx_set_tx_desc_csum(struct wl1271 *wl,
  855. struct wl1271_tx_hw_descr *desc,
  856. struct sk_buff *skb)
  857. {
  858. u32 ip_hdr_offset;
  859. struct iphdr *ip_hdr;
  860. if (!checksum_param) {
  861. desc->wl18xx_checksum_data = 0;
  862. return;
  863. }
  864. if (skb->ip_summed != CHECKSUM_PARTIAL) {
  865. desc->wl18xx_checksum_data = 0;
  866. return;
  867. }
  868. ip_hdr_offset = skb_network_header(skb) - skb_mac_header(skb);
  869. if (WARN_ON(ip_hdr_offset >= (1<<7))) {
  870. desc->wl18xx_checksum_data = 0;
  871. return;
  872. }
  873. desc->wl18xx_checksum_data = ip_hdr_offset << 1;
  874. /* FW is interested only in the LSB of the protocol TCP=0 UDP=1 */
  875. ip_hdr = (void *)skb_network_header(skb);
  876. desc->wl18xx_checksum_data |= (ip_hdr->protocol & 0x01);
  877. }
  878. static void wl18xx_set_rx_csum(struct wl1271 *wl,
  879. struct wl1271_rx_descriptor *desc,
  880. struct sk_buff *skb)
  881. {
  882. if (desc->status & WL18XX_RX_CHECKSUM_MASK)
  883. skb->ip_summed = CHECKSUM_UNNECESSARY;
  884. }
  885. /*
  886. * TODO: instead of having these two functions to get the rate mask,
  887. * we should modify the wlvif->rate_set instead
  888. */
  889. static u32 wl18xx_sta_get_ap_rate_mask(struct wl1271 *wl,
  890. struct wl12xx_vif *wlvif)
  891. {
  892. u32 hw_rate_set = wlvif->rate_set;
  893. if (wlvif->channel_type == NL80211_CHAN_HT40MINUS ||
  894. wlvif->channel_type == NL80211_CHAN_HT40PLUS) {
  895. wl1271_debug(DEBUG_ACX, "using wide channel rate mask");
  896. hw_rate_set |= CONF_TX_RATE_USE_WIDE_CHAN;
  897. /* we don't support MIMO in wide-channel mode */
  898. hw_rate_set &= ~CONF_TX_MIMO_RATES;
  899. }
  900. return hw_rate_set;
  901. }
  902. static u32 wl18xx_ap_get_mimo_wide_rate_mask(struct wl1271 *wl,
  903. struct wl12xx_vif *wlvif)
  904. {
  905. if ((wlvif->channel_type == NL80211_CHAN_HT40MINUS ||
  906. wlvif->channel_type == NL80211_CHAN_HT40PLUS) &&
  907. !strcmp(ht_mode_param, "wide")) {
  908. wl1271_debug(DEBUG_ACX, "using wide channel rate mask");
  909. return CONF_TX_RATE_USE_WIDE_CHAN;
  910. } else if (!strcmp(ht_mode_param, "mimo")) {
  911. wl1271_debug(DEBUG_ACX, "using MIMO rate mask");
  912. /*
  913. * PG 1.0 has some problems with MCS_13, so disable it
  914. *
  915. * TODO: instead of hacking this in here, we should
  916. * make it more general and change a bit in the
  917. * wlvif->rate_set instead.
  918. */
  919. if (wl->chip.id == CHIP_ID_185x_PG10)
  920. return CONF_TX_MIMO_RATES & ~CONF_HW_BIT_RATE_MCS_13;
  921. return CONF_TX_MIMO_RATES;
  922. } else {
  923. return 0;
  924. }
  925. }
  926. static s8 wl18xx_get_pg_ver(struct wl1271 *wl)
  927. {
  928. u32 fuse;
  929. wlcore_set_partition(wl, &wl->ptable[PART_TOP_PRCM_ELP_SOC]);
  930. fuse = wl1271_read32(wl, WL18XX_REG_FUSE_DATA_1_3);
  931. fuse = (fuse & WL18XX_PG_VER_MASK) >> WL18XX_PG_VER_OFFSET;
  932. wlcore_set_partition(wl, &wl->ptable[PART_BOOT]);
  933. return (s8)fuse;
  934. }
  935. static void wl18xx_conf_init(struct wl1271 *wl)
  936. {
  937. struct wl18xx_priv *priv = wl->priv;
  938. /* apply driver default configuration */
  939. memcpy(&wl->conf, &wl18xx_conf, sizeof(wl18xx_conf));
  940. /* apply default private configuration */
  941. memcpy(&priv->conf, &wl18xx_default_priv_conf, sizeof(priv->conf));
  942. }
  943. static int wl18xx_plt_init(struct wl1271 *wl)
  944. {
  945. wl1271_write32(wl, WL18XX_SCR_PAD8, WL18XX_SCR_PAD8_PLT);
  946. return wl->ops->boot(wl);
  947. }
  948. static void wl18xx_get_mac(struct wl1271 *wl)
  949. {
  950. u32 mac1, mac2;
  951. wlcore_set_partition(wl, &wl->ptable[PART_TOP_PRCM_ELP_SOC]);
  952. mac1 = wl1271_read32(wl, WL18XX_REG_FUSE_BD_ADDR_1);
  953. mac2 = wl1271_read32(wl, WL18XX_REG_FUSE_BD_ADDR_2);
  954. /* these are the two parts of the BD_ADDR */
  955. wl->fuse_oui_addr = ((mac2 & 0xffff) << 8) +
  956. ((mac1 & 0xff000000) >> 24);
  957. wl->fuse_nic_addr = (mac1 & 0xffffff);
  958. wlcore_set_partition(wl, &wl->ptable[PART_DOWN]);
  959. }
  960. static int wl18xx_handle_static_data(struct wl1271 *wl,
  961. struct wl1271_static_data *static_data)
  962. {
  963. struct wl18xx_static_data_priv *static_data_priv =
  964. (struct wl18xx_static_data_priv *) static_data->priv;
  965. wl1271_info("PHY firmware version: %s", static_data_priv->phy_version);
  966. return 0;
  967. }
  968. static int wl18xx_get_spare_blocks(struct wl1271 *wl, bool is_gem)
  969. {
  970. struct wl18xx_priv *priv = wl->priv;
  971. /* If we have VIFs requiring extra spare, indulge them */
  972. if (priv->extra_spare_vif_count)
  973. return WL18XX_TX_HW_EXTRA_BLOCK_SPARE;
  974. return WL18XX_TX_HW_BLOCK_SPARE;
  975. }
  976. static int wl18xx_set_key(struct wl1271 *wl, enum set_key_cmd cmd,
  977. struct ieee80211_vif *vif,
  978. struct ieee80211_sta *sta,
  979. struct ieee80211_key_conf *key_conf)
  980. {
  981. struct wl18xx_priv *priv = wl->priv;
  982. bool change_spare = false;
  983. int ret;
  984. /*
  985. * when adding the first or removing the last GEM/TKIP interface,
  986. * we have to adjust the number of spare blocks.
  987. */
  988. change_spare = (key_conf->cipher == WL1271_CIPHER_SUITE_GEM ||
  989. key_conf->cipher == WLAN_CIPHER_SUITE_TKIP) &&
  990. ((priv->extra_spare_vif_count == 0 && cmd == SET_KEY) ||
  991. (priv->extra_spare_vif_count == 1 && cmd == DISABLE_KEY));
  992. /* no need to change spare - just regular set_key */
  993. if (!change_spare)
  994. return wlcore_set_key(wl, cmd, vif, sta, key_conf);
  995. /*
  996. * stop the queues and flush to ensure the next packets are
  997. * in sync with FW spare block accounting
  998. */
  999. wlcore_stop_queues(wl, WLCORE_QUEUE_STOP_REASON_SPARE_BLK);
  1000. wl1271_tx_flush(wl);
  1001. ret = wlcore_set_key(wl, cmd, vif, sta, key_conf);
  1002. if (ret < 0)
  1003. goto out;
  1004. /* key is now set, change the spare blocks */
  1005. if (cmd == SET_KEY) {
  1006. ret = wl18xx_set_host_cfg_bitmap(wl,
  1007. WL18XX_TX_HW_EXTRA_BLOCK_SPARE);
  1008. if (ret < 0)
  1009. goto out;
  1010. priv->extra_spare_vif_count++;
  1011. } else {
  1012. ret = wl18xx_set_host_cfg_bitmap(wl,
  1013. WL18XX_TX_HW_BLOCK_SPARE);
  1014. if (ret < 0)
  1015. goto out;
  1016. priv->extra_spare_vif_count--;
  1017. }
  1018. out:
  1019. wlcore_wake_queues(wl, WLCORE_QUEUE_STOP_REASON_SPARE_BLK);
  1020. return ret;
  1021. }
  1022. static u32 wl18xx_pre_pkt_send(struct wl1271 *wl,
  1023. u32 buf_offset, u32 last_len)
  1024. {
  1025. if (wl->quirks & WLCORE_QUIRK_TX_PAD_LAST_FRAME) {
  1026. struct wl1271_tx_hw_descr *last_desc;
  1027. /* get the last TX HW descriptor written to the aggr buf */
  1028. last_desc = (struct wl1271_tx_hw_descr *)(wl->aggr_buf +
  1029. buf_offset - last_len);
  1030. /* the last frame is padded up to an SDIO block */
  1031. last_desc->wl18xx_mem.ctrl &= ~WL18XX_TX_CTRL_NOT_PADDED;
  1032. return ALIGN(buf_offset, WL12XX_BUS_BLOCK_SIZE);
  1033. }
  1034. /* no modifications */
  1035. return buf_offset;
  1036. }
  1037. static struct wlcore_ops wl18xx_ops = {
  1038. .identify_chip = wl18xx_identify_chip,
  1039. .boot = wl18xx_boot,
  1040. .plt_init = wl18xx_plt_init,
  1041. .trigger_cmd = wl18xx_trigger_cmd,
  1042. .ack_event = wl18xx_ack_event,
  1043. .calc_tx_blocks = wl18xx_calc_tx_blocks,
  1044. .set_tx_desc_blocks = wl18xx_set_tx_desc_blocks,
  1045. .set_tx_desc_data_len = wl18xx_set_tx_desc_data_len,
  1046. .get_rx_buf_align = wl18xx_get_rx_buf_align,
  1047. .get_rx_packet_len = wl18xx_get_rx_packet_len,
  1048. .tx_immediate_compl = wl18xx_tx_immediate_completion,
  1049. .tx_delayed_compl = NULL,
  1050. .hw_init = wl18xx_hw_init,
  1051. .set_tx_desc_csum = wl18xx_set_tx_desc_csum,
  1052. .get_pg_ver = wl18xx_get_pg_ver,
  1053. .set_rx_csum = wl18xx_set_rx_csum,
  1054. .sta_get_ap_rate_mask = wl18xx_sta_get_ap_rate_mask,
  1055. .ap_get_mimo_wide_rate_mask = wl18xx_ap_get_mimo_wide_rate_mask,
  1056. .get_mac = wl18xx_get_mac,
  1057. .debugfs_init = wl18xx_debugfs_add_files,
  1058. .handle_static_data = wl18xx_handle_static_data,
  1059. .get_spare_blocks = wl18xx_get_spare_blocks,
  1060. .set_key = wl18xx_set_key,
  1061. .pre_pkt_send = wl18xx_pre_pkt_send,
  1062. };
  1063. /* HT cap appropriate for wide channels */
  1064. static struct ieee80211_sta_ht_cap wl18xx_siso40_ht_cap = {
  1065. .cap = IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 |
  1066. IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_DSSSCCK40,
  1067. .ht_supported = true,
  1068. .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
  1069. .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
  1070. .mcs = {
  1071. .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
  1072. .rx_highest = cpu_to_le16(150),
  1073. .tx_params = IEEE80211_HT_MCS_TX_DEFINED,
  1074. },
  1075. };
  1076. /* HT cap appropriate for SISO 20 */
  1077. static struct ieee80211_sta_ht_cap wl18xx_siso20_ht_cap = {
  1078. .cap = IEEE80211_HT_CAP_SGI_20,
  1079. .ht_supported = true,
  1080. .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
  1081. .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
  1082. .mcs = {
  1083. .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
  1084. .rx_highest = cpu_to_le16(72),
  1085. .tx_params = IEEE80211_HT_MCS_TX_DEFINED,
  1086. },
  1087. };
  1088. /* HT cap appropriate for MIMO rates in 20mhz channel */
  1089. static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap_2ghz = {
  1090. .cap = IEEE80211_HT_CAP_SGI_20,
  1091. .ht_supported = true,
  1092. .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
  1093. .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
  1094. .mcs = {
  1095. .rx_mask = { 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, },
  1096. .rx_highest = cpu_to_le16(144),
  1097. .tx_params = IEEE80211_HT_MCS_TX_DEFINED,
  1098. },
  1099. };
  1100. static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap_5ghz = {
  1101. .cap = IEEE80211_HT_CAP_SGI_20,
  1102. .ht_supported = true,
  1103. .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
  1104. .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
  1105. .mcs = {
  1106. .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
  1107. .rx_highest = cpu_to_le16(72),
  1108. .tx_params = IEEE80211_HT_MCS_TX_DEFINED,
  1109. },
  1110. };
  1111. static int __devinit wl18xx_probe(struct platform_device *pdev)
  1112. {
  1113. struct wl1271 *wl;
  1114. struct ieee80211_hw *hw;
  1115. struct wl18xx_priv *priv;
  1116. hw = wlcore_alloc_hw(sizeof(*priv));
  1117. if (IS_ERR(hw)) {
  1118. wl1271_error("can't allocate hw");
  1119. return PTR_ERR(hw);
  1120. }
  1121. wl = hw->priv;
  1122. priv = wl->priv;
  1123. wl->ops = &wl18xx_ops;
  1124. wl->ptable = wl18xx_ptable;
  1125. wl->rtable = wl18xx_rtable;
  1126. wl->num_tx_desc = 32;
  1127. wl->num_rx_desc = 16;
  1128. wl->band_rate_to_idx = wl18xx_band_rate_to_idx;
  1129. wl->hw_tx_rate_tbl_size = WL18XX_CONF_HW_RXTX_RATE_MAX;
  1130. wl->hw_min_ht_rate = WL18XX_CONF_HW_RXTX_RATE_MCS0;
  1131. wl->fw_status_priv_len = sizeof(struct wl18xx_fw_status_priv);
  1132. wl->stats.fw_stats_len = sizeof(struct wl18xx_acx_statistics);
  1133. wl->static_data_priv_len = sizeof(struct wl18xx_static_data_priv);
  1134. if (!strcmp(ht_mode_param, "wide")) {
  1135. memcpy(&wl->ht_cap[IEEE80211_BAND_2GHZ],
  1136. &wl18xx_siso40_ht_cap,
  1137. sizeof(wl18xx_siso40_ht_cap));
  1138. memcpy(&wl->ht_cap[IEEE80211_BAND_5GHZ],
  1139. &wl18xx_siso40_ht_cap,
  1140. sizeof(wl18xx_siso40_ht_cap));
  1141. } else if (!strcmp(ht_mode_param, "mimo")) {
  1142. memcpy(&wl->ht_cap[IEEE80211_BAND_2GHZ],
  1143. &wl18xx_mimo_ht_cap_2ghz,
  1144. sizeof(wl18xx_mimo_ht_cap_2ghz));
  1145. memcpy(&wl->ht_cap[IEEE80211_BAND_5GHZ],
  1146. &wl18xx_mimo_ht_cap_5ghz,
  1147. sizeof(wl18xx_mimo_ht_cap_5ghz));
  1148. } else if (!strcmp(ht_mode_param, "siso20")) {
  1149. memcpy(&wl->ht_cap[IEEE80211_BAND_2GHZ],
  1150. &wl18xx_siso20_ht_cap,
  1151. sizeof(wl18xx_siso20_ht_cap));
  1152. memcpy(&wl->ht_cap[IEEE80211_BAND_5GHZ],
  1153. &wl18xx_siso20_ht_cap,
  1154. sizeof(wl18xx_siso20_ht_cap));
  1155. } else {
  1156. wl1271_error("invalid ht_mode '%s'", ht_mode_param);
  1157. goto out_free;
  1158. }
  1159. wl18xx_conf_init(wl);
  1160. if (!strcmp(board_type_param, "fpga")) {
  1161. priv->board_type = BOARD_TYPE_FPGA_18XX;
  1162. } else if (!strcmp(board_type_param, "hdk")) {
  1163. priv->board_type = BOARD_TYPE_HDK_18XX;
  1164. /* HACK! Just for now we hardcode HDK to 0x06 */
  1165. priv->conf.phy.low_band_component_type = 0x06;
  1166. } else if (!strcmp(board_type_param, "dvp")) {
  1167. priv->board_type = BOARD_TYPE_DVP_18XX;
  1168. } else if (!strcmp(board_type_param, "evb")) {
  1169. priv->board_type = BOARD_TYPE_EVB_18XX;
  1170. } else if (!strcmp(board_type_param, "com8")) {
  1171. priv->board_type = BOARD_TYPE_COM8_18XX;
  1172. /* HACK! Just for now we hardcode COM8 to 0x06 */
  1173. priv->conf.phy.low_band_component_type = 0x06;
  1174. } else {
  1175. wl1271_error("invalid board type '%s'", board_type_param);
  1176. goto out_free;
  1177. }
  1178. /*
  1179. * If the module param is not set, update it with the one from
  1180. * conf. If it is set, overwrite conf with it.
  1181. */
  1182. if (low_band_component == -1)
  1183. low_band_component = priv->conf.phy.low_band_component;
  1184. else
  1185. priv->conf.phy.low_band_component = low_band_component;
  1186. if (low_band_component_type == -1)
  1187. low_band_component_type =
  1188. priv->conf.phy.low_band_component_type;
  1189. else
  1190. priv->conf.phy.low_band_component_type =
  1191. low_band_component_type;
  1192. if (high_band_component == -1)
  1193. high_band_component = priv->conf.phy.high_band_component;
  1194. else
  1195. priv->conf.phy.high_band_component = high_band_component;
  1196. if (high_band_component_type == -1)
  1197. high_band_component_type =
  1198. priv->conf.phy.high_band_component_type;
  1199. else
  1200. priv->conf.phy.high_band_component_type =
  1201. high_band_component_type;
  1202. if (pwr_limit_reference_11_abg == -1)
  1203. pwr_limit_reference_11_abg =
  1204. priv->conf.phy.pwr_limit_reference_11_abg;
  1205. else
  1206. priv->conf.phy.pwr_limit_reference_11_abg =
  1207. pwr_limit_reference_11_abg;
  1208. if (!checksum_param) {
  1209. wl18xx_ops.set_rx_csum = NULL;
  1210. wl18xx_ops.init_vif = NULL;
  1211. }
  1212. wl->enable_11a = enable_11a_param;
  1213. return wlcore_probe(wl, pdev);
  1214. out_free:
  1215. wlcore_free_hw(wl);
  1216. return -EINVAL;
  1217. }
  1218. static const struct platform_device_id wl18xx_id_table[] __devinitconst = {
  1219. { "wl18xx", 0 },
  1220. { } /* Terminating Entry */
  1221. };
  1222. MODULE_DEVICE_TABLE(platform, wl18xx_id_table);
  1223. static struct platform_driver wl18xx_driver = {
  1224. .probe = wl18xx_probe,
  1225. .remove = __devexit_p(wlcore_remove),
  1226. .id_table = wl18xx_id_table,
  1227. .driver = {
  1228. .name = "wl18xx_driver",
  1229. .owner = THIS_MODULE,
  1230. }
  1231. };
  1232. static int __init wl18xx_init(void)
  1233. {
  1234. return platform_driver_register(&wl18xx_driver);
  1235. }
  1236. module_init(wl18xx_init);
  1237. static void __exit wl18xx_exit(void)
  1238. {
  1239. platform_driver_unregister(&wl18xx_driver);
  1240. }
  1241. module_exit(wl18xx_exit);
  1242. module_param_named(ht_mode, ht_mode_param, charp, S_IRUSR);
  1243. MODULE_PARM_DESC(ht_mode, "Force HT mode: wide (default), mimo or siso20");
  1244. module_param_named(board_type, board_type_param, charp, S_IRUSR);
  1245. MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or "
  1246. "dvp");
  1247. module_param_named(dc2dc, dc2dc_param, bool, S_IRUSR);
  1248. MODULE_PARM_DESC(dc2dc, "External DC2DC: boolean (defaults to false)");
  1249. module_param_named(n_antennas_2, n_antennas_2_param, uint, S_IRUSR);
  1250. MODULE_PARM_DESC(n_antennas_2, "Number of installed 2.4GHz antennas: 1 (default) or 2");
  1251. module_param_named(n_antennas_5, n_antennas_5_param, uint, S_IRUSR);
  1252. MODULE_PARM_DESC(n_antennas_5, "Number of installed 5GHz antennas: 1 (default) or 2");
  1253. module_param_named(checksum, checksum_param, bool, S_IRUSR);
  1254. MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to false)");
  1255. module_param_named(enable_11a, enable_11a_param, bool, S_IRUSR);
  1256. MODULE_PARM_DESC(enable_11a, "Enable 11a (5GHz): boolean (defaults to true)");
  1257. module_param(low_band_component, uint, S_IRUSR);
  1258. MODULE_PARM_DESC(low_band_component, "Low band component: u8 "
  1259. "(default is 0x01)");
  1260. module_param(low_band_component_type, uint, S_IRUSR);
  1261. MODULE_PARM_DESC(low_band_component_type, "Low band component type: u8 "
  1262. "(default is 0x05 or 0x06 depending on the board_type)");
  1263. module_param(high_band_component, uint, S_IRUSR);
  1264. MODULE_PARM_DESC(high_band_component, "High band component: u8, "
  1265. "(default is 0x01)");
  1266. module_param(high_band_component_type, uint, S_IRUSR);
  1267. MODULE_PARM_DESC(high_band_component_type, "High band component type: u8 "
  1268. "(default is 0x09)");
  1269. module_param(pwr_limit_reference_11_abg, uint, S_IRUSR);
  1270. MODULE_PARM_DESC(pwr_limit_reference_11_abg, "Power limit reference: u8 "
  1271. "(default is 0xc8)");
  1272. MODULE_LICENSE("GPL v2");
  1273. MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
  1274. MODULE_FIRMWARE(WL18XX_FW_NAME);