aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@nokia.com>2009-12-11 08:40:50 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-28 16:31:31 -0500
commit6e92b416b0aa6a59629cc32ee2b27129d73b98b8 (patch)
tree8514223049b03e3adf169b961769891339f0a511 /drivers/net
parentac9b40fac6983ab30e8b5019a5d2abda200c89d5 (diff)
wl1271: implement dco itrim parameters setting
Newer firmwares require the dco itrim parameters to be set during initialization. This patch implements the new ACX function and calls it. Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.c29
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_acx.h10
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_conf.h9
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_init.c4
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c4
5 files changed, 56 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.c b/drivers/net/wireless/wl12xx/wl1271_acx.c
index 5cc89bbdac7a..a38a967ba78a 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.c
@@ -390,6 +390,35 @@ out:
390 return ret; 390 return ret;
391} 391}
392 392
393int wl1271_acx_dco_itrim_params(struct wl1271 *wl)
394{
395 struct acx_dco_itrim_params *dco;
396 struct conf_itrim_settings *c = &wl->conf.itrim;
397 int ret;
398
399 wl1271_debug(DEBUG_ACX, "acx dco itrim parameters");
400
401 dco = kzalloc(sizeof(*dco), GFP_KERNEL);
402 if (!dco) {
403 ret = -ENOMEM;
404 goto out;
405 }
406
407 dco->enable = c->enable;
408 dco->timeout = cpu_to_le32(c->timeout);
409
410 ret = wl1271_cmd_configure(wl, ACX_SET_DCO_ITRIM_PARAMS,
411 dco, sizeof(*dco));
412 if (ret < 0) {
413 wl1271_warning("failed to set dco itrim parameters: %d", ret);
414 goto out;
415 }
416
417out:
418 kfree(dco);
419 return ret;
420}
421
393int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter) 422int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter)
394{ 423{
395 struct acx_beacon_filter_option *beacon_filter = NULL; 424 struct acx_beacon_filter_option *beacon_filter = NULL;
diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h
index 2ce0a8128542..fa5d9539440d 100644
--- a/drivers/net/wireless/wl12xx/wl1271_acx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_acx.h
@@ -434,6 +434,14 @@ struct acx_smart_reflex_config_params {
434 struct smart_reflex_err_table error_table[3]; 434 struct smart_reflex_err_table error_table[3];
435} __attribute__ ((packed)); 435} __attribute__ ((packed));
436 436
437struct acx_dco_itrim_params {
438 struct acx_header header;
439
440 u8 enable;
441 u8 padding[3];
442 __le32 timeout;
443} __attribute__ ((packed));
444
437#define PTA_ANTENNA_TYPE_DEF (0) 445#define PTA_ANTENNA_TYPE_DEF (0)
438#define PTA_BT_HP_MAXTIME_DEF (2000) 446#define PTA_BT_HP_MAXTIME_DEF (2000)
439#define PTA_WLAN_HP_MAX_TIME_DEF (5000) 447#define PTA_WLAN_HP_MAX_TIME_DEF (5000)
@@ -1029,6 +1037,7 @@ enum {
1029 ACX_SET_SMART_REFLEX_DEBUG = 0x005A, 1037 ACX_SET_SMART_REFLEX_DEBUG = 0x005A,
1030 ACX_SET_SMART_REFLEX_STATE = 0x005B, 1038 ACX_SET_SMART_REFLEX_STATE = 0x005B,
1031 ACX_SET_SMART_REFLEX_PARAMS = 0x005F, 1039 ACX_SET_SMART_REFLEX_PARAMS = 0x005F,
1040 ACX_SET_DCO_ITRIM_PARAMS = 0x0061,
1032 DOT11_RX_MSDU_LIFE_TIME = 0x1004, 1041 DOT11_RX_MSDU_LIFE_TIME = 0x1004,
1033 DOT11_CUR_TX_PWR = 0x100D, 1042 DOT11_CUR_TX_PWR = 0x100D,
1034 DOT11_RX_DOT11_MODE = 0x1012, 1043 DOT11_RX_DOT11_MODE = 0x1012,
@@ -1056,6 +1065,7 @@ int wl1271_acx_group_address_tbl(struct wl1271 *wl, bool enable,
1056 void *mc_list, u32 mc_list_len); 1065 void *mc_list, u32 mc_list_len);
1057int wl1271_acx_service_period_timeout(struct wl1271 *wl); 1066int wl1271_acx_service_period_timeout(struct wl1271 *wl);
1058int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold); 1067int wl1271_acx_rts_threshold(struct wl1271 *wl, u16 rts_threshold);
1068int wl1271_acx_dco_itrim_params(struct wl1271 *wl);
1059int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter); 1069int wl1271_acx_beacon_filter_opt(struct wl1271 *wl, bool enable_filter);
1060int wl1271_acx_beacon_filter_table(struct wl1271 *wl); 1070int wl1271_acx_beacon_filter_table(struct wl1271 *wl);
1061int wl1271_acx_conn_monit_params(struct wl1271 *wl); 1071int wl1271_acx_conn_monit_params(struct wl1271 *wl);
diff --git a/drivers/net/wireless/wl12xx/wl1271_conf.h b/drivers/net/wireless/wl12xx/wl1271_conf.h
index a4bd35b0f9fd..905d4287915b 100644
--- a/drivers/net/wireless/wl12xx/wl1271_conf.h
+++ b/drivers/net/wireless/wl12xx/wl1271_conf.h
@@ -934,12 +934,21 @@ struct conf_init_settings {
934 934
935}; 935};
936 936
937struct conf_itrim_settings {
938 /* enable dco itrim */
939 u8 enable;
940
941 /* moderation timeout in microsecs from the last TX */
942 u32 timeout;
943};
944
937struct conf_drv_settings { 945struct conf_drv_settings {
938 struct conf_sg_settings sg; 946 struct conf_sg_settings sg;
939 struct conf_rx_settings rx; 947 struct conf_rx_settings rx;
940 struct conf_tx_settings tx; 948 struct conf_tx_settings tx;
941 struct conf_conn_settings conn; 949 struct conf_conn_settings conn;
942 struct conf_init_settings init; 950 struct conf_init_settings init;
951 struct conf_itrim_settings itrim;
943}; 952};
944 953
945#endif 954#endif
diff --git a/drivers/net/wireless/wl12xx/wl1271_init.c b/drivers/net/wireless/wl12xx/wl1271_init.c
index d72ccc68b855..39f01d875703 100644
--- a/drivers/net/wireless/wl12xx/wl1271_init.c
+++ b/drivers/net/wireless/wl12xx/wl1271_init.c
@@ -229,6 +229,10 @@ int wl1271_hw_init(struct wl1271 *wl)
229 if (ret < 0) 229 if (ret < 0)
230 goto out_free_memmap; 230 goto out_free_memmap;
231 231
232 ret = wl1271_acx_dco_itrim_params(wl);
233 if (ret < 0)
234 goto out_free_memmap;
235
232 /* Initialize connection monitoring thresholds */ 236 /* Initialize connection monitoring thresholds */
233 ret = wl1271_acx_conn_monit_params(wl); 237 ret = wl1271_acx_conn_monit_params(wl);
234 if (ret < 0) 238 if (ret < 0)
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 64f8623e0325..8c44f4cd688d 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -338,6 +338,10 @@ static struct conf_drv_settings default_conf = {
338 .degraded_low_to_normal_threshold_5 = 0x00, 338 .degraded_low_to_normal_threshold_5 = 0x00,
339 .degraded_normal_to_high_threshold_5 = 0x00 339 .degraded_normal_to_high_threshold_5 = 0x00
340 } 340 }
341 },
342 .itrim = {
343 .enable = false,
344 .timeout = 50000,
341 } 345 }
342}; 346};
343 347