diff options
Diffstat (limited to 'drivers/net/wireless/libertas/cmdresp.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 69 |
1 files changed, 3 insertions, 66 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index f0ef7081bdeb..63aa884b18f2 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -74,7 +74,7 @@ void lbs_mac_event_disconnected(struct lbs_private *priv) | |||
74 | lbs_deb_cmd("disconnected, so exit PS mode\n"); | 74 | lbs_deb_cmd("disconnected, so exit PS mode\n"); |
75 | lbs_ps_wakeup(priv, 0); | 75 | lbs_ps_wakeup(priv, 0); |
76 | } | 76 | } |
77 | lbs_deb_leave(LBS_DEB_CMD); | 77 | lbs_deb_leave(LBS_DEB_ASSOC); |
78 | } | 78 | } |
79 | 79 | ||
80 | /** | 80 | /** |
@@ -204,61 +204,6 @@ static int lbs_ret_802_11_snmp_mib(struct lbs_private *priv, | |||
204 | return 0; | 204 | return 0; |
205 | } | 205 | } |
206 | 206 | ||
207 | static int lbs_ret_802_11_key_material(struct lbs_private *priv, | ||
208 | struct cmd_ds_command *resp) | ||
209 | { | ||
210 | struct cmd_ds_802_11_key_material *pkeymaterial = | ||
211 | &resp->params.keymaterial; | ||
212 | u16 action = le16_to_cpu(pkeymaterial->action); | ||
213 | |||
214 | lbs_deb_enter(LBS_DEB_CMD); | ||
215 | |||
216 | /* Copy the returned key to driver private data */ | ||
217 | if (action == CMD_ACT_GET) { | ||
218 | u8 * buf_ptr = (u8 *) &pkeymaterial->keyParamSet; | ||
219 | u8 * resp_end = (u8 *) (resp + le16_to_cpu(resp->size)); | ||
220 | |||
221 | while (buf_ptr < resp_end) { | ||
222 | struct MrvlIEtype_keyParamSet * pkeyparamset = | ||
223 | (struct MrvlIEtype_keyParamSet *) buf_ptr; | ||
224 | struct enc_key * pkey; | ||
225 | u16 param_set_len = le16_to_cpu(pkeyparamset->length); | ||
226 | u16 key_len = le16_to_cpu(pkeyparamset->keylen); | ||
227 | u16 key_flags = le16_to_cpu(pkeyparamset->keyinfo); | ||
228 | u16 key_type = le16_to_cpu(pkeyparamset->keytypeid); | ||
229 | u8 * end; | ||
230 | |||
231 | end = (u8 *) pkeyparamset + sizeof (pkeyparamset->type) | ||
232 | + sizeof (pkeyparamset->length) | ||
233 | + param_set_len; | ||
234 | /* Make sure we don't access past the end of the IEs */ | ||
235 | if (end > resp_end) | ||
236 | break; | ||
237 | |||
238 | if (key_flags & KEY_INFO_WPA_UNICAST) | ||
239 | pkey = &priv->wpa_unicast_key; | ||
240 | else if (key_flags & KEY_INFO_WPA_MCAST) | ||
241 | pkey = &priv->wpa_mcast_key; | ||
242 | else | ||
243 | break; | ||
244 | |||
245 | /* Copy returned key into driver */ | ||
246 | memset(pkey, 0, sizeof(struct enc_key)); | ||
247 | if (key_len > sizeof(pkey->key)) | ||
248 | break; | ||
249 | pkey->type = key_type; | ||
250 | pkey->flags = key_flags; | ||
251 | pkey->len = key_len; | ||
252 | memcpy(pkey->key, pkeyparamset->key, pkey->len); | ||
253 | |||
254 | buf_ptr = end + 1; | ||
255 | } | ||
256 | } | ||
257 | |||
258 | lbs_deb_enter(LBS_DEB_CMD); | ||
259 | return 0; | ||
260 | } | ||
261 | |||
262 | static int lbs_ret_802_11_mac_address(struct lbs_private *priv, | 207 | static int lbs_ret_802_11_mac_address(struct lbs_private *priv, |
263 | struct cmd_ds_command *resp) | 208 | struct cmd_ds_command *resp) |
264 | { | 209 | { |
@@ -407,10 +352,6 @@ static inline int handle_cmd_response(struct lbs_private *priv, | |||
407 | ret = lbs_ret_reg_access(priv, respcmd, resp); | 352 | ret = lbs_ret_reg_access(priv, respcmd, resp); |
408 | break; | 353 | break; |
409 | 354 | ||
410 | case CMD_RET(CMD_802_11_SCAN): | ||
411 | ret = lbs_ret_80211_scan(priv, resp); | ||
412 | break; | ||
413 | |||
414 | case CMD_RET(CMD_802_11_GET_LOG): | 355 | case CMD_RET(CMD_802_11_GET_LOG): |
415 | ret = lbs_ret_get_log(priv, resp); | 356 | ret = lbs_ret_get_log(priv, resp); |
416 | break; | 357 | break; |
@@ -475,10 +416,6 @@ static inline int handle_cmd_response(struct lbs_private *priv, | |||
475 | ret = lbs_ret_80211_ad_hoc_stop(priv, resp); | 416 | ret = lbs_ret_80211_ad_hoc_stop(priv, resp); |
476 | break; | 417 | break; |
477 | 418 | ||
478 | case CMD_RET(CMD_802_11_KEY_MATERIAL): | ||
479 | ret = lbs_ret_802_11_key_material(priv, resp); | ||
480 | break; | ||
481 | |||
482 | case CMD_RET(CMD_802_11_EEPROM_ACCESS): | 419 | case CMD_RET(CMD_802_11_EEPROM_ACCESS): |
483 | ret = lbs_ret_802_11_eeprom_access(priv, resp); | 420 | ret = lbs_ret_802_11_eeprom_access(priv, resp); |
484 | break; | 421 | break; |
@@ -566,9 +503,9 @@ int lbs_process_rx_command(struct lbs_private *priv) | |||
566 | respcmd = le16_to_cpu(resp->command); | 503 | respcmd = le16_to_cpu(resp->command); |
567 | result = le16_to_cpu(resp->result); | 504 | result = le16_to_cpu(resp->result); |
568 | 505 | ||
569 | lbs_deb_host("CMD_RESP: response 0x%04x, seq %d, size %d, jiffies %lu\n", | 506 | lbs_deb_cmd("CMD_RESP: response 0x%04x, seq %d, size %d, jiffies %lu\n", |
570 | respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies); | 507 | respcmd, le16_to_cpu(resp->seqnum), priv->upld_len, jiffies); |
571 | lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", (void *) resp, priv->upld_len); | 508 | lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", (void *) resp, priv->upld_len); |
572 | 509 | ||
573 | if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) { | 510 | if (resp->seqnum != priv->cur_cmd->cmdbuf->seqnum) { |
574 | lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", | 511 | lbs_pr_info("Received CMD_RESP with invalid sequence %d (expected %d)\n", |