aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/assoc.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-12-18 00:18:05 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:07:49 -0500
commitf70dd4515a8ad9c9d59ebb8c1d1fa2c610fb4020 (patch)
treeb9c5f3682972024fad4726a4163bbfb74a55ac0b /drivers/net/wireless/libertas/assoc.c
parent3fbe104cecdb8c812976fdb0cc41be65491b85ee (diff)
libertas: convert SET_WEP to a direct command
Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/assoc.c')
-rw-r--r--drivers/net/wireless/libertas/assoc.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 882e51c16a75..e91cd6724de7 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -258,7 +258,7 @@ static int assoc_helper_channel(struct lbs_private *priv,
258 258
259 259
260static int assoc_helper_wep_keys(struct lbs_private *priv, 260static int assoc_helper_wep_keys(struct lbs_private *priv,
261 struct assoc_request * assoc_req) 261 struct assoc_request *assoc_req)
262{ 262{
263 int i; 263 int i;
264 int ret = 0; 264 int ret = 0;
@@ -266,22 +266,11 @@ static int assoc_helper_wep_keys(struct lbs_private *priv,
266 lbs_deb_enter(LBS_DEB_ASSOC); 266 lbs_deb_enter(LBS_DEB_ASSOC);
267 267
268 /* Set or remove WEP keys */ 268 /* Set or remove WEP keys */
269 if ( assoc_req->wep_keys[0].len 269 if (assoc_req->wep_keys[0].len || assoc_req->wep_keys[1].len ||
270 || assoc_req->wep_keys[1].len 270 assoc_req->wep_keys[2].len || assoc_req->wep_keys[3].len)
271 || assoc_req->wep_keys[2].len 271 ret = lbs_cmd_802_11_set_wep(priv, CMD_ACT_ADD, assoc_req);
272 || assoc_req->wep_keys[3].len) { 272 else
273 ret = lbs_prepare_and_send_command(priv, 273 ret = lbs_cmd_802_11_set_wep(priv, CMD_ACT_REMOVE, assoc_req);
274 CMD_802_11_SET_WEP,
275 CMD_ACT_ADD,
276 CMD_OPTION_WAITFORRSP,
277 0, assoc_req);
278 } else {
279 ret = lbs_prepare_and_send_command(priv,
280 CMD_802_11_SET_WEP,
281 CMD_ACT_REMOVE,
282 CMD_OPTION_WAITFORRSP,
283 0, NULL);
284 }
285 274
286 if (ret) 275 if (ret)
287 goto out; 276 goto out;
@@ -291,6 +280,7 @@ static int assoc_helper_wep_keys(struct lbs_private *priv,
291 priv->currentpacketfilter |= CMD_ACT_MAC_WEP_ENABLE; 280 priv->currentpacketfilter |= CMD_ACT_MAC_WEP_ENABLE;
292 else 281 else
293 priv->currentpacketfilter &= ~CMD_ACT_MAC_WEP_ENABLE; 282 priv->currentpacketfilter &= ~CMD_ACT_MAC_WEP_ENABLE;
283
294 ret = lbs_set_mac_packet_filter(priv); 284 ret = lbs_set_mac_packet_filter(priv);
295 if (ret) 285 if (ret)
296 goto out; 286 goto out;
@@ -300,7 +290,7 @@ static int assoc_helper_wep_keys(struct lbs_private *priv,
300 /* Copy WEP keys into priv wep key fields */ 290 /* Copy WEP keys into priv wep key fields */
301 for (i = 0; i < 4; i++) { 291 for (i = 0; i < 4; i++) {
302 memcpy(&priv->wep_keys[i], &assoc_req->wep_keys[i], 292 memcpy(&priv->wep_keys[i], &assoc_req->wep_keys[i],
303 sizeof(struct enc_key)); 293 sizeof(struct enc_key));
304 } 294 }
305 priv->wep_tx_keyidx = assoc_req->wep_tx_keyidx; 295 priv->wep_tx_keyidx = assoc_req->wep_tx_keyidx;
306 296