diff options
author | Holger Schurig <hs4233@mail.mn-solutions.de> | 2007-05-25 11:27:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2007-06-11 14:28:37 -0400 |
commit | 9012b28a407511fb355f6d2176a12d4653489672 (patch) | |
tree | 771b0f7adb9dbab5c907981bd4fa3a7f6219587d /drivers/net/wireless/libertas/cmdresp.c | |
parent | 46868202b2dd22156460a220553a223f406f4f22 (diff) |
[PATCH] libertas: make debug configurable
The debug output of libertas was either not present or it was overwhelming.
This patch adds the possibility to specify a bitmask for the area of
interest. One should then only get the desired output.
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/cmdresp.c')
-rw-r--r-- | drivers/net/wireless/libertas/cmdresp.c | 158 |
1 files changed, 79 insertions, 79 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c index c86454034b5..9509b8ef626 100644 --- a/drivers/net/wireless/libertas/cmdresp.c +++ b/drivers/net/wireless/libertas/cmdresp.c | |||
@@ -32,7 +32,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) | |||
32 | if (adapter->connect_status != libertas_connected) | 32 | if (adapter->connect_status != libertas_connected) |
33 | return; | 33 | return; |
34 | 34 | ||
35 | lbs_pr_debug(1, "Handles disconnect event.\n"); | 35 | lbs_deb_cmd("Handles disconnect event.\n"); |
36 | 36 | ||
37 | memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN); | 37 | memset(wrqu.ap_addr.sa_data, 0x00, ETH_ALEN); |
38 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; | 38 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; |
@@ -62,10 +62,10 @@ void libertas_mac_event_disconnected(wlan_private * priv) | |||
62 | adapter->nextSNRNF = 0; | 62 | adapter->nextSNRNF = 0; |
63 | adapter->numSNRNF = 0; | 63 | adapter->numSNRNF = 0; |
64 | adapter->rxpd_rate = 0; | 64 | adapter->rxpd_rate = 0; |
65 | lbs_pr_debug(1, "Current SSID=%s, ssid length=%u\n", | 65 | lbs_deb_cmd("Current SSID=%s, ssid length=%u\n", |
66 | adapter->curbssparams.ssid.ssid, | 66 | adapter->curbssparams.ssid.ssid, |
67 | adapter->curbssparams.ssid.ssidlength); | 67 | adapter->curbssparams.ssid.ssidlength); |
68 | lbs_pr_debug(1, "Previous SSID=%s, ssid length=%u\n", | 68 | lbs_deb_cmd("Previous SSID=%s, ssid length=%u\n", |
69 | adapter->previousssid.ssid, adapter->previousssid.ssidlength); | 69 | adapter->previousssid.ssid, adapter->previousssid.ssidlength); |
70 | 70 | ||
71 | /* reset internal flags */ | 71 | /* reset internal flags */ |
@@ -90,7 +90,7 @@ void libertas_mac_event_disconnected(wlan_private * priv) | |||
90 | 90 | ||
91 | if (adapter->psstate != PS_STATE_FULL_POWER) { | 91 | if (adapter->psstate != PS_STATE_FULL_POWER) { |
92 | /* make firmware to exit PS mode */ | 92 | /* make firmware to exit PS mode */ |
93 | lbs_pr_debug(1, "Disconnected, so exit PS mode.\n"); | 93 | lbs_deb_cmd("Disconnected, so exit PS mode.\n"); |
94 | libertas_ps_wakeup(priv, 0); | 94 | libertas_ps_wakeup(priv, 0); |
95 | } | 95 | } |
96 | } | 96 | } |
@@ -122,9 +122,10 @@ static void handle_mic_failureevent(wlan_private * priv, u32 event) | |||
122 | static int wlan_ret_reg_access(wlan_private * priv, | 122 | static int wlan_ret_reg_access(wlan_private * priv, |
123 | u16 type, struct cmd_ds_command *resp) | 123 | u16 type, struct cmd_ds_command *resp) |
124 | { | 124 | { |
125 | int ret = 0; | ||
125 | wlan_adapter *adapter = priv->adapter; | 126 | wlan_adapter *adapter = priv->adapter; |
126 | 127 | ||
127 | ENTER(); | 128 | lbs_deb_enter(LBS_DEB_CMD); |
128 | 129 | ||
129 | switch (type) { | 130 | switch (type) { |
130 | case cmd_ret_mac_reg_access: | 131 | case cmd_ret_mac_reg_access: |
@@ -165,12 +166,11 @@ static int wlan_ret_reg_access(wlan_private * priv, | |||
165 | } | 166 | } |
166 | 167 | ||
167 | default: | 168 | default: |
168 | LEAVE(); | 169 | ret = -1; |
169 | return -1; | ||
170 | } | 170 | } |
171 | 171 | ||
172 | LEAVE(); | 172 | lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); |
173 | return 0; | 173 | return ret; |
174 | } | 174 | } |
175 | 175 | ||
176 | static int wlan_ret_get_hw_spec(wlan_private * priv, | 176 | static int wlan_ret_get_hw_spec(wlan_private * priv, |
@@ -181,19 +181,19 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, | |||
181 | wlan_adapter *adapter = priv->adapter; | 181 | wlan_adapter *adapter = priv->adapter; |
182 | int ret = 0; | 182 | int ret = 0; |
183 | 183 | ||
184 | ENTER(); | 184 | lbs_deb_enter(LBS_DEB_CMD); |
185 | 185 | ||
186 | adapter->fwcapinfo = le32_to_cpu(hwspec->fwcapinfo); | 186 | adapter->fwcapinfo = le32_to_cpu(hwspec->fwcapinfo); |
187 | 187 | ||
188 | adapter->fwreleasenumber = hwspec->fwreleasenumber; | 188 | adapter->fwreleasenumber = hwspec->fwreleasenumber; |
189 | 189 | ||
190 | lbs_pr_debug(1, "GET_HW_SPEC: FWReleaseVersion- 0x%X\n", | 190 | lbs_deb_cmd("GET_HW_SPEC: FWReleaseVersion- 0x%X\n", |
191 | adapter->fwreleasenumber); | 191 | adapter->fwreleasenumber); |
192 | lbs_pr_debug(1, "GET_HW_SPEC: Permanent addr- %2x:%2x:%2x:%2x:%2x:%2x\n", | 192 | lbs_deb_cmd("GET_HW_SPEC: Permanent addr- %2x:%2x:%2x:%2x:%2x:%2x\n", |
193 | hwspec->permanentaddr[0], hwspec->permanentaddr[1], | 193 | hwspec->permanentaddr[0], hwspec->permanentaddr[1], |
194 | hwspec->permanentaddr[2], hwspec->permanentaddr[3], | 194 | hwspec->permanentaddr[2], hwspec->permanentaddr[3], |
195 | hwspec->permanentaddr[4], hwspec->permanentaddr[5]); | 195 | hwspec->permanentaddr[4], hwspec->permanentaddr[5]); |
196 | lbs_pr_debug(1, "GET_HW_SPEC: hwifversion=0x%X version=0x%X\n", | 196 | lbs_deb_cmd("GET_HW_SPEC: hwifversion=0x%X version=0x%X\n", |
197 | hwspec->hwifversion, hwspec->version); | 197 | hwspec->hwifversion, hwspec->version); |
198 | 198 | ||
199 | adapter->regioncode = le16_to_cpu(hwspec->regioncode); | 199 | adapter->regioncode = le16_to_cpu(hwspec->regioncode); |
@@ -232,8 +232,8 @@ static int wlan_ret_get_hw_spec(wlan_private * priv, | |||
232 | goto done; | 232 | goto done; |
233 | } | 233 | } |
234 | 234 | ||
235 | done: | 235 | done: |
236 | LEAVE(); | 236 | lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); |
237 | return ret; | 237 | return ret; |
238 | } | 238 | } |
239 | 239 | ||
@@ -243,9 +243,9 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv, | |||
243 | struct cmd_ds_802_11_sleep_params *sp = &resp->params.sleep_params; | 243 | struct cmd_ds_802_11_sleep_params *sp = &resp->params.sleep_params; |
244 | wlan_adapter *adapter = priv->adapter; | 244 | wlan_adapter *adapter = priv->adapter; |
245 | 245 | ||
246 | ENTER(); | 246 | lbs_deb_enter(LBS_DEB_CMD); |
247 | 247 | ||
248 | lbs_pr_debug(1, "error=%x offset=%x stabletime=%x calcontrol=%x\n" | 248 | lbs_deb_cmd("error=%x offset=%x stabletime=%x calcontrol=%x\n" |
249 | " extsleepclk=%x\n", sp->error, sp->offset, | 249 | " extsleepclk=%x\n", sp->error, sp->offset, |
250 | sp->stabletime, sp->calcontrol, sp->externalsleepclk); | 250 | sp->stabletime, sp->calcontrol, sp->externalsleepclk); |
251 | adapter->sp.sp_error = le16_to_cpu(sp->error); | 251 | adapter->sp.sp_error = le16_to_cpu(sp->error); |
@@ -255,7 +255,7 @@ static int wlan_ret_802_11_sleep_params(wlan_private * priv, | |||
255 | adapter->sp.sp_extsleepclk = le16_to_cpu(sp->externalsleepclk); | 255 | adapter->sp.sp_extsleepclk = le16_to_cpu(sp->externalsleepclk); |
256 | adapter->sp.sp_reserved = le16_to_cpu(sp->reserved); | 256 | adapter->sp.sp_reserved = le16_to_cpu(sp->reserved); |
257 | 257 | ||
258 | LEAVE(); | 258 | lbs_deb_enter(LBS_DEB_CMD); |
259 | return 0; | 259 | return 0; |
260 | } | 260 | } |
261 | 261 | ||
@@ -281,11 +281,11 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, | |||
281 | u16 oid = le16_to_cpu(smib->oid); | 281 | u16 oid = le16_to_cpu(smib->oid); |
282 | u16 querytype = le16_to_cpu(smib->querytype); | 282 | u16 querytype = le16_to_cpu(smib->querytype); |
283 | 283 | ||
284 | ENTER(); | 284 | lbs_deb_enter(LBS_DEB_CMD); |
285 | 285 | ||
286 | lbs_pr_debug(1, "SNMP_RESP: value of the oid = %x, querytype=%x\n", oid, | 286 | lbs_deb_cmd("SNMP_RESP: value of the oid = %x, querytype=%x\n", oid, |
287 | querytype); | 287 | querytype); |
288 | lbs_pr_debug(1, "SNMP_RESP: Buf size = %x\n", | 288 | lbs_deb_cmd("SNMP_RESP: Buf size = %x\n", |
289 | le16_to_cpu(smib->bufsize)); | 289 | le16_to_cpu(smib->bufsize)); |
290 | 290 | ||
291 | if (querytype == cmd_act_get) { | 291 | if (querytype == cmd_act_get) { |
@@ -294,21 +294,21 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, | |||
294 | priv->adapter->fragthsd = | 294 | priv->adapter->fragthsd = |
295 | le16_to_cpu(* | 295 | le16_to_cpu(* |
296 | ((unsigned short *)(smib->value))); | 296 | ((unsigned short *)(smib->value))); |
297 | lbs_pr_debug(1, "SNMP_RESP: fragthsd =%u\n", | 297 | lbs_deb_cmd("SNMP_RESP: fragthsd =%u\n", |
298 | priv->adapter->fragthsd); | 298 | priv->adapter->fragthsd); |
299 | break; | 299 | break; |
300 | case rtsthresh_i: | 300 | case rtsthresh_i: |
301 | priv->adapter->rtsthsd = | 301 | priv->adapter->rtsthsd = |
302 | le16_to_cpu(* | 302 | le16_to_cpu(* |
303 | ((unsigned short *)(smib->value))); | 303 | ((unsigned short *)(smib->value))); |
304 | lbs_pr_debug(1, "SNMP_RESP: rtsthsd =%u\n", | 304 | lbs_deb_cmd("SNMP_RESP: rtsthsd =%u\n", |
305 | priv->adapter->rtsthsd); | 305 | priv->adapter->rtsthsd); |
306 | break; | 306 | break; |
307 | case short_retrylim_i: | 307 | case short_retrylim_i: |
308 | priv->adapter->txretrycount = | 308 | priv->adapter->txretrycount = |
309 | le16_to_cpu(* | 309 | le16_to_cpu(* |
310 | ((unsigned short *)(smib->value))); | 310 | ((unsigned short *)(smib->value))); |
311 | lbs_pr_debug(1, "SNMP_RESP: txretrycount =%u\n", | 311 | lbs_deb_cmd("SNMP_RESP: txretrycount =%u\n", |
312 | priv->adapter->rtsthsd); | 312 | priv->adapter->rtsthsd); |
313 | break; | 313 | break; |
314 | default: | 314 | default: |
@@ -316,7 +316,7 @@ static int wlan_ret_802_11_snmp_mib(wlan_private * priv, | |||
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||
319 | LEAVE(); | 319 | lbs_deb_enter(LBS_DEB_CMD); |
320 | return 0; | 320 | return 0; |
321 | } | 321 | } |
322 | 322 | ||
@@ -328,7 +328,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv, | |||
328 | wlan_adapter *adapter = priv->adapter; | 328 | wlan_adapter *adapter = priv->adapter; |
329 | u16 action = le16_to_cpu(pkeymaterial->action); | 329 | u16 action = le16_to_cpu(pkeymaterial->action); |
330 | 330 | ||
331 | ENTER(); | 331 | lbs_deb_enter(LBS_DEB_CMD); |
332 | 332 | ||
333 | /* Copy the returned key to driver private data */ | 333 | /* Copy the returned key to driver private data */ |
334 | if (action == cmd_act_get) { | 334 | if (action == cmd_act_get) { |
@@ -371,7 +371,7 @@ static int wlan_ret_802_11_key_material(wlan_private * priv, | |||
371 | } | 371 | } |
372 | } | 372 | } |
373 | 373 | ||
374 | LEAVE(); | 374 | lbs_deb_enter(LBS_DEB_CMD); |
375 | return 0; | 375 | return 0; |
376 | } | 376 | } |
377 | 377 | ||
@@ -381,11 +381,11 @@ static int wlan_ret_802_11_mac_address(wlan_private * priv, | |||
381 | struct cmd_ds_802_11_mac_address *macadd = &resp->params.macadd; | 381 | struct cmd_ds_802_11_mac_address *macadd = &resp->params.macadd; |
382 | wlan_adapter *adapter = priv->adapter; | 382 | wlan_adapter *adapter = priv->adapter; |
383 | 383 | ||
384 | ENTER(); | 384 | lbs_deb_enter(LBS_DEB_CMD); |
385 | 385 | ||
386 | memcpy(adapter->current_addr, macadd->macadd, ETH_ALEN); | 386 | memcpy(adapter->current_addr, macadd->macadd, ETH_ALEN); |
387 | 387 | ||
388 | LEAVE(); | 388 | lbs_deb_enter(LBS_DEB_CMD); |
389 | return 0; | 389 | return 0; |
390 | } | 390 | } |
391 | 391 | ||
@@ -395,13 +395,13 @@ static int wlan_ret_802_11_rf_tx_power(wlan_private * priv, | |||
395 | struct cmd_ds_802_11_rf_tx_power *rtp = &resp->params.txp; | 395 | struct cmd_ds_802_11_rf_tx_power *rtp = &resp->params.txp; |
396 | wlan_adapter *adapter = priv->adapter; | 396 | wlan_adapter *adapter = priv->adapter; |
397 | 397 | ||
398 | ENTER(); | 398 | lbs_deb_enter(LBS_DEB_CMD); |
399 | 399 | ||
400 | adapter->txpowerlevel = le16_to_cpu(rtp->currentlevel); | 400 | adapter->txpowerlevel = le16_to_cpu(rtp->currentlevel); |
401 | 401 | ||
402 | lbs_pr_debug(1, "Current TxPower Level = %d\n", adapter->txpowerlevel); | 402 | lbs_deb_cmd("Current TxPower Level = %d\n", adapter->txpowerlevel); |
403 | 403 | ||
404 | LEAVE(); | 404 | lbs_deb_enter(LBS_DEB_CMD); |
405 | return 0; | 405 | return 0; |
406 | } | 406 | } |
407 | 407 | ||
@@ -420,7 +420,7 @@ static int wlan_ret_802_11_rf_antenna(wlan_private * priv, | |||
420 | adapter->txantennamode = | 420 | adapter->txantennamode = |
421 | le16_to_cpu(pAntenna->antennamode); | 421 | le16_to_cpu(pAntenna->antennamode); |
422 | 422 | ||
423 | lbs_pr_debug(1, "RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n", | 423 | lbs_deb_cmd("RF_ANT_RESP: action = 0x%x, mode = 0x%04x\n", |
424 | action, le16_to_cpu(pAntenna->antennamode)); | 424 | action, le16_to_cpu(pAntenna->antennamode)); |
425 | 425 | ||
426 | return 0; | 426 | return 0; |
@@ -433,15 +433,14 @@ static int wlan_ret_802_11_rate_adapt_rateset(wlan_private * priv, | |||
433 | &resp->params.rateset; | 433 | &resp->params.rateset; |
434 | wlan_adapter *adapter = priv->adapter; | 434 | wlan_adapter *adapter = priv->adapter; |
435 | 435 | ||
436 | ENTER(); | 436 | lbs_deb_enter(LBS_DEB_CMD); |
437 | 437 | ||
438 | if (rates->action == cmd_act_get) { | 438 | if (rates->action == cmd_act_get) { |
439 | adapter->enablehwauto = rates->enablehwauto; | 439 | adapter->enablehwauto = rates->enablehwauto; |
440 | adapter->ratebitmap = rates->bitmap; | 440 | adapter->ratebitmap = rates->bitmap; |
441 | } | 441 | } |
442 | 442 | ||
443 | LEAVE(); | 443 | lbs_deb_enter(LBS_DEB_CMD); |
444 | |||
445 | return 0; | 444 | return 0; |
446 | } | 445 | } |
447 | 446 | ||
@@ -452,7 +451,7 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, | |||
452 | wlan_adapter *adapter = priv->adapter; | 451 | wlan_adapter *adapter = priv->adapter; |
453 | u8 dot11datarate; | 452 | u8 dot11datarate; |
454 | 453 | ||
455 | ENTER(); | 454 | lbs_deb_enter(LBS_DEB_CMD); |
456 | 455 | ||
457 | lbs_dbg_hex("DATA_RATE_RESP: data_rate- ", | 456 | lbs_dbg_hex("DATA_RATE_RESP: data_rate- ", |
458 | (u8 *) pdatarate, sizeof(struct cmd_ds_802_11_data_rate)); | 457 | (u8 *) pdatarate, sizeof(struct cmd_ds_802_11_data_rate)); |
@@ -464,7 +463,7 @@ static int wlan_ret_802_11_data_rate(wlan_private * priv, | |||
464 | } | 463 | } |
465 | adapter->datarate = libertas_index_to_data_rate(dot11datarate); | 464 | adapter->datarate = libertas_index_to_data_rate(dot11datarate); |
466 | 465 | ||
467 | LEAVE(); | 466 | lbs_deb_enter(LBS_DEB_CMD); |
468 | return 0; | 467 | return 0; |
469 | } | 468 | } |
470 | 469 | ||
@@ -477,18 +476,18 @@ static int wlan_ret_802_11_rf_channel(wlan_private * priv, | |||
477 | u16 action = le16_to_cpu(rfchannel->action); | 476 | u16 action = le16_to_cpu(rfchannel->action); |
478 | u16 newchannel = le16_to_cpu(rfchannel->currentchannel); | 477 | u16 newchannel = le16_to_cpu(rfchannel->currentchannel); |
479 | 478 | ||
480 | ENTER(); | 479 | lbs_deb_enter(LBS_DEB_CMD); |
481 | 480 | ||
482 | if (action == cmd_opt_802_11_rf_channel_get | 481 | if (action == cmd_opt_802_11_rf_channel_get |
483 | && adapter->curbssparams.channel != newchannel) { | 482 | && adapter->curbssparams.channel != newchannel) { |
484 | lbs_pr_debug(1, "channel Switch: %d to %d\n", | 483 | lbs_deb_cmd("channel Switch: %d to %d\n", |
485 | adapter->curbssparams.channel, newchannel); | 484 | adapter->curbssparams.channel, newchannel); |
486 | 485 | ||
487 | /* Update the channel again */ | 486 | /* Update the channel again */ |
488 | adapter->curbssparams.channel = newchannel; | 487 | adapter->curbssparams.channel = newchannel; |
489 | } | 488 | } |
490 | 489 | ||
491 | LEAVE(); | 490 | lbs_deb_enter(LBS_DEB_CMD); |
492 | return 0; | 491 | return 0; |
493 | } | 492 | } |
494 | 493 | ||
@@ -515,7 +514,7 @@ static int wlan_ret_802_11_rssi(wlan_private * priv, | |||
515 | CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_AVG] / AVG_SCALE, | 514 | CAL_RSSI(adapter->SNR[TYPE_BEACON][TYPE_AVG] / AVG_SCALE, |
516 | adapter->NF[TYPE_BEACON][TYPE_AVG] / AVG_SCALE); | 515 | adapter->NF[TYPE_BEACON][TYPE_AVG] / AVG_SCALE); |
517 | 516 | ||
518 | lbs_pr_debug(1, "Beacon RSSI value = 0x%x\n", | 517 | lbs_deb_cmd("Beacon RSSI value = 0x%x\n", |
519 | adapter->RSSI[TYPE_BEACON][TYPE_AVG]); | 518 | adapter->RSSI[TYPE_BEACON][TYPE_AVG]); |
520 | 519 | ||
521 | return 0; | 520 | return 0; |
@@ -528,11 +527,11 @@ static int wlan_ret_802_11_eeprom_access(wlan_private * priv, | |||
528 | struct wlan_ioctl_regrdwr *pbuf; | 527 | struct wlan_ioctl_regrdwr *pbuf; |
529 | pbuf = (struct wlan_ioctl_regrdwr *) adapter->prdeeprom; | 528 | pbuf = (struct wlan_ioctl_regrdwr *) adapter->prdeeprom; |
530 | 529 | ||
531 | lbs_pr_debug(1, "eeprom read len=%x\n", | 530 | lbs_deb_cmd("eeprom read len=%x\n", |
532 | le16_to_cpu(resp->params.rdeeprom.bytecount)); | 531 | le16_to_cpu(resp->params.rdeeprom.bytecount)); |
533 | if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) { | 532 | if (pbuf->NOB < le16_to_cpu(resp->params.rdeeprom.bytecount)) { |
534 | pbuf->NOB = 0; | 533 | pbuf->NOB = 0; |
535 | lbs_pr_debug(1, "eeprom read return length is too big\n"); | 534 | lbs_deb_cmd("eeprom read return length is too big\n"); |
536 | return -1; | 535 | return -1; |
537 | } | 536 | } |
538 | pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount); | 537 | pbuf->NOB = le16_to_cpu(resp->params.rdeeprom.bytecount); |
@@ -553,13 +552,13 @@ static int wlan_ret_get_log(wlan_private * priv, | |||
553 | (struct cmd_ds_802_11_get_log *)&resp->params.glog; | 552 | (struct cmd_ds_802_11_get_log *)&resp->params.glog; |
554 | wlan_adapter *adapter = priv->adapter; | 553 | wlan_adapter *adapter = priv->adapter; |
555 | 554 | ||
556 | ENTER(); | 555 | lbs_deb_enter(LBS_DEB_CMD); |
557 | 556 | ||
558 | /* TODO Convert it to Big Endian before copy */ | 557 | /* TODO Convert it to Big Endian before copy */ |
559 | memcpy(&adapter->logmsg, logmessage, | 558 | memcpy(&adapter->logmsg, logmessage, |
560 | sizeof(struct cmd_ds_802_11_get_log)); | 559 | sizeof(struct cmd_ds_802_11_get_log)); |
561 | 560 | ||
562 | LEAVE(); | 561 | lbs_deb_enter(LBS_DEB_CMD); |
563 | return 0; | 562 | return 0; |
564 | } | 563 | } |
565 | 564 | ||
@@ -663,7 +662,7 @@ static inline int handle_cmd_response(u16 respcmd, | |||
663 | break; | 662 | break; |
664 | 663 | ||
665 | case cmd_ret_802_11_key_material: | 664 | case cmd_ret_802_11_key_material: |
666 | lbs_pr_debug(1, "CMD_RESP: KEY_MATERIAL command response\n"); | 665 | lbs_deb_cmd("CMD_RESP: KEY_MATERIAL command response\n"); |
667 | ret = wlan_ret_802_11_key_material(priv, resp); | 666 | ret = wlan_ret_802_11_key_material(priv, resp); |
668 | break; | 667 | break; |
669 | 668 | ||
@@ -739,7 +738,7 @@ static inline int handle_cmd_response(u16 respcmd, | |||
739 | priv->adapter->txrate = resp->params.txrate.txrate; | 738 | priv->adapter->txrate = resp->params.txrate.txrate; |
740 | break; | 739 | break; |
741 | default: | 740 | default: |
742 | lbs_pr_debug(1, "CMD_RESP: Unknown command response %#x\n", | 741 | lbs_deb_cmd("CMD_RESP: Unknown command response %#x\n", |
743 | resp->command); | 742 | resp->command); |
744 | break; | 743 | break; |
745 | } | 744 | } |
@@ -755,9 +754,9 @@ int libertas_process_rx_command(wlan_private * priv) | |||
755 | ulong flags; | 754 | ulong flags; |
756 | u16 result; | 755 | u16 result; |
757 | 756 | ||
758 | ENTER(); | 757 | lbs_deb_enter(LBS_DEB_CMD); |
759 | 758 | ||
760 | lbs_pr_debug(1, "CMD_RESP: @ %lu\n", jiffies); | 759 | lbs_deb_cmd("CMD_RESP: @ %lu\n", jiffies); |
761 | 760 | ||
762 | /* Now we got response from FW, cancel the command timer */ | 761 | /* Now we got response from FW, cancel the command timer */ |
763 | del_timer(&adapter->command_timer); | 762 | del_timer(&adapter->command_timer); |
@@ -766,7 +765,7 @@ int libertas_process_rx_command(wlan_private * priv) | |||
766 | spin_lock_irqsave(&adapter->driver_lock, flags); | 765 | spin_lock_irqsave(&adapter->driver_lock, flags); |
767 | 766 | ||
768 | if (!adapter->cur_cmd) { | 767 | if (!adapter->cur_cmd) { |
769 | lbs_pr_debug(1, "CMD_RESP: NULL cur_cmd=%p\n", adapter->cur_cmd); | 768 | lbs_deb_cmd("CMD_RESP: NULL cur_cmd=%p\n", adapter->cur_cmd); |
770 | ret = -1; | 769 | ret = -1; |
771 | spin_unlock_irqrestore(&adapter->driver_lock, flags); | 770 | spin_unlock_irqrestore(&adapter->driver_lock, flags); |
772 | goto done; | 771 | goto done; |
@@ -780,11 +779,11 @@ int libertas_process_rx_command(wlan_private * priv) | |||
780 | 779 | ||
781 | result = le16_to_cpu(resp->result); | 780 | result = le16_to_cpu(resp->result); |
782 | 781 | ||
783 | lbs_pr_debug(1, "CMD_RESP: %x result: %d length: %d\n", respcmd, | 782 | lbs_deb_cmd("CMD_RESP: %x result: %d length: %d\n", respcmd, |
784 | result, priv->wlan_dev.upld_len); | 783 | result, priv->wlan_dev.upld_len); |
785 | 784 | ||
786 | if (!(respcmd & 0x8000)) { | 785 | if (!(respcmd & 0x8000)) { |
787 | lbs_pr_debug(1, "Invalid response to command!"); | 786 | lbs_deb_cmd("Invalid response to command!"); |
788 | adapter->cur_cmd_retcode = -1; | 787 | adapter->cur_cmd_retcode = -1; |
789 | __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); | 788 | __libertas_cleanup_and_insert_cmd(priv, adapter->cur_cmd); |
790 | adapter->nr_cmd_pending--; | 789 | adapter->nr_cmd_pending--; |
@@ -801,13 +800,13 @@ int libertas_process_rx_command(wlan_private * priv) | |||
801 | struct cmd_ds_802_11_ps_mode *psmode; | 800 | struct cmd_ds_802_11_ps_mode *psmode; |
802 | 801 | ||
803 | psmode = &resp->params.psmode; | 802 | psmode = &resp->params.psmode; |
804 | lbs_pr_debug(1, | 803 | lbs_deb_cmd( |
805 | "CMD_RESP: PS_MODE cmd reply result=%#x action=0x%X\n", | 804 | "CMD_RESP: PS_MODE cmd reply result=%#x action=0x%X\n", |
806 | resp->result, psmode->action); | 805 | resp->result, psmode->action); |
807 | psmode->action = cpu_to_le16(psmode->action); | 806 | psmode->action = cpu_to_le16(psmode->action); |
808 | 807 | ||
809 | if (result) { | 808 | if (result) { |
810 | lbs_pr_debug(1, "CMD_RESP: PS command failed- %#x \n", | 809 | lbs_deb_cmd("CMD_RESP: PS command failed- %#x \n", |
811 | resp->result); | 810 | resp->result); |
812 | if (adapter->mode == IW_MODE_ADHOC) { | 811 | if (adapter->mode == IW_MODE_ADHOC) { |
813 | /* | 812 | /* |
@@ -823,13 +822,13 @@ int libertas_process_rx_command(wlan_private * priv) | |||
823 | adapter->needtowakeup = 0; | 822 | adapter->needtowakeup = 0; |
824 | adapter->psstate = PS_STATE_AWAKE; | 823 | adapter->psstate = PS_STATE_AWAKE; |
825 | 824 | ||
826 | lbs_pr_debug(1, "CMD_RESP: Enter_PS command response\n"); | 825 | lbs_deb_cmd("CMD_RESP: Enter_PS command response\n"); |
827 | if (adapter->connect_status != libertas_connected) { | 826 | if (adapter->connect_status != libertas_connected) { |
828 | /* | 827 | /* |
829 | * When Deauth Event received before Enter_PS command | 828 | * When Deauth Event received before Enter_PS command |
830 | * response, We need to wake up the firmware. | 829 | * response, We need to wake up the firmware. |
831 | */ | 830 | */ |
832 | lbs_pr_debug(1, | 831 | lbs_deb_cmd( |
833 | "Disconnected, Going to invoke libertas_ps_wakeup\n"); | 832 | "Disconnected, Going to invoke libertas_ps_wakeup\n"); |
834 | 833 | ||
835 | mutex_unlock(&adapter->lock); | 834 | mutex_unlock(&adapter->lock); |
@@ -841,9 +840,9 @@ int libertas_process_rx_command(wlan_private * priv) | |||
841 | } else if (psmode->action == cmd_subcmd_exit_ps) { | 840 | } else if (psmode->action == cmd_subcmd_exit_ps) { |
842 | adapter->needtowakeup = 0; | 841 | adapter->needtowakeup = 0; |
843 | adapter->psstate = PS_STATE_FULL_POWER; | 842 | adapter->psstate = PS_STATE_FULL_POWER; |
844 | lbs_pr_debug(1, "CMD_RESP: Exit_PS command response\n"); | 843 | lbs_deb_cmd("CMD_RESP: Exit_PS command response\n"); |
845 | } else { | 844 | } else { |
846 | lbs_pr_debug(1, "CMD_RESP: PS- action=0x%X\n", | 845 | lbs_deb_cmd("CMD_RESP: PS- action=0x%X\n", |
847 | psmode->action); | 846 | psmode->action); |
848 | } | 847 | } |
849 | 848 | ||
@@ -865,7 +864,7 @@ int libertas_process_rx_command(wlan_private * priv) | |||
865 | 864 | ||
866 | /* If the command is not successful, cleanup and return failure */ | 865 | /* If the command is not successful, cleanup and return failure */ |
867 | if ((result != 0 || !(respcmd & 0x8000))) { | 866 | if ((result != 0 || !(respcmd & 0x8000))) { |
868 | lbs_pr_debug(1, "CMD_RESP: command reply %#x result=%#x\n", | 867 | lbs_deb_cmd("CMD_RESP: command reply %#x result=%#x\n", |
869 | resp->command, resp->result); | 868 | resp->command, resp->result); |
870 | /* | 869 | /* |
871 | * Handling errors here | 870 | * Handling errors here |
@@ -873,7 +872,7 @@ int libertas_process_rx_command(wlan_private * priv) | |||
873 | switch (respcmd) { | 872 | switch (respcmd) { |
874 | case cmd_ret_hw_spec_info: | 873 | case cmd_ret_hw_spec_info: |
875 | case cmd_ret_802_11_reset: | 874 | case cmd_ret_802_11_reset: |
876 | lbs_pr_debug(1, "CMD_RESP: Reset command failed\n"); | 875 | lbs_deb_cmd("CMD_RESP: Reset command failed\n"); |
877 | break; | 876 | break; |
878 | 877 | ||
879 | } | 878 | } |
@@ -903,7 +902,7 @@ int libertas_process_rx_command(wlan_private * priv) | |||
903 | 902 | ||
904 | done: | 903 | done: |
905 | mutex_unlock(&adapter->lock); | 904 | mutex_unlock(&adapter->lock); |
906 | LEAVE(); | 905 | lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); |
907 | return ret; | 906 | return ret; |
908 | } | 907 | } |
909 | 908 | ||
@@ -917,37 +916,37 @@ int libertas_process_event(wlan_private * priv) | |||
917 | eventcause = adapter->eventcause; | 916 | eventcause = adapter->eventcause; |
918 | spin_unlock_irq(&adapter->driver_lock); | 917 | spin_unlock_irq(&adapter->driver_lock); |
919 | 918 | ||
920 | ENTER(); | 919 | lbs_deb_enter(LBS_DEB_CMD); |
921 | 920 | ||
922 | lbs_pr_debug(1, "EVENT Cause %x\n", eventcause); | 921 | lbs_deb_cmd("EVENT Cause %x\n", eventcause); |
923 | 922 | ||
924 | switch (eventcause >> SBI_EVENT_CAUSE_SHIFT) { | 923 | switch (eventcause >> SBI_EVENT_CAUSE_SHIFT) { |
925 | case MACREG_INT_CODE_LINK_SENSED: | 924 | case MACREG_INT_CODE_LINK_SENSED: |
926 | lbs_pr_debug(1, "EVENT: MACREG_INT_CODE_LINK_SENSED\n"); | 925 | lbs_deb_cmd("EVENT: MACREG_INT_CODE_LINK_SENSED\n"); |
927 | break; | 926 | break; |
928 | 927 | ||
929 | case MACREG_INT_CODE_DEAUTHENTICATED: | 928 | case MACREG_INT_CODE_DEAUTHENTICATED: |
930 | lbs_pr_debug(1, "EVENT: Deauthenticated\n"); | 929 | lbs_deb_cmd("EVENT: Deauthenticated\n"); |
931 | libertas_mac_event_disconnected(priv); | 930 | libertas_mac_event_disconnected(priv); |
932 | break; | 931 | break; |
933 | 932 | ||
934 | case MACREG_INT_CODE_DISASSOCIATED: | 933 | case MACREG_INT_CODE_DISASSOCIATED: |
935 | lbs_pr_debug(1, "EVENT: Disassociated\n"); | 934 | lbs_deb_cmd("EVENT: Disassociated\n"); |
936 | libertas_mac_event_disconnected(priv); | 935 | libertas_mac_event_disconnected(priv); |
937 | break; | 936 | break; |
938 | 937 | ||
939 | case MACREG_INT_CODE_LINK_LOSE_NO_SCAN: | 938 | case MACREG_INT_CODE_LINK_LOSE_NO_SCAN: |
940 | lbs_pr_debug(1, "EVENT: Link lost\n"); | 939 | lbs_deb_cmd("EVENT: Link lost\n"); |
941 | libertas_mac_event_disconnected(priv); | 940 | libertas_mac_event_disconnected(priv); |
942 | break; | 941 | break; |
943 | 942 | ||
944 | case MACREG_INT_CODE_PS_SLEEP: | 943 | case MACREG_INT_CODE_PS_SLEEP: |
945 | lbs_pr_debug(1, "EVENT: SLEEP\n"); | 944 | lbs_deb_cmd("EVENT: SLEEP\n"); |
946 | lbs_pr_debug(1, "_"); | 945 | lbs_deb_cmd("_"); |
947 | 946 | ||
948 | /* handle unexpected PS SLEEP event */ | 947 | /* handle unexpected PS SLEEP event */ |
949 | if (adapter->psstate == PS_STATE_FULL_POWER) { | 948 | if (adapter->psstate == PS_STATE_FULL_POWER) { |
950 | lbs_pr_debug(1, | 949 | lbs_deb_cmd( |
951 | "EVENT: In FULL POWER mode - ignore PS SLEEP\n"); | 950 | "EVENT: In FULL POWER mode - ignore PS SLEEP\n"); |
952 | break; | 951 | break; |
953 | } | 952 | } |
@@ -958,12 +957,12 @@ int libertas_process_event(wlan_private * priv) | |||
958 | break; | 957 | break; |
959 | 958 | ||
960 | case MACREG_INT_CODE_PS_AWAKE: | 959 | case MACREG_INT_CODE_PS_AWAKE: |
961 | lbs_pr_debug(1, "EVENT: AWAKE \n"); | 960 | lbs_deb_cmd("EVENT: AWAKE \n"); |
962 | lbs_pr_debug(1, "|"); | 961 | lbs_deb_cmd("|"); |
963 | 962 | ||
964 | /* handle unexpected PS AWAKE event */ | 963 | /* handle unexpected PS AWAKE event */ |
965 | if (adapter->psstate == PS_STATE_FULL_POWER) { | 964 | if (adapter->psstate == PS_STATE_FULL_POWER) { |
966 | lbs_pr_debug(1, | 965 | lbs_deb_cmd( |
967 | "EVENT: In FULL POWER mode - ignore PS AWAKE\n"); | 966 | "EVENT: In FULL POWER mode - ignore PS AWAKE\n"); |
968 | break; | 967 | break; |
969 | } | 968 | } |
@@ -977,18 +976,18 @@ int libertas_process_event(wlan_private * priv) | |||
977 | * adapter->needtowakeup will be set to FALSE | 976 | * adapter->needtowakeup will be set to FALSE |
978 | * in libertas_ps_wakeup() | 977 | * in libertas_ps_wakeup() |
979 | */ | 978 | */ |
980 | lbs_pr_debug(1, "Waking up...\n"); | 979 | lbs_deb_cmd("Waking up...\n"); |
981 | libertas_ps_wakeup(priv, 0); | 980 | libertas_ps_wakeup(priv, 0); |
982 | } | 981 | } |
983 | break; | 982 | break; |
984 | 983 | ||
985 | case MACREG_INT_CODE_MIC_ERR_UNICAST: | 984 | case MACREG_INT_CODE_MIC_ERR_UNICAST: |
986 | lbs_pr_debug(1, "EVENT: UNICAST MIC ERROR\n"); | 985 | lbs_deb_cmd("EVENT: UNICAST MIC ERROR\n"); |
987 | handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_UNICAST); | 986 | handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_UNICAST); |
988 | break; | 987 | break; |
989 | 988 | ||
990 | case MACREG_INT_CODE_MIC_ERR_MULTICAST: | 989 | case MACREG_INT_CODE_MIC_ERR_MULTICAST: |
991 | lbs_pr_debug(1, "EVENT: MULTICAST MIC ERROR\n"); | 990 | lbs_deb_cmd("EVENT: MULTICAST MIC ERROR\n"); |
992 | handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_MULTICAST); | 991 | handle_mic_failureevent(priv, MACREG_INT_CODE_MIC_ERR_MULTICAST); |
993 | break; | 992 | break; |
994 | case MACREG_INT_CODE_MIB_CHANGED: | 993 | case MACREG_INT_CODE_MIB_CHANGED: |
@@ -996,7 +995,7 @@ int libertas_process_event(wlan_private * priv) | |||
996 | break; | 995 | break; |
997 | 996 | ||
998 | case MACREG_INT_CODE_ADHOC_BCN_LOST: | 997 | case MACREG_INT_CODE_ADHOC_BCN_LOST: |
999 | lbs_pr_debug(1, "EVENT: HWAC - ADHOC BCN LOST\n"); | 998 | lbs_deb_cmd("EVENT: HWAC - ADHOC BCN LOST\n"); |
1000 | break; | 999 | break; |
1001 | 1000 | ||
1002 | case MACREG_INT_CODE_RSSI_LOW: | 1001 | case MACREG_INT_CODE_RSSI_LOW: |
@@ -1024,6 +1023,7 @@ int libertas_process_event(wlan_private * priv) | |||
1024 | spin_lock_irq(&adapter->driver_lock); | 1023 | spin_lock_irq(&adapter->driver_lock); |
1025 | adapter->eventcause = 0; | 1024 | adapter->eventcause = 0; |
1026 | spin_unlock_irq(&adapter->driver_lock); | 1025 | spin_unlock_irq(&adapter->driver_lock); |
1027 | LEAVE(); | 1026 | |
1027 | lbs_deb_enter_args(LBS_DEB_CMD, "ret %d", ret); | ||
1028 | return ret; | 1028 | return ret; |
1029 | } | 1029 | } |