aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_cmd.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 596e333919ae..5d3e8485ea4e 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -108,6 +108,8 @@ out:
108int wl1271_cmd_general_parms(struct wl1271 *wl) 108int wl1271_cmd_general_parms(struct wl1271 *wl)
109{ 109{
110 struct wl1271_general_parms_cmd *gen_parms; 110 struct wl1271_general_parms_cmd *gen_parms;
111 struct wl1271_ini_general_params *gp = &wl->nvs->general_params;
112 bool answer = false;
111 int ret; 113 int ret;
112 114
113 if (!wl->nvs) 115 if (!wl->nvs)
@@ -119,13 +121,24 @@ int wl1271_cmd_general_parms(struct wl1271 *wl)
119 121
120 gen_parms->test.id = TEST_CMD_INI_FILE_GENERAL_PARAM; 122 gen_parms->test.id = TEST_CMD_INI_FILE_GENERAL_PARAM;
121 123
122 memcpy(&gen_parms->general_params, &wl->nvs->general_params, 124 memcpy(&gen_parms->general_params, gp, sizeof(*gp));
123 sizeof(struct wl1271_ini_general_params));
124 125
125 ret = wl1271_cmd_test(wl, gen_parms, sizeof(*gen_parms), 0); 126 if (gp->tx_bip_fem_auto_detect)
126 if (ret < 0) 127 answer = true;
128
129 ret = wl1271_cmd_test(wl, gen_parms, sizeof(*gen_parms), answer);
130 if (ret < 0) {
127 wl1271_warning("CMD_INI_FILE_GENERAL_PARAM failed"); 131 wl1271_warning("CMD_INI_FILE_GENERAL_PARAM failed");
132 goto out;
133 }
134
135 gp->tx_bip_fem_manufacturer =
136 gen_parms->general_params.tx_bip_fem_manufacturer;
128 137
138 wl1271_debug(DEBUG_CMD, "FEM autodetect: %s, manufacturer: %d\n",
139 answer ? "auto" : "manual", gp->tx_bip_fem_manufacturer);
140
141out:
129 kfree(gen_parms); 142 kfree(gen_parms);
130 return ret; 143 return ret;
131} 144}