diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2007-08-02 11:54:10 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:49:54 -0400 |
commit | a6c8700f36cd8f217420bbe26721094824fab8de (patch) | |
tree | 77d19dc1607ff7cd8530500ac3595e37fa050a3b | |
parent | 6b63cd0f420c3c3002024da6c9eff252a3772021 (diff) |
[PATCH] libertas: use LBS_DEB_HOST for host-to-card communications
... and LBS_DEB_CMD for command execution. Also tidies misc
comments to give a consistent output.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 147 |
1 files changed, 78 insertions, 69 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index ae11e1f2739f..197d04517840 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -31,7 +31,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) | |||
31 | if (adapter->connect_status != LIBERTAS_CONNECTED) | 31 | if (adapter->connect_status != LIBERTAS_CONNECTED) |
32 | return; | 32 | return; |
33 | 33 | ||
34 | lbs_deb_cmd("Handles disconnect event.\n"); | 34 | lbs_deb_enter(LBS_DEB_CMD); |
35 | 35 | ||
36 | memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN); | 36 | memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN); |
37 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | 37 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; |
@@ -61,11 +61,11 @@ void libertas_mac_event_disconnected(wlan_private * priv) | |||
61 | adapter->nextSNRNF = 0; | 61 | adapter->nextSNRNF = 0; |
62 | adapter->numSNRNF = 0; | 62 | adapter->numSNRNF = 0; |
63 | adapter->rxpd_rate = 0; | 63 | adapter->rxpd_rate = 0; |
64 | lbs_deb_cmd("Current SSID='%s', ssid length=%u\n", | 64 | lbs_deb_cmd("current SSID '%s', length %u\n", |
65 | escape_essid(adapter->curbssparams.ssid, | 65 | escape_essid(adapter->curbssparams.ssid, |
66 | adapter->curbssparams.ssid_len), | 66 | adapter->curbssparams.ssid_len), |
67 | adapter->curbssparams.ssid_len); | 67 | adapter->curbssparams.ssid_len); |
68 | lbs_deb_cmd("Previous SSID='%s', ssid length=%u\n", | 68 | lbs_deb_cmd("previous SSID '%s', length %u\n", |
69 | escape_essid(adapter->prev_ssid, adapter->prev_ssid_len), | 69 | escape_essid(adapter->prev_ssid, adapter->prev_ssid_len), |
70 | adapter->prev_ssid_len); | 70 | adapter->prev_ssid_len); |
71 | 71 | ||
@@ -86,9 +86,10 @@ void libertas_mac_event_disconnected(wlan_private * priv) | |||
86 | 86 | ||
87 | if (adapter->psstate != PS_STATE_FULL_POWER) { | 87 | if (adapter->psstate != PS_STATE_FULL_POWER) { |
88 | /* make firmware to exit PS mode */ | 88 | /* make firmware to exit PS mode */ |
89 | lbs_deb_cmd("Disconnected, so exit PS mode.\n"); | 89 | lbs_deb_cmd("disconnected, so exit PS mode\n"); |
90 | libertas_ps_wakeup(priv, 0); | 90 | libertas_ps_wakeup(priv, 0); |
91 | } | 91 | } |
92 | lbs_deb_leave(LBS_DEB_CMD); | ||
92 | } | 93 | } |
93 | 94 | ||
94 | /** | 95 | /** |
@@ -102,6 +103,7 @@ static void handle_mic_failureevent(wlan_private * priv, u32 event) | |||
102 | { | 103 | { |
103 | char buf[50]; | 104 | char buf[50]; |
104 | 105 | ||
106 | lbs_deb_enter(LBS_DEB_CMD); | ||
105 | memset(buf, 0, sizeof(buf)); | 107 | memset(buf, 0, sizeof(buf)); |
106 | 108 | ||
107 | sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication "); | 109 | sprintf(buf, "%s", "MLME-MICHAELMICFAILURE.indication "); |
@@ -113,6 +115,7 @@ static void handle_mic_failureevent(wlan_private * priv, u32 event) | |||
113 | } | 115 | } |
114 | 116 | ||
115 | libertas_send_iwevcustom_event(priv, buf); | 117 | libertas_send_iwevcustom_event(priv, buf); |
118 | lbs_deb_leave(LBS_DEB_CMD); | ||
116 | } | 119 | } |
117 | 120 | ||
118 | static int wlan_ret_reg_access(wlan_private * priv, | 121 | static int wlan_ret_reg_access(wlan_private * priv, |
@@ -173,12 +176,12 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, | |||
173 | 176 | ||
174 | memcpy(adapter->fwreleasenumber, hwspec->fwreleasenumber, 4); | 177 | memcpy(adapter->fwreleasenumber, hwspec->fwreleasenumber, 4); |
175 | 178 | ||
176 | lbs_deb_cmd("GET_HW_SPEC: FWReleaseVersion: %u.%u.%u.p%u\n", | 179 | lbs_deb_cmd("GET_HW_SPEC: firmware release %u.%u.%up%u\n", |
177 | adapter->fwreleasenumber[2], adapter->fwreleasenumber[1], | 180 | adapter->fwreleasenumber[2], adapter->fwreleasenumber[1], |
178 | adapter->fwreleasenumber[0], adapter->fwreleasenumber[3]); | 181 | adapter->fwreleasenumber[0], adapter->fwreleasenumber[3]); |
179 | lbs_deb_cmd("GET_HW_SPEC: Permanent addr: " MAC_FMT "\n", | 182 | lbs_deb_cmd("GET_HW_SPEC: MAC addr " MAC_FMT "\n", |
180 | MAC_ARG(hwspec->permanentaddr)); | 183 | MAC_ARG(hwspec->permanentaddr)); |
181 | lbs_deb_cmd("GET_HW_SPEC: hwifversion: 0x%x version:0x%x\n", | 184 | lbs_deb_cmd("GET_HW_SPEC: hardware interface 0x%x, hardware spec 0x%04x\n", |
182 | hwspec->hwifversion, hwspec->version); | 185 | hwspec->hwifversion, hwspec->version); |
183 | 186 | ||
184 | adapter->regioncode = le16_to_cpu(hwspec->regioncode); | 187 | adapter->regioncode = le16_to_cpu(hwspec->regioncode); |
@@ -228,8 +231,8 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv, | |||
228 | 231 | ||
229 | lbs_deb_enter(LBS_DEB_CMD); | 232 | lbs_deb_enter(LBS_DEB_CMD); |
230 | 233 | ||
231 | lbs_deb_cmd("error=%x offset=%x stabletime=%x calcontrol=%x\n" | 234 | lbs_deb_cmd("error 0x%x, offset 0x%x, stabletime 0x%x, calcontrol 0x%x " |
232 | " extsleepclk=%x\n", le16_to_cpu(sp->error), | 235 | "extsleepclk 0x%x\n", le16_to_cpu(sp->error), |
233 | le16_to_cpu(sp->offset), le16_to_cpu(sp->stabletime), | 236 | le16_to_cpu(sp->offset), le16_to_cpu(sp->stabletime), |
234 | sp->calcontrol, sp->externalsleepclk); | 237 | sp->calcontrol, sp->externalsleepclk); |
235 | 238 | ||
@@ -247,6 +250,7 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv, | |||
247 | static int wlan_ret_802_11_stat(wlan_private * priv, | 250 | static int wlan_ret_802_11_stat(wlan_private * priv, |
248 | struct cmd_ds_command *resp) | 251 | struct cmd_ds_command *resp) |
249 | { | 252 | { |
253 | lbs_deb_enter(LBS_DEB_CMD); | ||
250 | /* currently adapter->wlan802_11Stat is unused | 254 | /* currently adapter->wlan802_11Stat is unused |
251 | 255 | ||
252 | struct cmd_ds_802_11_get_stat *p11Stat = &resp->params.gstat; | 256 | struct cmd_ds_802_11_get_stat *p11Stat = &resp->params.gstat; |
@@ -256,6 +260,7 @@ static int wlan_ret_802_11_stat(wlan_private * priv, | |||
256 | memcpy(&adapter->wlan802_11Stat, | 260 | memcpy(&adapter->wlan802_11Stat, |
257 | p11Stat, sizeof(struct cmd_ds_802_11_get_stat)); | 261 | p11Stat, sizeof(struct cmd_ds_802_11_get_stat)); |
258 | */ | 262 | */ |
263 | lbs_deb_leave(LBS_DEB_CMD); | ||
259 | return 0; | 264 | return 0; |
260 | } | 265 | } |
261 | 266 | ||
@@ -268,28 +273,28 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, | |||
268 | 273 | ||
269 | lbs_deb_enter(LBS_DEB_CMD); | 274 | lbs_deb_enter(LBS_DEB_CMD); |
270 | 275 | ||
271 | lbs_deb_cmd("SNMP_RESP: value of the oid = %x, querytype=%x\n", oid, | 276 | lbs_deb_cmd("SNMP_RESP: oid 0x%x, querytype 0x%x\n", oid, |
272 | querytype); | 277 | querytype); |
273 | lbs_deb_cmd("SNMP_RESP: Buf size = %x\n", le16_to_cpu(smib->bufsize)); | 278 | lbs_deb_cmd("SNMP_RESP: Buf size %d\n", le16_to_cpu(smib->bufsize)); |
274 | 279 | ||
275 | if (querytype == CMD_ACT_GET) { | 280 | if (querytype == CMD_ACT_GET) { |
276 | switch (oid) { | 281 | switch (oid) { |
277 | case FRAGTHRESH_I: | 282 | case FRAGTHRESH_I: |
278 | priv->adapter->fragthsd = | 283 | priv->adapter->fragthsd = |
279 | le16_to_cpu(*((__le16 *)(smib->value))); | 284 | le16_to_cpu(*((__le16 *)(smib->value))); |
280 | lbs_deb_cmd("SNMP_RESP: fragthsd =%u\n", | 285 | lbs_deb_cmd("SNMP_RESP: frag threshold %u\n", |
281 | priv->adapter->fragthsd); | 286 | priv->adapter->fragthsd); |
282 | break; | 287 | break; |
283 | case RTSTHRESH_I: | 288 | case RTSTHRESH_I: |
284 | priv->adapter->rtsthsd = | 289 | priv->adapter->rtsthsd = |
285 | le16_to_cpu(*((__le16 *)(smib->value))); | 290 | le16_to_cpu(*((__le16 *)(smib->value))); |
286 | lbs_deb_cmd("SNMP_RESP: rtsthsd =%u\n", | 291 | lbs_deb_cmd("SNMP_RESP: rts threshold %u\n", |
287 | priv->adapter->rtsthsd); | 292 | priv->adapter->rtsthsd); |
288 | break; | 293 | break; |
289 | case SHORT_RETRYLIM_I: | 294 | case SHORT_RETRYLIM_I: |
290 | priv->adapter->txretrycount = | 295 | priv->adapter->txretrycount = |
291 | le16_to_cpu(*((__le16 *)(smib->value))); | 296 | le16_to_cpu(*((__le16 *)(smib->value))); |
292 | lbs_deb_cmd("SNMP_RESP: txretrycount =%u\n", | 297 | lbs_deb_cmd("SNMP_RESP: tx retry count %u\n", |
293 | priv->adapter->rtsthsd); | 298 | priv->adapter->rtsthsd); |
294 | break; | 299 | break; |
295 | default: | 300 | default: |
@@ -381,9 +386,9 @@ static int wlan_ret_802_11_rf_tx_power(wlan_private * priv, | |||
381 | 386 | ||
382 | adapter->txpowerlevel = le16_to_cpu(rtp->currentlevel); | 387 | adapter->txpowerlevel = le16_to_cpu(rtp->currentlevel); |
383 | 388 | ||
384 | lbs_deb_cmd("Current TxPower Level = %d\n", adapter->txpowerlevel); | 389 | lbs_deb_cmd("TX power currently %d\n", adapter->txpowerlevel); |
385 | 390 | ||
386 | lbs_deb_enter(LBS_DEB_CMD); | 391 | lbs_deb_leave(LBS_DEB_CMD); |
387 | return 0; | 392 | return 0; |
388 | } | 393 | } |
389 | 394 | ||
@@ -394,15 +399,17 @@ static int wlan_ret_802_11_rf_antenna(wlan_private * priv, | |||
394 | wlan_adapter *adapter = priv->adapter; | 399 | wlan_adapter *adapter = priv->adapter; |
395 | u16 action = le16_to_cpu(pAntenna->action); | 400 | u16 action = le16_to_cpu(pAntenna->action); |
396 | 401 | ||
402 | lbs_deb_enter(LBS_DEB_CMD); | ||
397 | if (action == CMD_ACT_GET_RX) | 403 | if (action == CMD_ACT_GET_RX) |
398 | adapter->rxantennamode = le16_to_cpu(pAntenna->antennamode); | 404 | adapter->rxantennamode = le16_to_cpu(pAntenna->antennamode); |
399 | 405 | ||
400 | if (action == CMD_ACT_GET_TX) | 406 | if (action == CMD_ACT_GET_TX) |
401 | adapter->txantennamode = le16_to_cpu(pAntenna->antennamode); | 407 | adapter->txantennamode = le16_to_cpu(pAntenna->antennamode); |
402 | 408 | ||
403 | lbs_deb_cmd("RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n", | 409 | lbs_deb_cmd("RF_ANT_RESP: action 0x%x, mode 0x%04x\n", |
404 | action, le16_to_cpu(pAntenna->antennamode)); | 410 | action, le16_to_cpu(pAntenna->antennamode)); |
405 | 411 | ||
412 | lbs_deb_leave(LBS_DEB_CMD); | ||
406 | return 0; | 413 | return 0; |
407 | } | 414 | } |
408 | 415 | ||
@@ -419,7 +426,7 @@ static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv, | |||
419 | adapter->ratebitmap = le16_to_cpu(rates->bitmap); | 426 | adapter->ratebitmap = le16_to_cpu(rates->bitmap); |
420 | } | 427 | } |
421 | 428 | ||
422 | lbs_deb_enter(LBS_DEB_CMD); | 429 | lbs_deb_leave(LBS_DEB_CMD); |
423 | return 0; | 430 | return 0; |
424 | } | 431 | } |
425 | 432 | ||
@@ -431,13 +438,14 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, | |||
431 | 438 | ||
432 | lbs_deb_enter(LBS_DEB_CMD); | 439 | lbs_deb_enter(LBS_DEB_CMD); |
433 | 440 | ||
434 | lbs_deb_hex(LBS_DEB_CMD, "DATA_RATE_RESP: data_rate- ", (u8 *) pdatarate, | 441 | lbs_deb_hex(LBS_DEB_CMD, "DATA_RATE_RESP", (u8 *) pdatarate, |
435 | sizeof(struct cmd_ds_802_11_data_rate)); | 442 | sizeof(struct cmd_ds_802_11_data_rate)); |
436 | 443 | ||
437 | /* FIXME: get actual rates FW can do if this command actually returns | 444 | /* FIXME: get actual rates FW can do if this command actually returns |
438 | * all data rates supported. | 445 | * all data rates supported. |
439 | */ | 446 | */ |
440 | adapter->cur_rate = libertas_fw_index_to_data_rate(pdatarate->rates[0]); | 447 | adapter->cur_rate = libertas_fw_index_to_data_rate(pdatarate->rates[0]); |
448 | lbs_deb_cmd("DATA_RATE: current rate 0x%02x\n", adapter->cur_rate); | ||
441 | 449 | ||
442 | lbs_deb_leave(LBS_DEB_CMD); | 450 | lbs_deb_leave(LBS_DEB_CMD); |
443 | return 0; | 451 | return 0; |
@@ -455,7 +463,7 @@ static int wlan_ret_802_11_rf_channel(wlan_private * priv, | |||
455 | 463 | ||
456 | if (action == CMD_OPT_802_11_RF_CHANNEL_GET | 464 | if (action == CMD_OPT_802_11_RF_CHANNEL_GET |
457 | && adapter->curbssparams.channel != newchannel) { | 465 | && adapter->curbssparams.channel != newchannel) { |
458 | lbs_deb_cmd("channel Switch: %d to %d\n", | 466 | lbs_deb_cmd("channel switch from %d to %d\n", |
459 | adapter->curbssparams.channel, newchannel); | 467 | adapter->curbssparams.channel, newchannel); |
460 | 468 | ||
461 | /* Update the channel again */ | 469 | /* Update the channel again */ |
@@ -472,6 +480,8 @@ static int wlan_ret_802_11_rssi(wlan_private * priv, | |||
472 | struct cmd_ds_802_11_rssi_rsp *rssirsp = &resp->params.rssirsp; | 480 | struct cmd_ds_802_11_rssi_rsp *rssirsp = &resp->params.rssirsp; |
473 | wlan_adapter *adapter = priv->adapter; | 481 | wlan_adapter *adapter = priv->adapter; |
474 | 482 | ||
483 | lbs_deb_enter(LBS_DEB_CMD); | ||
484 | |||
475 | /* store the non average value */ | 485 | /* store the non average value */ |
476 | adapter->SNR[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->SNR); | 486 | adapter->SNR[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->SNR); |
477 | adapter->NF[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->noisefloor); | 487 | adapter->NF[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->noisefloor); |
@@ -487,9 +497,11 @@ static int wlan_ret_802_11_rssi(wlan_private * priv, | |||
487 | CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_AVG] / AVG_SCALE, | 497 | CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_AVG] / AVG_SCALE, |
488 | adapter->NF[TYPE_BEACON][TYPE_AVG] / AVG_SCALE); | 498 | adapter->NF[TYPE_BEACON][TYPE_AVG] / AVG_SCALE); |
489 | 499 | ||
490 | lbs_deb_cmd("Beacon RSSI value = 0x%x\n", | 500 | lbs_deb_cmd("RSSI: beacon %d, avg %d\n", |
501 | adapter->RSSI[TYPE_BEACON][TYPE_NOAVG], | ||
491 | adapter->RSSI[TYPE_BEACON][TYPE_AVG]); | 502 | adapter->RSSI[TYPE_BEACON][TYPE_AVG]); |
492 | 503 | ||
504 | lbs_deb_leave(LBS_DEB_CMD); | ||
493 | return 0; | 505 | return 0; |
494 | } | 506 | } |
495 | 507 | ||
@@ -500,11 +512,11 @@ static int wlan_ret_802_11_eeprom_access(wlan_private * priv, | |||
500 | struct wlan_ioctl_regrdwr *pbuf; | 512 | struct wlan_ioctl_regrdwr *pbuf; |
501 | pbuf = (struct wlan_ioctl_regrdwr *) adapter->prdeeprom; | 513 | pbuf = (struct wlan_ioctl_regrdwr *) adapter->prdeeprom; |
502 | 514 | ||
503 | lbs_deb_cmd("eeprom read len=%x\n", | 515 | lbs_deb_enter_args(LBS_DEB_CMD, "len %d", |
504 | le16_to_cpu(resp->params.rdeeprom.bytecount)); | 516 | le16_to_cpu(resp->params.rdeeprom.bytecount)); |
505 | if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) { | 517 | if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) { |
506 | pbuf->NOB = 0; | 518 | pbuf->NOB = 0; |
507 | lbs_deb_cmd("eeprom read return length is too big\n"); | 519 | lbs_deb_cmd("EEPROM read length too big\n"); |
508 | return -1; | 520 | return -1; |
509 | } | 521 | } |
510 | pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount); | 522 | pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount); |
@@ -512,9 +524,10 @@ static int wlan_ret_802_11_eeprom_access(wlan_private * priv, | |||
512 | 524 | ||
513 | memcpy(&pbuf->value, (u8 *) & resp->params.rdeeprom.value, | 525 | memcpy(&pbuf->value, (u8 *) & resp->params.rdeeprom.value, |
514 | le16_to_cpu(resp->params.rdeeprom.bytecount)); | 526 | le16_to_cpu(resp->params.rdeeprom.bytecount)); |
515 | lbs_deb_hex(LBS_DEB_CMD, "adapter", (char *)&pbuf->value, | 527 | lbs_deb_hex(LBS_DEB_CMD, "EEPROM", (char *)&pbuf->value, |
516 | le16_to_cpu(resp->params.rdeeprom.bytecount)); | 528 | le16_to_cpu(resp->params.rdeeprom.bytecount)); |
517 | } | 529 | } |
530 | lbs_deb_leave(LBS_DEB_CMD); | ||
518 | return 0; | 531 | return 0; |
519 | } | 532 | } |
520 | 533 | ||
@@ -529,7 +542,7 @@ static int wlan_ret_get_log(wlan_private * priv, | |||
529 | /* Stored little-endian */ | 542 | /* Stored little-endian */ |
530 | memcpy(&adapter->logmsg, logmessage, sizeof(struct cmd_ds_802_11_get_log)); | 543 | memcpy(&adapter->logmsg, logmessage, sizeof(struct cmd_ds_802_11_get_log)); |
531 | 544 | ||
532 | lbs_deb_enter(LBS_DEB_CMD); | 545 | lbs_deb_leave(LBS_DEB_CMD); |
533 | return 0; | 546 | return 0; |
534 | } | 547 | } |
535 | 548 | ||
@@ -547,7 +560,7 @@ static int libertas_ret_802_11_enable_rsn(wlan_private * priv, | |||
547 | *pdata_buf = (u32) le16_to_cpu(enable_rsn->enable); | 560 | *pdata_buf = (u32) le16_to_cpu(enable_rsn->enable); |
548 | } | 561 | } |
549 | 562 | ||
550 | lbs_deb_enter(LBS_DEB_CMD); | 563 | lbs_deb_leave(LBS_DEB_CMD); |
551 | return 0; | 564 | return 0; |
552 | } | 565 | } |
553 | 566 | ||
@@ -559,6 +572,8 @@ static inline int handle_cmd_response(u16 respcmd, | |||
559 | unsigned long flags; | 572 | unsigned long flags; |
560 | wlan_adapter *adapter = priv->adapter; | 573 | wlan_adapter *adapter = priv->adapter; |
561 | 574 | ||
575 | lbs_deb_enter(LBS_DEB_HOST); | ||
576 | |||
562 | switch (respcmd) { | 577 | switch (respcmd) { |
563 | case CMD_RET(CMD_MAC_REG_ACCESS): | 578 | case CMD_RET(CMD_MAC_REG_ACCESS): |
564 | case CMD_RET(CMD_BBP_REG_ACCESS): | 579 | case CMD_RET(CMD_BBP_REG_ACCESS): |
@@ -654,7 +669,6 @@ static inline int handle_cmd_response(u16 respcmd, | |||
654 | break; | 669 | break; |
655 | 670 | ||
656 | case CMD_RET(CMD_802_11_KEY_MATERIAL): | 671 | case CMD_RET(CMD_802_11_KEY_MATERIAL): |
657 | lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n"); | ||
658 | ret = wlan_ret_802_11_key_material(priv, resp); | 672 | ret = wlan_ret_802_11_key_material(priv, resp); |
659 | break; | 673 | break; |
660 | 674 | ||
@@ -725,10 +739,11 @@ static inline int handle_cmd_response(u16 respcmd, | |||
725 | priv->adapter->txrate = resp->params.txrate.txrate; | 739 | priv->adapter->txrate = resp->params.txrate.txrate; |
726 | break; | 740 | break; |
727 | default: | 741 | default: |
728 | lbs_deb_cmd("CMD_RESP: Unknown command response %#x\n", | 742 | lbs_deb_host("CMD_RESP: unknown cmd response 0x%04x\n", |
729 | resp->command); | 743 | resp->command); |
730 | break; | 744 | break; |
731 | } | 745 | } |
746 | lbs_deb_leave(LBS_DEB_HOST); | ||
732 | return ret; | 747 | return ret; |
733 | } | 748 | } |
734 | 749 | ||
@@ -741,9 +756,7 @@ int libertas_process_rx_command(wlan_private * priv) | |||
741 | ulong flags; | 756 | ulong flags; |
742 | u16 result; | 757 | u16 result; |
743 | 758 | ||
744 | lbs_deb_enter(LBS_DEB_CMD); | 759 | lbs_deb_enter(LBS_DEB_HOST); |
745 | |||
746 | lbs_deb_cmd("CMD_RESP: @ %lu\n", jiffies); | ||
747 | 760 | ||
748 | /* Now we got response from FW, cancel the command timer */ | 761 | /* Now we got response from FW, cancel the command timer */ |
749 | del_timer(&adapter->command_timer); | 762 | del_timer(&adapter->command_timer); |
@@ -752,25 +765,23 @@ int libertas_process_rx_command(wlan_private * priv) | |||
752 | spin_lock_irqsave(&adapter->driver_lock, flags); | 765 | spin_lock_irqsave(&adapter->driver_lock, flags); |
753 | 766 | ||
754 | if (!adapter->cur_cmd) { | 767 | if (!adapter->cur_cmd) { |
755 | lbs_deb_cmd("CMD_RESP: NULL cur_cmd=%p\n", adapter->cur_cmd); | 768 | lbs_deb_host("CMD_RESP: cur_cmd is NULL\n"); |
756 | ret = -1; | 769 | ret = -1; |
757 | spin_unlock_irqrestore(&adapter->driver_lock, flags); | 770 | spin_unlock_irqrestore(&adapter->driver_lock, flags); |
758 | goto done; | 771 | goto done; |
759 | } | 772 | } |
760 | resp = (struct cmd_ds_command *)(adapter->cur_cmd->bufvirtualaddr); | 773 | resp = (struct cmd_ds_command *)(adapter->cur_cmd->bufvirtualaddr); |
761 | 774 | ||
762 | lbs_deb_hex(LBS_DEB_CMD, "CMD_RESP", adapter->cur_cmd->bufvirtualaddr, | ||
763 | priv->upld_len); | ||
764 | |||
765 | respcmd = le16_to_cpu(resp->command); | 775 | respcmd = le16_to_cpu(resp->command); |
766 | |||
767 | result = le16_to_cpu(resp->result); | 776 | result = le16_to_cpu(resp->result); |
768 | 777 | ||
769 | lbs_deb_cmd("CMD_RESP: %x result: %d length: %d\n", respcmd, | 778 | lbs_deb_host("CMD_RESP: response 0x%04x, size %d, jiffies %lu\n", |
770 | result, priv->upld_len); | 779 | respcmd, priv->upld_len, jiffies); |
780 | lbs_deb_hex(LBS_DEB_HOST, "CMD_RESP", adapter->cur_cmd->bufvirtualaddr, | ||
781 | priv->upld_len); | ||
771 | 782 | ||
772 | if (!(respcmd & 0x8000)) { | 783 | if (!(respcmd & 0x8000)) { |
773 | lbs_deb_cmd("Invalid response to command!"); | 784 | lbs_deb_host("invalid response!\n"); |
774 | adapter->cur_cmd_retcode = -1; | 785 | adapter->cur_cmd_retcode = -1; |
775 | __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); | 786 | __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); |
776 | adapter->nr_cmd_pending--; | 787 | adapter->nr_cmd_pending--; |
@@ -787,12 +798,12 @@ int libertas_process_rx_command(wlan_private * priv) | |||
787 | struct cmd_ds_802_11_ps_mode *psmode = &resp->params.psmode; | 798 | struct cmd_ds_802_11_ps_mode *psmode = &resp->params.psmode; |
788 | u16 action = le16_to_cpu(psmode->action); | 799 | u16 action = le16_to_cpu(psmode->action); |
789 | 800 | ||
790 | lbs_deb_cmd( | 801 | lbs_deb_host( |
791 | "CMD_RESP: PS_MODE cmd reply result=%#x action=0x%X\n", | 802 | "CMD_RESP: PS_MODE cmd reply result 0x%x, action 0x%x\n", |
792 | result, action); | 803 | result, action); |
793 | 804 | ||
794 | if (result) { | 805 | if (result) { |
795 | lbs_deb_cmd("CMD_RESP: PS command failed- %#x \n", | 806 | lbs_deb_host("CMD_RESP: PS command failed with 0x%x\n", |
796 | result); | 807 | result); |
797 | /* | 808 | /* |
798 | * We should not re-try enter-ps command in | 809 | * We should not re-try enter-ps command in |
@@ -806,14 +817,14 @@ int libertas_process_rx_command(wlan_private * priv) | |||
806 | adapter->needtowakeup = 0; | 817 | adapter->needtowakeup = 0; |
807 | adapter->psstate = PS_STATE_AWAKE; | 818 | adapter->psstate = PS_STATE_AWAKE; |
808 | 819 | ||
809 | lbs_deb_cmd("CMD_RESP: Enter_PS command response\n"); | 820 | lbs_deb_host("CMD_RESP: ENTER_PS command response\n"); |
810 | if (adapter->connect_status != LIBERTAS_CONNECTED) { | 821 | if (adapter->connect_status != LIBERTAS_CONNECTED) { |
811 | /* | 822 | /* |
812 | * When Deauth Event received before Enter_PS command | 823 | * When Deauth Event received before Enter_PS command |
813 | * response, We need to wake up the firmware. | 824 | * response, We need to wake up the firmware. |
814 | */ | 825 | */ |
815 | lbs_deb_cmd( | 826 | lbs_deb_host( |
816 | "Disconnected, Going to invoke libertas_ps_wakeup\n"); | 827 | "disconnected, invoking libertas_ps_wakeup\n"); |
817 | 828 | ||
818 | spin_unlock_irqrestore(&adapter->driver_lock, flags); | 829 | spin_unlock_irqrestore(&adapter->driver_lock, flags); |
819 | mutex_unlock(&adapter->lock); | 830 | mutex_unlock(&adapter->lock); |
@@ -824,9 +835,9 @@ int libertas_process_rx_command(wlan_private * priv) | |||
824 | } else if (action == CMD_SUBCMD_EXIT_PS) { | 835 | } else if (action == CMD_SUBCMD_EXIT_PS) { |
825 | adapter->needtowakeup = 0; | 836 | adapter->needtowakeup = 0; |
826 | adapter->psstate = PS_STATE_FULL_POWER; | 837 | adapter->psstate = PS_STATE_FULL_POWER; |
827 | lbs_deb_cmd("CMD_RESP: Exit_PS command response\n"); | 838 | lbs_deb_host("CMD_RESP: EXIT_PS command response\n"); |
828 | } else { | 839 | } else { |
829 | lbs_deb_cmd("CMD_RESP: PS- action=0x%X\n", action); | 840 | lbs_deb_host("CMD_RESP: PS action 0x%X\n", action); |
830 | } | 841 | } |
831 | 842 | ||
832 | __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); | 843 | __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); |
@@ -847,15 +858,15 @@ int libertas_process_rx_command(wlan_private * priv) | |||
847 | 858 | ||
848 | /* If the command is not successful, cleanup and return failure */ | 859 | /* If the command is not successful, cleanup and return failure */ |
849 | if ((result != 0 || !(respcmd & 0x8000))) { | 860 | if ((result != 0 || !(respcmd & 0x8000))) { |
850 | lbs_deb_cmd("CMD_RESP: command reply %#x result=%#x\n", | 861 | lbs_deb_host("CMD_RESP: error 0x%04x in command reply 0x%04x\n", |
851 | respcmd, result); | 862 | result, respcmd); |
852 | /* | 863 | /* |
853 | * Handling errors here | 864 | * Handling errors here |
854 | */ | 865 | */ |
855 | switch (respcmd) { | 866 | switch (respcmd) { |
856 | case CMD_RET(CMD_GET_HW_SPEC): | 867 | case CMD_RET(CMD_GET_HW_SPEC): |
857 | case CMD_RET(CMD_802_11_RESET): | 868 | case CMD_RET(CMD_802_11_RESET): |
858 | lbs_deb_cmd("CMD_RESP: Reset command failed\n"); | 869 | lbs_deb_host("CMD_RESP: reset failed\n"); |
859 | break; | 870 | break; |
860 | 871 | ||
861 | } | 872 | } |
@@ -885,7 +896,7 @@ int libertas_process_rx_command(wlan_private * priv) | |||
885 | 896 | ||
886 | done: | 897 | done: |
887 | mutex_unlock(&adapter->lock); | 898 | mutex_unlock(&adapter->lock); |
888 | lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); | 899 | lbs_deb_leave_args(LBS_DEB_HOST, "ret %d", ret); |
889 | return ret; | 900 | return ret; |
890 | } | 901 | } |
891 | 902 | ||
@@ -901,7 +912,7 @@ int libertas_process_event(wlan_private * priv) | |||
901 | 912 | ||
902 | lbs_deb_enter(LBS_DEB_CMD); | 913 | lbs_deb_enter(LBS_DEB_CMD); |
903 | 914 | ||
904 | lbs_deb_cmd("EVENT Cause %x\n", eventcause); | 915 | lbs_deb_cmd("event cause 0x%x\n", eventcause); |
905 | 916 | ||
906 | switch (eventcause >> SBI_EVENT_CAUSE_SHIFT) { | 917 | switch (eventcause >> SBI_EVENT_CAUSE_SHIFT) { |
907 | case MACREG_INT_CODE_LINK_SENSED: | 918 | case MACREG_INT_CODE_LINK_SENSED: |
@@ -909,28 +920,27 @@ int libertas_process_event(wlan_private * priv) | |||
909 | break; | 920 | break; |
910 | 921 | ||
911 | case MACREG_INT_CODE_DEAUTHENTICATED: | 922 | case MACREG_INT_CODE_DEAUTHENTICATED: |
912 | lbs_deb_cmd("EVENT: Deauthenticated\n"); | 923 | lbs_deb_cmd("EVENT: deauthenticated\n"); |
913 | libertas_mac_event_disconnected(priv); | 924 | libertas_mac_event_disconnected(priv); |
914 | break; | 925 | break; |
915 | 926 | ||
916 | case MACREG_INT_CODE_DISASSOCIATED: | 927 | case MACREG_INT_CODE_DISASSOCIATED: |
917 | lbs_deb_cmd("EVENT: Disassociated\n"); | 928 | lbs_deb_cmd("EVENT: disassociated\n"); |
918 | libertas_mac_event_disconnected(priv); | 929 | libertas_mac_event_disconnected(priv); |
919 | break; | 930 | break; |
920 | 931 | ||
921 | case MACREG_INT_CODE_LINK_LOSE_NO_SCAN: | 932 | case MACREG_INT_CODE_LINK_LOSE_NO_SCAN: |
922 | lbs_deb_cmd("EVENT: Link lost\n"); | 933 | lbs_deb_cmd("EVENT: link lost\n"); |
923 | libertas_mac_event_disconnected(priv); | 934 | libertas_mac_event_disconnected(priv); |
924 | break; | 935 | break; |
925 | 936 | ||
926 | case MACREG_INT_CODE_PS_SLEEP: | 937 | case MACREG_INT_CODE_PS_SLEEP: |
927 | lbs_deb_cmd("EVENT: SLEEP\n"); | 938 | lbs_deb_cmd("EVENT: sleep\n"); |
928 | lbs_deb_cmd("_"); | ||
929 | 939 | ||
930 | /* handle unexpected PS SLEEP event */ | 940 | /* handle unexpected PS SLEEP event */ |
931 | if (adapter->psstate == PS_STATE_FULL_POWER) { | 941 | if (adapter->psstate == PS_STATE_FULL_POWER) { |
932 | lbs_deb_cmd( | 942 | lbs_deb_cmd( |
933 | "EVENT: In FULL POWER mode - ignore PS SLEEP\n"); | 943 | "EVENT: in FULL POWER mode, ignoreing PS_SLEEP\n"); |
934 | break; | 944 | break; |
935 | } | 945 | } |
936 | adapter->psstate = PS_STATE_PRE_SLEEP; | 946 | adapter->psstate = PS_STATE_PRE_SLEEP; |
@@ -940,8 +950,7 @@ int libertas_process_event(wlan_private * priv) | |||
940 | break; | 950 | break; |
941 | 951 | ||
942 | case MACREG_INT_CODE_PS_AWAKE: | 952 | case MACREG_INT_CODE_PS_AWAKE: |
943 | lbs_deb_cmd("EVENT: AWAKE \n"); | 953 | lbs_deb_cmd("EVENT: awake\n"); |
944 | lbs_deb_cmd("|"); | ||
945 | 954 | ||
946 | /* handle unexpected PS AWAKE event */ | 955 | /* handle unexpected PS AWAKE event */ |
947 | if (adapter->psstate == PS_STATE_FULL_POWER) { | 956 | if (adapter->psstate == PS_STATE_FULL_POWER) { |
@@ -959,7 +968,7 @@ int libertas_process_event(wlan_private * priv) | |||
959 | * adapter->needtowakeup will be set to FALSE | 968 | * adapter->needtowakeup will be set to FALSE |
960 | * in libertas_ps_wakeup() | 969 | * in libertas_ps_wakeup() |
961 | */ | 970 | */ |
962 | lbs_deb_cmd("Waking up...\n"); | 971 | lbs_deb_cmd("waking up ...\n"); |
963 | libertas_ps_wakeup(priv, 0); | 972 | libertas_ps_wakeup(priv, 0); |
964 | } | 973 | } |
965 | break; | 974 | break; |
@@ -978,27 +987,27 @@ int libertas_process_event(wlan_private * priv) | |||
978 | break; | 987 | break; |
979 | 988 | ||
980 | case MACREG_INT_CODE_ADHOC_BCN_LOST: | 989 | case MACREG_INT_CODE_ADHOC_BCN_LOST: |
981 | lbs_deb_cmd("EVENT: HWAC - ADHOC BCN LOST\n"); | 990 | lbs_deb_cmd("EVENT: ADHOC beacon lost\n"); |
982 | break; | 991 | break; |
983 | 992 | ||
984 | case MACREG_INT_CODE_RSSI_LOW: | 993 | case MACREG_INT_CODE_RSSI_LOW: |
985 | lbs_pr_alert( "EVENT: RSSI_LOW\n"); | 994 | lbs_pr_alert("EVENT: rssi low\n"); |
986 | break; | 995 | break; |
987 | case MACREG_INT_CODE_SNR_LOW: | 996 | case MACREG_INT_CODE_SNR_LOW: |
988 | lbs_pr_alert( "EVENT: SNR_LOW\n"); | 997 | lbs_pr_alert("EVENT: snr low\n"); |
989 | break; | 998 | break; |
990 | case MACREG_INT_CODE_MAX_FAIL: | 999 | case MACREG_INT_CODE_MAX_FAIL: |
991 | lbs_pr_alert( "EVENT: MAX_FAIL\n"); | 1000 | lbs_pr_alert("EVENT: max fail\n"); |
992 | break; | 1001 | break; |
993 | case MACREG_INT_CODE_RSSI_HIGH: | 1002 | case MACREG_INT_CODE_RSSI_HIGH: |
994 | lbs_pr_alert( "EVENT: RSSI_HIGH\n"); | 1003 | lbs_pr_alert("EVENT: rssi high\n"); |
995 | break; | 1004 | break; |
996 | case MACREG_INT_CODE_SNR_HIGH: | 1005 | case MACREG_INT_CODE_SNR_HIGH: |
997 | lbs_pr_alert( "EVENT: SNR_HIGH\n"); | 1006 | lbs_pr_alert("EVENT: snr high\n"); |
998 | break; | 1007 | break; |
999 | 1008 | ||
1000 | case MACREG_INT_CODE_MESH_AUTO_STARTED: | 1009 | case MACREG_INT_CODE_MESH_AUTO_STARTED: |
1001 | lbs_pr_alert( "EVENT: MESH_AUTO_STARTED\n"); | 1010 | lbs_pr_alert("EVENT: MESH_AUTO_STARTED\n"); |
1002 | adapter->connect_status = LIBERTAS_CONNECTED ; | 1011 | adapter->connect_status = LIBERTAS_CONNECTED ; |
1003 | if (priv->mesh_open == 1) { | 1012 | if (priv->mesh_open == 1) { |
1004 | netif_wake_queue(priv->mesh_dev) ; | 1013 | netif_wake_queue(priv->mesh_dev) ; |
@@ -1009,7 +1018,7 @@ int libertas_process_event(wlan_private * priv) | |||
1009 | break; | 1018 | break; |
1010 | 1019 | ||
1011 | default: | 1020 | default: |
1012 | lbs_pr_alert( "EVENT: unknown event id: %#x\n", | 1021 | lbs_pr_alert("EVENT: unknown event id 0x%04x\n", |
1013 | eventcause >> SBI_EVENT_CAUSE_SHIFT); | 1022 | eventcause >> SBI_EVENT_CAUSE_SHIFT); |
1014 | break; | 1023 | break; |
1015 | } | 1024 | } |