blob: 27cd9b8a6e85186eefeeaec36679d496539990a9 [file] [log] [blame]
Luciano Coelho9a1a6992012-05-10 12:13:06 +03001/*
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
22#include <linux/module.h>
23#include <linux/platform_device.h>
Arik Nemtsov2fc28de2012-05-10 12:13:27 +030024#include <linux/ip.h>
Luciano Coelho9a1a6992012-05-10 12:13:06 +030025
26#include "../wlcore/wlcore.h"
27#include "../wlcore/debug.h"
Luciano Coelho46a1d512012-05-10 12:13:12 +030028#include "../wlcore/io.h"
29#include "../wlcore/acx.h"
Arik Nemtsovfb0f2e42012-05-10 12:13:18 +030030#include "../wlcore/tx.h"
Arik Nemtsov9c809f82012-05-10 12:13:23 +030031#include "../wlcore/rx.h"
32#include "../wlcore/io.h"
Luciano Coelho46a1d512012-05-10 12:13:12 +030033#include "../wlcore/boot.h"
Luciano Coelho9a1a6992012-05-10 12:13:06 +030034
Luciano Coelho5d4a9fa2012-05-10 12:13:10 +030035#include "reg.h"
Luciano Coelho46a1d512012-05-10 12:13:12 +030036#include "conf.h"
Luciano Coelhob8422dc2012-05-10 12:13:26 +030037#include "acx.h"
Arik Nemtsov872b3452012-05-10 12:13:25 +030038#include "tx.h"
Luciano Coelho274c66c2012-05-10 12:13:13 +030039#include "wl18xx.h"
Luciano Coelhobe652022012-05-10 12:13:41 +030040#include "io.h"
Luciano Coelho8c0ea102012-05-10 12:14:09 +030041#include "debugfs.h"
Arik Nemtsov1349c422012-05-10 12:13:16 +030042
Arik Nemtsov169da042012-05-10 12:13:28 +030043#define WL18XX_RX_CHECKSUM_MASK 0x40
44
Luciano Coelho174a7302012-05-10 12:14:13 +030045static char *ht_mode_param = "wide";
Luciano Coelho4b9d2362012-05-10 12:13:59 +030046static char *board_type_param = "hdk";
Luciano Coelhoe9258812012-05-10 12:13:52 +030047static bool dc2dc_param = false;
48static int n_antennas_2_param = 1;
49static int n_antennas_5_param = 1;
Luciano Coelho102165c2012-05-10 12:13:53 +030050static bool checksum_param = true;
Luciano Coelho1ddbc7d2012-05-10 12:13:56 +030051static bool enable_11a_param = true;
Luciano Coelho858403a2012-05-10 12:14:17 +030052static int low_band_component = -1;
53static int low_band_component_type = -1;
54static int high_band_component = -1;
55static int high_band_component_type = -1;
Luciano Coelho7b03c302012-05-10 12:14:18 +030056static int pwr_limit_reference_11_abg = -1;
Arik Nemtsov3a8ddb62012-05-10 12:13:36 +030057
Arik Nemtsovf648eab2012-05-10 12:13:20 +030058static const u8 wl18xx_rate_to_idx_2ghz[] = {
59 /* MCS rates are used only with 11n */
60 15, /* WL18XX_CONF_HW_RXTX_RATE_MCS15 */
61 14, /* WL18XX_CONF_HW_RXTX_RATE_MCS14 */
62 13, /* WL18XX_CONF_HW_RXTX_RATE_MCS13 */
63 12, /* WL18XX_CONF_HW_RXTX_RATE_MCS12 */
64 11, /* WL18XX_CONF_HW_RXTX_RATE_MCS11 */
65 10, /* WL18XX_CONF_HW_RXTX_RATE_MCS10 */
66 9, /* WL18XX_CONF_HW_RXTX_RATE_MCS9 */
67 8, /* WL18XX_CONF_HW_RXTX_RATE_MCS8 */
68 7, /* WL18XX_CONF_HW_RXTX_RATE_MCS7 */
69 6, /* WL18XX_CONF_HW_RXTX_RATE_MCS6 */
70 5, /* WL18XX_CONF_HW_RXTX_RATE_MCS5 */
71 4, /* WL18XX_CONF_HW_RXTX_RATE_MCS4 */
72 3, /* WL18XX_CONF_HW_RXTX_RATE_MCS3 */
73 2, /* WL18XX_CONF_HW_RXTX_RATE_MCS2 */
74 1, /* WL18XX_CONF_HW_RXTX_RATE_MCS1 */
75 0, /* WL18XX_CONF_HW_RXTX_RATE_MCS0 */
76
77 11, /* WL18XX_CONF_HW_RXTX_RATE_54 */
78 10, /* WL18XX_CONF_HW_RXTX_RATE_48 */
79 9, /* WL18XX_CONF_HW_RXTX_RATE_36 */
80 8, /* WL18XX_CONF_HW_RXTX_RATE_24 */
81
82 /* TI-specific rate */
83 CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_22 */
84
85 7, /* WL18XX_CONF_HW_RXTX_RATE_18 */
86 6, /* WL18XX_CONF_HW_RXTX_RATE_12 */
87 3, /* WL18XX_CONF_HW_RXTX_RATE_11 */
88 5, /* WL18XX_CONF_HW_RXTX_RATE_9 */
89 4, /* WL18XX_CONF_HW_RXTX_RATE_6 */
90 2, /* WL18XX_CONF_HW_RXTX_RATE_5_5 */
91 1, /* WL18XX_CONF_HW_RXTX_RATE_2 */
92 0 /* WL18XX_CONF_HW_RXTX_RATE_1 */
93};
94
95static const u8 wl18xx_rate_to_idx_5ghz[] = {
96 /* MCS rates are used only with 11n */
97 15, /* WL18XX_CONF_HW_RXTX_RATE_MCS15 */
98 14, /* WL18XX_CONF_HW_RXTX_RATE_MCS14 */
99 13, /* WL18XX_CONF_HW_RXTX_RATE_MCS13 */
100 12, /* WL18XX_CONF_HW_RXTX_RATE_MCS12 */
101 11, /* WL18XX_CONF_HW_RXTX_RATE_MCS11 */
102 10, /* WL18XX_CONF_HW_RXTX_RATE_MCS10 */
103 9, /* WL18XX_CONF_HW_RXTX_RATE_MCS9 */
104 8, /* WL18XX_CONF_HW_RXTX_RATE_MCS8 */
105 7, /* WL18XX_CONF_HW_RXTX_RATE_MCS7 */
106 6, /* WL18XX_CONF_HW_RXTX_RATE_MCS6 */
107 5, /* WL18XX_CONF_HW_RXTX_RATE_MCS5 */
108 4, /* WL18XX_CONF_HW_RXTX_RATE_MCS4 */
109 3, /* WL18XX_CONF_HW_RXTX_RATE_MCS3 */
110 2, /* WL18XX_CONF_HW_RXTX_RATE_MCS2 */
111 1, /* WL18XX_CONF_HW_RXTX_RATE_MCS1 */
112 0, /* WL18XX_CONF_HW_RXTX_RATE_MCS0 */
113
114 7, /* WL18XX_CONF_HW_RXTX_RATE_54 */
115 6, /* WL18XX_CONF_HW_RXTX_RATE_48 */
116 5, /* WL18XX_CONF_HW_RXTX_RATE_36 */
117 4, /* WL18XX_CONF_HW_RXTX_RATE_24 */
118
119 /* TI-specific rate */
120 CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_22 */
121
122 3, /* WL18XX_CONF_HW_RXTX_RATE_18 */
123 2, /* WL18XX_CONF_HW_RXTX_RATE_12 */
124 CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_11 */
125 1, /* WL18XX_CONF_HW_RXTX_RATE_9 */
126 0, /* WL18XX_CONF_HW_RXTX_RATE_6 */
127 CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_5_5 */
128 CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_2 */
129 CONF_HW_RXTX_RATE_UNSUPPORTED, /* WL18XX_CONF_HW_RXTX_RATE_1 */
130};
131
132static const u8 *wl18xx_band_rate_to_idx[] = {
133 [IEEE80211_BAND_2GHZ] = wl18xx_rate_to_idx_2ghz,
134 [IEEE80211_BAND_5GHZ] = wl18xx_rate_to_idx_5ghz
135};
136
137enum wl18xx_hw_rates {
138 WL18XX_CONF_HW_RXTX_RATE_MCS15 = 0,
139 WL18XX_CONF_HW_RXTX_RATE_MCS14,
140 WL18XX_CONF_HW_RXTX_RATE_MCS13,
141 WL18XX_CONF_HW_RXTX_RATE_MCS12,
142 WL18XX_CONF_HW_RXTX_RATE_MCS11,
143 WL18XX_CONF_HW_RXTX_RATE_MCS10,
144 WL18XX_CONF_HW_RXTX_RATE_MCS9,
145 WL18XX_CONF_HW_RXTX_RATE_MCS8,
146 WL18XX_CONF_HW_RXTX_RATE_MCS7,
147 WL18XX_CONF_HW_RXTX_RATE_MCS6,
148 WL18XX_CONF_HW_RXTX_RATE_MCS5,
149 WL18XX_CONF_HW_RXTX_RATE_MCS4,
150 WL18XX_CONF_HW_RXTX_RATE_MCS3,
151 WL18XX_CONF_HW_RXTX_RATE_MCS2,
152 WL18XX_CONF_HW_RXTX_RATE_MCS1,
153 WL18XX_CONF_HW_RXTX_RATE_MCS0,
154 WL18XX_CONF_HW_RXTX_RATE_54,
155 WL18XX_CONF_HW_RXTX_RATE_48,
156 WL18XX_CONF_HW_RXTX_RATE_36,
157 WL18XX_CONF_HW_RXTX_RATE_24,
158 WL18XX_CONF_HW_RXTX_RATE_22,
159 WL18XX_CONF_HW_RXTX_RATE_18,
160 WL18XX_CONF_HW_RXTX_RATE_12,
161 WL18XX_CONF_HW_RXTX_RATE_11,
162 WL18XX_CONF_HW_RXTX_RATE_9,
163 WL18XX_CONF_HW_RXTX_RATE_6,
164 WL18XX_CONF_HW_RXTX_RATE_5_5,
165 WL18XX_CONF_HW_RXTX_RATE_2,
166 WL18XX_CONF_HW_RXTX_RATE_1,
167 WL18XX_CONF_HW_RXTX_RATE_MAX,
168};
169
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300170static struct wlcore_conf wl18xx_conf = {
171 .sg = {
172 .params = {
173 [CONF_SG_ACL_BT_MASTER_MIN_BR] = 10,
174 [CONF_SG_ACL_BT_MASTER_MAX_BR] = 180,
175 [CONF_SG_ACL_BT_SLAVE_MIN_BR] = 10,
176 [CONF_SG_ACL_BT_SLAVE_MAX_BR] = 180,
177 [CONF_SG_ACL_BT_MASTER_MIN_EDR] = 10,
178 [CONF_SG_ACL_BT_MASTER_MAX_EDR] = 80,
179 [CONF_SG_ACL_BT_SLAVE_MIN_EDR] = 10,
180 [CONF_SG_ACL_BT_SLAVE_MAX_EDR] = 80,
181 [CONF_SG_ACL_WLAN_PS_MASTER_BR] = 8,
182 [CONF_SG_ACL_WLAN_PS_SLAVE_BR] = 8,
183 [CONF_SG_ACL_WLAN_PS_MASTER_EDR] = 20,
184 [CONF_SG_ACL_WLAN_PS_SLAVE_EDR] = 20,
185 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_BR] = 20,
186 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_BR] = 35,
187 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_BR] = 16,
188 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_BR] = 35,
189 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_EDR] = 32,
190 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_EDR] = 50,
191 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_EDR] = 28,
192 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_EDR] = 50,
193 [CONF_SG_ACL_ACTIVE_SCAN_WLAN_BR] = 10,
194 [CONF_SG_ACL_ACTIVE_SCAN_WLAN_EDR] = 20,
195 [CONF_SG_ACL_PASSIVE_SCAN_BT_BR] = 75,
196 [CONF_SG_ACL_PASSIVE_SCAN_WLAN_BR] = 15,
197 [CONF_SG_ACL_PASSIVE_SCAN_BT_EDR] = 27,
198 [CONF_SG_ACL_PASSIVE_SCAN_WLAN_EDR] = 17,
199 /* active scan params */
200 [CONF_SG_AUTO_SCAN_PROBE_REQ] = 170,
201 [CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3] = 50,
202 [CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP] = 100,
203 /* passive scan params */
204 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_BR] = 800,
205 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_EDR] = 200,
206 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3] = 200,
207 /* passive scan in dual antenna params */
208 [CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN] = 0,
209 [CONF_SG_BCN_HV3_COLLISION_THRESH_IN_PASSIVE_SCAN] = 0,
210 [CONF_SG_TX_RX_PROTECTION_BWIDTH_IN_PASSIVE_SCAN] = 0,
211 /* general params */
212 [CONF_SG_STA_FORCE_PS_IN_BT_SCO] = 1,
213 [CONF_SG_ANTENNA_CONFIGURATION] = 0,
214 [CONF_SG_BEACON_MISS_PERCENT] = 60,
215 [CONF_SG_DHCP_TIME] = 5000,
216 [CONF_SG_RXT] = 1200,
217 [CONF_SG_TXT] = 1000,
218 [CONF_SG_ADAPTIVE_RXT_TXT] = 1,
219 [CONF_SG_GENERAL_USAGE_BIT_MAP] = 3,
220 [CONF_SG_HV3_MAX_SERVED] = 6,
221 [CONF_SG_PS_POLL_TIMEOUT] = 10,
222 [CONF_SG_UPSD_TIMEOUT] = 10,
223 [CONF_SG_CONSECUTIVE_CTS_THRESHOLD] = 2,
224 [CONF_SG_STA_RX_WINDOW_AFTER_DTIM] = 5,
225 [CONF_SG_STA_CONNECTION_PROTECTION_TIME] = 30,
226 /* AP params */
227 [CONF_AP_BEACON_MISS_TX] = 3,
228 [CONF_AP_RX_WINDOW_AFTER_BEACON] = 10,
229 [CONF_AP_BEACON_WINDOW_INTERVAL] = 2,
230 [CONF_AP_CONNECTION_PROTECTION_TIME] = 0,
231 [CONF_AP_BT_ACL_VAL_BT_SERVE_TIME] = 25,
232 [CONF_AP_BT_ACL_VAL_WL_SERVE_TIME] = 25,
233 /* CTS Diluting params */
234 [CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH] = 0,
235 [CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER] = 0,
236 },
237 .state = CONF_SG_PROTECTIVE,
238 },
239 .rx = {
240 .rx_msdu_life_time = 512000,
241 .packet_detection_threshold = 0,
242 .ps_poll_timeout = 15,
243 .upsd_timeout = 15,
244 .rts_threshold = IEEE80211_MAX_RTS_THRESHOLD,
245 .rx_cca_threshold = 0,
246 .irq_blk_threshold = 0xFFFF,
247 .irq_pkt_threshold = 0,
248 .irq_timeout = 600,
249 .queue_type = CONF_RX_QUEUE_TYPE_LOW_PRIORITY,
250 },
251 .tx = {
252 .tx_energy_detection = 0,
253 .sta_rc_conf = {
254 .enabled_rates = 0,
255 .short_retry_limit = 10,
256 .long_retry_limit = 10,
257 .aflags = 0,
258 },
259 .ac_conf_count = 4,
260 .ac_conf = {
261 [CONF_TX_AC_BE] = {
262 .ac = CONF_TX_AC_BE,
263 .cw_min = 15,
264 .cw_max = 63,
265 .aifsn = 3,
266 .tx_op_limit = 0,
267 },
268 [CONF_TX_AC_BK] = {
269 .ac = CONF_TX_AC_BK,
270 .cw_min = 15,
271 .cw_max = 63,
272 .aifsn = 7,
273 .tx_op_limit = 0,
274 },
275 [CONF_TX_AC_VI] = {
276 .ac = CONF_TX_AC_VI,
277 .cw_min = 15,
278 .cw_max = 63,
279 .aifsn = CONF_TX_AIFS_PIFS,
280 .tx_op_limit = 3008,
281 },
282 [CONF_TX_AC_VO] = {
283 .ac = CONF_TX_AC_VO,
284 .cw_min = 15,
285 .cw_max = 63,
286 .aifsn = CONF_TX_AIFS_PIFS,
287 .tx_op_limit = 1504,
288 },
289 },
290 .max_tx_retries = 100,
291 .ap_aging_period = 300,
292 .tid_conf_count = 4,
293 .tid_conf = {
294 [CONF_TX_AC_BE] = {
295 .queue_id = CONF_TX_AC_BE,
296 .channel_type = CONF_CHANNEL_TYPE_EDCF,
297 .tsid = CONF_TX_AC_BE,
298 .ps_scheme = CONF_PS_SCHEME_LEGACY,
299 .ack_policy = CONF_ACK_POLICY_LEGACY,
300 .apsd_conf = {0, 0},
301 },
302 [CONF_TX_AC_BK] = {
303 .queue_id = CONF_TX_AC_BK,
304 .channel_type = CONF_CHANNEL_TYPE_EDCF,
305 .tsid = CONF_TX_AC_BK,
306 .ps_scheme = CONF_PS_SCHEME_LEGACY,
307 .ack_policy = CONF_ACK_POLICY_LEGACY,
308 .apsd_conf = {0, 0},
309 },
310 [CONF_TX_AC_VI] = {
311 .queue_id = CONF_TX_AC_VI,
312 .channel_type = CONF_CHANNEL_TYPE_EDCF,
313 .tsid = CONF_TX_AC_VI,
314 .ps_scheme = CONF_PS_SCHEME_LEGACY,
315 .ack_policy = CONF_ACK_POLICY_LEGACY,
316 .apsd_conf = {0, 0},
317 },
318 [CONF_TX_AC_VO] = {
319 .queue_id = CONF_TX_AC_VO,
320 .channel_type = CONF_CHANNEL_TYPE_EDCF,
321 .tsid = CONF_TX_AC_VO,
322 .ps_scheme = CONF_PS_SCHEME_LEGACY,
323 .ack_policy = CONF_ACK_POLICY_LEGACY,
324 .apsd_conf = {0, 0},
325 },
326 },
327 .frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD,
328 .tx_compl_timeout = 350,
329 .tx_compl_threshold = 10,
330 .basic_rate = CONF_HW_BIT_RATE_1MBPS,
331 .basic_rate_5 = CONF_HW_BIT_RATE_6MBPS,
332 .tmpl_short_retry_limit = 10,
333 .tmpl_long_retry_limit = 10,
334 .tx_watchdog_timeout = 5000,
335 },
336 .conn = {
337 .wake_up_event = CONF_WAKE_UP_EVENT_DTIM,
338 .listen_interval = 1,
339 .suspend_wake_up_event = CONF_WAKE_UP_EVENT_N_DTIM,
340 .suspend_listen_interval = 3,
341 .bcn_filt_mode = CONF_BCN_FILT_MODE_ENABLED,
342 .bcn_filt_ie_count = 2,
343 .bcn_filt_ie = {
344 [0] = {
345 .ie = WLAN_EID_CHANNEL_SWITCH,
346 .rule = CONF_BCN_RULE_PASS_ON_APPEARANCE,
347 },
348 [1] = {
349 .ie = WLAN_EID_HT_OPERATION,
350 .rule = CONF_BCN_RULE_PASS_ON_CHANGE,
351 },
352 },
353 .synch_fail_thold = 10,
354 .bss_lose_timeout = 100,
355 .beacon_rx_timeout = 10000,
356 .broadcast_timeout = 20000,
357 .rx_broadcast_in_ps = 1,
358 .ps_poll_threshold = 10,
359 .bet_enable = CONF_BET_MODE_ENABLE,
360 .bet_max_consecutive = 50,
361 .psm_entry_retries = 8,
362 .psm_exit_retries = 16,
363 .psm_entry_nullfunc_retries = 3,
364 .dynamic_ps_timeout = 40,
365 .forced_ps = false,
366 .keep_alive_interval = 55000,
367 .max_listen_interval = 20,
368 },
369 .itrim = {
370 .enable = false,
371 .timeout = 50000,
372 },
373 .pm_config = {
374 .host_clk_settling_time = 5000,
375 .host_fast_wakeup_support = false
376 },
377 .roam_trigger = {
378 .trigger_pacing = 1,
379 .avg_weight_rssi_beacon = 20,
380 .avg_weight_rssi_data = 10,
381 .avg_weight_snr_beacon = 20,
382 .avg_weight_snr_data = 10,
383 },
384 .scan = {
385 .min_dwell_time_active = 7500,
386 .max_dwell_time_active = 30000,
387 .min_dwell_time_passive = 100000,
388 .max_dwell_time_passive = 100000,
389 .num_probe_reqs = 2,
390 .split_scan_timeout = 50000,
391 },
392 .sched_scan = {
393 /*
394 * Values are in TU/1000 but since sched scan FW command
395 * params are in TUs rounding up may occur.
396 */
397 .base_dwell_time = 7500,
398 .max_dwell_time_delta = 22500,
399 /* based on 250bits per probe @1Mbps */
400 .dwell_time_delta_per_probe = 2000,
401 /* based on 250bits per probe @6Mbps (plus a bit more) */
402 .dwell_time_delta_per_probe_5 = 350,
403 .dwell_time_passive = 100000,
404 .dwell_time_dfs = 150000,
405 .num_probe_reqs = 2,
406 .rssi_threshold = -90,
407 .snr_threshold = 0,
408 },
409 .ht = {
410 .rx_ba_win_size = 10,
411 .tx_ba_win_size = 10,
412 .inactivity_timeout = 10000,
413 .tx_ba_tid_bitmap = CONF_TX_BA_ENABLED_TID_BITMAP,
414 },
415 .mem = {
416 .num_stations = 1,
417 .ssid_profiles = 1,
418 .rx_block_num = 40,
419 .tx_min_block_num = 40,
420 .dynamic_memory = 1,
421 .min_req_tx_blocks = 45,
422 .min_req_rx_blocks = 22,
423 .tx_min = 27,
424 },
425 .fm_coex = {
426 .enable = true,
427 .swallow_period = 5,
428 .n_divider_fref_set_1 = 0xff, /* default */
429 .n_divider_fref_set_2 = 12,
430 .m_divider_fref_set_1 = 148,
431 .m_divider_fref_set_2 = 0xffff, /* default */
432 .coex_pll_stabilization_time = 0xffffffff, /* default */
433 .ldo_stabilization_time = 0xffff, /* default */
434 .fm_disturbed_band_margin = 0xff, /* default */
435 .swallow_clk_diff = 0xff, /* default */
436 },
437 .rx_streaming = {
438 .duration = 150,
439 .queues = 0x1,
440 .interval = 20,
441 .always = 0,
442 },
443 .fwlog = {
444 .mode = WL12XX_FWLOG_ON_DEMAND,
445 .mem_blocks = 2,
446 .severity = 0,
447 .timestamp = WL12XX_FWLOG_TIMESTAMP_DISABLED,
448 .output = WL12XX_FWLOG_OUTPUT_HOST,
449 .threshold = 0,
450 },
451 .rate = {
452 .rate_retry_score = 32000,
453 .per_add = 8192,
454 .per_th1 = 2048,
455 .per_th2 = 4096,
456 .max_per = 8100,
457 .inverse_curiosity_factor = 5,
458 .tx_fail_low_th = 4,
459 .tx_fail_high_th = 10,
460 .per_alpha_shift = 4,
461 .per_add_shift = 13,
462 .per_beta1_shift = 10,
463 .per_beta2_shift = 8,
464 .rate_check_up = 2,
465 .rate_check_down = 12,
466 .rate_retry_policy = {
467 0x00, 0x00, 0x00, 0x00, 0x00,
468 0x00, 0x00, 0x00, 0x00, 0x00,
469 0x00, 0x00, 0x00,
470 },
471 },
472 .hangover = {
473 .recover_time = 0,
474 .hangover_period = 20,
475 .dynamic_mode = 1,
476 .early_termination_mode = 1,
477 .max_period = 20,
478 .min_period = 1,
479 .increase_delta = 1,
480 .decrease_delta = 2,
481 .quiet_time = 4,
482 .increase_time = 1,
483 .window_size = 16,
484 },
485};
486
487static struct wl18xx_priv_conf wl18xx_default_priv_conf = {
Luciano Coelho46a1d512012-05-10 12:13:12 +0300488 .phy = {
489 .phy_standalone = 0x00,
490 .primary_clock_setting_time = 0x05,
491 .clock_valid_on_wake_up = 0x00,
492 .secondary_clock_setting_time = 0x05,
493 .rdl = 0x01,
494 .auto_detect = 0x00,
495 .dedicated_fem = FEM_NONE,
496 .low_band_component = COMPONENT_2_WAY_SWITCH,
497 .low_band_component_type = 0x05,
498 .high_band_component = COMPONENT_2_WAY_SWITCH,
499 .high_band_component_type = 0x09,
Luciano Coelho46a1d512012-05-10 12:13:12 +0300500 .tcxo_ldo_voltage = 0x00,
501 .xtal_itrim_val = 0x04,
502 .srf_state = 0x00,
503 .io_configuration = 0x01,
504 .sdio_configuration = 0x00,
505 .settings = 0x00,
506 .enable_clpc = 0x00,
507 .enable_tx_low_pwr_on_siso_rdl = 0x00,
508 .rx_profile = 0x00,
Luciano Coelho5add82e2012-05-10 12:14:16 +0300509 .pwr_limit_reference_11_abg = 0xc8,
Luciano Coelho46a1d512012-05-10 12:13:12 +0300510 },
511};
Luciano Coelho5d4a9fa2012-05-10 12:13:10 +0300512
Luciano Coelho82b890c2012-05-10 12:13:09 +0300513static const struct wlcore_partition_set wl18xx_ptable[PART_TABLE_LEN] = {
514 [PART_TOP_PRCM_ELP_SOC] = {
515 .mem = { .start = 0x00A02000, .size = 0x00010000 },
516 .reg = { .start = 0x00807000, .size = 0x00005000 },
517 .mem2 = { .start = 0x00800000, .size = 0x0000B000 },
518 .mem3 = { .start = 0x00000000, .size = 0x00000000 },
519 },
520 [PART_DOWN] = {
521 .mem = { .start = 0x00000000, .size = 0x00014000 },
522 .reg = { .start = 0x00810000, .size = 0x0000BFFF },
523 .mem2 = { .start = 0x00000000, .size = 0x00000000 },
524 .mem3 = { .start = 0x00000000, .size = 0x00000000 },
525 },
526 [PART_BOOT] = {
527 .mem = { .start = 0x00700000, .size = 0x0000030c },
528 .reg = { .start = 0x00802000, .size = 0x00014578 },
529 .mem2 = { .start = 0x00B00404, .size = 0x00001000 },
530 .mem3 = { .start = 0x00C00000, .size = 0x00000400 },
531 },
532 [PART_WORK] = {
533 .mem = { .start = 0x00800000, .size = 0x000050FC },
534 .reg = { .start = 0x00B00404, .size = 0x00001000 },
535 .mem2 = { .start = 0x00C00000, .size = 0x00000400 },
536 .mem3 = { .start = 0x00000000, .size = 0x00000000 },
537 },
538 [PART_PHY_INIT] = {
539 /* TODO: use the phy_conf struct size here */
540 .mem = { .start = 0x80926000, .size = 252 },
541 .reg = { .start = 0x00000000, .size = 0x00000000 },
542 .mem2 = { .start = 0x00000000, .size = 0x00000000 },
543 .mem3 = { .start = 0x00000000, .size = 0x00000000 },
544 },
545};
546
Luciano Coelho5d4a9fa2012-05-10 12:13:10 +0300547static const int wl18xx_rtable[REG_TABLE_LEN] = {
548 [REG_ECPU_CONTROL] = WL18XX_REG_ECPU_CONTROL,
549 [REG_INTERRUPT_NO_CLEAR] = WL18XX_REG_INTERRUPT_NO_CLEAR,
550 [REG_INTERRUPT_ACK] = WL18XX_REG_INTERRUPT_ACK,
551 [REG_COMMAND_MAILBOX_PTR] = WL18XX_REG_COMMAND_MAILBOX_PTR,
552 [REG_EVENT_MAILBOX_PTR] = WL18XX_REG_EVENT_MAILBOX_PTR,
553 [REG_INTERRUPT_TRIG] = WL18XX_REG_INTERRUPT_TRIG_H,
554 [REG_INTERRUPT_MASK] = WL18XX_REG_INTERRUPT_MASK,
Arik Nemtsov1c351da2012-05-10 12:13:39 +0300555 [REG_PC_ON_RECOVERY] = WL18XX_SCR_PAD4,
Luciano Coelho5d4a9fa2012-05-10 12:13:10 +0300556 [REG_CHIP_ID_B] = WL18XX_REG_CHIP_ID_B,
557 [REG_CMD_MBOX_ADDRESS] = WL18XX_CMD_MBOX_ADDRESS,
558
559 /* data access memory addresses, used with partition translation */
560 [REG_SLV_MEM_DATA] = WL18XX_SLV_MEM_DATA,
561 [REG_SLV_REG_DATA] = WL18XX_SLV_REG_DATA,
562
563 /* raw data access memory addresses */
564 [REG_RAW_FW_STATUS_ADDR] = WL18XX_FW_STATUS_ADDR,
565};
566
Luciano Coelhobe652022012-05-10 12:13:41 +0300567static const struct wl18xx_clk_cfg wl18xx_clk_table[NUM_CLOCK_CONFIGS] = {
568 [CLOCK_CONFIG_16_2_M] = { 7, 104, 801, 4, true },
569 [CLOCK_CONFIG_16_368_M] = { 9, 132, 3751, 4, true },
570 [CLOCK_CONFIG_16_8_M] = { 7, 100, 0, 0, false },
571 [CLOCK_CONFIG_19_2_M] = { 8, 100, 0, 0, false },
572 [CLOCK_CONFIG_26_M] = { 13, 120, 0, 0, false },
573 [CLOCK_CONFIG_32_736_M] = { 9, 132, 3751, 4, true },
574 [CLOCK_CONFIG_33_6_M] = { 7, 100, 0, 0, false },
575 [CLOCK_CONFIG_38_468_M] = { 8, 100, 0, 0, false },
576 [CLOCK_CONFIG_52_M] = { 13, 120, 0, 0, false },
577};
578
Luciano Coelho0cd65432012-05-10 12:13:11 +0300579/* TODO: maybe move to a new header file? */
580#define WL18XX_FW_NAME "ti-connectivity/wl18xx-fw.bin"
581
582static int wl18xx_identify_chip(struct wl1271 *wl)
583{
584 int ret = 0;
585
586 switch (wl->chip.id) {
587 case CHIP_ID_185x_PG10:
588 wl1271_debug(DEBUG_BOOT, "chip id 0x%x (185x PG10)",
589 wl->chip.id);
590 wl->sr_fw_name = WL18XX_FW_NAME;
Luciano Coelhobe42aee2012-05-10 12:13:50 +0300591 /* wl18xx uses the same firmware for PLT */
592 wl->plt_fw_name = WL18XX_FW_NAME;
Arik Nemtsov7cfefd12012-05-10 12:13:22 +0300593 wl->quirks |= WLCORE_QUIRK_NO_ELP |
Arik Nemtsovd9fedea2012-05-10 12:13:40 +0300594 WLCORE_QUIRK_FWLOG_NOT_IMPLEMENTED |
Arik Nemtsov7cfefd12012-05-10 12:13:22 +0300595 WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN;
Luciano Coelho0cd65432012-05-10 12:13:11 +0300596
Luciano Coelho7ae25da2012-05-10 12:14:03 +0300597 /* PG 1.0 has some problems with MCS_13, so disable it */
598 wl->ht_cap.mcs.rx_mask[1] &= ~BIT(5);
599
Luciano Coelho0cd65432012-05-10 12:13:11 +0300600 /* TODO: need to blocksize alignment for RX/TX separately? */
601 break;
602 default:
603 wl1271_warning("unsupported chip id: 0x%x", wl->chip.id);
604 ret = -ENODEV;
605 goto out;
606 }
607
608out:
609 return ret;
610}
611
Luciano Coelho46a1d512012-05-10 12:13:12 +0300612static void wl18xx_set_clk(struct wl1271 *wl)
613{
Luciano Coelhobe652022012-05-10 12:13:41 +0300614 u32 clk_freq;
Luciano Coelhod5b59272012-05-10 12:13:38 +0300615
Luciano Coelho46a1d512012-05-10 12:13:12 +0300616 wlcore_set_partition(wl, &wl->ptable[PART_TOP_PRCM_ELP_SOC]);
Luciano Coelhobe652022012-05-10 12:13:41 +0300617
618 /* TODO: PG2: apparently we need to read the clk type */
619
620 clk_freq = wl18xx_top_reg_read(wl, PRIMARY_CLK_DETECT);
621 wl1271_debug(DEBUG_BOOT, "clock freq %d (%d, %d, %d, %d, %s)", clk_freq,
622 wl18xx_clk_table[clk_freq].n, wl18xx_clk_table[clk_freq].m,
623 wl18xx_clk_table[clk_freq].p, wl18xx_clk_table[clk_freq].q,
624 wl18xx_clk_table[clk_freq].swallow ? "swallow" : "spit");
625
626 wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_N, wl18xx_clk_table[clk_freq].n);
627 wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_M, wl18xx_clk_table[clk_freq].m);
628
629 if (wl18xx_clk_table[clk_freq].swallow) {
630 /* first the 16 lower bits */
631 wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_Q_FACTOR_CFG_1,
632 wl18xx_clk_table[clk_freq].q &
633 PLLSH_WCS_PLL_Q_FACTOR_CFG_1_MASK);
634 /* then the 16 higher bits, masked out */
635 wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_Q_FACTOR_CFG_2,
636 (wl18xx_clk_table[clk_freq].q >> 16) &
637 PLLSH_WCS_PLL_Q_FACTOR_CFG_2_MASK);
638
639 /* first the 16 lower bits */
640 wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_P_FACTOR_CFG_1,
641 wl18xx_clk_table[clk_freq].p &
642 PLLSH_WCS_PLL_P_FACTOR_CFG_1_MASK);
643 /* then the 16 higher bits, masked out */
644 wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_P_FACTOR_CFG_2,
645 (wl18xx_clk_table[clk_freq].p >> 16) &
646 PLLSH_WCS_PLL_P_FACTOR_CFG_2_MASK);
647 } else {
648 wl18xx_top_reg_write(wl, PLLSH_WCS_PLL_SWALLOW_EN,
649 PLLSH_WCS_PLL_SWALLOW_EN_VAL2);
650 }
Luciano Coelho46a1d512012-05-10 12:13:12 +0300651}
652
653static void wl18xx_boot_soft_reset(struct wl1271 *wl)
654{
655 /* disable Rx/Tx */
656 wl1271_write32(wl, WL18XX_ENABLE, 0x0);
657
658 /* disable auto calibration on start*/
659 wl1271_write32(wl, WL18XX_SPARE_A2, 0xffff);
660}
661
662static int wl18xx_pre_boot(struct wl1271 *wl)
663{
Luciano Coelho46a1d512012-05-10 12:13:12 +0300664 wl18xx_set_clk(wl);
665
666 /* Continue the ELP wake up sequence */
667 wl1271_write32(wl, WL18XX_WELP_ARM_COMMAND, WELP_ARM_COMMAND_VAL);
668 udelay(500);
669
670 wlcore_set_partition(wl, &wl->ptable[PART_BOOT]);
671
672 /* Disable interrupts */
673 wlcore_write_reg(wl, REG_INTERRUPT_MASK, WL1271_ACX_INTR_ALL);
674
675 wl18xx_boot_soft_reset(wl);
676
677 return 0;
678}
679
680static void wl18xx_pre_upload(struct wl1271 *wl)
681{
682 u32 tmp;
683
684 wlcore_set_partition(wl, &wl->ptable[PART_BOOT]);
685
686 /* TODO: check if this is all needed */
687 wl1271_write32(wl, WL18XX_EEPROMLESS_IND, WL18XX_EEPROMLESS_IND);
688
689 tmp = wlcore_read_reg(wl, REG_CHIP_ID_B);
690
691 wl1271_debug(DEBUG_BOOT, "chip id 0x%x", tmp);
692
693 tmp = wl1271_read32(wl, WL18XX_SCR_PAD2);
694}
695
696static void wl18xx_set_mac_and_phy(struct wl1271 *wl)
697{
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300698 struct wl18xx_priv *priv = wl->priv;
699 struct wl18xx_conf_phy *phy = &priv->conf.phy;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300700 struct wl18xx_mac_and_phy_params params;
701
702 memset(&params, 0, sizeof(params));
703
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300704 params.phy_standalone = phy->phy_standalone;
705 params.rdl = phy->rdl;
706 params.enable_clpc = phy->enable_clpc;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300707 params.enable_tx_low_pwr_on_siso_rdl =
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300708 phy->enable_tx_low_pwr_on_siso_rdl;
709 params.auto_detect = phy->auto_detect;
710 params.dedicated_fem = phy->dedicated_fem;
711 params.low_band_component = phy->low_band_component;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300712 params.low_band_component_type =
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300713 phy->low_band_component_type;
714 params.high_band_component = phy->high_band_component;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300715 params.high_band_component_type =
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300716 phy->high_band_component_type;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300717 params.number_of_assembled_ant2_4 =
Luciano Coelhoe9258812012-05-10 12:13:52 +0300718 n_antennas_2_param;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300719 params.number_of_assembled_ant5 =
Luciano Coelhoe9258812012-05-10 12:13:52 +0300720 n_antennas_5_param;
721 params.external_pa_dc2dc = dc2dc_param;
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300722 params.tcxo_ldo_voltage = phy->tcxo_ldo_voltage;
723 params.xtal_itrim_val = phy->xtal_itrim_val;
724 params.srf_state = phy->srf_state;
725 params.io_configuration = phy->io_configuration;
726 params.sdio_configuration = phy->sdio_configuration;
727 params.settings = phy->settings;
728 params.rx_profile = phy->rx_profile;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300729 params.primary_clock_setting_time =
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300730 phy->primary_clock_setting_time;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300731 params.clock_valid_on_wake_up =
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300732 phy->clock_valid_on_wake_up;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300733 params.secondary_clock_setting_time =
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300734 phy->secondary_clock_setting_time;
Luciano Coelho5add82e2012-05-10 12:14:16 +0300735 params.pwr_limit_reference_11_abg =
736 phy->pwr_limit_reference_11_abg;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300737
Luciano Coelhoa9c130d2012-05-10 12:13:37 +0300738 params.board_type = priv->board_type;
Luciano Coelho46a1d512012-05-10 12:13:12 +0300739
740 wlcore_set_partition(wl, &wl->ptable[PART_PHY_INIT]);
741 wl1271_write(wl, WL18XX_PHY_INIT_MEM_ADDR, (u8 *)&params,
742 sizeof(params), false);
743}
744
745static void wl18xx_enable_interrupts(struct wl1271 *wl)
746{
747 wlcore_write_reg(wl, REG_INTERRUPT_MASK, WL1271_ACX_ALL_EVENTS_VECTOR);
748
749 wlcore_enable_interrupts(wl);
750 wlcore_write_reg(wl, REG_INTERRUPT_MASK,
751 WL1271_ACX_INTR_ALL & ~(WL1271_INTR_MASK));
752}
753
754static int wl18xx_boot(struct wl1271 *wl)
755{
756 int ret;
757
758 ret = wl18xx_pre_boot(wl);
759 if (ret < 0)
760 goto out;
761
Luciano Coelho46a1d512012-05-10 12:13:12 +0300762 wl18xx_pre_upload(wl);
763
764 ret = wlcore_boot_upload_firmware(wl);
765 if (ret < 0)
766 goto out;
767
768 wl18xx_set_mac_and_phy(wl);
769
770 ret = wlcore_boot_run_firmware(wl);
771 if (ret < 0)
772 goto out;
773
774 wl18xx_enable_interrupts(wl);
775
776out:
777 return ret;
778}
779
Luciano Coelho274c66c2012-05-10 12:13:13 +0300780static void wl18xx_trigger_cmd(struct wl1271 *wl, int cmd_box_addr,
781 void *buf, size_t len)
782{
783 struct wl18xx_priv *priv = wl->priv;
784
785 memcpy(priv->cmd_buf, buf, len);
786 memset(priv->cmd_buf + len, 0, WL18XX_CMD_MAX_SIZE - len);
787
788 wl1271_write(wl, cmd_box_addr, priv->cmd_buf, WL18XX_CMD_MAX_SIZE,
789 false);
790}
791
792static void wl18xx_ack_event(struct wl1271 *wl)
793{
794 wlcore_write_reg(wl, REG_INTERRUPT_TRIG, WL18XX_INTR_TRIG_EVENT_ACK);
795}
796
Arik Nemtsov624845b2012-05-10 12:13:17 +0300797static u32 wl18xx_calc_tx_blocks(struct wl1271 *wl, u32 len, u32 spare_blks)
798{
799 u32 blk_size = WL18XX_TX_HW_BLOCK_SIZE;
800 return (len + blk_size - 1) / blk_size + spare_blks;
801}
802
Arik Nemtsovfb0f2e42012-05-10 12:13:18 +0300803static void
804wl18xx_set_tx_desc_blocks(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
805 u32 blks, u32 spare_blks)
806{
807 desc->wl18xx_mem.total_mem_blocks = blks;
808 desc->wl18xx_mem.reserved = 0;
809}
810
Arik Nemtsovd2361c52012-05-10 12:13:19 +0300811static void
812wl18xx_set_tx_desc_data_len(struct wl1271 *wl, struct wl1271_tx_hw_descr *desc,
813 struct sk_buff *skb)
814{
815 desc->length = cpu_to_le16(skb->len);
816
817 wl1271_debug(DEBUG_TX, "tx_fill_hdr: hlid: %d "
818 "len: %d life: %d mem: %d", desc->hlid,
819 le16_to_cpu(desc->length),
820 le16_to_cpu(desc->life_time),
821 desc->wl18xx_mem.total_mem_blocks);
822}
823
Arik Nemtsov9c809f82012-05-10 12:13:23 +0300824static enum wl_rx_buf_align
825wl18xx_get_rx_buf_align(struct wl1271 *wl, u32 rx_desc)
826{
827 if (rx_desc & RX_BUF_PADDED_PAYLOAD)
828 return WLCORE_RX_BUF_PADDED;
829
830 return WLCORE_RX_BUF_ALIGNED;
831}
832
Arik Nemtsov30e2dd72012-05-10 12:13:24 +0300833static u32 wl18xx_get_rx_packet_len(struct wl1271 *wl, void *rx_data,
834 u32 data_len)
835{
836 struct wl1271_rx_descriptor *desc = rx_data;
837
838 /* invalid packet */
839 if (data_len < sizeof(*desc))
840 return 0;
841
842 return data_len - sizeof(*desc);
843}
Arik Nemtsov9c809f82012-05-10 12:13:23 +0300844
Arik Nemtsov872b3452012-05-10 12:13:25 +0300845static void wl18xx_tx_immediate_completion(struct wl1271 *wl)
846{
847 wl18xx_tx_immediate_complete(wl);
848}
849
Luciano Coelhob8422dc2012-05-10 12:13:26 +0300850static int wl18xx_hw_init(struct wl1271 *wl)
851{
852 int ret;
Arik Nemtsovf2baf072012-05-10 12:13:46 +0300853 struct wl18xx_priv *priv = wl->priv;
Luciano Coelhob8422dc2012-05-10 12:13:26 +0300854 u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE |
855 HOST_IF_CFG_ADD_RX_ALIGNMENT;
856
857 u32 sdio_align_size = 0;
858
Arik Nemtsovf2baf072012-05-10 12:13:46 +0300859 /* (re)init private structures. Relevant on recovery as well. */
860 priv->last_fw_rls_idx = 0;
861
Luciano Coelhob8422dc2012-05-10 12:13:26 +0300862 /* Enable Tx SDIO padding */
863 if (wl->quirks & WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN) {
864 host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK;
865 sdio_align_size = WL12XX_BUS_BLOCK_SIZE;
866 }
867
868 /* Enable Rx SDIO padding */
869 if (wl->quirks & WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN) {
870 host_cfg_bitmap |= HOST_IF_CFG_RX_PAD_TO_SDIO_BLK;
871 sdio_align_size = WL12XX_BUS_BLOCK_SIZE;
872 }
873
874 ret = wl18xx_acx_host_if_cfg_bitmap(wl, host_cfg_bitmap,
875 sdio_align_size,
876 WL18XX_TX_HW_BLOCK_SPARE,
877 WL18XX_HOST_IF_LEN_SIZE_FIELD);
878 if (ret < 0)
879 return ret;
880
Luciano Coelho102165c2012-05-10 12:13:53 +0300881 if (checksum_param) {
882 ret = wl18xx_acx_set_checksum_state(wl);
883 if (ret != 0)
884 return ret;
885 }
Arik Nemtsov2fc28de2012-05-10 12:13:27 +0300886
Luciano Coelhob8422dc2012-05-10 12:13:26 +0300887 return ret;
888}
889
Arik Nemtsov2fc28de2012-05-10 12:13:27 +0300890static void wl18xx_set_tx_desc_csum(struct wl1271 *wl,
891 struct wl1271_tx_hw_descr *desc,
892 struct sk_buff *skb)
893{
894 u32 ip_hdr_offset;
895 struct iphdr *ip_hdr;
896
Luciano Coelho102165c2012-05-10 12:13:53 +0300897 if (!checksum_param) {
898 desc->wl18xx_checksum_data = 0;
899 return;
900 }
901
Arik Nemtsov2fc28de2012-05-10 12:13:27 +0300902 if (skb->ip_summed != CHECKSUM_PARTIAL) {
903 desc->wl18xx_checksum_data = 0;
904 return;
905 }
906
907 ip_hdr_offset = skb_network_header(skb) - skb_mac_header(skb);
908 if (WARN_ON(ip_hdr_offset >= (1<<7))) {
909 desc->wl18xx_checksum_data = 0;
910 return;
911 }
912
913 desc->wl18xx_checksum_data = ip_hdr_offset << 1;
914
915 /* FW is interested only in the LSB of the protocol TCP=0 UDP=1 */
916 ip_hdr = (void *)skb_network_header(skb);
917 desc->wl18xx_checksum_data |= (ip_hdr->protocol & 0x01);
918}
919
Arik Nemtsov169da042012-05-10 12:13:28 +0300920static void wl18xx_set_rx_csum(struct wl1271 *wl,
921 struct wl1271_rx_descriptor *desc,
922 struct sk_buff *skb)
923{
924 if (desc->status & WL18XX_RX_CHECKSUM_MASK)
925 skb->ip_summed = CHECKSUM_UNNECESSARY;
926}
927
Luciano Coelho7ae25da2012-05-10 12:14:03 +0300928/*
929 * TODO: instead of having these two functions to get the rate mask,
930 * we should modify the wlvif->rate_set instead
931 */
Arik Nemtsovf13af342012-05-10 12:13:32 +0300932static u32 wl18xx_sta_get_ap_rate_mask(struct wl1271 *wl,
933 struct wl12xx_vif *wlvif)
934{
935 u32 hw_rate_set = wlvif->rate_set;
936
937 if (wlvif->channel_type == NL80211_CHAN_HT40MINUS ||
938 wlvif->channel_type == NL80211_CHAN_HT40PLUS) {
939 wl1271_debug(DEBUG_ACX, "using wide channel rate mask");
940 hw_rate_set |= CONF_TX_RATE_USE_WIDE_CHAN;
941
942 /* we don't support MIMO in wide-channel mode */
943 hw_rate_set &= ~CONF_TX_MIMO_RATES;
944 }
945
946 return hw_rate_set;
947}
948
Arik Nemtsovebc7e572012-05-10 12:13:34 +0300949static u32 wl18xx_ap_get_mimo_wide_rate_mask(struct wl1271 *wl,
950 struct wl12xx_vif *wlvif)
951{
Luciano Coelho174a7302012-05-10 12:14:13 +0300952 if ((wlvif->channel_type == NL80211_CHAN_HT40MINUS ||
953 wlvif->channel_type == NL80211_CHAN_HT40PLUS) &&
954 !strcmp(ht_mode_param, "wide")) {
Arik Nemtsovebc7e572012-05-10 12:13:34 +0300955 wl1271_debug(DEBUG_ACX, "using wide channel rate mask");
956 return CONF_TX_RATE_USE_WIDE_CHAN;
Luciano Coelho174a7302012-05-10 12:14:13 +0300957 } else if (!strcmp(ht_mode_param, "mimo")) {
Arik Nemtsovebc7e572012-05-10 12:13:34 +0300958 wl1271_debug(DEBUG_ACX, "using MIMO rate mask");
Luciano Coelho7ae25da2012-05-10 12:14:03 +0300959
960 /*
961 * PG 1.0 has some problems with MCS_13, so disable it
962 *
963 * TODO: instead of hacking this in here, we should
964 * make it more general and change a bit in the
965 * wlvif->rate_set instead.
966 */
967 if (wl->chip.id == CHIP_ID_185x_PG10)
968 return CONF_TX_MIMO_RATES & ~CONF_HW_BIT_RATE_MCS_13;
969
Arik Nemtsovebc7e572012-05-10 12:13:34 +0300970 return CONF_TX_MIMO_RATES;
Luciano Coelho174a7302012-05-10 12:14:13 +0300971 } else {
972 return 0;
Arik Nemtsovebc7e572012-05-10 12:13:34 +0300973 }
974}
975
Arik Nemtsov54956292012-05-10 12:13:44 +0300976static s8 wl18xx_get_pg_ver(struct wl1271 *wl)
977{
978 u32 fuse;
979
980 wlcore_set_partition(wl, &wl->ptable[PART_TOP_PRCM_ELP_SOC]);
981
982 fuse = wl1271_read32(wl, WL18XX_REG_FUSE_DATA_1_3);
983 fuse = (fuse & WL18XX_PG_VER_MASK) >> WL18XX_PG_VER_OFFSET;
984
985 wlcore_set_partition(wl, &wl->ptable[PART_BOOT]);
986
987 return (s8)fuse;
988}
989
Luciano Coelho23ee9bf2012-05-10 12:13:29 +0300990static void wl18xx_conf_init(struct wl1271 *wl)
991{
992 struct wl18xx_priv *priv = wl->priv;
993
994 /* apply driver default configuration */
995 memcpy(&wl->conf, &wl18xx_conf, sizeof(wl18xx_conf));
996
997 /* apply default private configuration */
998 memcpy(&priv->conf, &wl18xx_default_priv_conf, sizeof(priv->conf));
999}
1000
Luciano Coelhobe42aee2012-05-10 12:13:50 +03001001static int wl18xx_plt_init(struct wl1271 *wl)
1002{
1003 wl1271_write32(wl, WL18XX_SCR_PAD8, WL18XX_SCR_PAD8_PLT);
1004
1005 return wl->ops->boot(wl);
1006}
1007
Luciano Coelhoa5114d92012-05-10 12:13:55 +03001008static void wl18xx_get_mac(struct wl1271 *wl)
1009{
1010 u32 mac1, mac2;
1011
1012 wlcore_set_partition(wl, &wl->ptable[PART_TOP_PRCM_ELP_SOC]);
1013
1014 mac1 = wl1271_read32(wl, WL18XX_REG_FUSE_BD_ADDR_1);
1015 mac2 = wl1271_read32(wl, WL18XX_REG_FUSE_BD_ADDR_2);
1016
1017 /* these are the two parts of the BD_ADDR */
1018 wl->fuse_oui_addr = ((mac2 & 0xffff) << 8) +
1019 ((mac1 & 0xff000000) >> 24);
1020 wl->fuse_nic_addr = (mac1 & 0xffffff);
1021
1022 wlcore_set_partition(wl, &wl->ptable[PART_DOWN]);
1023}
1024
Luciano Coelho283e8c42012-05-10 12:14:11 +03001025static int wl18xx_handle_static_data(struct wl1271 *wl,
1026 struct wl1271_static_data *static_data)
1027{
1028 struct wl18xx_static_data_priv *static_data_priv =
1029 (struct wl18xx_static_data_priv *) static_data->priv;
1030
1031 wl1271_info("PHY firmware version: %s", static_data_priv->phy_version);
1032
1033 return 0;
1034}
1035
Luciano Coelho0cd65432012-05-10 12:13:11 +03001036static struct wlcore_ops wl18xx_ops = {
Luciano Coelho46a1d512012-05-10 12:13:12 +03001037 .identify_chip = wl18xx_identify_chip,
1038 .boot = wl18xx_boot,
Luciano Coelhobe42aee2012-05-10 12:13:50 +03001039 .plt_init = wl18xx_plt_init,
Luciano Coelho274c66c2012-05-10 12:13:13 +03001040 .trigger_cmd = wl18xx_trigger_cmd,
1041 .ack_event = wl18xx_ack_event,
Arik Nemtsov624845b2012-05-10 12:13:17 +03001042 .calc_tx_blocks = wl18xx_calc_tx_blocks,
Arik Nemtsovfb0f2e42012-05-10 12:13:18 +03001043 .set_tx_desc_blocks = wl18xx_set_tx_desc_blocks,
Arik Nemtsovd2361c52012-05-10 12:13:19 +03001044 .set_tx_desc_data_len = wl18xx_set_tx_desc_data_len,
Arik Nemtsov9c809f82012-05-10 12:13:23 +03001045 .get_rx_buf_align = wl18xx_get_rx_buf_align,
Arik Nemtsov30e2dd72012-05-10 12:13:24 +03001046 .get_rx_packet_len = wl18xx_get_rx_packet_len,
Arik Nemtsov872b3452012-05-10 12:13:25 +03001047 .tx_immediate_compl = wl18xx_tx_immediate_completion,
1048 .tx_delayed_compl = NULL,
Luciano Coelhob8422dc2012-05-10 12:13:26 +03001049 .hw_init = wl18xx_hw_init,
Arik Nemtsov2fc28de2012-05-10 12:13:27 +03001050 .set_tx_desc_csum = wl18xx_set_tx_desc_csum,
Arik Nemtsov54956292012-05-10 12:13:44 +03001051 .get_pg_ver = wl18xx_get_pg_ver,
Arik Nemtsov169da042012-05-10 12:13:28 +03001052 .set_rx_csum = wl18xx_set_rx_csum,
Arik Nemtsovf13af342012-05-10 12:13:32 +03001053 .sta_get_ap_rate_mask = wl18xx_sta_get_ap_rate_mask,
Arik Nemtsovebc7e572012-05-10 12:13:34 +03001054 .ap_get_mimo_wide_rate_mask = wl18xx_ap_get_mimo_wide_rate_mask,
Luciano Coelhoa5114d92012-05-10 12:13:55 +03001055 .get_mac = wl18xx_get_mac,
Luciano Coelhoad62d812012-05-10 12:14:19 +03001056 .debugfs_init = wl18xx_debugfs_add_files,
Luciano Coelho283e8c42012-05-10 12:14:11 +03001057 .handle_static_data = wl18xx_handle_static_data,
Luciano Coelho0cd65432012-05-10 12:13:11 +03001058};
1059
Arik Nemtsov0e0f5a32012-05-10 12:13:35 +03001060/* HT cap appropriate for wide channels */
Luciano Coelho83342712012-05-10 12:14:15 +03001061static struct ieee80211_sta_ht_cap wl18xx_siso40_ht_cap = {
Arik Nemtsov0e0f5a32012-05-10 12:13:35 +03001062 .cap = IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40 |
1063 IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_DSSSCCK40,
1064 .ht_supported = true,
1065 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
1066 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
1067 .mcs = {
1068 .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
1069 .rx_highest = cpu_to_le16(150),
1070 .tx_params = IEEE80211_HT_MCS_TX_DEFINED,
1071 },
1072};
1073
Luciano Coelho83342712012-05-10 12:14:15 +03001074/* HT cap appropriate for SISO 20 */
1075static struct ieee80211_sta_ht_cap wl18xx_siso20_ht_cap = {
1076 .cap = IEEE80211_HT_CAP_SGI_20,
1077 .ht_supported = true,
1078 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
1079 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
1080 .mcs = {
1081 .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
1082 .rx_highest = cpu_to_le16(72),
1083 .tx_params = IEEE80211_HT_MCS_TX_DEFINED,
1084 },
1085};
1086
Arik Nemtsov3a8ddb62012-05-10 12:13:36 +03001087/* HT cap appropriate for MIMO rates in 20mhz channel */
1088static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap = {
1089 .cap = IEEE80211_HT_CAP_SGI_20,
1090 .ht_supported = true,
1091 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
1092 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16,
1093 .mcs = {
1094 .rx_mask = { 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, },
1095 .rx_highest = cpu_to_le16(144),
1096 .tx_params = IEEE80211_HT_MCS_TX_DEFINED,
1097 },
1098};
1099
Luciano Coelho9a1a6992012-05-10 12:13:06 +03001100int __devinit wl18xx_probe(struct platform_device *pdev)
1101{
1102 struct wl1271 *wl;
1103 struct ieee80211_hw *hw;
Arik Nemtsov9d1c9732012-05-10 12:13:14 +03001104 struct wl18xx_priv *priv;
Luciano Coelho9a1a6992012-05-10 12:13:06 +03001105
Arik Nemtsov9d1c9732012-05-10 12:13:14 +03001106 hw = wlcore_alloc_hw(sizeof(*priv));
Luciano Coelho9a1a6992012-05-10 12:13:06 +03001107 if (IS_ERR(hw)) {
1108 wl1271_error("can't allocate hw");
1109 return PTR_ERR(hw);
1110 }
1111
1112 wl = hw->priv;
Luciano Coelhoa9c130d2012-05-10 12:13:37 +03001113 priv = wl->priv;
Luciano Coelho554c36b2012-05-10 12:13:08 +03001114 wl->ops = &wl18xx_ops;
Luciano Coelho82b890c2012-05-10 12:13:09 +03001115 wl->ptable = wl18xx_ptable;
Luciano Coelho5d4a9fa2012-05-10 12:13:10 +03001116 wl->rtable = wl18xx_rtable;
Arik Nemtsovcb7b5d82012-05-10 12:13:15 +03001117 wl->num_tx_desc = 32;
Arik Nemtsov0afd04e2012-05-10 12:13:54 +03001118 wl->num_rx_desc = 16;
Arik Nemtsov1349c422012-05-10 12:13:16 +03001119 wl->normal_tx_spare = WL18XX_TX_HW_BLOCK_SPARE;
1120 wl->gem_tx_spare = WL18XX_TX_HW_GEM_BLOCK_SPARE;
Arik Nemtsovf648eab2012-05-10 12:13:20 +03001121 wl->band_rate_to_idx = wl18xx_band_rate_to_idx;
1122 wl->hw_tx_rate_tbl_size = WL18XX_CONF_HW_RXTX_RATE_MAX;
1123 wl->hw_min_ht_rate = WL18XX_CONF_HW_RXTX_RATE_MCS0;
Arik Nemtsov1fab39d2012-05-10 12:13:21 +03001124 wl->fw_status_priv_len = sizeof(struct wl18xx_fw_status_priv);
Luciano Coelho8c0ea102012-05-10 12:14:09 +03001125 wl->stats.fw_stats_len = sizeof(struct wl18xx_acx_statistics);
Luciano Coelho283e8c42012-05-10 12:14:11 +03001126 wl->static_data_priv_len = sizeof(struct wl18xx_static_data_priv);
Luciano Coelho83342712012-05-10 12:14:15 +03001127
1128 if (!strcmp(ht_mode_param, "wide")) {
1129 memcpy(&wl->ht_cap, &wl18xx_siso40_ht_cap,
1130 sizeof(wl18xx_siso40_ht_cap));
1131 } else if (!strcmp(ht_mode_param, "mimo")) {
Arik Nemtsov3a8ddb62012-05-10 12:13:36 +03001132 memcpy(&wl->ht_cap, &wl18xx_mimo_ht_cap,
1133 sizeof(wl18xx_mimo_ht_cap));
Luciano Coelho83342712012-05-10 12:14:15 +03001134 } else if (!strcmp(ht_mode_param, "siso20")) {
1135 memcpy(&wl->ht_cap, &wl18xx_siso20_ht_cap,
1136 sizeof(wl18xx_siso20_ht_cap));
1137 } else {
1138 wl1271_error("invalid ht_mode '%s'", ht_mode_param);
1139 goto out_free;
1140 }
Arik Nemtsov3a8ddb62012-05-10 12:13:36 +03001141
Luciano Coelho776f0302012-05-10 12:13:58 +03001142 wl18xx_conf_init(wl);
1143
Luciano Coelho4b9d2362012-05-10 12:13:59 +03001144 if (!strcmp(board_type_param, "fpga")) {
Arik Nemtsov05057c02012-05-10 12:13:48 +03001145 priv->board_type = BOARD_TYPE_FPGA_18XX;
1146 } else if (!strcmp(board_type_param, "hdk")) {
1147 priv->board_type = BOARD_TYPE_HDK_18XX;
Luciano Coelho0a1569f2012-05-10 12:13:51 +03001148 /* HACK! Just for now we hardcode HDK to 0x06 */
1149 priv->conf.phy.low_band_component_type = 0x06;
Arik Nemtsov05057c02012-05-10 12:13:48 +03001150 } else if (!strcmp(board_type_param, "dvp")) {
1151 priv->board_type = BOARD_TYPE_DVP_18XX;
1152 } else if (!strcmp(board_type_param, "evb")) {
1153 priv->board_type = BOARD_TYPE_EVB_18XX;
1154 } else if (!strcmp(board_type_param, "com8")) {
1155 priv->board_type = BOARD_TYPE_COM8_18XX;
Luciano Coelho73d8a422012-05-10 12:14:01 +03001156 /* HACK! Just for now we hardcode COM8 to 0x06 */
1157 priv->conf.phy.low_band_component_type = 0x06;
Luciano Coelhoa9c130d2012-05-10 12:13:37 +03001158 } else {
Arik Nemtsov05057c02012-05-10 12:13:48 +03001159 wl1271_error("invalid board type '%s'", board_type_param);
Luciano Coelho83342712012-05-10 12:14:15 +03001160 goto out_free;
Luciano Coelhoa9c130d2012-05-10 12:13:37 +03001161 }
1162
Luciano Coelho858403a2012-05-10 12:14:17 +03001163 /*
1164 * If the module param is not set, update it with the one from
1165 * conf. If it is set, overwrite conf with it.
1166 */
1167 if (low_band_component == -1)
1168 low_band_component = priv->conf.phy.low_band_component;
1169 else
1170 priv->conf.phy.low_band_component = low_band_component;
1171 if (low_band_component_type == -1)
1172 low_band_component_type =
1173 priv->conf.phy.low_band_component_type;
1174 else
1175 priv->conf.phy.low_band_component_type =
1176 low_band_component_type;
1177
1178 if (high_band_component == -1)
1179 high_band_component = priv->conf.phy.high_band_component;
1180 else
1181 priv->conf.phy.high_band_component = high_band_component;
1182 if (high_band_component_type == -1)
1183 high_band_component_type =
1184 priv->conf.phy.high_band_component_type;
1185 else
1186 priv->conf.phy.high_band_component_type =
1187 high_band_component_type;
1188
Luciano Coelho7b03c302012-05-10 12:14:18 +03001189 if (pwr_limit_reference_11_abg == -1)
1190 pwr_limit_reference_11_abg =
1191 priv->conf.phy.pwr_limit_reference_11_abg;
1192 else
1193 priv->conf.phy.pwr_limit_reference_11_abg =
1194 pwr_limit_reference_11_abg;
1195
Luciano Coelho102165c2012-05-10 12:13:53 +03001196 if (!checksum_param) {
1197 wl18xx_ops.set_rx_csum = NULL;
1198 wl18xx_ops.init_vif = NULL;
1199 }
1200
Luciano Coelho1ddbc7d2012-05-10 12:13:56 +03001201 wl->enable_11a = enable_11a_param;
1202
Luciano Coelho9a1a6992012-05-10 12:13:06 +03001203 return wlcore_probe(wl, pdev);
Luciano Coelho83342712012-05-10 12:14:15 +03001204
1205out_free:
1206 wlcore_free_hw(wl);
1207 return -EINVAL;
Luciano Coelho9a1a6992012-05-10 12:13:06 +03001208}
1209
1210static const struct platform_device_id wl18xx_id_table[] __devinitconst = {
1211 { "wl18xx", 0 },
1212 { } /* Terminating Entry */
1213};
1214MODULE_DEVICE_TABLE(platform, wl18xx_id_table);
1215
1216static struct platform_driver wl18xx_driver = {
1217 .probe = wl18xx_probe,
1218 .remove = __devexit_p(wlcore_remove),
1219 .id_table = wl18xx_id_table,
1220 .driver = {
1221 .name = "wl18xx_driver",
1222 .owner = THIS_MODULE,
1223 }
1224};
1225
1226static int __init wl18xx_init(void)
1227{
1228 return platform_driver_register(&wl18xx_driver);
1229}
1230module_init(wl18xx_init);
1231
1232static void __exit wl18xx_exit(void)
1233{
1234 platform_driver_unregister(&wl18xx_driver);
1235}
1236module_exit(wl18xx_exit);
1237
Arik Nemtsov3a8ddb62012-05-10 12:13:36 +03001238module_param_named(ht_mode, ht_mode_param, charp, S_IRUSR);
Luciano Coelho83342712012-05-10 12:14:15 +03001239MODULE_PARM_DESC(ht_mode, "Force HT mode: wide (default), mimo or siso20");
Arik Nemtsov3a8ddb62012-05-10 12:13:36 +03001240
Luciano Coelhoa9c130d2012-05-10 12:13:37 +03001241module_param_named(board_type, board_type_param, charp, S_IRUSR);
Luciano Coelho4b9d2362012-05-10 12:13:59 +03001242MODULE_PARM_DESC(board_type, "Board type: fpga, hdk (default), evb, com8 or "
1243 "dvp");
Luciano Coelhoa9c130d2012-05-10 12:13:37 +03001244
Luciano Coelhoe9258812012-05-10 12:13:52 +03001245module_param_named(dc2dc, dc2dc_param, bool, S_IRUSR);
1246MODULE_PARM_DESC(dc2dc, "External DC2DC: boolean (defaults to false)");
1247
1248module_param_named(n_antennas_2, n_antennas_2_param, uint, S_IRUSR);
1249MODULE_PARM_DESC(n_antennas_2, "Number of installed 2.4GHz antennas: 1 (default) or 2");
1250
1251module_param_named(n_antennas_5, n_antennas_5_param, uint, S_IRUSR);
1252MODULE_PARM_DESC(n_antennas_5, "Number of installed 5GHz antennas: 1 (default) or 2");
1253
Luciano Coelho102165c2012-05-10 12:13:53 +03001254module_param_named(checksum, checksum_param, bool, S_IRUSR);
1255MODULE_PARM_DESC(checksum, "Enable TCP checksum: boolean (defaults to true)");
1256
Luciano Coelho1ddbc7d2012-05-10 12:13:56 +03001257module_param_named(enable_11a, enable_11a_param, bool, S_IRUSR);
1258MODULE_PARM_DESC(enable_11a, "Enable 11a (5GHz): boolean (defaults to true)");
1259
Luciano Coelho858403a2012-05-10 12:14:17 +03001260module_param(low_band_component, uint, S_IRUSR);
1261MODULE_PARM_DESC(low_band_component, "Low band component: u8 "
1262 "(default is 0x01)");
1263
1264module_param(low_band_component_type, uint, S_IRUSR);
1265MODULE_PARM_DESC(low_band_component_type, "Low band component type: u8 "
1266 "(default is 0x05 or 0x06 depending on the board_type)");
1267
1268module_param(high_band_component, uint, S_IRUSR);
1269MODULE_PARM_DESC(high_band_component, "High band component: u8, "
1270 "(default is 0x01)");
1271
1272module_param(high_band_component_type, uint, S_IRUSR);
1273MODULE_PARM_DESC(high_band_component_type, "High band component type: u8 "
1274 "(default is 0x09)");
1275
Luciano Coelho7b03c302012-05-10 12:14:18 +03001276module_param(pwr_limit_reference_11_abg, uint, S_IRUSR);
1277MODULE_PARM_DESC(pwr_limit_reference_11_abg, "Power limit reference: u8 "
1278 "(default is 0xc8)");
1279
Luciano Coelho9a1a6992012-05-10 12:13:06 +03001280MODULE_LICENSE("GPL v2");
1281MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
Luciano Coelho0cd65432012-05-10 12:13:11 +03001282MODULE_FIRMWARE(WL18XX_FW_NAME);