aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLuciano Coelho <coelho@ti.com>2011-12-05 09:12:54 -0500
committerLuciano Coelho <coelho@ti.com>2012-04-12 01:44:01 -0400
commite87288f089d3ba1c10d2323c286f8145450fd250 (patch)
tree53e0a1889aef21766d05dfb50687c9936bf74aa5 /drivers/net
parent5d10b1957d4dd7b5f854a224fb30cc564405d4d9 (diff)
wlcore/wl12xx: move runtime configuration struct to the lower driver
The configuration parameters vary with different chip families. Some of the parameters used only by some chip families, others should have different value depending on the family. Thus move the configuration values from wlcore to wl12xx. Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c345
-rw-r--r--drivers/net/wireless/ti/wlcore/conf.h2
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c359
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h2
4 files changed, 352 insertions, 356 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index 083e1d8be17..242bb5f4e0f 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -39,6 +39,344 @@
39#include "cmd.h" 39#include "cmd.h"
40#include "acx.h" 40#include "acx.h"
41 41
42static struct wlcore_conf wl12xx_conf = {
43 .sg = {
44 .params = {
45 [CONF_SG_ACL_BT_MASTER_MIN_BR] = 10,
46 [CONF_SG_ACL_BT_MASTER_MAX_BR] = 180,
47 [CONF_SG_ACL_BT_SLAVE_MIN_BR] = 10,
48 [CONF_SG_ACL_BT_SLAVE_MAX_BR] = 180,
49 [CONF_SG_ACL_BT_MASTER_MIN_EDR] = 10,
50 [CONF_SG_ACL_BT_MASTER_MAX_EDR] = 80,
51 [CONF_SG_ACL_BT_SLAVE_MIN_EDR] = 10,
52 [CONF_SG_ACL_BT_SLAVE_MAX_EDR] = 80,
53 [CONF_SG_ACL_WLAN_PS_MASTER_BR] = 8,
54 [CONF_SG_ACL_WLAN_PS_SLAVE_BR] = 8,
55 [CONF_SG_ACL_WLAN_PS_MASTER_EDR] = 20,
56 [CONF_SG_ACL_WLAN_PS_SLAVE_EDR] = 20,
57 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_BR] = 20,
58 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_BR] = 35,
59 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_BR] = 16,
60 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_BR] = 35,
61 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_EDR] = 32,
62 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_EDR] = 50,
63 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_EDR] = 28,
64 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_EDR] = 50,
65 [CONF_SG_ACL_ACTIVE_SCAN_WLAN_BR] = 10,
66 [CONF_SG_ACL_ACTIVE_SCAN_WLAN_EDR] = 20,
67 [CONF_SG_ACL_PASSIVE_SCAN_BT_BR] = 75,
68 [CONF_SG_ACL_PASSIVE_SCAN_WLAN_BR] = 15,
69 [CONF_SG_ACL_PASSIVE_SCAN_BT_EDR] = 27,
70 [CONF_SG_ACL_PASSIVE_SCAN_WLAN_EDR] = 17,
71 /* active scan params */
72 [CONF_SG_AUTO_SCAN_PROBE_REQ] = 170,
73 [CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3] = 50,
74 [CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP] = 100,
75 /* passive scan params */
76 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_BR] = 800,
77 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_EDR] = 200,
78 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3] = 200,
79 /* passive scan in dual antenna params */
80 [CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN] = 0,
81 [CONF_SG_BCN_HV3_COLLISION_THRESH_IN_PASSIVE_SCAN] = 0,
82 [CONF_SG_TX_RX_PROTECTION_BWIDTH_IN_PASSIVE_SCAN] = 0,
83 /* general params */
84 [CONF_SG_STA_FORCE_PS_IN_BT_SCO] = 1,
85 [CONF_SG_ANTENNA_CONFIGURATION] = 0,
86 [CONF_SG_BEACON_MISS_PERCENT] = 60,
87 [CONF_SG_DHCP_TIME] = 5000,
88 [CONF_SG_RXT] = 1200,
89 [CONF_SG_TXT] = 1000,
90 [CONF_SG_ADAPTIVE_RXT_TXT] = 1,
91 [CONF_SG_GENERAL_USAGE_BIT_MAP] = 3,
92 [CONF_SG_HV3_MAX_SERVED] = 6,
93 [CONF_SG_PS_POLL_TIMEOUT] = 10,
94 [CONF_SG_UPSD_TIMEOUT] = 10,
95 [CONF_SG_CONSECUTIVE_CTS_THRESHOLD] = 2,
96 [CONF_SG_STA_RX_WINDOW_AFTER_DTIM] = 5,
97 [CONF_SG_STA_CONNECTION_PROTECTION_TIME] = 30,
98 /* AP params */
99 [CONF_AP_BEACON_MISS_TX] = 3,
100 [CONF_AP_RX_WINDOW_AFTER_BEACON] = 10,
101 [CONF_AP_BEACON_WINDOW_INTERVAL] = 2,
102 [CONF_AP_CONNECTION_PROTECTION_TIME] = 0,
103 [CONF_AP_BT_ACL_VAL_BT_SERVE_TIME] = 25,
104 [CONF_AP_BT_ACL_VAL_WL_SERVE_TIME] = 25,
105 /* CTS Diluting params */
106 [CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH] = 0,
107 [CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER] = 0,
108 },
109 .state = CONF_SG_PROTECTIVE,
110 },
111 .rx = {
112 .rx_msdu_life_time = 512000,
113 .packet_detection_threshold = 0,
114 .ps_poll_timeout = 15,
115 .upsd_timeout = 15,
116 .rts_threshold = IEEE80211_MAX_RTS_THRESHOLD,
117 .rx_cca_threshold = 0,
118 .irq_blk_threshold = 0xFFFF,
119 .irq_pkt_threshold = 0,
120 .irq_timeout = 600,
121 .queue_type = CONF_RX_QUEUE_TYPE_LOW_PRIORITY,
122 },
123 .tx = {
124 .tx_energy_detection = 0,
125 .sta_rc_conf = {
126 .enabled_rates = 0,
127 .short_retry_limit = 10,
128 .long_retry_limit = 10,
129 .aflags = 0,
130 },
131 .ac_conf_count = 4,
132 .ac_conf = {
133 [CONF_TX_AC_BE] = {
134 .ac = CONF_TX_AC_BE,
135 .cw_min = 15,
136 .cw_max = 63,
137 .aifsn = 3,
138 .tx_op_limit = 0,
139 },
140 [CONF_TX_AC_BK] = {
141 .ac = CONF_TX_AC_BK,
142 .cw_min = 15,
143 .cw_max = 63,
144 .aifsn = 7,
145 .tx_op_limit = 0,
146 },
147 [CONF_TX_AC_VI] = {
148 .ac = CONF_TX_AC_VI,
149 .cw_min = 15,
150 .cw_max = 63,
151 .aifsn = CONF_TX_AIFS_PIFS,
152 .tx_op_limit = 3008,
153 },
154 [CONF_TX_AC_VO] = {
155 .ac = CONF_TX_AC_VO,
156 .cw_min = 15,
157 .cw_max = 63,
158 .aifsn = CONF_TX_AIFS_PIFS,
159 .tx_op_limit = 1504,
160 },
161 },
162 .max_tx_retries = 100,
163 .ap_aging_period = 300,
164 .tid_conf_count = 4,
165 .tid_conf = {
166 [CONF_TX_AC_BE] = {
167 .queue_id = CONF_TX_AC_BE,
168 .channel_type = CONF_CHANNEL_TYPE_EDCF,
169 .tsid = CONF_TX_AC_BE,
170 .ps_scheme = CONF_PS_SCHEME_LEGACY,
171 .ack_policy = CONF_ACK_POLICY_LEGACY,
172 .apsd_conf = {0, 0},
173 },
174 [CONF_TX_AC_BK] = {
175 .queue_id = CONF_TX_AC_BK,
176 .channel_type = CONF_CHANNEL_TYPE_EDCF,
177 .tsid = CONF_TX_AC_BK,
178 .ps_scheme = CONF_PS_SCHEME_LEGACY,
179 .ack_policy = CONF_ACK_POLICY_LEGACY,
180 .apsd_conf = {0, 0},
181 },
182 [CONF_TX_AC_VI] = {
183 .queue_id = CONF_TX_AC_VI,
184 .channel_type = CONF_CHANNEL_TYPE_EDCF,
185 .tsid = CONF_TX_AC_VI,
186 .ps_scheme = CONF_PS_SCHEME_LEGACY,
187 .ack_policy = CONF_ACK_POLICY_LEGACY,
188 .apsd_conf = {0, 0},
189 },
190 [CONF_TX_AC_VO] = {
191 .queue_id = CONF_TX_AC_VO,
192 .channel_type = CONF_CHANNEL_TYPE_EDCF,
193 .tsid = CONF_TX_AC_VO,
194 .ps_scheme = CONF_PS_SCHEME_LEGACY,
195 .ack_policy = CONF_ACK_POLICY_LEGACY,
196 .apsd_conf = {0, 0},
197 },
198 },
199 .frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD,
200 .tx_compl_timeout = 700,
201 .tx_compl_threshold = 4,
202 .basic_rate = CONF_HW_BIT_RATE_1MBPS,
203 .basic_rate_5 = CONF_HW_BIT_RATE_6MBPS,
204 .tmpl_short_retry_limit = 10,
205 .tmpl_long_retry_limit = 10,
206 .tx_watchdog_timeout = 5000,
207 },
208 .conn = {
209 .wake_up_event = CONF_WAKE_UP_EVENT_DTIM,
210 .listen_interval = 1,
211 .suspend_wake_up_event = CONF_WAKE_UP_EVENT_N_DTIM,
212 .suspend_listen_interval = 3,
213 .bcn_filt_mode = CONF_BCN_FILT_MODE_ENABLED,
214 .bcn_filt_ie_count = 2,
215 .bcn_filt_ie = {
216 [0] = {
217 .ie = WLAN_EID_CHANNEL_SWITCH,
218 .rule = CONF_BCN_RULE_PASS_ON_APPEARANCE,
219 },
220 [1] = {
221 .ie = WLAN_EID_HT_OPERATION,
222 .rule = CONF_BCN_RULE_PASS_ON_CHANGE,
223 },
224 },
225 .synch_fail_thold = 10,
226 .bss_lose_timeout = 100,
227 .beacon_rx_timeout = 10000,
228 .broadcast_timeout = 20000,
229 .rx_broadcast_in_ps = 1,
230 .ps_poll_threshold = 10,
231 .bet_enable = CONF_BET_MODE_ENABLE,
232 .bet_max_consecutive = 50,
233 .psm_entry_retries = 8,
234 .psm_exit_retries = 16,
235 .psm_entry_nullfunc_retries = 3,
236 .dynamic_ps_timeout = 40,
237 .forced_ps = false,
238 .keep_alive_interval = 55000,
239 .max_listen_interval = 20,
240 },
241 .itrim = {
242 .enable = false,
243 .timeout = 50000,
244 },
245 .pm_config = {
246 .host_clk_settling_time = 5000,
247 .host_fast_wakeup_support = false
248 },
249 .roam_trigger = {
250 .trigger_pacing = 1,
251 .avg_weight_rssi_beacon = 20,
252 .avg_weight_rssi_data = 10,
253 .avg_weight_snr_beacon = 20,
254 .avg_weight_snr_data = 10,
255 },
256 .scan = {
257 .min_dwell_time_active = 7500,
258 .max_dwell_time_active = 30000,
259 .min_dwell_time_passive = 100000,
260 .max_dwell_time_passive = 100000,
261 .num_probe_reqs = 2,
262 .split_scan_timeout = 50000,
263 },
264 .sched_scan = {
265 /*
266 * Values are in TU/1000 but since sched scan FW command
267 * params are in TUs rounding up may occur.
268 */
269 .base_dwell_time = 7500,
270 .max_dwell_time_delta = 22500,
271 /* based on 250bits per probe @1Mbps */
272 .dwell_time_delta_per_probe = 2000,
273 /* based on 250bits per probe @6Mbps (plus a bit more) */
274 .dwell_time_delta_per_probe_5 = 350,
275 .dwell_time_passive = 100000,
276 .dwell_time_dfs = 150000,
277 .num_probe_reqs = 2,
278 .rssi_threshold = -90,
279 .snr_threshold = 0,
280 },
281 .rf = {
282 .tx_per_channel_power_compensation_2 = {
283 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
284 },
285 .tx_per_channel_power_compensation_5 = {
286 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
287 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
288 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
289 },
290 },
291 .ht = {
292 .rx_ba_win_size = 8,
293 .tx_ba_win_size = 64,
294 .inactivity_timeout = 10000,
295 .tx_ba_tid_bitmap = CONF_TX_BA_ENABLED_TID_BITMAP,
296 },
297 .mem_wl127x = {
298 .num_stations = 1,
299 .ssid_profiles = 1,
300 .rx_block_num = 70,
301 .tx_min_block_num = 40,
302 .dynamic_memory = 1,
303 .min_req_tx_blocks = 100,
304 .min_req_rx_blocks = 22,
305 .tx_min = 27,
306 },
307 .mem_wl128x = {
308 .num_stations = 1,
309 .ssid_profiles = 1,
310 .rx_block_num = 40,
311 .tx_min_block_num = 40,
312 .dynamic_memory = 1,
313 .min_req_tx_blocks = 45,
314 .min_req_rx_blocks = 22,
315 .tx_min = 27,
316 },
317 .fm_coex = {
318 .enable = true,
319 .swallow_period = 5,
320 .n_divider_fref_set_1 = 0xff, /* default */
321 .n_divider_fref_set_2 = 12,
322 .m_divider_fref_set_1 = 148,
323 .m_divider_fref_set_2 = 0xffff, /* 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 */
328 },
329 .rx_streaming = {
330 .duration = 150,
331 .queues = 0x1,
332 .interval = 20,
333 .always = 0,
334 },
335 .fwlog = {
336 .mode = WL12XX_FWLOG_ON_DEMAND,
337 .mem_blocks = 2,
338 .severity = 0,
339 .timestamp = WL12XX_FWLOG_TIMESTAMP_DISABLED,
340 .output = WL12XX_FWLOG_OUTPUT_HOST,
341 .threshold = 0,
342 },
343 .rate = {
344 .rate_retry_score = 32000,
345 .per_add = 8192,
346 .per_th1 = 2048,
347 .per_th2 = 4096,
348 .max_per = 8100,
349 .inverse_curiosity_factor = 5,
350 .tx_fail_low_th = 4,
351 .tx_fail_high_th = 10,
352 .per_alpha_shift = 4,
353 .per_add_shift = 13,
354 .per_beta1_shift = 10,
355 .per_beta2_shift = 8,
356 .rate_check_up = 2,
357 .rate_check_down = 12,
358 .rate_retry_policy = {
359 0x00, 0x00, 0x00, 0x00, 0x00,
360 0x00, 0x00, 0x00, 0x00, 0x00,
361 0x00, 0x00, 0x00,
362 },
363 },
364 .hangover = {
365 .recover_time = 0,
366 .hangover_period = 20,
367 .dynamic_mode = 1,
368 .early_termination_mode = 1,
369 .max_period = 20,
370 .min_period = 1,
371 .increase_delta = 1,
372 .decrease_delta = 2,
373 .quiet_time = 4,
374 .increase_time = 1,
375 .window_size = 16,
376 },
377};
378
379
42#define WL12XX_TX_HW_BLOCK_SPARE_DEFAULT 1 380#define WL12XX_TX_HW_BLOCK_SPARE_DEFAULT 1
43#define WL12XX_TX_HW_BLOCK_GEM_SPARE 2 381#define WL12XX_TX_HW_BLOCK_GEM_SPARE 2
44#define WL12XX_TX_HW_BLOCK_SIZE 252 382#define WL12XX_TX_HW_BLOCK_SIZE 252
@@ -841,6 +1179,12 @@ out:
841 return ret; 1179 return ret;
842} 1180}
843 1181
1182static void wl12xx_conf_init(struct wl1271 *wl)
1183{
1184 /* apply driver default configuration */
1185 memcpy(&wl->conf, &wl12xx_conf, sizeof(wl12xx_conf));
1186}
1187
844static bool wl12xx_mac_in_fuse(struct wl1271 *wl) 1188static bool wl12xx_mac_in_fuse(struct wl1271 *wl)
845{ 1189{
846 bool supported = false; 1190 bool supported = false;
@@ -947,6 +1291,7 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
947 wl->band_rate_to_idx = wl12xx_band_rate_to_idx; 1291 wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
948 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX; 1292 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
949 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0; 1293 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0;
1294 wl12xx_conf_init(wl);
950 1295
951 return wlcore_probe(wl, pdev); 1296 return wlcore_probe(wl, pdev);
952} 1297}
diff --git a/drivers/net/wireless/ti/wlcore/conf.h b/drivers/net/wireless/ti/wlcore/conf.h
index 11b69510849..4e04e863ac0 100644
--- a/drivers/net/wireless/ti/wlcore/conf.h
+++ b/drivers/net/wireless/ti/wlcore/conf.h
@@ -1272,7 +1272,7 @@ struct conf_hangover_settings {
1272 u8 window_size; 1272 u8 window_size;
1273}; 1273};
1274 1274
1275struct conf_drv_settings { 1275struct wlcore_conf {
1276 struct conf_sg_settings sg; 1276 struct conf_sg_settings sg;
1277 struct conf_rx_settings rx; 1277 struct conf_rx_settings rx;
1278 struct conf_tx_settings tx; 1278 struct conf_tx_settings tx;
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 6a98013329d..d351c8f2dc6 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -53,342 +53,7 @@
53 53
54#define WL1271_BOOT_RETRIES 3 54#define WL1271_BOOT_RETRIES 3
55 55
56static struct conf_drv_settings default_conf = { 56#define WL1271_BOOT_RETRIES 3
57 .sg = {
58 .params = {
59 [CONF_SG_ACL_BT_MASTER_MIN_BR] = 10,
60 [CONF_SG_ACL_BT_MASTER_MAX_BR] = 180,
61 [CONF_SG_ACL_BT_SLAVE_MIN_BR] = 10,
62 [CONF_SG_ACL_BT_SLAVE_MAX_BR] = 180,
63 [CONF_SG_ACL_BT_MASTER_MIN_EDR] = 10,
64 [CONF_SG_ACL_BT_MASTER_MAX_EDR] = 80,
65 [CONF_SG_ACL_BT_SLAVE_MIN_EDR] = 10,
66 [CONF_SG_ACL_BT_SLAVE_MAX_EDR] = 80,
67 [CONF_SG_ACL_WLAN_PS_MASTER_BR] = 8,
68 [CONF_SG_ACL_WLAN_PS_SLAVE_BR] = 8,
69 [CONF_SG_ACL_WLAN_PS_MASTER_EDR] = 20,
70 [CONF_SG_ACL_WLAN_PS_SLAVE_EDR] = 20,
71 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_BR] = 20,
72 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_BR] = 35,
73 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_BR] = 16,
74 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_BR] = 35,
75 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MIN_EDR] = 32,
76 [CONF_SG_ACL_WLAN_ACTIVE_MASTER_MAX_EDR] = 50,
77 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MIN_EDR] = 28,
78 [CONF_SG_ACL_WLAN_ACTIVE_SLAVE_MAX_EDR] = 50,
79 [CONF_SG_ACL_ACTIVE_SCAN_WLAN_BR] = 10,
80 [CONF_SG_ACL_ACTIVE_SCAN_WLAN_EDR] = 20,
81 [CONF_SG_ACL_PASSIVE_SCAN_BT_BR] = 75,
82 [CONF_SG_ACL_PASSIVE_SCAN_WLAN_BR] = 15,
83 [CONF_SG_ACL_PASSIVE_SCAN_BT_EDR] = 27,
84 [CONF_SG_ACL_PASSIVE_SCAN_WLAN_EDR] = 17,
85 /* active scan params */
86 [CONF_SG_AUTO_SCAN_PROBE_REQ] = 170,
87 [CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_HV3] = 50,
88 [CONF_SG_ACTIVE_SCAN_DURATION_FACTOR_A2DP] = 100,
89 /* passive scan params */
90 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_BR] = 800,
91 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_A2DP_EDR] = 200,
92 [CONF_SG_PASSIVE_SCAN_DURATION_FACTOR_HV3] = 200,
93 /* passive scan in dual antenna params */
94 [CONF_SG_CONSECUTIVE_HV3_IN_PASSIVE_SCAN] = 0,
95 [CONF_SG_BCN_HV3_COLLISION_THRESH_IN_PASSIVE_SCAN] = 0,
96 [CONF_SG_TX_RX_PROTECTION_BWIDTH_IN_PASSIVE_SCAN] = 0,
97 /* general params */
98 [CONF_SG_STA_FORCE_PS_IN_BT_SCO] = 1,
99 [CONF_SG_ANTENNA_CONFIGURATION] = 0,
100 [CONF_SG_BEACON_MISS_PERCENT] = 60,
101 [CONF_SG_DHCP_TIME] = 5000,
102 [CONF_SG_RXT] = 1200,
103 [CONF_SG_TXT] = 1000,
104 [CONF_SG_ADAPTIVE_RXT_TXT] = 1,
105 [CONF_SG_GENERAL_USAGE_BIT_MAP] = 3,
106 [CONF_SG_HV3_MAX_SERVED] = 6,
107 [CONF_SG_PS_POLL_TIMEOUT] = 10,
108 [CONF_SG_UPSD_TIMEOUT] = 10,
109 [CONF_SG_CONSECUTIVE_CTS_THRESHOLD] = 2,
110 [CONF_SG_STA_RX_WINDOW_AFTER_DTIM] = 5,
111 [CONF_SG_STA_CONNECTION_PROTECTION_TIME] = 30,
112 /* AP params */
113 [CONF_AP_BEACON_MISS_TX] = 3,
114 [CONF_AP_RX_WINDOW_AFTER_BEACON] = 10,
115 [CONF_AP_BEACON_WINDOW_INTERVAL] = 2,
116 [CONF_AP_CONNECTION_PROTECTION_TIME] = 0,
117 [CONF_AP_BT_ACL_VAL_BT_SERVE_TIME] = 25,
118 [CONF_AP_BT_ACL_VAL_WL_SERVE_TIME] = 25,
119 /* CTS Diluting params */
120 [CONF_SG_CTS_DILUTED_BAD_RX_PACKETS_TH] = 0,
121 [CONF_SG_CTS_CHOP_IN_DUAL_ANT_SCO_MASTER] = 0,
122 },
123 .state = CONF_SG_PROTECTIVE,
124 },
125 .rx = {
126 .rx_msdu_life_time = 512000,
127 .packet_detection_threshold = 0,
128 .ps_poll_timeout = 15,
129 .upsd_timeout = 15,
130 .rts_threshold = IEEE80211_MAX_RTS_THRESHOLD,
131 .rx_cca_threshold = 0,
132 .irq_blk_threshold = 0xFFFF,
133 .irq_pkt_threshold = 0,
134 .irq_timeout = 600,
135 .queue_type = CONF_RX_QUEUE_TYPE_LOW_PRIORITY,
136 },
137 .tx = {
138 .tx_energy_detection = 0,
139 .sta_rc_conf = {
140 .enabled_rates = 0,
141 .short_retry_limit = 10,
142 .long_retry_limit = 10,
143 .aflags = 0,
144 },
145 .ac_conf_count = 4,
146 .ac_conf = {
147 [CONF_TX_AC_BE] = {
148 .ac = CONF_TX_AC_BE,
149 .cw_min = 15,
150 .cw_max = 63,
151 .aifsn = 3,
152 .tx_op_limit = 0,
153 },
154 [CONF_TX_AC_BK] = {
155 .ac = CONF_TX_AC_BK,
156 .cw_min = 15,
157 .cw_max = 63,
158 .aifsn = 7,
159 .tx_op_limit = 0,
160 },
161 [CONF_TX_AC_VI] = {
162 .ac = CONF_TX_AC_VI,
163 .cw_min = 15,
164 .cw_max = 63,
165 .aifsn = CONF_TX_AIFS_PIFS,
166 .tx_op_limit = 3008,
167 },
168 [CONF_TX_AC_VO] = {
169 .ac = CONF_TX_AC_VO,
170 .cw_min = 15,
171 .cw_max = 63,
172 .aifsn = CONF_TX_AIFS_PIFS,
173 .tx_op_limit = 1504,
174 },
175 },
176 .max_tx_retries = 100,
177 .ap_aging_period = 300,
178 .tid_conf_count = 4,
179 .tid_conf = {
180 [CONF_TX_AC_BE] = {
181 .queue_id = CONF_TX_AC_BE,
182 .channel_type = CONF_CHANNEL_TYPE_EDCF,
183 .tsid = CONF_TX_AC_BE,
184 .ps_scheme = CONF_PS_SCHEME_LEGACY,
185 .ack_policy = CONF_ACK_POLICY_LEGACY,
186 .apsd_conf = {0, 0},
187 },
188 [CONF_TX_AC_BK] = {
189 .queue_id = CONF_TX_AC_BK,
190 .channel_type = CONF_CHANNEL_TYPE_EDCF,
191 .tsid = CONF_TX_AC_BK,
192 .ps_scheme = CONF_PS_SCHEME_LEGACY,
193 .ack_policy = CONF_ACK_POLICY_LEGACY,
194 .apsd_conf = {0, 0},
195 },
196 [CONF_TX_AC_VI] = {
197 .queue_id = CONF_TX_AC_VI,
198 .channel_type = CONF_CHANNEL_TYPE_EDCF,
199 .tsid = CONF_TX_AC_VI,
200 .ps_scheme = CONF_PS_SCHEME_LEGACY,
201 .ack_policy = CONF_ACK_POLICY_LEGACY,
202 .apsd_conf = {0, 0},
203 },
204 [CONF_TX_AC_VO] = {
205 .queue_id = CONF_TX_AC_VO,
206 .channel_type = CONF_CHANNEL_TYPE_EDCF,
207 .tsid = CONF_TX_AC_VO,
208 .ps_scheme = CONF_PS_SCHEME_LEGACY,
209 .ack_policy = CONF_ACK_POLICY_LEGACY,
210 .apsd_conf = {0, 0},
211 },
212 },
213 .frag_threshold = IEEE80211_MAX_FRAG_THRESHOLD,
214 .tx_compl_timeout = 700,
215 .tx_compl_threshold = 4,
216 .basic_rate = CONF_HW_BIT_RATE_1MBPS,
217 .basic_rate_5 = CONF_HW_BIT_RATE_6MBPS,
218 .tmpl_short_retry_limit = 10,
219 .tmpl_long_retry_limit = 10,
220 .tx_watchdog_timeout = 5000,
221 },
222 .conn = {
223 .wake_up_event = CONF_WAKE_UP_EVENT_DTIM,
224 .listen_interval = 1,
225 .suspend_wake_up_event = CONF_WAKE_UP_EVENT_N_DTIM,
226 .suspend_listen_interval = 3,
227 .bcn_filt_mode = CONF_BCN_FILT_MODE_ENABLED,
228 .bcn_filt_ie_count = 2,
229 .bcn_filt_ie = {
230 [0] = {
231 .ie = WLAN_EID_CHANNEL_SWITCH,
232 .rule = CONF_BCN_RULE_PASS_ON_APPEARANCE,
233 },
234 [1] = {
235 .ie = WLAN_EID_HT_OPERATION,
236 .rule = CONF_BCN_RULE_PASS_ON_CHANGE,
237 },
238 },
239 .synch_fail_thold = 10,
240 .bss_lose_timeout = 100,
241 .beacon_rx_timeout = 10000,
242 .broadcast_timeout = 20000,
243 .rx_broadcast_in_ps = 1,
244 .ps_poll_threshold = 10,
245 .bet_enable = CONF_BET_MODE_ENABLE,
246 .bet_max_consecutive = 50,
247 .psm_entry_retries = 8,
248 .psm_exit_retries = 16,
249 .psm_entry_nullfunc_retries = 3,
250 .dynamic_ps_timeout = 200,
251 .forced_ps = false,
252 .keep_alive_interval = 55000,
253 .max_listen_interval = 20,
254 },
255 .itrim = {
256 .enable = false,
257 .timeout = 50000,
258 },
259 .pm_config = {
260 .host_clk_settling_time = 5000,
261 .host_fast_wakeup_support = false
262 },
263 .roam_trigger = {
264 .trigger_pacing = 1,
265 .avg_weight_rssi_beacon = 20,
266 .avg_weight_rssi_data = 10,
267 .avg_weight_snr_beacon = 20,
268 .avg_weight_snr_data = 10,
269 },
270 .scan = {
271 .min_dwell_time_active = 7500,
272 .max_dwell_time_active = 30000,
273 .min_dwell_time_passive = 100000,
274 .max_dwell_time_passive = 100000,
275 .num_probe_reqs = 2,
276 .split_scan_timeout = 50000,
277 },
278 .sched_scan = {
279 /*
280 * Values are in TU/1000 but since sched scan FW command
281 * params are in TUs rounding up may occur.
282 */
283 .base_dwell_time = 7500,
284 .max_dwell_time_delta = 22500,
285 /* based on 250bits per probe @1Mbps */
286 .dwell_time_delta_per_probe = 2000,
287 /* based on 250bits per probe @6Mbps (plus a bit more) */
288 .dwell_time_delta_per_probe_5 = 350,
289 .dwell_time_passive = 100000,
290 .dwell_time_dfs = 150000,
291 .num_probe_reqs = 2,
292 .rssi_threshold = -90,
293 .snr_threshold = 0,
294 },
295 .rf = {
296 .tx_per_channel_power_compensation_2 = {
297 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
298 },
299 .tx_per_channel_power_compensation_5 = {
300 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
301 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
302 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
303 },
304 },
305 .ht = {
306 .rx_ba_win_size = 8,
307 .tx_ba_win_size = 64,
308 .inactivity_timeout = 10000,
309 .tx_ba_tid_bitmap = CONF_TX_BA_ENABLED_TID_BITMAP,
310 },
311 .mem_wl127x = {
312 .num_stations = 1,
313 .ssid_profiles = 1,
314 .rx_block_num = 70,
315 .tx_min_block_num = 40,
316 .dynamic_memory = 1,
317 .min_req_tx_blocks = 100,
318 .min_req_rx_blocks = 22,
319 .tx_min = 27,
320 },
321 .mem_wl128x = {
322 .num_stations = 1,
323 .ssid_profiles = 1,
324 .rx_block_num = 40,
325 .tx_min_block_num = 40,
326 .dynamic_memory = 1,
327 .min_req_tx_blocks = 45,
328 .min_req_rx_blocks = 22,
329 .tx_min = 27,
330 },
331 .fm_coex = {
332 .enable = true,
333 .swallow_period = 5,
334 .n_divider_fref_set_1 = 0xff, /* default */
335 .n_divider_fref_set_2 = 12,
336 .m_divider_fref_set_1 = 148,
337 .m_divider_fref_set_2 = 0xffff, /* default */
338 .coex_pll_stabilization_time = 0xffffffff, /* default */
339 .ldo_stabilization_time = 0xffff, /* default */
340 .fm_disturbed_band_margin = 0xff, /* default */
341 .swallow_clk_diff = 0xff, /* default */
342 },
343 .rx_streaming = {
344 .duration = 150,
345 .queues = 0x1,
346 .interval = 20,
347 .always = 0,
348 },
349 .fwlog = {
350 .mode = WL12XX_FWLOG_ON_DEMAND,
351 .mem_blocks = 2,
352 .severity = 0,
353 .timestamp = WL12XX_FWLOG_TIMESTAMP_DISABLED,
354 .output = WL12XX_FWLOG_OUTPUT_HOST,
355 .threshold = 0,
356 },
357 .rate = {
358 .rate_retry_score = 32000,
359 .per_add = 8192,
360 .per_th1 = 2048,
361 .per_th2 = 4096,
362 .max_per = 8100,
363 .inverse_curiosity_factor = 5,
364 .tx_fail_low_th = 4,
365 .tx_fail_high_th = 10,
366 .per_alpha_shift = 4,
367 .per_add_shift = 13,
368 .per_beta1_shift = 10,
369 .per_beta2_shift = 8,
370 .rate_check_up = 2,
371 .rate_check_down = 12,
372 .rate_retry_policy = {
373 0x00, 0x00, 0x00, 0x00, 0x00,
374 0x00, 0x00, 0x00, 0x00, 0x00,
375 0x00, 0x00, 0x00,
376 },
377 },
378 .hangover = {
379 .recover_time = 0,
380 .hangover_period = 20,
381 .dynamic_mode = 1,
382 .early_termination_mode = 1,
383 .max_period = 20,
384 .min_period = 1,
385 .increase_delta = 1,
386 .decrease_delta = 2,
387 .quiet_time = 4,
388 .increase_time = 1,
389 .window_size = 16,
390 },
391};
392 57
393static char *fwlog_param; 58static char *fwlog_param;
394static bool bug_on_recovery; 59static bool bug_on_recovery;
@@ -634,22 +299,8 @@ out:
634 mutex_unlock(&wl->mutex); 299 mutex_unlock(&wl->mutex);
635} 300}
636 301
637static void wl1271_conf_init(struct wl1271 *wl) 302static void wlcore_adjust_conf(struct wl1271 *wl)
638{ 303{
639
640 /*
641 * This function applies the default configuration to the driver. This
642 * function is invoked upon driver load (spi probe.)
643 *
644 * The configuration is stored in a run-time structure in order to
645 * facilitate for run-time adjustment of any of the parameters. Making
646 * changes to the configuration structure will apply the new values on
647 * the next interface up (wl1271_op_start.)
648 */
649
650 /* apply driver default configuration */
651 memcpy(&wl->conf, &default_conf, sizeof(default_conf));
652
653 /* Adjust settings according to optional module parameters */ 304 /* Adjust settings according to optional module parameters */
654 if (fwlog_param) { 305 if (fwlog_param) {
655 if (!strcmp(fwlog_param, "continuous")) { 306 if (!strcmp(fwlog_param, "continuous")) {
@@ -5190,9 +4841,6 @@ struct ieee80211_hw *wlcore_alloc_hw(size_t priv_size)
5190 wl->fw_type = WL12XX_FW_TYPE_NONE; 4841 wl->fw_type = WL12XX_FW_TYPE_NONE;
5191 mutex_init(&wl->mutex); 4842 mutex_init(&wl->mutex);
5192 4843
5193 /* Apply default driver configuration. */
5194 wl1271_conf_init(wl);
5195
5196 order = get_order(WL1271_AGGR_BUFFER_SIZE); 4844 order = get_order(WL1271_AGGR_BUFFER_SIZE);
5197 wl->aggr_buf = (u8 *)__get_free_pages(GFP_KERNEL, order); 4845 wl->aggr_buf = (u8 *)__get_free_pages(GFP_KERNEL, order);
5198 if (!wl->aggr_buf) { 4846 if (!wl->aggr_buf) {
@@ -5325,6 +4973,9 @@ int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev)
5325 4973
5326 BUG_ON(wl->num_tx_desc > WLCORE_MAX_TX_DESCRIPTORS); 4974 BUG_ON(wl->num_tx_desc > WLCORE_MAX_TX_DESCRIPTORS);
5327 4975
4976 /* adjust some runtime configuration parameters */
4977 wlcore_adjust_conf(wl);
4978
5328 wl->irq = platform_get_irq(pdev, 0); 4979 wl->irq = platform_get_irq(pdev, 0);
5329 wl->ref_clock = pdata->board_ref_clock; 4980 wl->ref_clock = pdata->board_ref_clock;
5330 wl->tcxo_clock = pdata->board_tcxo_clock; 4981 wl->tcxo_clock = pdata->board_tcxo_clock;
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 83f1d7cfd78..9f33f96e803 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -261,7 +261,7 @@ struct wl1271 {
261 struct wl1271_tx_hw_res_if *tx_res_if; 261 struct wl1271_tx_hw_res_if *tx_res_if;
262 262
263 /* Current chipset configuration */ 263 /* Current chipset configuration */
264 struct conf_drv_settings conf; 264 struct wlcore_conf conf;
265 265
266 bool sg_enabled; 266 bool sg_enabled;
267 267