2 * This file is part of wl1271
4 * Copyright (C) 2008-2010 Nokia Corporation
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.
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.
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
22 #include <linux/module.h>
23 #include <linux/platform_device.h>
25 #include <linux/err.h>
27 #include "../wlcore/wlcore.h"
28 #include "../wlcore/debug.h"
29 #include "../wlcore/io.h"
30 #include "../wlcore/acx.h"
31 #include "../wlcore/tx.h"
32 #include "../wlcore/rx.h"
33 #include "../wlcore/boot.h"
44 static char *fref_param
;
45 static char *tcxo_param
;
47 static struct wlcore_conf wl12xx_conf
= {
50 [WL12XX_CONF_SG_ACL_BT_MASTER_MIN_BR
] = 10,
51 [WL12XX_CONF_SG_ACL_BT_MASTER_MAX_BR
] = 180,
52 [WL12XX_CONF_SG_ACL_BT_SLAVE_MIN_BR
] = 10,
53 [WL12XX_CONF_SG_ACL_BT_SLAVE_MAX_BR
] = 180,
54 [WL12XX_CONF_SG_ACL_BT_MASTER_MIN_EDR
] = 10,
55 [WL12XX_CONF_SG_ACL_BT_MASTER_MAX_EDR
] = 80,
56 [WL12XX_CONF_SG_ACL_BT_SLAVE_MIN_EDR
] = 10,
57 [WL12XX_CONF_SG_ACL_BT_SLAVE_MAX_EDR
] = 80,
58 [WL12XX_CONF_SG_ACL_WLAN_PS_MASTER_BR
] = 8,
59 [WL12XX_CONF_SG_ACL_WLAN_PS_SLAVE_BR
] = 8,
60 [WL12XX_CONF_SG_ACL_WLAN_PS_MASTER_EDR
] = 20,
61 [WL12XX_CONF_SG_ACL_WLAN_PS_SLAVE_EDR
] = 20,
62 [WL12XX_CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_BR
] = 20,
63 [WL12XX_CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_BR
] = 35,
64 [WL12XX_CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_BR
] = 16,
65 [WL12XX_CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_BR
] = 35,
66 [WL12XX_CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_EDR
] = 32,
67 [WL12XX_CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_EDR
] = 50,
68 [WL12XX_CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_EDR
] = 28,
69 [WL12XX_CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_EDR
] = 50,
70 [WL12XX_CONF_SG_ACL_ACTIVE_SCAN_WLAN_BR
] = 10,
71 [WL12XX_CONF_SG_ACL_ACTIVE_SCAN_WLAN_EDR
] = 20,
72 [WL12XX_CONF_SG_ACL_PASSIVE_SCAN_BT_BR
] = 75,
73 [WL12XX_CONF_SG_ACL_PASSIVE_SCAN_WLAN_BR
] = 15,
74 [WL12XX_CONF_SG_ACL_PASSIVE_SCAN_BT_EDR
] = 27,
75 [WL12XX_CONF_SG_ACL_PASSIVE_SCAN_WLAN_EDR
] = 17,
76 /* active scan params */
77 [WL12XX_CONF_SG_AUTO_SCAN_PROBE_REQ
] = 170,
78 [WL12XX_CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3
] = 50,
79 [WL12XX_CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP
] = 100,
80 /* passive scan params */
81 [WL12XX_CONF_SG_PASSIVE_SCAN_DUR_FACTOR_A2DP_BR
] = 800,
82 [WL12XX_CONF_SG_PASSIVE_SCAN_DUR_FACTOR_A2DP_EDR
] = 200,
83 [WL12XX_CONF_SG_PASSIVE_SCAN_DUR_FACTOR_HV3
] = 200,
84 /* passive scan in dual antenna params */
85 [WL12XX_CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN
] = 0,
86 [WL12XX_CONF_SG_BCN_HV3_COLL_THR_IN_PASSIVE_SCAN
] = 0,
87 [WL12XX_CONF_SG_TX_RX_PROTECT_BW_IN_PASSIVE_SCAN
] = 0,
89 [WL12XX_CONF_SG_STA_FORCE_PS_IN_BT_SCO
] = 1,
90 [WL12XX_CONF_SG_ANTENNA_CONFIGURATION
] = 0,
91 [WL12XX_CONF_SG_BEACON_MISS_PERCENT
] = 60,
92 [WL12XX_CONF_SG_DHCP_TIME
] = 5000,
93 [WL12XX_CONF_SG_RXT
] = 1200,
94 [WL12XX_CONF_SG_TXT
] = 1000,
95 [WL12XX_CONF_SG_ADAPTIVE_RXT_TXT
] = 1,
96 [WL12XX_CONF_SG_GENERAL_USAGE_BIT_MAP
] = 3,
97 [WL12XX_CONF_SG_HV3_MAX_SERVED
] = 6,
98 [WL12XX_CONF_SG_PS_POLL_TIMEOUT
] = 10,
99 [WL12XX_CONF_SG_UPSD_TIMEOUT
] = 10,
100 [WL12XX_CONF_SG_CONSECUTIVE_CTS_THRESHOLD
] = 2,
101 [WL12XX_CONF_SG_STA_RX_WINDOW_AFTER_DTIM
] = 5,
102 [WL12XX_CONF_SG_STA_CONNECTION_PROTECTION_TIME
] = 30,
104 [WL12XX_CONF_AP_BEACON_MISS_TX
] = 3,
105 [WL12XX_CONF_AP_RX_WINDOW_AFTER_BEACON
] = 10,
106 [WL12XX_CONF_AP_BEACON_WINDOW_INTERVAL
] = 2,
107 [WL12XX_CONF_AP_CONNECTION_PROTECTION_TIME
] = 0,
108 [WL12XX_CONF_AP_BT_ACL_VAL_BT_SERVE_TIME
] = 25,
109 [WL12XX_CONF_AP_BT_ACL_VAL_WL_SERVE_TIME
] = 25,
110 /* CTS Diluting params */
111 [WL12XX_CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH
] = 0,
112 [WL12XX_CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER
] = 0,
114 .state
= CONF_SG_PROTECTIVE
,
117 .rx_msdu_life_time
= 512000,
118 .packet_detection_threshold
= 0,
119 .ps_poll_timeout
= 15,
121 .rts_threshold
= IEEE80211_MAX_RTS_THRESHOLD
,
122 .rx_cca_threshold
= 0,
123 .irq_blk_threshold
= 0xFFFF,
124 .irq_pkt_threshold
= 0,
126 .queue_type
= CONF_RX_QUEUE_TYPE_LOW_PRIORITY
,
129 .tx_energy_detection
= 0,
132 .short_retry_limit
= 10,
133 .long_retry_limit
= 10,
156 .aifsn
= CONF_TX_AIFS_PIFS
,
163 .aifsn
= CONF_TX_AIFS_PIFS
,
167 .max_tx_retries
= 100,
168 .ap_aging_period
= 300,
172 .queue_id
= CONF_TX_AC_BE
,
173 .channel_type
= CONF_CHANNEL_TYPE_EDCF
,
174 .tsid
= CONF_TX_AC_BE
,
175 .ps_scheme
= CONF_PS_SCHEME_LEGACY
,
176 .ack_policy
= CONF_ACK_POLICY_LEGACY
,
180 .queue_id
= CONF_TX_AC_BK
,
181 .channel_type
= CONF_CHANNEL_TYPE_EDCF
,
182 .tsid
= CONF_TX_AC_BK
,
183 .ps_scheme
= CONF_PS_SCHEME_LEGACY
,
184 .ack_policy
= CONF_ACK_POLICY_LEGACY
,
188 .queue_id
= CONF_TX_AC_VI
,
189 .channel_type
= CONF_CHANNEL_TYPE_EDCF
,
190 .tsid
= CONF_TX_AC_VI
,
191 .ps_scheme
= CONF_PS_SCHEME_LEGACY
,
192 .ack_policy
= CONF_ACK_POLICY_LEGACY
,
196 .queue_id
= CONF_TX_AC_VO
,
197 .channel_type
= CONF_CHANNEL_TYPE_EDCF
,
198 .tsid
= CONF_TX_AC_VO
,
199 .ps_scheme
= CONF_PS_SCHEME_LEGACY
,
200 .ack_policy
= CONF_ACK_POLICY_LEGACY
,
204 .frag_threshold
= IEEE80211_MAX_FRAG_THRESHOLD
,
205 .tx_compl_timeout
= 700,
206 .tx_compl_threshold
= 4,
207 .basic_rate
= CONF_HW_BIT_RATE_1MBPS
,
208 .basic_rate_5
= CONF_HW_BIT_RATE_6MBPS
,
209 .tmpl_short_retry_limit
= 10,
210 .tmpl_long_retry_limit
= 10,
211 .tx_watchdog_timeout
= 5000,
212 .slow_link_thold
= 3,
213 .fast_link_thold
= 10,
216 .wake_up_event
= CONF_WAKE_UP_EVENT_DTIM
,
217 .listen_interval
= 1,
218 .suspend_wake_up_event
= CONF_WAKE_UP_EVENT_N_DTIM
,
219 .suspend_listen_interval
= 3,
220 .bcn_filt_mode
= CONF_BCN_FILT_MODE_ENABLED
,
221 .bcn_filt_ie_count
= 3,
224 .ie
= WLAN_EID_CHANNEL_SWITCH
,
225 .rule
= CONF_BCN_RULE_PASS_ON_APPEARANCE
,
228 .ie
= WLAN_EID_HT_OPERATION
,
229 .rule
= CONF_BCN_RULE_PASS_ON_CHANGE
,
232 .ie
= WLAN_EID_ERP_INFO
,
233 .rule
= CONF_BCN_RULE_PASS_ON_CHANGE
,
236 .synch_fail_thold
= 12,
237 .bss_lose_timeout
= 400,
238 .beacon_rx_timeout
= 10000,
239 .broadcast_timeout
= 20000,
240 .rx_broadcast_in_ps
= 1,
241 .ps_poll_threshold
= 10,
242 .bet_enable
= CONF_BET_MODE_ENABLE
,
243 .bet_max_consecutive
= 50,
244 .psm_entry_retries
= 8,
245 .psm_exit_retries
= 16,
246 .psm_entry_nullfunc_retries
= 3,
247 .dynamic_ps_timeout
= 1500,
249 .keep_alive_interval
= 55000,
250 .max_listen_interval
= 20,
251 .sta_sleep_auth
= WL1271_PSM_ILLEGAL
,
252 .suspend_rx_ba_activity
= 0,
259 .host_clk_settling_time
= 5000,
260 .host_fast_wakeup_support
= CONF_FAST_WAKEUP_DISABLE
,
264 .avg_weight_rssi_beacon
= 20,
265 .avg_weight_rssi_data
= 10,
266 .avg_weight_snr_beacon
= 20,
267 .avg_weight_snr_data
= 10,
270 .min_dwell_time_active
= 7500,
271 .max_dwell_time_active
= 30000,
272 .min_dwell_time_active_long
= 25000,
273 .max_dwell_time_active_long
= 50000,
274 .dwell_time_passive
= 100000,
275 .dwell_time_dfs
= 150000,
277 .split_scan_timeout
= 50000,
281 * Values are in TU/1000 but since sched scan FW command
282 * params are in TUs rounding up may occur.
284 .base_dwell_time
= 7500,
285 .max_dwell_time_delta
= 22500,
286 /* based on 250bits per probe @1Mbps */
287 .dwell_time_delta_per_probe
= 2000,
288 /* based on 250bits per probe @6Mbps (plus a bit more) */
289 .dwell_time_delta_per_probe_5
= 350,
290 .dwell_time_passive
= 100000,
291 .dwell_time_dfs
= 150000,
293 .rssi_threshold
= -90,
298 .tx_ba_win_size
= 64,
299 .inactivity_timeout
= 10000,
300 .tx_ba_tid_bitmap
= CONF_TX_BA_ENABLED_TID_BITMAP
,
303 * Memory config for wl127x chips is given in the
304 * wl12xx_default_priv_conf struct. The below configuration is
311 .tx_min_block_num
= 40,
313 .min_req_tx_blocks
= 45,
314 .min_req_rx_blocks
= 22,
320 .n_divider_fref_set_1
= 0xff, /* default */
321 .n_divider_fref_set_2
= 12,
322 .m_divider_fref_set_1
= 0xffff,
323 .m_divider_fref_set_2
= 148, /* default */
324 .coex_pll_stabilization_time
= 0xffffffff, /* default */
325 .ldo_stabilization_time
= 0xffff, /* default */
326 .fm_disturbed_band_margin
= 0xff, /* default */
327 .swallow_clk_diff
= 0xff, /* default */
336 .mode
= WL12XX_FWLOG_CONTINUOUS
,
339 .timestamp
= WL12XX_FWLOG_TIMESTAMP_DISABLED
,
340 .output
= WL12XX_FWLOG_OUTPUT_DBG_PINS
,
344 .rate_retry_score
= 32000,
349 .inverse_curiosity_factor
= 5,
351 .tx_fail_high_th
= 10,
352 .per_alpha_shift
= 4,
354 .per_beta1_shift
= 10,
355 .per_beta2_shift
= 8,
357 .rate_check_down
= 12,
358 .rate_retry_policy
= {
359 0x00, 0x00, 0x00, 0x00, 0x00,
360 0x00, 0x00, 0x00, 0x00, 0x00,
366 .hangover_period
= 20,
368 .early_termination_mode
= 1,
378 .bug_on_recovery
= 0,
383 static struct wl12xx_priv_conf wl12xx_default_priv_conf
= {
385 .tx_per_channel_power_compensation_2
= {
386 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
388 .tx_per_channel_power_compensation_5
= {
389 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
390 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
391 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
398 .tx_min_block_num
= 40,
400 .min_req_tx_blocks
= 100,
401 .min_req_rx_blocks
= 22,
407 #define WL12XX_TX_HW_BLOCK_SPARE_DEFAULT 1
408 #define WL12XX_TX_HW_BLOCK_GEM_SPARE 2
409 #define WL12XX_TX_HW_BLOCK_SIZE 252
411 static const u8 wl12xx_rate_to_idx_2ghz
[] = {
412 /* MCS rates are used only with 11n */
413 7, /* WL12XX_CONF_HW_RXTX_RATE_MCS7_SGI */
414 7, /* WL12XX_CONF_HW_RXTX_RATE_MCS7 */
415 6, /* WL12XX_CONF_HW_RXTX_RATE_MCS6 */
416 5, /* WL12XX_CONF_HW_RXTX_RATE_MCS5 */
417 4, /* WL12XX_CONF_HW_RXTX_RATE_MCS4 */
418 3, /* WL12XX_CONF_HW_RXTX_RATE_MCS3 */
419 2, /* WL12XX_CONF_HW_RXTX_RATE_MCS2 */
420 1, /* WL12XX_CONF_HW_RXTX_RATE_MCS1 */
421 0, /* WL12XX_CONF_HW_RXTX_RATE_MCS0 */
423 11, /* WL12XX_CONF_HW_RXTX_RATE_54 */
424 10, /* WL12XX_CONF_HW_RXTX_RATE_48 */
425 9, /* WL12XX_CONF_HW_RXTX_RATE_36 */
426 8, /* WL12XX_CONF_HW_RXTX_RATE_24 */
428 /* TI-specific rate */
429 CONF_HW_RXTX_RATE_UNSUPPORTED
, /* WL12XX_CONF_HW_RXTX_RATE_22 */
431 7, /* WL12XX_CONF_HW_RXTX_RATE_18 */
432 6, /* WL12XX_CONF_HW_RXTX_RATE_12 */
433 3, /* WL12XX_CONF_HW_RXTX_RATE_11 */
434 5, /* WL12XX_CONF_HW_RXTX_RATE_9 */
435 4, /* WL12XX_CONF_HW_RXTX_RATE_6 */
436 2, /* WL12XX_CONF_HW_RXTX_RATE_5_5 */
437 1, /* WL12XX_CONF_HW_RXTX_RATE_2 */
438 0 /* WL12XX_CONF_HW_RXTX_RATE_1 */
441 static const u8 wl12xx_rate_to_idx_5ghz
[] = {
442 /* MCS rates are used only with 11n */
443 7, /* WL12XX_CONF_HW_RXTX_RATE_MCS7_SGI */
444 7, /* WL12XX_CONF_HW_RXTX_RATE_MCS7 */
445 6, /* WL12XX_CONF_HW_RXTX_RATE_MCS6 */
446 5, /* WL12XX_CONF_HW_RXTX_RATE_MCS5 */
447 4, /* WL12XX_CONF_HW_RXTX_RATE_MCS4 */
448 3, /* WL12XX_CONF_HW_RXTX_RATE_MCS3 */
449 2, /* WL12XX_CONF_HW_RXTX_RATE_MCS2 */
450 1, /* WL12XX_CONF_HW_RXTX_RATE_MCS1 */
451 0, /* WL12XX_CONF_HW_RXTX_RATE_MCS0 */
453 7, /* WL12XX_CONF_HW_RXTX_RATE_54 */
454 6, /* WL12XX_CONF_HW_RXTX_RATE_48 */
455 5, /* WL12XX_CONF_HW_RXTX_RATE_36 */
456 4, /* WL12XX_CONF_HW_RXTX_RATE_24 */
458 /* TI-specific rate */
459 CONF_HW_RXTX_RATE_UNSUPPORTED
, /* WL12XX_CONF_HW_RXTX_RATE_22 */
461 3, /* WL12XX_CONF_HW_RXTX_RATE_18 */
462 2, /* WL12XX_CONF_HW_RXTX_RATE_12 */
463 CONF_HW_RXTX_RATE_UNSUPPORTED
, /* WL12XX_CONF_HW_RXTX_RATE_11 */
464 1, /* WL12XX_CONF_HW_RXTX_RATE_9 */
465 0, /* WL12XX_CONF_HW_RXTX_RATE_6 */
466 CONF_HW_RXTX_RATE_UNSUPPORTED
, /* WL12XX_CONF_HW_RXTX_RATE_5_5 */
467 CONF_HW_RXTX_RATE_UNSUPPORTED
, /* WL12XX_CONF_HW_RXTX_RATE_2 */
468 CONF_HW_RXTX_RATE_UNSUPPORTED
/* WL12XX_CONF_HW_RXTX_RATE_1 */
471 static const u8
*wl12xx_band_rate_to_idx
[] = {
472 [NL80211_BAND_2GHZ
] = wl12xx_rate_to_idx_2ghz
,
473 [NL80211_BAND_5GHZ
] = wl12xx_rate_to_idx_5ghz
476 enum wl12xx_hw_rates
{
477 WL12XX_CONF_HW_RXTX_RATE_MCS7_SGI
= 0,
478 WL12XX_CONF_HW_RXTX_RATE_MCS7
,
479 WL12XX_CONF_HW_RXTX_RATE_MCS6
,
480 WL12XX_CONF_HW_RXTX_RATE_MCS5
,
481 WL12XX_CONF_HW_RXTX_RATE_MCS4
,
482 WL12XX_CONF_HW_RXTX_RATE_MCS3
,
483 WL12XX_CONF_HW_RXTX_RATE_MCS2
,
484 WL12XX_CONF_HW_RXTX_RATE_MCS1
,
485 WL12XX_CONF_HW_RXTX_RATE_MCS0
,
486 WL12XX_CONF_HW_RXTX_RATE_54
,
487 WL12XX_CONF_HW_RXTX_RATE_48
,
488 WL12XX_CONF_HW_RXTX_RATE_36
,
489 WL12XX_CONF_HW_RXTX_RATE_24
,
490 WL12XX_CONF_HW_RXTX_RATE_22
,
491 WL12XX_CONF_HW_RXTX_RATE_18
,
492 WL12XX_CONF_HW_RXTX_RATE_12
,
493 WL12XX_CONF_HW_RXTX_RATE_11
,
494 WL12XX_CONF_HW_RXTX_RATE_9
,
495 WL12XX_CONF_HW_RXTX_RATE_6
,
496 WL12XX_CONF_HW_RXTX_RATE_5_5
,
497 WL12XX_CONF_HW_RXTX_RATE_2
,
498 WL12XX_CONF_HW_RXTX_RATE_1
,
499 WL12XX_CONF_HW_RXTX_RATE_MAX
,
502 static struct wlcore_partition_set wl12xx_ptable
[PART_TABLE_LEN
] = {
509 .start
= REGISTERS_BASE
,
522 [PART_BOOT
] = { /* in wl12xx we can use a mix of work and down
529 .start
= REGISTERS_BASE
,
548 .start
= REGISTERS_BASE
,
581 static const int wl12xx_rtable
[REG_TABLE_LEN
] = {
582 [REG_ECPU_CONTROL
] = WL12XX_REG_ECPU_CONTROL
,
583 [REG_INTERRUPT_NO_CLEAR
] = WL12XX_REG_INTERRUPT_NO_CLEAR
,
584 [REG_INTERRUPT_ACK
] = WL12XX_REG_INTERRUPT_ACK
,
585 [REG_COMMAND_MAILBOX_PTR
] = WL12XX_REG_COMMAND_MAILBOX_PTR
,
586 [REG_EVENT_MAILBOX_PTR
] = WL12XX_REG_EVENT_MAILBOX_PTR
,
587 [REG_INTERRUPT_TRIG
] = WL12XX_REG_INTERRUPT_TRIG
,
588 [REG_INTERRUPT_MASK
] = WL12XX_REG_INTERRUPT_MASK
,
589 [REG_PC_ON_RECOVERY
] = WL12XX_SCR_PAD4
,
590 [REG_CHIP_ID_B
] = WL12XX_CHIP_ID_B
,
591 [REG_CMD_MBOX_ADDRESS
] = WL12XX_CMD_MBOX_ADDRESS
,
593 /* data access memory addresses, used with partition translation */
594 [REG_SLV_MEM_DATA
] = WL1271_SLV_MEM_DATA
,
595 [REG_SLV_REG_DATA
] = WL1271_SLV_REG_DATA
,
597 /* raw data access memory addresses */
598 [REG_RAW_FW_STATUS_ADDR
] = FW_STATUS_ADDR
,
601 /* TODO: maybe move to a new header file? */
602 #define WL127X_FW_NAME_MULTI "ti-connectivity/wl127x-fw-5-mr.bin"
603 #define WL127X_FW_NAME_SINGLE "ti-connectivity/wl127x-fw-5-sr.bin"
604 #define WL127X_PLT_FW_NAME "ti-connectivity/wl127x-fw-5-plt.bin"
606 #define WL128X_FW_NAME_MULTI "ti-connectivity/wl128x-fw-5-mr.bin"
607 #define WL128X_FW_NAME_SINGLE "ti-connectivity/wl128x-fw-5-sr.bin"
608 #define WL128X_PLT_FW_NAME "ti-connectivity/wl128x-fw-5-plt.bin"
610 static int wl127x_prepare_read(struct wl1271
*wl
, u32 rx_desc
, u32 len
)
614 if (wl
->chip
.id
!= CHIP_ID_128X_PG20
) {
615 struct wl1271_acx_mem_map
*wl_mem_map
= wl
->target_mem_map
;
616 struct wl12xx_priv
*priv
= wl
->priv
;
619 * Choose the block we want to read
620 * For aggregated packets, only the first memory block
621 * should be retrieved. The FW takes care of the rest.
623 u32 mem_block
= rx_desc
& RX_MEM_BLOCK_MASK
;
625 priv
->rx_mem_addr
->addr
= (mem_block
<< 8) +
626 le32_to_cpu(wl_mem_map
->packet_memory_pool_start
);
628 priv
->rx_mem_addr
->addr_extra
= priv
->rx_mem_addr
->addr
+ 4;
630 ret
= wlcore_write(wl
, WL1271_SLV_REG_DATA
, priv
->rx_mem_addr
,
631 sizeof(*priv
->rx_mem_addr
), false);
639 static int wl12xx_identify_chip(struct wl1271
*wl
)
643 switch (wl
->chip
.id
) {
644 case CHIP_ID_127X_PG10
:
645 wl1271_warning("chip id 0x%x (1271 PG10) support is obsolete",
648 wl
->quirks
|= WLCORE_QUIRK_LEGACY_NVS
|
649 WLCORE_QUIRK_DUAL_PROBE_TMPL
|
650 WLCORE_QUIRK_TKIP_HEADER_SPACE
|
651 WLCORE_QUIRK_START_STA_FAILS
|
652 WLCORE_QUIRK_AP_ZERO_SESSION_ID
;
653 wl
->sr_fw_name
= WL127X_FW_NAME_SINGLE
;
654 wl
->mr_fw_name
= WL127X_FW_NAME_MULTI
;
655 memcpy(&wl
->conf
.mem
, &wl12xx_default_priv_conf
.mem_wl127x
,
656 sizeof(wl
->conf
.mem
));
658 /* read data preparation is only needed by wl127x */
659 wl
->ops
->prepare_read
= wl127x_prepare_read
;
661 wlcore_set_min_fw_ver(wl
, WL127X_CHIP_VER
,
662 WL127X_IFTYPE_SR_VER
, WL127X_MAJOR_SR_VER
,
663 WL127X_SUBTYPE_SR_VER
, WL127X_MINOR_SR_VER
,
664 WL127X_IFTYPE_MR_VER
, WL127X_MAJOR_MR_VER
,
665 WL127X_SUBTYPE_MR_VER
, WL127X_MINOR_MR_VER
);
668 case CHIP_ID_127X_PG20
:
669 wl1271_debug(DEBUG_BOOT
, "chip id 0x%x (1271 PG20)",
672 wl
->quirks
|= WLCORE_QUIRK_LEGACY_NVS
|
673 WLCORE_QUIRK_DUAL_PROBE_TMPL
|
674 WLCORE_QUIRK_TKIP_HEADER_SPACE
|
675 WLCORE_QUIRK_START_STA_FAILS
|
676 WLCORE_QUIRK_AP_ZERO_SESSION_ID
;
677 wl
->plt_fw_name
= WL127X_PLT_FW_NAME
;
678 wl
->sr_fw_name
= WL127X_FW_NAME_SINGLE
;
679 wl
->mr_fw_name
= WL127X_FW_NAME_MULTI
;
680 memcpy(&wl
->conf
.mem
, &wl12xx_default_priv_conf
.mem_wl127x
,
681 sizeof(wl
->conf
.mem
));
683 /* read data preparation is only needed by wl127x */
684 wl
->ops
->prepare_read
= wl127x_prepare_read
;
686 wlcore_set_min_fw_ver(wl
, WL127X_CHIP_VER
,
687 WL127X_IFTYPE_SR_VER
, WL127X_MAJOR_SR_VER
,
688 WL127X_SUBTYPE_SR_VER
, WL127X_MINOR_SR_VER
,
689 WL127X_IFTYPE_MR_VER
, WL127X_MAJOR_MR_VER
,
690 WL127X_SUBTYPE_MR_VER
, WL127X_MINOR_MR_VER
);
693 case CHIP_ID_128X_PG20
:
694 wl1271_debug(DEBUG_BOOT
, "chip id 0x%x (1283 PG20)",
696 wl
->plt_fw_name
= WL128X_PLT_FW_NAME
;
697 wl
->sr_fw_name
= WL128X_FW_NAME_SINGLE
;
698 wl
->mr_fw_name
= WL128X_FW_NAME_MULTI
;
700 /* wl128x requires TX blocksize alignment */
701 wl
->quirks
|= WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN
|
702 WLCORE_QUIRK_DUAL_PROBE_TMPL
|
703 WLCORE_QUIRK_TKIP_HEADER_SPACE
|
704 WLCORE_QUIRK_START_STA_FAILS
|
705 WLCORE_QUIRK_AP_ZERO_SESSION_ID
;
707 wlcore_set_min_fw_ver(wl
, WL128X_CHIP_VER
,
708 WL128X_IFTYPE_SR_VER
, WL128X_MAJOR_SR_VER
,
709 WL128X_SUBTYPE_SR_VER
, WL128X_MINOR_SR_VER
,
710 WL128X_IFTYPE_MR_VER
, WL128X_MAJOR_MR_VER
,
711 WL128X_SUBTYPE_MR_VER
, WL128X_MINOR_MR_VER
);
713 case CHIP_ID_128X_PG10
:
715 wl1271_warning("unsupported chip id: 0x%x", wl
->chip
.id
);
720 wl
->fw_mem_block_size
= 256;
721 wl
->fwlog_end
= 0x2000000;
723 /* common settings */
724 wl
->scan_templ_id_2_4
= CMD_TEMPL_APP_PROBE_REQ_2_4_LEGACY
;
725 wl
->scan_templ_id_5
= CMD_TEMPL_APP_PROBE_REQ_5_LEGACY
;
726 wl
->sched_scan_templ_id_2_4
= CMD_TEMPL_CFG_PROBE_REQ_2_4
;
727 wl
->sched_scan_templ_id_5
= CMD_TEMPL_CFG_PROBE_REQ_5
;
728 wl
->max_channels_5
= WL12XX_MAX_CHANNELS_5GHZ
;
729 wl
->ba_rx_session_count_max
= WL12XX_RX_BA_MAX_SESSIONS
;
734 static int __must_check
wl12xx_top_reg_write(struct wl1271
*wl
, int addr
,
739 /* write address >> 1 + 0x30000 to OCP_POR_CTR */
740 addr
= (addr
>> 1) + 0x30000;
741 ret
= wlcore_write32(wl
, WL12XX_OCP_POR_CTR
, addr
);
745 /* write value to OCP_POR_WDATA */
746 ret
= wlcore_write32(wl
, WL12XX_OCP_DATA_WRITE
, val
);
750 /* write 1 to OCP_CMD */
751 ret
= wlcore_write32(wl
, WL12XX_OCP_CMD
, OCP_CMD_WRITE
);
759 static int __must_check
wl12xx_top_reg_read(struct wl1271
*wl
, int addr
,
763 int timeout
= OCP_CMD_LOOP
;
766 /* write address >> 1 + 0x30000 to OCP_POR_CTR */
767 addr
= (addr
>> 1) + 0x30000;
768 ret
= wlcore_write32(wl
, WL12XX_OCP_POR_CTR
, addr
);
772 /* write 2 to OCP_CMD */
773 ret
= wlcore_write32(wl
, WL12XX_OCP_CMD
, OCP_CMD_READ
);
777 /* poll for data ready */
779 ret
= wlcore_read32(wl
, WL12XX_OCP_DATA_READ
, &val
);
782 } while (!(val
& OCP_READY_MASK
) && --timeout
);
785 wl1271_warning("Top register access timed out.");
789 /* check data status and return if OK */
790 if ((val
& OCP_STATUS_MASK
) != OCP_STATUS_OK
) {
791 wl1271_warning("Top register access returned error.");
801 static int wl128x_switch_tcxo_to_fref(struct wl1271
*wl
)
806 /* Mask bits [2] & [8:4] in the sys_clk_cfg register */
807 ret
= wl12xx_top_reg_read(wl
, WL_SPARE_REG
, &spare_reg
);
811 if (spare_reg
== 0xFFFF)
813 spare_reg
|= (BIT(3) | BIT(5) | BIT(6));
814 ret
= wl12xx_top_reg_write(wl
, WL_SPARE_REG
, spare_reg
);
818 /* Enable FREF_CLK_REQ & mux MCS and coex PLLs to FREF */
819 ret
= wl12xx_top_reg_write(wl
, SYS_CLK_CFG_REG
,
820 WL_CLK_REQ_TYPE_PG2
| MCS_PLL_CLK_SEL_FREF
);
824 /* Delay execution for 15msec, to let the HW settle */
830 static bool wl128x_is_tcxo_valid(struct wl1271
*wl
)
835 ret
= wl12xx_top_reg_read(wl
, TCXO_CLK_DETECT_REG
, &tcxo_detection
);
839 if (tcxo_detection
& TCXO_DET_FAILED
)
845 static bool wl128x_is_fref_valid(struct wl1271
*wl
)
850 ret
= wl12xx_top_reg_read(wl
, FREF_CLK_DETECT_REG
, &fref_detection
);
854 if (fref_detection
& FREF_CLK_DETECT_FAIL
)
860 static int wl128x_manually_configure_mcs_pll(struct wl1271
*wl
)
864 ret
= wl12xx_top_reg_write(wl
, MCS_PLL_M_REG
, MCS_PLL_M_REG_VAL
);
868 ret
= wl12xx_top_reg_write(wl
, MCS_PLL_N_REG
, MCS_PLL_N_REG_VAL
);
872 ret
= wl12xx_top_reg_write(wl
, MCS_PLL_CONFIG_REG
,
873 MCS_PLL_CONFIG_REG_VAL
);
879 static int wl128x_configure_mcs_pll(struct wl1271
*wl
, int clk
)
884 struct wl12xx_priv
*priv
= wl
->priv
;
887 /* Mask bits [3:1] in the sys_clk_cfg register */
888 ret
= wl12xx_top_reg_read(wl
, WL_SPARE_REG
, &spare_reg
);
892 if (spare_reg
== 0xFFFF)
895 ret
= wl12xx_top_reg_write(wl
, WL_SPARE_REG
, spare_reg
);
899 /* Handle special cases of the TCXO clock */
900 if (priv
->tcxo_clock
== WL12XX_TCXOCLOCK_16_8
||
901 priv
->tcxo_clock
== WL12XX_TCXOCLOCK_33_6
)
902 return wl128x_manually_configure_mcs_pll(wl
);
904 /* Set the input frequency according to the selected clock source */
905 input_freq
= (clk
& 1) + 1;
907 ret
= wl12xx_top_reg_read(wl
, MCS_PLL_CONFIG_REG
, &pll_config
);
911 if (pll_config
== 0xFFFF)
913 pll_config
|= (input_freq
<< MCS_SEL_IN_FREQ_SHIFT
);
914 pll_config
|= MCS_PLL_ENABLE_HP
;
915 ret
= wl12xx_top_reg_write(wl
, MCS_PLL_CONFIG_REG
, pll_config
);
921 * WL128x has two clocks input - TCXO and FREF.
922 * TCXO is the main clock of the device, while FREF is used to sync
923 * between the GPS and the cellular modem.
924 * In cases where TCXO is 32.736MHz or 16.368MHz, the FREF will be used
925 * as the WLAN/BT main clock.
927 static int wl128x_boot_clk(struct wl1271
*wl
, int *selected_clock
)
929 struct wl12xx_priv
*priv
= wl
->priv
;
933 /* For XTAL-only modes, FREF will be used after switching from TCXO */
934 if (priv
->ref_clock
== WL12XX_REFCLOCK_26_XTAL
||
935 priv
->ref_clock
== WL12XX_REFCLOCK_38_XTAL
) {
936 if (!wl128x_switch_tcxo_to_fref(wl
))
941 /* Query the HW, to determine which clock source we should use */
942 ret
= wl12xx_top_reg_read(wl
, SYS_CLK_CFG_REG
, &sys_clk_cfg
);
946 if (sys_clk_cfg
== 0xFFFF)
948 if (sys_clk_cfg
& PRCM_CM_EN_MUX_WLAN_FREF
)
951 /* If TCXO is either 32.736MHz or 16.368MHz, switch to FREF */
952 if (priv
->tcxo_clock
== WL12XX_TCXOCLOCK_16_368
||
953 priv
->tcxo_clock
== WL12XX_TCXOCLOCK_32_736
) {
954 if (!wl128x_switch_tcxo_to_fref(wl
))
959 /* TCXO clock is selected */
960 if (!wl128x_is_tcxo_valid(wl
))
962 *selected_clock
= priv
->tcxo_clock
;
966 /* FREF clock is selected */
967 if (!wl128x_is_fref_valid(wl
))
969 *selected_clock
= priv
->ref_clock
;
972 return wl128x_configure_mcs_pll(wl
, *selected_clock
);
975 static int wl127x_boot_clk(struct wl1271
*wl
)
977 struct wl12xx_priv
*priv
= wl
->priv
;
982 if (WL127X_PG_GET_MAJOR(wl
->hw_pg_ver
) < 3)
983 wl
->quirks
|= WLCORE_QUIRK_END_OF_TRANSACTION
;
985 if (priv
->ref_clock
== CONF_REF_CLK_19_2_E
||
986 priv
->ref_clock
== CONF_REF_CLK_38_4_E
||
987 priv
->ref_clock
== CONF_REF_CLK_38_4_M_XTAL
)
988 /* ref clk: 19.2/38.4/38.4-XTAL */
990 else if (priv
->ref_clock
== CONF_REF_CLK_26_E
||
991 priv
->ref_clock
== CONF_REF_CLK_26_M_XTAL
||
992 priv
->ref_clock
== CONF_REF_CLK_52_E
)
998 if (priv
->ref_clock
!= CONF_REF_CLK_19_2_E
) {
1000 /* Set clock type (open drain) */
1001 ret
= wl12xx_top_reg_read(wl
, OCP_REG_CLK_TYPE
, &val
);
1005 val
&= FREF_CLK_TYPE_BITS
;
1006 ret
= wl12xx_top_reg_write(wl
, OCP_REG_CLK_TYPE
, val
);
1010 /* Set clock pull mode (no pull) */
1011 ret
= wl12xx_top_reg_read(wl
, OCP_REG_CLK_PULL
, &val
);
1016 ret
= wl12xx_top_reg_write(wl
, OCP_REG_CLK_PULL
, val
);
1021 /* Set clock polarity */
1022 ret
= wl12xx_top_reg_read(wl
, OCP_REG_CLK_POLARITY
, &val
);
1026 val
&= FREF_CLK_POLARITY_BITS
;
1027 val
|= CLK_REQ_OUTN_SEL
;
1028 ret
= wl12xx_top_reg_write(wl
, OCP_REG_CLK_POLARITY
, val
);
1033 ret
= wlcore_write32(wl
, WL12XX_PLL_PARAMETERS
, clk
);
1037 ret
= wlcore_read32(wl
, WL12XX_PLL_PARAMETERS
, &pause
);
1041 wl1271_debug(DEBUG_BOOT
, "pause1 0x%x", pause
);
1043 pause
&= ~(WU_COUNTER_PAUSE_VAL
);
1044 pause
|= WU_COUNTER_PAUSE_VAL
;
1045 ret
= wlcore_write32(wl
, WL12XX_WU_COUNTER_PAUSE
, pause
);
1051 static int wl1271_boot_soft_reset(struct wl1271
*wl
)
1053 unsigned long timeout
;
1057 /* perform soft reset */
1058 ret
= wlcore_write32(wl
, WL12XX_SLV_SOFT_RESET
, ACX_SLV_SOFT_RESET_BIT
);
1062 /* SOFT_RESET is self clearing */
1063 timeout
= jiffies
+ usecs_to_jiffies(SOFT_RESET_MAX_TIME
);
1065 ret
= wlcore_read32(wl
, WL12XX_SLV_SOFT_RESET
, &boot_data
);
1069 wl1271_debug(DEBUG_BOOT
, "soft reset bootdata 0x%x", boot_data
);
1070 if ((boot_data
& ACX_SLV_SOFT_RESET_BIT
) == 0)
1073 if (time_after(jiffies
, timeout
)) {
1074 /* 1.2 check pWhalBus->uSelfClearTime if the
1075 * timeout was reached */
1076 wl1271_error("soft reset timeout");
1080 udelay(SOFT_RESET_STALL_TIME
);
1084 ret
= wlcore_write32(wl
, WL12XX_ENABLE
, 0x0);
1088 /* disable auto calibration on start*/
1089 ret
= wlcore_write32(wl
, WL12XX_SPARE_A2
, 0xffff);
1095 static int wl12xx_pre_boot(struct wl1271
*wl
)
1097 struct wl12xx_priv
*priv
= wl
->priv
;
1100 int selected_clock
= -1;
1102 if (wl
->chip
.id
== CHIP_ID_128X_PG20
) {
1103 ret
= wl128x_boot_clk(wl
, &selected_clock
);
1107 ret
= wl127x_boot_clk(wl
);
1112 /* Continue the ELP wake up sequence */
1113 ret
= wlcore_write32(wl
, WL12XX_WELP_ARM_COMMAND
, WELP_ARM_COMMAND_VAL
);
1119 ret
= wlcore_set_partition(wl
, &wl
->ptable
[PART_DRPW
]);
1123 /* Read-modify-write DRPW_SCRATCH_START register (see next state)
1124 to be used by DRPw FW. The RTRIM value will be added by the FW
1125 before taking DRPw out of reset */
1127 ret
= wlcore_read32(wl
, WL12XX_DRPW_SCRATCH_START
, &clk
);
1131 wl1271_debug(DEBUG_BOOT
, "clk2 0x%x", clk
);
1133 if (wl
->chip
.id
== CHIP_ID_128X_PG20
)
1134 clk
|= ((selected_clock
& 0x3) << 1) << 4;
1136 clk
|= (priv
->ref_clock
<< 1) << 4;
1138 ret
= wlcore_write32(wl
, WL12XX_DRPW_SCRATCH_START
, clk
);
1142 ret
= wlcore_set_partition(wl
, &wl
->ptable
[PART_WORK
]);
1146 /* Disable interrupts */
1147 ret
= wlcore_write_reg(wl
, REG_INTERRUPT_MASK
, WL1271_ACX_INTR_ALL
);
1151 ret
= wl1271_boot_soft_reset(wl
);
1159 static int wl12xx_pre_upload(struct wl1271
*wl
)
1165 /* write firmware's last address (ie. it's length) to
1166 * ACX_EEPROMLESS_IND_REG */
1167 wl1271_debug(DEBUG_BOOT
, "ACX_EEPROMLESS_IND_REG");
1169 ret
= wlcore_write32(wl
, WL12XX_EEPROMLESS_IND
, WL12XX_EEPROMLESS_IND
);
1173 ret
= wlcore_read_reg(wl
, REG_CHIP_ID_B
, &tmp
);
1177 wl1271_debug(DEBUG_BOOT
, "chip id 0x%x", tmp
);
1179 /* 6. read the EEPROM parameters */
1180 ret
= wlcore_read32(wl
, WL12XX_SCR_PAD2
, &tmp
);
1184 /* WL1271: The reference driver skips steps 7 to 10 (jumps directly
1187 if (wl
->chip
.id
== CHIP_ID_128X_PG20
) {
1188 ret
= wl12xx_top_reg_write(wl
, SDIO_IO_DS
, HCI_IO_DS_6MA
);
1193 /* polarity must be set before the firmware is loaded */
1194 ret
= wl12xx_top_reg_read(wl
, OCP_REG_POLARITY
, &polarity
);
1198 /* We use HIGH polarity, so unset the LOW bit */
1199 polarity
&= ~POLARITY_LOW
;
1200 ret
= wl12xx_top_reg_write(wl
, OCP_REG_POLARITY
, polarity
);
1206 static int wl12xx_enable_interrupts(struct wl1271
*wl
)
1210 ret
= wlcore_write_reg(wl
, REG_INTERRUPT_MASK
,
1211 WL12XX_ACX_ALL_EVENTS_VECTOR
);
1215 wlcore_enable_interrupts(wl
);
1216 ret
= wlcore_write_reg(wl
, REG_INTERRUPT_MASK
,
1217 WL1271_ACX_INTR_ALL
& ~(WL12XX_INTR_MASK
));
1219 goto disable_interrupts
;
1221 ret
= wlcore_write32(wl
, WL12XX_HI_CFG
, HI_CFG_DEF_VAL
);
1223 goto disable_interrupts
;
1228 wlcore_disable_interrupts(wl
);
1234 static int wl12xx_boot(struct wl1271
*wl
)
1238 ret
= wl12xx_pre_boot(wl
);
1242 ret
= wlcore_boot_upload_nvs(wl
);
1246 ret
= wl12xx_pre_upload(wl
);
1250 ret
= wlcore_boot_upload_firmware(wl
);
1254 wl
->event_mask
= BSS_LOSE_EVENT_ID
|
1255 REGAINED_BSS_EVENT_ID
|
1256 SCAN_COMPLETE_EVENT_ID
|
1257 ROLE_STOP_COMPLETE_EVENT_ID
|
1258 RSSI_SNR_TRIGGER_0_EVENT_ID
|
1259 PSPOLL_DELIVERY_FAILURE_EVENT_ID
|
1260 SOFT_GEMINI_SENSE_EVENT_ID
|
1261 PERIODIC_SCAN_REPORT_EVENT_ID
|
1262 PERIODIC_SCAN_COMPLETE_EVENT_ID
|
1263 DUMMY_PACKET_EVENT_ID
|
1264 PEER_REMOVE_COMPLETE_EVENT_ID
|
1265 BA_SESSION_RX_CONSTRAINT_EVENT_ID
|
1266 REMAIN_ON_CHANNEL_COMPLETE_EVENT_ID
|
1267 INACTIVE_STA_EVENT_ID
|
1268 CHANNEL_SWITCH_COMPLETE_EVENT_ID
;
1270 wl
->ap_event_mask
= MAX_TX_RETRY_EVENT_ID
;
1272 ret
= wlcore_boot_run_firmware(wl
);
1276 ret
= wl12xx_enable_interrupts(wl
);
1282 static int wl12xx_trigger_cmd(struct wl1271
*wl
, int cmd_box_addr
,
1283 void *buf
, size_t len
)
1287 ret
= wlcore_write(wl
, cmd_box_addr
, buf
, len
, false);
1291 ret
= wlcore_write_reg(wl
, REG_INTERRUPT_TRIG
, WL12XX_INTR_TRIG_CMD
);
1296 static int wl12xx_ack_event(struct wl1271
*wl
)
1298 return wlcore_write_reg(wl
, REG_INTERRUPT_TRIG
,
1299 WL12XX_INTR_TRIG_EVENT_ACK
);
1302 static u32
wl12xx_calc_tx_blocks(struct wl1271
*wl
, u32 len
, u32 spare_blks
)
1304 u32 blk_size
= WL12XX_TX_HW_BLOCK_SIZE
;
1305 u32 align_len
= wlcore_calc_packet_alignment(wl
, len
);
1307 return (align_len
+ blk_size
- 1) / blk_size
+ spare_blks
;
1311 wl12xx_set_tx_desc_blocks(struct wl1271
*wl
, struct wl1271_tx_hw_descr
*desc
,
1312 u32 blks
, u32 spare_blks
)
1314 if (wl
->chip
.id
== CHIP_ID_128X_PG20
) {
1315 desc
->wl128x_mem
.total_mem_blocks
= blks
;
1317 desc
->wl127x_mem
.extra_blocks
= spare_blks
;
1318 desc
->wl127x_mem
.total_mem_blocks
= blks
;
1323 wl12xx_set_tx_desc_data_len(struct wl1271
*wl
, struct wl1271_tx_hw_descr
*desc
,
1324 struct sk_buff
*skb
)
1326 u32 aligned_len
= wlcore_calc_packet_alignment(wl
, skb
->len
);
1328 if (wl
->chip
.id
== CHIP_ID_128X_PG20
) {
1329 desc
->wl128x_mem
.extra_bytes
= aligned_len
- skb
->len
;
1330 desc
->length
= cpu_to_le16(aligned_len
>> 2);
1332 wl1271_debug(DEBUG_TX
,
1333 "tx_fill_hdr: hlid: %d len: %d life: %d mem: %d extra: %d",
1335 le16_to_cpu(desc
->length
),
1336 le16_to_cpu(desc
->life_time
),
1337 desc
->wl128x_mem
.total_mem_blocks
,
1338 desc
->wl128x_mem
.extra_bytes
);
1340 /* calculate number of padding bytes */
1341 int pad
= aligned_len
- skb
->len
;
1343 cpu_to_le16(pad
<< TX_HW_ATTR_OFST_LAST_WORD_PAD
);
1345 /* Store the aligned length in terms of words */
1346 desc
->length
= cpu_to_le16(aligned_len
>> 2);
1348 wl1271_debug(DEBUG_TX
,
1349 "tx_fill_hdr: pad: %d hlid: %d len: %d life: %d mem: %d",
1351 le16_to_cpu(desc
->length
),
1352 le16_to_cpu(desc
->life_time
),
1353 desc
->wl127x_mem
.total_mem_blocks
);
1357 static enum wl_rx_buf_align
1358 wl12xx_get_rx_buf_align(struct wl1271
*wl
, u32 rx_desc
)
1360 if (rx_desc
& RX_BUF_UNALIGNED_PAYLOAD
)
1361 return WLCORE_RX_BUF_UNALIGNED
;
1363 return WLCORE_RX_BUF_ALIGNED
;
1366 static u32
wl12xx_get_rx_packet_len(struct wl1271
*wl
, void *rx_data
,
1369 struct wl1271_rx_descriptor
*desc
= rx_data
;
1371 /* invalid packet */
1372 if (data_len
< sizeof(*desc
) ||
1373 data_len
< sizeof(*desc
) + desc
->pad_len
)
1376 return data_len
- sizeof(*desc
) - desc
->pad_len
;
1379 static int wl12xx_tx_delayed_compl(struct wl1271
*wl
)
1381 if (wl
->fw_status
->tx_results_counter
==
1382 (wl
->tx_results_count
& 0xff))
1385 return wlcore_tx_complete(wl
);
1388 static int wl12xx_hw_init(struct wl1271
*wl
)
1392 if (wl
->chip
.id
== CHIP_ID_128X_PG20
) {
1393 u32 host_cfg_bitmap
= HOST_IF_CFG_RX_FIFO_ENABLE
;
1395 ret
= wl128x_cmd_general_parms(wl
);
1400 * If we are in calibrator based auto detect then we got the FEM nr
1401 * in wl->fem_manuf. No need to continue further
1403 if (wl
->plt_mode
== PLT_FEM_DETECT
)
1406 ret
= wl128x_cmd_radio_parms(wl
);
1410 if (wl
->quirks
& WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN
)
1411 /* Enable SDIO padding */
1412 host_cfg_bitmap
|= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK
;
1414 /* Must be before wl1271_acx_init_mem_config() */
1415 ret
= wl1271_acx_host_if_cfg_bitmap(wl
, host_cfg_bitmap
);
1419 ret
= wl1271_cmd_general_parms(wl
);
1424 * If we are in calibrator based auto detect then we got the FEM nr
1425 * in wl->fem_manuf. No need to continue further
1427 if (wl
->plt_mode
== PLT_FEM_DETECT
)
1430 ret
= wl1271_cmd_radio_parms(wl
);
1433 ret
= wl1271_cmd_ext_radio_parms(wl
);
1441 static void wl12xx_convert_fw_status(struct wl1271
*wl
, void *raw_fw_status
,
1442 struct wl_fw_status
*fw_status
)
1444 struct wl12xx_fw_status
*int_fw_status
= raw_fw_status
;
1446 fw_status
->intr
= le32_to_cpu(int_fw_status
->intr
);
1447 fw_status
->fw_rx_counter
= int_fw_status
->fw_rx_counter
;
1448 fw_status
->drv_rx_counter
= int_fw_status
->drv_rx_counter
;
1449 fw_status
->tx_results_counter
= int_fw_status
->tx_results_counter
;
1450 fw_status
->rx_pkt_descs
= int_fw_status
->rx_pkt_descs
;
1452 fw_status
->fw_localtime
= le32_to_cpu(int_fw_status
->fw_localtime
);
1453 fw_status
->link_ps_bitmap
= le32_to_cpu(int_fw_status
->link_ps_bitmap
);
1454 fw_status
->link_fast_bitmap
=
1455 le32_to_cpu(int_fw_status
->link_fast_bitmap
);
1456 fw_status
->total_released_blks
=
1457 le32_to_cpu(int_fw_status
->total_released_blks
);
1458 fw_status
->tx_total
= le32_to_cpu(int_fw_status
->tx_total
);
1460 fw_status
->counters
.tx_released_pkts
=
1461 int_fw_status
->counters
.tx_released_pkts
;
1462 fw_status
->counters
.tx_lnk_free_pkts
=
1463 int_fw_status
->counters
.tx_lnk_free_pkts
;
1464 fw_status
->counters
.tx_voice_released_blks
=
1465 int_fw_status
->counters
.tx_voice_released_blks
;
1466 fw_status
->counters
.tx_last_rate
=
1467 int_fw_status
->counters
.tx_last_rate
;
1469 fw_status
->log_start_addr
= le32_to_cpu(int_fw_status
->log_start_addr
);
1472 static u32
wl12xx_sta_get_ap_rate_mask(struct wl1271
*wl
,
1473 struct wl12xx_vif
*wlvif
)
1475 return wlvif
->rate_set
;
1478 static void wl12xx_conf_init(struct wl1271
*wl
)
1480 struct wl12xx_priv
*priv
= wl
->priv
;
1482 /* apply driver default configuration */
1483 memcpy(&wl
->conf
, &wl12xx_conf
, sizeof(wl12xx_conf
));
1485 /* apply default private configuration */
1486 memcpy(&priv
->conf
, &wl12xx_default_priv_conf
, sizeof(priv
->conf
));
1489 static bool wl12xx_mac_in_fuse(struct wl1271
*wl
)
1491 bool supported
= false;
1494 if (wl
->chip
.id
== CHIP_ID_128X_PG20
) {
1495 major
= WL128X_PG_GET_MAJOR(wl
->hw_pg_ver
);
1496 minor
= WL128X_PG_GET_MINOR(wl
->hw_pg_ver
);
1498 /* in wl128x we have the MAC address if the PG is >= (2, 1) */
1499 if (major
> 2 || (major
== 2 && minor
>= 1))
1502 major
= WL127X_PG_GET_MAJOR(wl
->hw_pg_ver
);
1503 minor
= WL127X_PG_GET_MINOR(wl
->hw_pg_ver
);
1505 /* in wl127x we have the MAC address if the PG is >= (3, 1) */
1506 if (major
== 3 && minor
>= 1)
1510 wl1271_debug(DEBUG_PROBE
,
1511 "PG Ver major = %d minor = %d, MAC %s present",
1512 major
, minor
, supported
? "is" : "is not");
1517 static int wl12xx_get_fuse_mac(struct wl1271
*wl
)
1522 ret
= wlcore_set_partition(wl
, &wl
->ptable
[PART_DRPW
]);
1526 ret
= wlcore_read32(wl
, WL12XX_REG_FUSE_BD_ADDR_1
, &mac1
);
1530 ret
= wlcore_read32(wl
, WL12XX_REG_FUSE_BD_ADDR_2
, &mac2
);
1534 /* these are the two parts of the BD_ADDR */
1535 wl
->fuse_oui_addr
= ((mac2
& 0xffff) << 8) +
1536 ((mac1
& 0xff000000) >> 24);
1537 wl
->fuse_nic_addr
= mac1
& 0xffffff;
1539 ret
= wlcore_set_partition(wl
, &wl
->ptable
[PART_DOWN
]);
1545 static int wl12xx_get_pg_ver(struct wl1271
*wl
, s8
*ver
)
1550 if (wl
->chip
.id
== CHIP_ID_128X_PG20
)
1551 ret
= wl12xx_top_reg_read(wl
, WL128X_REG_FUSE_DATA_2_1
,
1554 ret
= wl12xx_top_reg_read(wl
, WL127X_REG_FUSE_DATA_2_1
,
1557 if (ret
>= 0 && ver
)
1558 *ver
= (s8
)((die_info
& PG_VER_MASK
) >> PG_VER_OFFSET
);
1563 static int wl12xx_get_mac(struct wl1271
*wl
)
1565 if (wl12xx_mac_in_fuse(wl
))
1566 return wl12xx_get_fuse_mac(wl
);
1571 static void wl12xx_set_tx_desc_csum(struct wl1271
*wl
,
1572 struct wl1271_tx_hw_descr
*desc
,
1573 struct sk_buff
*skb
)
1575 desc
->wl12xx_reserved
= 0;
1578 static int wl12xx_plt_init(struct wl1271
*wl
)
1582 ret
= wl
->ops
->boot(wl
);
1586 ret
= wl
->ops
->hw_init(wl
);
1588 goto out_irq_disable
;
1591 * If we are in calibrator based auto detect then we got the FEM nr
1592 * in wl->fem_manuf. No need to continue further
1594 if (wl
->plt_mode
== PLT_FEM_DETECT
)
1597 ret
= wl1271_acx_init_mem_config(wl
);
1599 goto out_irq_disable
;
1601 ret
= wl12xx_acx_mem_cfg(wl
);
1603 goto out_free_memmap
;
1605 /* Enable data path */
1606 ret
= wl1271_cmd_data_path(wl
, 1);
1608 goto out_free_memmap
;
1610 /* Configure for CAM power saving (ie. always active) */
1611 ret
= wl1271_acx_sleep_auth(wl
, WL1271_PSM_CAM
);
1613 goto out_free_memmap
;
1616 ret
= wl1271_acx_pm_config(wl
);
1618 goto out_free_memmap
;
1623 kfree(wl
->target_mem_map
);
1624 wl
->target_mem_map
= NULL
;
1627 mutex_unlock(&wl
->mutex
);
1628 /* Unlocking the mutex in the middle of handling is
1629 inherently unsafe. In this case we deem it safe to do,
1630 because we need to let any possibly pending IRQ out of
1631 the system (and while we are WL1271_STATE_OFF the IRQ
1632 work function will not do anything.) Also, any other
1633 possible concurrent operations will fail due to the
1634 current state, hence the wl1271 struct should be safe. */
1635 wlcore_disable_interrupts(wl
);
1636 mutex_lock(&wl
->mutex
);
1641 static int wl12xx_get_spare_blocks(struct wl1271
*wl
, bool is_gem
)
1644 return WL12XX_TX_HW_BLOCK_GEM_SPARE
;
1646 return WL12XX_TX_HW_BLOCK_SPARE_DEFAULT
;
1649 static int wl12xx_set_key(struct wl1271
*wl
, enum set_key_cmd cmd
,
1650 struct ieee80211_vif
*vif
,
1651 struct ieee80211_sta
*sta
,
1652 struct ieee80211_key_conf
*key_conf
)
1654 return wlcore_set_key(wl
, cmd
, vif
, sta
, key_conf
);
1657 static int wl12xx_set_peer_cap(struct wl1271
*wl
,
1658 struct ieee80211_sta_ht_cap
*ht_cap
,
1659 bool allow_ht_operation
,
1660 u32 rate_set
, u8 hlid
)
1662 return wl1271_acx_set_ht_capabilities(wl
, ht_cap
, allow_ht_operation
,
1666 static bool wl12xx_lnk_high_prio(struct wl1271
*wl
, u8 hlid
,
1667 struct wl1271_link
*lnk
)
1671 if (test_bit(hlid
, &wl
->fw_fast_lnk_map
))
1672 thold
= wl
->conf
.tx
.fast_link_thold
;
1674 thold
= wl
->conf
.tx
.slow_link_thold
;
1676 return lnk
->allocated_pkts
< thold
;
1679 static bool wl12xx_lnk_low_prio(struct wl1271
*wl
, u8 hlid
,
1680 struct wl1271_link
*lnk
)
1682 /* any link is good for low priority */
1686 static u32
wl12xx_convert_hwaddr(struct wl1271
*wl
, u32 hwaddr
)
1691 static int wl12xx_setup(struct wl1271
*wl
);
1693 static struct wlcore_ops wl12xx_ops
= {
1694 .setup
= wl12xx_setup
,
1695 .identify_chip
= wl12xx_identify_chip
,
1696 .boot
= wl12xx_boot
,
1697 .plt_init
= wl12xx_plt_init
,
1698 .trigger_cmd
= wl12xx_trigger_cmd
,
1699 .ack_event
= wl12xx_ack_event
,
1700 .wait_for_event
= wl12xx_wait_for_event
,
1701 .process_mailbox_events
= wl12xx_process_mailbox_events
,
1702 .calc_tx_blocks
= wl12xx_calc_tx_blocks
,
1703 .set_tx_desc_blocks
= wl12xx_set_tx_desc_blocks
,
1704 .set_tx_desc_data_len
= wl12xx_set_tx_desc_data_len
,
1705 .get_rx_buf_align
= wl12xx_get_rx_buf_align
,
1706 .get_rx_packet_len
= wl12xx_get_rx_packet_len
,
1707 .tx_immediate_compl
= NULL
,
1708 .tx_delayed_compl
= wl12xx_tx_delayed_compl
,
1709 .hw_init
= wl12xx_hw_init
,
1711 .convert_fw_status
= wl12xx_convert_fw_status
,
1712 .sta_get_ap_rate_mask
= wl12xx_sta_get_ap_rate_mask
,
1713 .get_pg_ver
= wl12xx_get_pg_ver
,
1714 .get_mac
= wl12xx_get_mac
,
1715 .set_tx_desc_csum
= wl12xx_set_tx_desc_csum
,
1716 .set_rx_csum
= NULL
,
1717 .ap_get_mimo_wide_rate_mask
= NULL
,
1718 .debugfs_init
= wl12xx_debugfs_add_files
,
1719 .scan_start
= wl12xx_scan_start
,
1720 .scan_stop
= wl12xx_scan_stop
,
1721 .sched_scan_start
= wl12xx_sched_scan_start
,
1722 .sched_scan_stop
= wl12xx_scan_sched_scan_stop
,
1723 .get_spare_blocks
= wl12xx_get_spare_blocks
,
1724 .set_key
= wl12xx_set_key
,
1725 .channel_switch
= wl12xx_cmd_channel_switch
,
1726 .pre_pkt_send
= NULL
,
1727 .set_peer_cap
= wl12xx_set_peer_cap
,
1728 .convert_hwaddr
= wl12xx_convert_hwaddr
,
1729 .lnk_high_prio
= wl12xx_lnk_high_prio
,
1730 .lnk_low_prio
= wl12xx_lnk_low_prio
,
1731 .interrupt_notify
= NULL
,
1732 .rx_ba_filter
= NULL
,
1736 static struct ieee80211_sta_ht_cap wl12xx_ht_cap
= {
1737 .cap
= IEEE80211_HT_CAP_GRN_FLD
| IEEE80211_HT_CAP_SGI_20
|
1738 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT
),
1739 .ht_supported
= true,
1740 .ampdu_factor
= IEEE80211_HT_MAX_AMPDU_8K
,
1741 .ampdu_density
= IEEE80211_HT_MPDU_DENSITY_8
,
1743 .rx_mask
= { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
1744 .rx_highest
= cpu_to_le16(72),
1745 .tx_params
= IEEE80211_HT_MCS_TX_DEFINED
,
1749 static const struct ieee80211_iface_limit wl12xx_iface_limits
[] = {
1752 .types
= BIT(NL80211_IFTYPE_STATION
),
1756 .types
= BIT(NL80211_IFTYPE_AP
) |
1757 BIT(NL80211_IFTYPE_P2P_GO
) |
1758 BIT(NL80211_IFTYPE_P2P_CLIENT
),
1762 static const struct ieee80211_iface_combination
1763 wl12xx_iface_combinations
[] = {
1765 .max_interfaces
= 3,
1766 .limits
= wl12xx_iface_limits
,
1767 .n_limits
= ARRAY_SIZE(wl12xx_iface_limits
),
1768 .num_different_channels
= 1,
1772 static const struct wl12xx_clock wl12xx_refclock_table
[] = {
1773 { 19200000, false, WL12XX_REFCLOCK_19
},
1774 { 26000000, false, WL12XX_REFCLOCK_26
},
1775 { 26000000, true, WL12XX_REFCLOCK_26_XTAL
},
1776 { 38400000, false, WL12XX_REFCLOCK_38
},
1777 { 38400000, true, WL12XX_REFCLOCK_38_XTAL
},
1778 { 52000000, false, WL12XX_REFCLOCK_52
},
1782 static const struct wl12xx_clock wl12xx_tcxoclock_table
[] = {
1783 { 16368000, true, WL12XX_TCXOCLOCK_16_368
},
1784 { 16800000, true, WL12XX_TCXOCLOCK_16_8
},
1785 { 19200000, true, WL12XX_TCXOCLOCK_19_2
},
1786 { 26000000, true, WL12XX_TCXOCLOCK_26
},
1787 { 32736000, true, WL12XX_TCXOCLOCK_32_736
},
1788 { 33600000, true, WL12XX_TCXOCLOCK_33_6
},
1789 { 38400000, true, WL12XX_TCXOCLOCK_38_4
},
1790 { 52000000, true, WL12XX_TCXOCLOCK_52
},
1794 static int wl12xx_get_clock_idx(const struct wl12xx_clock
*table
,
1795 u32 freq
, bool xtal
)
1799 for (i
= 0; table
[i
].freq
!= 0; i
++)
1800 if ((table
[i
].freq
== freq
) && (table
[i
].xtal
== xtal
))
1801 return table
[i
].hw_idx
;
1806 static int wl12xx_setup(struct wl1271
*wl
)
1808 struct wl12xx_priv
*priv
= wl
->priv
;
1809 struct wlcore_platdev_data
*pdev_data
= dev_get_platdata(&wl
->pdev
->dev
);
1811 BUILD_BUG_ON(WL12XX_MAX_LINKS
> WLCORE_MAX_LINKS
);
1812 BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS
> WL12XX_MAX_LINKS
);
1813 BUILD_BUG_ON(WL12XX_CONF_SG_PARAMS_MAX
> WLCORE_CONF_SG_PARAMS_MAX
);
1815 wl
->rtable
= wl12xx_rtable
;
1816 wl
->num_tx_desc
= WL12XX_NUM_TX_DESCRIPTORS
;
1817 wl
->num_rx_desc
= WL12XX_NUM_RX_DESCRIPTORS
;
1818 wl
->num_links
= WL12XX_MAX_LINKS
;
1819 wl
->max_ap_stations
= WL12XX_MAX_AP_STATIONS
;
1820 wl
->iface_combinations
= wl12xx_iface_combinations
;
1821 wl
->n_iface_combinations
= ARRAY_SIZE(wl12xx_iface_combinations
);
1822 wl
->num_mac_addr
= WL12XX_NUM_MAC_ADDRESSES
;
1823 wl
->band_rate_to_idx
= wl12xx_band_rate_to_idx
;
1824 wl
->hw_tx_rate_tbl_size
= WL12XX_CONF_HW_RXTX_RATE_MAX
;
1825 wl
->hw_min_ht_rate
= WL12XX_CONF_HW_RXTX_RATE_MCS0
;
1826 wl
->fw_status_len
= sizeof(struct wl12xx_fw_status
);
1827 wl
->fw_status_priv_len
= 0;
1828 wl
->stats
.fw_stats_len
= sizeof(struct wl12xx_acx_statistics
);
1829 wl
->ofdm_only_ap
= true;
1830 wlcore_set_ht_cap(wl
, NL80211_BAND_2GHZ
, &wl12xx_ht_cap
);
1831 wlcore_set_ht_cap(wl
, NL80211_BAND_5GHZ
, &wl12xx_ht_cap
);
1832 wl12xx_conf_init(wl
);
1835 priv
->ref_clock
= wl12xx_get_clock_idx(wl12xx_refclock_table
,
1836 pdev_data
->ref_clock_freq
,
1837 pdev_data
->ref_clock_xtal
);
1838 if (priv
->ref_clock
< 0) {
1839 wl1271_error("Invalid ref_clock frequency (%d Hz, %s)",
1840 pdev_data
->ref_clock_freq
,
1841 pdev_data
->ref_clock_xtal
?
1842 "XTAL" : "not XTAL");
1844 return priv
->ref_clock
;
1847 if (!strcmp(fref_param
, "19.2"))
1848 priv
->ref_clock
= WL12XX_REFCLOCK_19
;
1849 else if (!strcmp(fref_param
, "26"))
1850 priv
->ref_clock
= WL12XX_REFCLOCK_26
;
1851 else if (!strcmp(fref_param
, "26x"))
1852 priv
->ref_clock
= WL12XX_REFCLOCK_26_XTAL
;
1853 else if (!strcmp(fref_param
, "38.4"))
1854 priv
->ref_clock
= WL12XX_REFCLOCK_38
;
1855 else if (!strcmp(fref_param
, "38.4x"))
1856 priv
->ref_clock
= WL12XX_REFCLOCK_38_XTAL
;
1857 else if (!strcmp(fref_param
, "52"))
1858 priv
->ref_clock
= WL12XX_REFCLOCK_52
;
1860 wl1271_error("Invalid fref parameter %s", fref_param
);
1863 if (!tcxo_param
&& pdev_data
->tcxo_clock_freq
) {
1864 priv
->tcxo_clock
= wl12xx_get_clock_idx(wl12xx_tcxoclock_table
,
1865 pdev_data
->tcxo_clock_freq
,
1867 if (priv
->tcxo_clock
< 0) {
1868 wl1271_error("Invalid tcxo_clock frequency (%d Hz)",
1869 pdev_data
->tcxo_clock_freq
);
1871 return priv
->tcxo_clock
;
1873 } else if (tcxo_param
) {
1874 if (!strcmp(tcxo_param
, "19.2"))
1875 priv
->tcxo_clock
= WL12XX_TCXOCLOCK_19_2
;
1876 else if (!strcmp(tcxo_param
, "26"))
1877 priv
->tcxo_clock
= WL12XX_TCXOCLOCK_26
;
1878 else if (!strcmp(tcxo_param
, "38.4"))
1879 priv
->tcxo_clock
= WL12XX_TCXOCLOCK_38_4
;
1880 else if (!strcmp(tcxo_param
, "52"))
1881 priv
->tcxo_clock
= WL12XX_TCXOCLOCK_52
;
1882 else if (!strcmp(tcxo_param
, "16.368"))
1883 priv
->tcxo_clock
= WL12XX_TCXOCLOCK_16_368
;
1884 else if (!strcmp(tcxo_param
, "32.736"))
1885 priv
->tcxo_clock
= WL12XX_TCXOCLOCK_32_736
;
1886 else if (!strcmp(tcxo_param
, "16.8"))
1887 priv
->tcxo_clock
= WL12XX_TCXOCLOCK_16_8
;
1888 else if (!strcmp(tcxo_param
, "33.6"))
1889 priv
->tcxo_clock
= WL12XX_TCXOCLOCK_33_6
;
1891 wl1271_error("Invalid tcxo parameter %s", tcxo_param
);
1894 priv
->rx_mem_addr
= kmalloc(sizeof(*priv
->rx_mem_addr
), GFP_KERNEL
);
1895 if (!priv
->rx_mem_addr
)
1901 static int wl12xx_probe(struct platform_device
*pdev
)
1904 struct ieee80211_hw
*hw
;
1907 hw
= wlcore_alloc_hw(sizeof(struct wl12xx_priv
),
1908 WL12XX_AGGR_BUFFER_SIZE
,
1909 sizeof(struct wl12xx_event_mailbox
));
1911 wl1271_error("can't allocate hw");
1917 wl
->ops
= &wl12xx_ops
;
1918 wl
->ptable
= wl12xx_ptable
;
1919 ret
= wlcore_probe(wl
, pdev
);
1931 static int wl12xx_remove(struct platform_device
*pdev
)
1933 struct wl1271
*wl
= platform_get_drvdata(pdev
);
1934 struct wl12xx_priv
*priv
;
1940 kfree(priv
->rx_mem_addr
);
1943 return wlcore_remove(pdev
);
1946 static const struct platform_device_id wl12xx_id_table
[] = {
1948 { } /* Terminating Entry */
1950 MODULE_DEVICE_TABLE(platform
, wl12xx_id_table
);
1952 static struct platform_driver wl12xx_driver
= {
1953 .probe
= wl12xx_probe
,
1954 .remove
= wl12xx_remove
,
1955 .id_table
= wl12xx_id_table
,
1957 .name
= "wl12xx_driver",
1961 module_platform_driver(wl12xx_driver
);
1963 module_param_named(fref
, fref_param
, charp
, 0);
1964 MODULE_PARM_DESC(fref
, "FREF clock: 19.2, 26, 26x, 38.4, 38.4x, 52");
1966 module_param_named(tcxo
, tcxo_param
, charp
, 0);
1967 MODULE_PARM_DESC(tcxo
,
1968 "TCXO clock: 19.2, 26, 38.4, 52, 16.368, 32.736, 16.8, 33.6");
1970 MODULE_LICENSE("GPL v2");
1971 MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
1972 MODULE_FIRMWARE(WL127X_FW_NAME_SINGLE
);
1973 MODULE_FIRMWARE(WL127X_FW_NAME_MULTI
);
1974 MODULE_FIRMWARE(WL127X_PLT_FW_NAME
);
1975 MODULE_FIRMWARE(WL128X_FW_NAME_SINGLE
);
1976 MODULE_FIRMWARE(WL128X_FW_NAME_MULTI
);
1977 MODULE_FIRMWARE(WL128X_PLT_FW_NAME
);