aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-07-08 10:49:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-07-08 16:35:50 -0400
commitab2807efcfd2dd646a2ca8d71585e26cda3fc0c1 (patch)
treefe67d7aa5f9463caf870df150988dfba2e7a2150 /drivers
parent3473187d2459a078e00e5fac8aafc30af69c57fa (diff)
wl1271: Remove calibration from join command
This patch removes the calibration performed on the first join command. The reasoning is that this is unnecessary as devices get their calibration data via the NVS file, and because the commands break BT coexistence. This is actually safe, because of the implementation the calibration was executed on the first JOIN anyway, after an ifdown/ifup the devices have relied on the NVS for calibration anyway (== most of the time.) Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c104
1 files changed, 0 insertions, 104 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 530678e45a13..8307f21053f8 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -104,100 +104,6 @@ out:
104 return ret; 104 return ret;
105} 105}
106 106
107static int wl1271_cmd_cal_channel_tune(struct wl1271 *wl)
108{
109 struct wl1271_cmd_cal_channel_tune *cmd;
110 int ret = 0;
111
112 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
113 if (!cmd)
114 return -ENOMEM;
115
116 cmd->test.id = TEST_CMD_CHANNEL_TUNE;
117
118 cmd->band = WL1271_CHANNEL_TUNE_BAND_2_4;
119 /* set up any channel, 7 is in the middle of the range */
120 cmd->channel = 7;
121
122 ret = wl1271_cmd_test(wl, cmd, sizeof(*cmd), 0);
123 if (ret < 0)
124 wl1271_warning("TEST_CMD_CHANNEL_TUNE failed");
125
126 kfree(cmd);
127 return ret;
128}
129
130static int wl1271_cmd_cal_update_ref_point(struct wl1271 *wl)
131{
132 struct wl1271_cmd_cal_update_ref_point *cmd;
133 int ret = 0;
134
135 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
136 if (!cmd)
137 return -ENOMEM;
138
139 cmd->test.id = TEST_CMD_UPDATE_PD_REFERENCE_POINT;
140
141 /* FIXME: still waiting for the correct values */
142 cmd->ref_power = 0;
143 cmd->ref_detector = 0;
144
145 cmd->sub_band = WL1271_PD_REFERENCE_POINT_BAND_B_G;
146
147 ret = wl1271_cmd_test(wl, cmd, sizeof(*cmd), 0);
148 if (ret < 0)
149 wl1271_warning("TEST_CMD_UPDATE_PD_REFERENCE_POINT failed");
150
151 kfree(cmd);
152 return ret;
153}
154
155static int wl1271_cmd_cal_p2g(struct wl1271 *wl)
156{
157 struct wl1271_cmd_cal_p2g *cmd;
158 int ret = 0;
159
160 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
161 if (!cmd)
162 return -ENOMEM;
163
164 cmd->test.id = TEST_CMD_P2G_CAL;
165
166 cmd->sub_band_mask = WL1271_CAL_P2G_BAND_B_G;
167
168 ret = wl1271_cmd_test(wl, cmd, sizeof(*cmd), 0);
169 if (ret < 0)
170 wl1271_warning("TEST_CMD_P2G_CAL failed");
171
172 kfree(cmd);
173 return ret;
174}
175
176static int wl1271_cmd_cal(struct wl1271 *wl)
177{
178 /*
179 * FIXME: we must make sure that we're not sleeping when calibration
180 * is done
181 */
182 int ret;
183
184 wl1271_notice("performing tx calibration");
185
186 ret = wl1271_cmd_cal_channel_tune(wl);
187 if (ret < 0)
188 return ret;
189
190 ret = wl1271_cmd_cal_update_ref_point(wl);
191 if (ret < 0)
192 return ret;
193
194 ret = wl1271_cmd_cal_p2g(wl);
195 if (ret < 0)
196 return ret;
197
198 return ret;
199}
200
201int wl1271_cmd_general_parms(struct wl1271 *wl) 107int wl1271_cmd_general_parms(struct wl1271 *wl)
202{ 108{
203 struct wl1271_general_parms_cmd *gen_parms; 109 struct wl1271_general_parms_cmd *gen_parms;
@@ -295,20 +201,10 @@ static int wl1271_cmd_wait_for_event(struct wl1271 *wl, u32 mask)
295 201
296int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type) 202int wl1271_cmd_join(struct wl1271 *wl, u8 bss_type)
297{ 203{
298 static bool do_cal = true;
299 struct wl1271_cmd_join *join; 204 struct wl1271_cmd_join *join;
300 int ret, i; 205 int ret, i;
301 u8 *bssid; 206 u8 *bssid;
302 207
303 /* FIXME: remove when we get calibration from the factory */
304 if (do_cal) {
305 ret = wl1271_cmd_cal(wl);
306 if (ret < 0)
307 wl1271_warning("couldn't calibrate");
308 else
309 do_cal = false;
310 }
311
312 join = kzalloc(sizeof(*join), GFP_KERNEL); 208 join = kzalloc(sizeof(*join), GFP_KERNEL);
313 if (!join) { 209 if (!join) {
314 ret = -ENOMEM; 210 ret = -ENOMEM;