diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_init.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271_init.c | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c index e3806b035d0c..4447af1557f5 100644 --- a/drivers/net/wireless/wl12xx/wl1271_init.c +++ b/drivers/net/wireless/wl12xx/wl1271_init.c | |||
@@ -52,50 +52,65 @@ static int wl1271_init_hwenc_config(struct wl1271 *wl) | |||
52 | 52 | ||
53 | int wl1271_init_templates_config(struct wl1271 *wl) | 53 | int wl1271_init_templates_config(struct wl1271 *wl) |
54 | { | 54 | { |
55 | int ret; | 55 | int ret, i; |
56 | 56 | ||
57 | /* send empty templates for fw memory reservation */ | 57 | /* send empty templates for fw memory reservation */ |
58 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL, | 58 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_2_4, NULL, |
59 | sizeof(struct wl12xx_probe_req_template)); | 59 | sizeof(struct wl12xx_probe_req_template), |
60 | 0, WL1271_RATE_AUTOMATIC); | ||
60 | if (ret < 0) | 61 | if (ret < 0) |
61 | return ret; | 62 | return ret; |
62 | 63 | ||
63 | if (wl1271_11a_enabled()) { | 64 | if (wl1271_11a_enabled()) { |
65 | size_t size = sizeof(struct wl12xx_probe_req_template); | ||
64 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, | 66 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_CFG_PROBE_REQ_5, |
65 | NULL, | 67 | NULL, size, 0, |
66 | sizeof(struct wl12xx_probe_req_template)); | 68 | WL1271_RATE_AUTOMATIC); |
67 | if (ret < 0) | 69 | if (ret < 0) |
68 | return ret; | 70 | return ret; |
69 | } | 71 | } |
70 | 72 | ||
71 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, | 73 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_NULL_DATA, NULL, |
72 | sizeof(struct wl12xx_null_data_template)); | 74 | sizeof(struct wl12xx_null_data_template), |
75 | 0, WL1271_RATE_AUTOMATIC); | ||
73 | if (ret < 0) | 76 | if (ret < 0) |
74 | return ret; | 77 | return ret; |
75 | 78 | ||
76 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, NULL, | 79 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PS_POLL, NULL, |
77 | sizeof(struct wl12xx_ps_poll_template)); | 80 | sizeof(struct wl12xx_ps_poll_template), |
81 | 0, WL1271_RATE_AUTOMATIC); | ||
78 | if (ret < 0) | 82 | if (ret < 0) |
79 | return ret; | 83 | return ret; |
80 | 84 | ||
81 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, NULL, | 85 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_QOS_NULL_DATA, NULL, |
82 | sizeof | 86 | sizeof |
83 | (struct wl12xx_qos_null_data_template)); | 87 | (struct wl12xx_qos_null_data_template), |
88 | 0, WL1271_RATE_AUTOMATIC); | ||
84 | if (ret < 0) | 89 | if (ret < 0) |
85 | return ret; | 90 | return ret; |
86 | 91 | ||
87 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PROBE_RESPONSE, NULL, | 92 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_PROBE_RESPONSE, NULL, |
88 | sizeof | 93 | sizeof |
89 | (struct wl12xx_probe_resp_template)); | 94 | (struct wl12xx_probe_resp_template), |
95 | 0, WL1271_RATE_AUTOMATIC); | ||
90 | if (ret < 0) | 96 | if (ret < 0) |
91 | return ret; | 97 | return ret; |
92 | 98 | ||
93 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, NULL, | 99 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_BEACON, NULL, |
94 | sizeof | 100 | sizeof |
95 | (struct wl12xx_beacon_template)); | 101 | (struct wl12xx_beacon_template), |
102 | 0, WL1271_RATE_AUTOMATIC); | ||
96 | if (ret < 0) | 103 | if (ret < 0) |
97 | return ret; | 104 | return ret; |
98 | 105 | ||
106 | for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) { | ||
107 | ret = wl1271_cmd_template_set(wl, CMD_TEMPL_KLV, NULL, | ||
108 | WL1271_CMD_TEMPL_MAX_SIZE, i, | ||
109 | WL1271_RATE_AUTOMATIC); | ||
110 | if (ret < 0) | ||
111 | return ret; | ||
112 | } | ||
113 | |||
99 | return 0; | 114 | return 0; |
100 | } | 115 | } |
101 | 116 | ||
@@ -237,7 +252,7 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
237 | goto out_free_memmap; | 252 | goto out_free_memmap; |
238 | 253 | ||
239 | /* Initialize connection monitoring thresholds */ | 254 | /* Initialize connection monitoring thresholds */ |
240 | ret = wl1271_acx_conn_monit_params(wl); | 255 | ret = wl1271_acx_conn_monit_params(wl, false); |
241 | if (ret < 0) | 256 | if (ret < 0) |
242 | goto out_free_memmap; | 257 | goto out_free_memmap; |
243 | 258 | ||
@@ -325,6 +340,24 @@ int wl1271_hw_init(struct wl1271 *wl) | |||
325 | if (ret < 0) | 340 | if (ret < 0) |
326 | goto out_free_memmap; | 341 | goto out_free_memmap; |
327 | 342 | ||
343 | /* disable all keep-alive templates */ | ||
344 | for (i = 0; i < CMD_TEMPL_KLV_IDX_MAX; i++) { | ||
345 | ret = wl1271_acx_keep_alive_config(wl, i, | ||
346 | ACX_KEEP_ALIVE_TPL_INVALID); | ||
347 | if (ret < 0) | ||
348 | goto out_free_memmap; | ||
349 | } | ||
350 | |||
351 | /* disable the keep-alive feature */ | ||
352 | ret = wl1271_acx_keep_alive_mode(wl, false); | ||
353 | if (ret < 0) | ||
354 | goto out_free_memmap; | ||
355 | |||
356 | /* Configure rssi/snr averaging weights */ | ||
357 | ret = wl1271_acx_rssi_snr_avg_weights(wl); | ||
358 | if (ret < 0) | ||
359 | goto out_free_memmap; | ||
360 | |||
328 | return 0; | 361 | return 0; |
329 | 362 | ||
330 | out_free_memmap: | 363 | out_free_memmap: |