init.c revision 9d68d1eea7fb4d05b5bd037da6a66329d640b2f1
1/*
2 * This file is part of wl1271
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 *
6 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 *
22 */
23
24#include <linux/kernel.h>
25#include <linux/module.h>
26#include <linux/slab.h>
27
28#include "debug.h"
29#include "init.h"
30#include "wl12xx_80211.h"
31#include "acx.h"
32#include "cmd.h"
33#include "tx.h"
34#include "io.h"
35
36int wl1271_init_templates_config(struct wl1271 *wl)
37{
38	int ret, i;
39	size_t max_size;
40
41	/* send empty templates for fw memory reservation */
42	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
43				      CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL,
44				      WL1271_CMD_TEMPL_MAX_SIZE,
45				      0, WL1271_RATE_AUTOMATIC);
46	if (ret < 0)
47		return ret;
48
49	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
50				      CMD_TEMPL_CFG_PROBE_REQ_5,
51				      NULL, WL1271_CMD_TEMPL_MAX_SIZE, 0,
52				      WL1271_RATE_AUTOMATIC);
53	if (ret < 0)
54		return ret;
55
56	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
57				      CMD_TEMPL_NULL_DATA, NULL,
58				      sizeof(struct wl12xx_null_data_template),
59				      0, WL1271_RATE_AUTOMATIC);
60	if (ret < 0)
61		return ret;
62
63	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
64				      CMD_TEMPL_PS_POLL, NULL,
65				      sizeof(struct wl12xx_ps_poll_template),
66				      0, WL1271_RATE_AUTOMATIC);
67	if (ret < 0)
68		return ret;
69
70	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
71				      CMD_TEMPL_QOS_NULL_DATA, NULL,
72				      sizeof
73				      (struct ieee80211_qos_hdr),
74				      0, WL1271_RATE_AUTOMATIC);
75	if (ret < 0)
76		return ret;
77
78	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
79				      CMD_TEMPL_PROBE_RESPONSE, NULL,
80				      WL1271_CMD_TEMPL_DFLT_SIZE,
81				      0, WL1271_RATE_AUTOMATIC);
82	if (ret < 0)
83		return ret;
84
85	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
86				      CMD_TEMPL_BEACON, NULL,
87				      WL1271_CMD_TEMPL_DFLT_SIZE,
88				      0, WL1271_RATE_AUTOMATIC);
89	if (ret < 0)
90		return ret;
91
92	max_size = sizeof(struct wl12xx_arp_rsp_template) +
93		   WL1271_EXTRA_SPACE_MAX;
94	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
95				      CMD_TEMPL_ARP_RSP, NULL,
96				      max_size,
97				      0, WL1271_RATE_AUTOMATIC);
98	if (ret < 0)
99		return ret;
100
101	/*
102	 * Put very large empty placeholders for all templates. These
103	 * reserve memory for later.
104	 */
105	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
106				      CMD_TEMPL_AP_PROBE_RESPONSE, NULL,
107				      WL1271_CMD_TEMPL_MAX_SIZE,
108				      0, WL1271_RATE_AUTOMATIC);
109	if (ret < 0)
110		return ret;
111
112	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
113				      CMD_TEMPL_AP_BEACON, NULL,
114				      WL1271_CMD_TEMPL_MAX_SIZE,
115				      0, WL1271_RATE_AUTOMATIC);
116	if (ret < 0)
117		return ret;
118
119	ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
120				      CMD_TEMPL_DEAUTH_AP, NULL,
121				      sizeof
122				      (struct wl12xx_disconn_template),
123				      0, WL1271_RATE_AUTOMATIC);
124	if (ret < 0)
125		return ret;
126
127	for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) {
128		ret = wl1271_cmd_template_set(wl, WL12XX_INVALID_ROLE_ID,
129					      CMD_TEMPL_KLV, NULL,
130					      sizeof(struct ieee80211_qos_hdr),
131					      i, WL1271_RATE_AUTOMATIC);
132		if (ret < 0)
133			return ret;
134	}
135
136	return 0;
137}
138
139static int wl1271_ap_init_deauth_template(struct wl1271 *wl,
140					  struct wl12xx_vif *wlvif)
141{
142	struct wl12xx_disconn_template *tmpl;
143	int ret;
144	u32 rate;
145
146	tmpl = kzalloc(sizeof(*tmpl), GFP_KERNEL);
147	if (!tmpl) {
148		ret = -ENOMEM;
149		goto out;
150	}
151
152	tmpl->header.frame_ctl = cpu_to_le16(IEEE80211_FTYPE_MGMT |
153					     IEEE80211_STYPE_DEAUTH);
154
155	rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
156	ret = wl1271_cmd_template_set(wl, wlvif->role_id,
157				      CMD_TEMPL_DEAUTH_AP,
158				      tmpl, sizeof(*tmpl), 0, rate);
159
160out:
161	kfree(tmpl);
162	return ret;
163}
164
165static int wl1271_ap_init_null_template(struct wl1271 *wl,
166					struct ieee80211_vif *vif)
167{
168	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
169	struct ieee80211_hdr_3addr *nullfunc;
170	int ret;
171	u32 rate;
172
173	nullfunc = kzalloc(sizeof(*nullfunc), GFP_KERNEL);
174	if (!nullfunc) {
175		ret = -ENOMEM;
176		goto out;
177	}
178
179	nullfunc->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA |
180					      IEEE80211_STYPE_NULLFUNC |
181					      IEEE80211_FCTL_FROMDS);
182
183	/* nullfunc->addr1 is filled by FW */
184
185	memcpy(nullfunc->addr2, vif->addr, ETH_ALEN);
186	memcpy(nullfunc->addr3, vif->addr, ETH_ALEN);
187
188	rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
189	ret = wl1271_cmd_template_set(wl, wlvif->role_id,
190				      CMD_TEMPL_NULL_DATA, nullfunc,
191				      sizeof(*nullfunc), 0, rate);
192
193out:
194	kfree(nullfunc);
195	return ret;
196}
197
198static int wl1271_ap_init_qos_null_template(struct wl1271 *wl,
199					    struct ieee80211_vif *vif)
200{
201	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
202	struct ieee80211_qos_hdr *qosnull;
203	int ret;
204	u32 rate;
205
206	qosnull = kzalloc(sizeof(*qosnull), GFP_KERNEL);
207	if (!qosnull) {
208		ret = -ENOMEM;
209		goto out;
210	}
211
212	qosnull->frame_control = cpu_to_le16(IEEE80211_FTYPE_DATA |
213					     IEEE80211_STYPE_QOS_NULLFUNC |
214					     IEEE80211_FCTL_FROMDS);
215
216	/* qosnull->addr1 is filled by FW */
217
218	memcpy(qosnull->addr2, vif->addr, ETH_ALEN);
219	memcpy(qosnull->addr3, vif->addr, ETH_ALEN);
220
221	rate = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
222	ret = wl1271_cmd_template_set(wl, wlvif->role_id,
223				      CMD_TEMPL_QOS_NULL_DATA, qosnull,
224				      sizeof(*qosnull), 0, rate);
225
226out:
227	kfree(qosnull);
228	return ret;
229}
230
231static int wl12xx_init_rx_config(struct wl1271 *wl)
232{
233	int ret;
234
235	ret = wl1271_acx_rx_msdu_life_time(wl);
236	if (ret < 0)
237		return ret;
238
239	return 0;
240}
241
242static int wl12xx_init_phy_vif_config(struct wl1271 *wl,
243					    struct wl12xx_vif *wlvif)
244{
245	int ret;
246
247	ret = wl1271_acx_slot(wl, wlvif, DEFAULT_SLOT_TIME);
248	if (ret < 0)
249		return ret;
250
251	ret = wl1271_acx_service_period_timeout(wl, wlvif);
252	if (ret < 0)
253		return ret;
254
255	ret = wl1271_acx_rts_threshold(wl, wlvif, wl->hw->wiphy->rts_threshold);
256	if (ret < 0)
257		return ret;
258
259	return 0;
260}
261
262static int wl1271_init_sta_beacon_filter(struct wl1271 *wl,
263					 struct wl12xx_vif *wlvif)
264{
265	int ret;
266
267	ret = wl1271_acx_beacon_filter_table(wl, wlvif);
268	if (ret < 0)
269		return ret;
270
271	/* enable beacon filtering */
272	ret = wl1271_acx_beacon_filter_opt(wl, wlvif, true);
273	if (ret < 0)
274		return ret;
275
276	return 0;
277}
278
279int wl1271_init_pta(struct wl1271 *wl)
280{
281	int ret;
282
283	ret = wl12xx_acx_sg_cfg(wl);
284	if (ret < 0)
285		return ret;
286
287	ret = wl1271_acx_sg_enable(wl, wl->sg_enabled);
288	if (ret < 0)
289		return ret;
290
291	return 0;
292}
293
294int wl1271_init_energy_detection(struct wl1271 *wl)
295{
296	int ret;
297
298	ret = wl1271_acx_cca_threshold(wl);
299	if (ret < 0)
300		return ret;
301
302	return 0;
303}
304
305static int wl1271_init_beacon_broadcast(struct wl1271 *wl,
306					struct wl12xx_vif *wlvif)
307{
308	int ret;
309
310	ret = wl1271_acx_bcn_dtim_options(wl, wlvif);
311	if (ret < 0)
312		return ret;
313
314	return 0;
315}
316
317static int wl12xx_init_fwlog(struct wl1271 *wl)
318{
319	int ret;
320
321	if (wl->quirks & WLCORE_QUIRK_FWLOG_NOT_IMPLEMENTED)
322		return 0;
323
324	ret = wl12xx_cmd_config_fwlog(wl);
325	if (ret < 0)
326		return ret;
327
328	return 0;
329}
330
331/* generic sta initialization (non vif-specific) */
332static int wl1271_sta_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif)
333{
334	int ret;
335
336	/* PS config */
337	ret = wl12xx_acx_config_ps(wl, wlvif);
338	if (ret < 0)
339		return ret;
340
341	/* FM WLAN coexistence */
342	ret = wl1271_acx_fm_coex(wl);
343	if (ret < 0)
344		return ret;
345
346	ret = wl1271_acx_sta_rate_policies(wl, wlvif);
347	if (ret < 0)
348		return ret;
349
350	return 0;
351}
352
353static int wl1271_sta_hw_init_post_mem(struct wl1271 *wl,
354				       struct ieee80211_vif *vif)
355{
356	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
357	int ret, i;
358
359	/* disable all keep-alive templates */
360	for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) {
361		ret = wl1271_acx_keep_alive_config(wl, wlvif, i,
362						   ACX_KEEP_ALIVE_TPL_INVALID);
363		if (ret < 0)
364			return ret;
365	}
366
367	/* disable the keep-alive feature */
368	ret = wl1271_acx_keep_alive_mode(wl, wlvif, false);
369	if (ret < 0)
370		return ret;
371
372	return 0;
373}
374
375/* generic ap initialization (non vif-specific) */
376static int wl1271_ap_hw_init(struct wl1271 *wl, struct wl12xx_vif *wlvif)
377{
378	int ret;
379
380	ret = wl1271_init_ap_rates(wl, wlvif);
381	if (ret < 0)
382		return ret;
383
384	return 0;
385}
386
387int wl1271_ap_init_templates(struct wl1271 *wl, struct ieee80211_vif *vif)
388{
389	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
390	int ret;
391
392	ret = wl1271_ap_init_deauth_template(wl, wlvif);
393	if (ret < 0)
394		return ret;
395
396	ret = wl1271_ap_init_null_template(wl, vif);
397	if (ret < 0)
398		return ret;
399
400	ret = wl1271_ap_init_qos_null_template(wl, vif);
401	if (ret < 0)
402		return ret;
403
404	/*
405	 * when operating as AP we want to receive external beacons for
406	 * configuring ERP protection.
407	 */
408	ret = wl1271_acx_beacon_filter_opt(wl, wlvif, false);
409	if (ret < 0)
410		return ret;
411
412	return 0;
413}
414
415static int wl1271_ap_hw_init_post_mem(struct wl1271 *wl,
416				      struct ieee80211_vif *vif)
417{
418	return wl1271_ap_init_templates(wl, vif);
419}
420
421int wl1271_init_ap_rates(struct wl1271 *wl, struct wl12xx_vif *wlvif)
422{
423	int i, ret;
424	struct conf_tx_rate_class rc;
425	u32 supported_rates;
426
427	wl1271_debug(DEBUG_AP, "AP basic rate set: 0x%x",
428		     wlvif->basic_rate_set);
429
430	if (wlvif->basic_rate_set == 0)
431		return -EINVAL;
432
433	rc.enabled_rates = wlvif->basic_rate_set;
434	rc.long_retry_limit = 10;
435	rc.short_retry_limit = 10;
436	rc.aflags = 0;
437	ret = wl1271_acx_ap_rate_policy(wl, &rc, wlvif->ap.mgmt_rate_idx);
438	if (ret < 0)
439		return ret;
440
441	/* use the min basic rate for AP broadcast/multicast */
442	rc.enabled_rates = wl1271_tx_min_rate_get(wl, wlvif->basic_rate_set);
443	rc.short_retry_limit = 10;
444	rc.long_retry_limit = 10;
445	rc.aflags = 0;
446	ret = wl1271_acx_ap_rate_policy(wl, &rc, wlvif->ap.bcast_rate_idx);
447	if (ret < 0)
448		return ret;
449
450	/*
451	 * If the basic rates contain OFDM rates, use OFDM only
452	 * rates for unicast TX as well. Else use all supported rates.
453	 */
454	if ((wlvif->basic_rate_set & CONF_TX_OFDM_RATES))
455		supported_rates = CONF_TX_OFDM_RATES;
456	else
457		supported_rates = CONF_TX_AP_ENABLED_RATES;
458
459	/* unconditionally enable HT rates */
460	supported_rates |= CONF_TX_MCS_RATES;
461
462	/* configure unicast TX rate classes */
463	for (i = 0; i < wl->conf.tx.ac_conf_count; i++) {
464		rc.enabled_rates = supported_rates;
465		rc.short_retry_limit = 10;
466		rc.long_retry_limit = 10;
467		rc.aflags = 0;
468		ret = wl1271_acx_ap_rate_policy(wl, &rc,
469						wlvif->ap.ucast_rate_idx[i]);
470		if (ret < 0)
471			return ret;
472	}
473
474	return 0;
475}
476
477static int wl1271_set_ba_policies(struct wl1271 *wl, struct wl12xx_vif *wlvif)
478{
479	/* Reset the BA RX indicators */
480	wlvif->ba_allowed = true;
481	wl->ba_rx_session_count = 0;
482
483	/* BA is supported in STA/AP modes */
484	if (wlvif->bss_type != BSS_TYPE_AP_BSS &&
485	    wlvif->bss_type != BSS_TYPE_STA_BSS) {
486		wlvif->ba_support = false;
487		return 0;
488	}
489
490	wlvif->ba_support = true;
491
492	/* 802.11n initiator BA session setting */
493	return wl12xx_acx_set_ba_initiator_policy(wl, wlvif);
494}
495
496/* vif-specifc initialization */
497static int wl12xx_init_sta_role(struct wl1271 *wl, struct wl12xx_vif *wlvif)
498{
499	int ret;
500
501	ret = wl1271_acx_group_address_tbl(wl, wlvif, true, NULL, 0);
502	if (ret < 0)
503		return ret;
504
505	/* Initialize connection monitoring thresholds */
506	ret = wl1271_acx_conn_monit_params(wl, wlvif, false);
507	if (ret < 0)
508		return ret;
509
510	/* Beacon filtering */
511	ret = wl1271_init_sta_beacon_filter(wl, wlvif);
512	if (ret < 0)
513		return ret;
514
515	/* Beacons and broadcast settings */
516	ret = wl1271_init_beacon_broadcast(wl, wlvif);
517	if (ret < 0)
518		return ret;
519
520	/* Configure rssi/snr averaging weights */
521	ret = wl1271_acx_rssi_snr_avg_weights(wl, wlvif);
522	if (ret < 0)
523		return ret;
524
525	return 0;
526}
527
528/* vif-specific intialization */
529static int wl12xx_init_ap_role(struct wl1271 *wl, struct wl12xx_vif *wlvif)
530{
531	int ret;
532
533	ret = wl1271_acx_ap_max_tx_retry(wl, wlvif);
534	if (ret < 0)
535		return ret;
536
537	/* initialize Tx power */
538	ret = wl1271_acx_tx_power(wl, wlvif, wlvif->power_level);
539	if (ret < 0)
540		return ret;
541
542	return 0;
543}
544
545int wl1271_init_vif_specific(struct wl1271 *wl, struct ieee80211_vif *vif)
546{
547	struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
548	struct conf_tx_ac_category *conf_ac;
549	struct conf_tx_tid *conf_tid;
550	bool is_ap = (wlvif->bss_type == BSS_TYPE_AP_BSS);
551	int ret, i;
552
553	/*
554	 * consider all existing roles before configuring psm.
555	 * TODO: reconfigure on interface removal.
556	 */
557	if (!wl->ap_count) {
558		if (is_ap) {
559			/* Configure for power always on */
560			ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM);
561			if (ret < 0)
562				return ret;
563		} else if (!wl->sta_count) {
564			if (wl->quirks & WLCORE_QUIRK_NO_ELP) {
565				/* Configure for power always on */
566				ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_CAM);
567				if (ret < 0)
568					return ret;
569			} else {
570				/* Configure for ELP power saving */
571				ret = wl1271_acx_sleep_auth(wl, WL1271_PSM_ELP);
572				if (ret < 0)
573					return ret;
574			}
575		}
576	}
577
578	/* Mode specific init */
579	if (is_ap) {
580		ret = wl1271_ap_hw_init(wl, wlvif);
581		if (ret < 0)
582			return ret;
583
584		ret = wl12xx_init_ap_role(wl, wlvif);
585		if (ret < 0)
586			return ret;
587	} else {
588		ret = wl1271_sta_hw_init(wl, wlvif);
589		if (ret < 0)
590			return ret;
591
592		ret = wl12xx_init_sta_role(wl, wlvif);
593		if (ret < 0)
594			return ret;
595	}
596
597	wl12xx_init_phy_vif_config(wl, wlvif);
598
599	/* Default TID/AC configuration */
600	BUG_ON(wl->conf.tx.tid_conf_count != wl->conf.tx.ac_conf_count);
601	for (i = 0; i < wl->conf.tx.tid_conf_count; i++) {
602		conf_ac = &wl->conf.tx.ac_conf[i];
603		ret = wl1271_acx_ac_cfg(wl, wlvif, conf_ac->ac,
604					conf_ac->cw_min, conf_ac->cw_max,
605					conf_ac->aifsn, conf_ac->tx_op_limit);
606		if (ret < 0)
607			return ret;
608
609		conf_tid = &wl->conf.tx.tid_conf[i];
610		ret = wl1271_acx_tid_cfg(wl, wlvif,
611					 conf_tid->queue_id,
612					 conf_tid->channel_type,
613					 conf_tid->tsid,
614					 conf_tid->ps_scheme,
615					 conf_tid->ack_policy,
616					 conf_tid->apsd_conf[0],
617					 conf_tid->apsd_conf[1]);
618		if (ret < 0)
619			return ret;
620	}
621
622	/* Configure HW encryption */
623	ret = wl1271_acx_feature_cfg(wl, wlvif);
624	if (ret < 0)
625		return ret;
626
627	/* Mode specific init - post mem init */
628	if (is_ap)
629		ret = wl1271_ap_hw_init_post_mem(wl, vif);
630	else
631		ret = wl1271_sta_hw_init_post_mem(wl, vif);
632
633	if (ret < 0)
634		return ret;
635
636	/* Configure initiator BA sessions policies */
637	ret = wl1271_set_ba_policies(wl, wlvif);
638	if (ret < 0)
639		return ret;
640
641	return 0;
642}
643
644int wl1271_hw_init(struct wl1271 *wl)
645{
646	int ret;
647
648	/* Chip-specific hw init */
649	ret = wl->ops->hw_init(wl);
650	if (ret < 0)
651		return ret;
652
653	/* Init templates */
654	ret = wl1271_init_templates_config(wl);
655	if (ret < 0)
656		return ret;
657
658	ret = wl12xx_acx_mem_cfg(wl);
659	if (ret < 0)
660		return ret;
661
662	/* Configure the FW logger */
663	ret = wl12xx_init_fwlog(wl);
664	if (ret < 0)
665		return ret;
666
667	/* Bluetooth WLAN coexistence */
668	ret = wl1271_init_pta(wl);
669	if (ret < 0)
670		return ret;
671
672	/* Default memory configuration */
673	ret = wl1271_acx_init_mem_config(wl);
674	if (ret < 0)
675		return ret;
676
677	/* RX config */
678	ret = wl12xx_init_rx_config(wl);
679	if (ret < 0)
680		goto out_free_memmap;
681
682	ret = wl1271_acx_dco_itrim_params(wl);
683	if (ret < 0)
684		goto out_free_memmap;
685
686	/* Configure TX patch complete interrupt behavior */
687	ret = wl1271_acx_tx_config_options(wl);
688	if (ret < 0)
689		goto out_free_memmap;
690
691	/* RX complete interrupt pacing */
692	ret = wl1271_acx_init_rx_interrupt(wl);
693	if (ret < 0)
694		goto out_free_memmap;
695
696	/* Energy detection */
697	ret = wl1271_init_energy_detection(wl);
698	if (ret < 0)
699		goto out_free_memmap;
700
701	/* Default fragmentation threshold */
702	ret = wl1271_acx_frag_threshold(wl, wl->hw->wiphy->frag_threshold);
703	if (ret < 0)
704		goto out_free_memmap;
705
706	/* Enable data path */
707	ret = wl1271_cmd_data_path(wl, 1);
708	if (ret < 0)
709		goto out_free_memmap;
710
711	/* configure PM */
712	ret = wl1271_acx_pm_config(wl);
713	if (ret < 0)
714		goto out_free_memmap;
715
716	ret = wl12xx_acx_set_rate_mgmt_params(wl);
717	if (ret < 0)
718		goto out_free_memmap;
719
720	/* configure hangover */
721	ret = wl12xx_acx_config_hangover(wl);
722	if (ret < 0)
723		goto out_free_memmap;
724
725	return 0;
726
727 out_free_memmap:
728	kfree(wl->target_mem_map);
729	wl->target_mem_map = NULL;
730
731	return ret;
732}
733