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/if_usb.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/if_usb.c')
-rw-r--r-- | drivers/net/wireless/libertas/if_usb.c | 146 |
1 files changed, 80 insertions, 66 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 38063de9da43..208d25700040 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -46,9 +46,11 @@ static void if_usb_write_bulk_callback(struct urb *urb) | |||
46 | /* print the failure status number for debug */ | 46 | /* print the failure status number for debug */ |
47 | lbs_pr_info("URB in failure status\n"); | 47 | lbs_pr_info("URB in failure status\n"); |
48 | } else { | 48 | } else { |
49 | lbs_dev_dbg(2, &urb->dev->dev, "URB status is successfull\n"); | 49 | /* |
50 | lbs_dev_dbg(2, &urb->dev->dev, "Actual length transmitted %d\n", | 50 | lbs_deb_usbd(&urb->dev->dev, "URB status is successfull\n"); |
51 | lbs_deb_usbd(&urb->dev->dev, "Actual length transmitted %d\n", | ||
51 | urb->actual_length); | 52 | urb->actual_length); |
53 | */ | ||
52 | priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; | 54 | priv->wlan_dev.dnld_sent = DNLD_RES_RECEIVED; |
53 | /* Wake main thread if commands are pending */ | 55 | /* Wake main thread if commands are pending */ |
54 | if (!adapter->cur_cmd) | 56 | if (!adapter->cur_cmd) |
@@ -67,7 +69,7 @@ static void if_usb_write_bulk_callback(struct urb *urb) | |||
67 | */ | 69 | */ |
68 | void if_usb_free(struct usb_card_rec *cardp) | 70 | void if_usb_free(struct usb_card_rec *cardp) |
69 | { | 71 | { |
70 | ENTER(); | 72 | lbs_deb_enter(LBS_DEB_USB); |
71 | 73 | ||
72 | /* Unlink tx & rx urb */ | 74 | /* Unlink tx & rx urb */ |
73 | usb_kill_urb(cardp->tx_urb); | 75 | usb_kill_urb(cardp->tx_urb); |
@@ -82,8 +84,7 @@ void if_usb_free(struct usb_card_rec *cardp) | |||
82 | kfree(cardp->bulk_out_buffer); | 84 | kfree(cardp->bulk_out_buffer); |
83 | cardp->bulk_out_buffer = NULL; | 85 | cardp->bulk_out_buffer = NULL; |
84 | 86 | ||
85 | LEAVE(); | 87 | lbs_deb_leave(LBS_DEB_USB); |
86 | return; | ||
87 | } | 88 | } |
88 | 89 | ||
89 | /** | 90 | /** |
@@ -113,7 +114,7 @@ static int if_usb_probe(struct usb_interface *intf, | |||
113 | usb_cardp->udev = udev; | 114 | usb_cardp->udev = udev; |
114 | iface_desc = intf->cur_altsetting; | 115 | iface_desc = intf->cur_altsetting; |
115 | 116 | ||
116 | lbs_dev_dbg(1, &udev->dev, "bcdUSB = 0x%X bDeviceClass = 0x%X" | 117 | lbs_deb_usbd(&udev->dev, "bcdUSB = 0x%X bDeviceClass = 0x%X" |
117 | " bDeviceSubClass = 0x%X, bDeviceProtocol = 0x%X\n", | 118 | " bDeviceSubClass = 0x%X, bDeviceProtocol = 0x%X\n", |
118 | udev->descriptor.bcdUSB, | 119 | udev->descriptor.bcdUSB, |
119 | udev->descriptor.bDeviceClass, | 120 | udev->descriptor.bDeviceClass, |
@@ -126,12 +127,12 @@ static int if_usb_probe(struct usb_interface *intf, | |||
126 | && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | 127 | && ((endpoint->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == |
127 | USB_ENDPOINT_XFER_BULK)) { | 128 | USB_ENDPOINT_XFER_BULK)) { |
128 | /* we found a bulk in endpoint */ | 129 | /* we found a bulk in endpoint */ |
129 | lbs_dev_dbg(1, &udev->dev, "Bulk in size is %d\n", | 130 | lbs_deb_usbd(&udev->dev, "Bulk in size is %d\n", |
130 | endpoint->wMaxPacketSize); | 131 | endpoint->wMaxPacketSize); |
131 | if (! | 132 | if (! |
132 | (usb_cardp->rx_urb = | 133 | (usb_cardp->rx_urb = |
133 | usb_alloc_urb(0, GFP_KERNEL))) { | 134 | usb_alloc_urb(0, GFP_KERNEL))) { |
134 | lbs_dev_dbg(1, &udev->dev, | 135 | lbs_deb_usbd(&udev->dev, |
135 | "Rx URB allocation failed\n"); | 136 | "Rx URB allocation failed\n"); |
136 | goto dealloc; | 137 | goto dealloc; |
137 | } | 138 | } |
@@ -142,7 +143,7 @@ static int if_usb_probe(struct usb_interface *intf, | |||
142 | usb_cardp->bulk_in_endpointAddr = | 143 | usb_cardp->bulk_in_endpointAddr = |
143 | (endpoint-> | 144 | (endpoint-> |
144 | bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); | 145 | bEndpointAddress & USB_ENDPOINT_NUMBER_MASK); |
145 | lbs_dev_dbg(1, &udev->dev, "in_endpoint = %d\n", | 146 | lbs_deb_usbd(&udev->dev, "in_endpoint = %d\n", |
146 | endpoint->bEndpointAddress); | 147 | endpoint->bEndpointAddress); |
147 | } | 148 | } |
148 | 149 | ||
@@ -155,26 +156,26 @@ static int if_usb_probe(struct usb_interface *intf, | |||
155 | if (! | 156 | if (! |
156 | (usb_cardp->tx_urb = | 157 | (usb_cardp->tx_urb = |
157 | usb_alloc_urb(0, GFP_KERNEL))) { | 158 | usb_alloc_urb(0, GFP_KERNEL))) { |
158 | lbs_dev_dbg(1,&udev->dev, | 159 | lbs_deb_usbd(&udev->dev, |
159 | "Tx URB allocation failed\n"); | 160 | "Tx URB allocation failed\n"); |
160 | goto dealloc; | 161 | goto dealloc; |
161 | } | 162 | } |
162 | 163 | ||
163 | usb_cardp->bulk_out_size = | 164 | usb_cardp->bulk_out_size = |
164 | endpoint->wMaxPacketSize; | 165 | endpoint->wMaxPacketSize; |
165 | lbs_dev_dbg(1, &udev->dev, | 166 | lbs_deb_usbd(&udev->dev, |
166 | "Bulk out size is %d\n", | 167 | "Bulk out size is %d\n", |
167 | endpoint->wMaxPacketSize); | 168 | endpoint->wMaxPacketSize); |
168 | usb_cardp->bulk_out_endpointAddr = | 169 | usb_cardp->bulk_out_endpointAddr = |
169 | endpoint->bEndpointAddress; | 170 | endpoint->bEndpointAddress; |
170 | lbs_dev_dbg(1, &udev->dev, "out_endpoint = %d\n", | 171 | lbs_deb_usbd(&udev->dev, "out_endpoint = %d\n", |
171 | endpoint->bEndpointAddress); | 172 | endpoint->bEndpointAddress); |
172 | usb_cardp->bulk_out_buffer = | 173 | usb_cardp->bulk_out_buffer = |
173 | kmalloc(MRVDRV_ETH_TX_PACKET_BUFFER_SIZE, | 174 | kmalloc(MRVDRV_ETH_TX_PACKET_BUFFER_SIZE, |
174 | GFP_KERNEL); | 175 | GFP_KERNEL); |
175 | 176 | ||
176 | if (!usb_cardp->bulk_out_buffer) { | 177 | if (!usb_cardp->bulk_out_buffer) { |
177 | lbs_dev_dbg(1, &udev->dev, | 178 | lbs_deb_usbd(&udev->dev, |
178 | "Could not allocate buffer\n"); | 179 | "Could not allocate buffer\n"); |
179 | goto dealloc; | 180 | goto dealloc; |
180 | } | 181 | } |
@@ -226,7 +227,7 @@ static void if_usb_disconnect(struct usb_interface *intf) | |||
226 | adapter->surpriseremoved = 1; | 227 | adapter->surpriseremoved = 1; |
227 | 228 | ||
228 | /* card is removed and we can call wlan_remove_card */ | 229 | /* card is removed and we can call wlan_remove_card */ |
229 | lbs_dev_dbg(1, &cardp->udev->dev, "call remove card\n"); | 230 | lbs_deb_usbd(&cardp->udev->dev, "call remove card\n"); |
230 | wlan_remove_card(cardp); | 231 | wlan_remove_card(cardp); |
231 | 232 | ||
232 | /* Unlink and free urb */ | 233 | /* Unlink and free urb */ |
@@ -262,8 +263,10 @@ static int if_prog_firmware(wlan_private * priv) | |||
262 | cardp->fwseqnum = cardp->lastseqnum - 1; | 263 | cardp->fwseqnum = cardp->lastseqnum - 1; |
263 | } | 264 | } |
264 | 265 | ||
265 | lbs_dev_dbg(2, &cardp->udev->dev, "totalbytes = %d\n", | 266 | /* |
267 | lbs_deb_usbd(&cardp->udev->dev, "totalbytes = %d\n", | ||
266 | cardp->totalbytes); | 268 | cardp->totalbytes); |
269 | */ | ||
267 | 270 | ||
268 | memcpy(fwheader, &firmware[cardp->totalbytes], | 271 | memcpy(fwheader, &firmware[cardp->totalbytes], |
269 | sizeof(struct fwheader)); | 272 | sizeof(struct fwheader)); |
@@ -271,12 +274,14 @@ static int if_prog_firmware(wlan_private * priv) | |||
271 | cardp->fwlastblksent = cardp->totalbytes; | 274 | cardp->fwlastblksent = cardp->totalbytes; |
272 | cardp->totalbytes += sizeof(struct fwheader); | 275 | cardp->totalbytes += sizeof(struct fwheader); |
273 | 276 | ||
274 | lbs_dev_dbg(2, &cardp->udev->dev,"Copy Data\n"); | 277 | /* lbs_deb_usbd(&cardp->udev->dev,"Copy Data\n"); */ |
275 | memcpy(fwdata->data, &firmware[cardp->totalbytes], | 278 | memcpy(fwdata->data, &firmware[cardp->totalbytes], |
276 | fwdata->fwheader.datalength); | 279 | fwdata->fwheader.datalength); |
277 | 280 | ||
278 | lbs_dev_dbg(2, &cardp->udev->dev, | 281 | /* |
282 | lbs_deb_usbd(&cardp->udev->dev, | ||
279 | "Data length = %d\n", fwdata->fwheader.datalength); | 283 | "Data length = %d\n", fwdata->fwheader.datalength); |
284 | */ | ||
280 | 285 | ||
281 | cardp->fwseqnum = cardp->fwseqnum + 1; | 286 | cardp->fwseqnum = cardp->fwseqnum + 1; |
282 | 287 | ||
@@ -285,26 +290,32 @@ static int if_prog_firmware(wlan_private * priv) | |||
285 | cardp->totalbytes += fwdata->fwheader.datalength; | 290 | cardp->totalbytes += fwdata->fwheader.datalength; |
286 | 291 | ||
287 | if (fwheader->dnldcmd == FW_HAS_DATA_TO_RECV) { | 292 | if (fwheader->dnldcmd == FW_HAS_DATA_TO_RECV) { |
288 | lbs_dev_dbg(2, &cardp->udev->dev, "There is data to follow\n"); | 293 | /* |
289 | lbs_dev_dbg(2, &cardp->udev->dev, | 294 | lbs_deb_usbd(&cardp->udev->dev, "There is data to follow\n"); |
295 | lbs_deb_usbd(&cardp->udev->dev, | ||
290 | "seqnum = %d totalbytes = %d\n", cardp->fwseqnum, | 296 | "seqnum = %d totalbytes = %d\n", cardp->fwseqnum, |
291 | cardp->totalbytes); | 297 | cardp->totalbytes); |
298 | */ | ||
292 | memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE); | 299 | memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE); |
293 | usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE); | 300 | usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE); |
294 | 301 | ||
295 | } else if (fwdata->fwheader.dnldcmd == FW_HAS_LAST_BLOCK) { | 302 | } else if (fwdata->fwheader.dnldcmd == FW_HAS_LAST_BLOCK) { |
296 | lbs_dev_dbg(2, &cardp->udev->dev, | 303 | /* |
304 | lbs_deb_usbd(&cardp->udev->dev, | ||
297 | "Host has finished FW downloading\n"); | 305 | "Host has finished FW downloading\n"); |
298 | lbs_dev_dbg(2, &cardp->udev->dev, | 306 | lbs_deb_usbd(&cardp->udev->dev, |
299 | "Donwloading FW JUMP BLOCK\n"); | 307 | "Donwloading FW JUMP BLOCK\n"); |
308 | */ | ||
300 | memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE); | 309 | memcpy(cardp->bulk_out_buffer, fwheader, FW_DATA_XMIT_SIZE); |
301 | usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE); | 310 | usb_tx_block(priv, cardp->bulk_out_buffer, FW_DATA_XMIT_SIZE); |
302 | cardp->fwfinalblk = 1; | 311 | cardp->fwfinalblk = 1; |
303 | } | 312 | } |
304 | 313 | ||
305 | lbs_dev_dbg(2, &cardp->udev->dev, | 314 | /* |
315 | lbs_deb_usbd(&cardp->udev->dev, | ||
306 | "The firmware download is done size is %d\n", | 316 | "The firmware download is done size is %d\n", |
307 | cardp->totalbytes); | 317 | cardp->totalbytes); |
318 | */ | ||
308 | 319 | ||
309 | kfree(fwdata); | 320 | kfree(fwdata); |
310 | 321 | ||
@@ -340,7 +351,7 @@ int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb) | |||
340 | 351 | ||
341 | /* check if device is removed */ | 352 | /* check if device is removed */ |
342 | if (priv->adapter->surpriseremoved) { | 353 | if (priv->adapter->surpriseremoved) { |
343 | lbs_dev_dbg(1, &cardp->udev->dev, "Device removed\n"); | 354 | lbs_deb_usbd(&cardp->udev->dev, "Device removed\n"); |
344 | goto tx_ret; | 355 | goto tx_ret; |
345 | } | 356 | } |
346 | 357 | ||
@@ -353,10 +364,10 @@ int usb_tx_block(wlan_private * priv, u8 * payload, u16 nb) | |||
353 | 364 | ||
354 | if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) { | 365 | if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) { |
355 | /* transfer failed */ | 366 | /* transfer failed */ |
356 | lbs_dev_dbg(1, &cardp->udev->dev, "usb_submit_urb failed\n"); | 367 | lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed\n"); |
357 | ret = -1; | 368 | ret = -1; |
358 | } else { | 369 | } else { |
359 | lbs_dev_dbg(2, &cardp->udev->dev, "usb_submit_urb success\n"); | 370 | /* lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb success\n"); */ |
360 | ret = 0; | 371 | ret = 0; |
361 | } | 372 | } |
362 | 373 | ||
@@ -390,13 +401,13 @@ static int __if_usb_submit_rx_urb(wlan_private * priv, | |||
390 | 401 | ||
391 | cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET; | 402 | cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET; |
392 | 403 | ||
393 | lbs_dev_dbg(2, &cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb); | 404 | /* lbs_deb_usbd(&cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb); */ |
394 | if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) { | 405 | if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) { |
395 | /* handle failure conditions */ | 406 | /* handle failure conditions */ |
396 | lbs_dev_dbg(1, &cardp->udev->dev, "Submit Rx URB failed\n"); | 407 | lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed\n"); |
397 | ret = -1; | 408 | ret = -1; |
398 | } else { | 409 | } else { |
399 | lbs_dev_dbg(2, &cardp->udev->dev, "Submit Rx URB success\n"); | 410 | /* lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB success\n"); */ |
400 | ret = 0; | 411 | ret = 0; |
401 | } | 412 | } |
402 | 413 | ||
@@ -424,7 +435,7 @@ static void if_usb_receive_fwload(struct urb *urb) | |||
424 | struct bootcmdrespStr bootcmdresp; | 435 | struct bootcmdrespStr bootcmdresp; |
425 | 436 | ||
426 | if (urb->status) { | 437 | if (urb->status) { |
427 | lbs_dev_dbg(1, &cardp->udev->dev, | 438 | lbs_deb_usbd(&cardp->udev->dev, |
428 | "URB status is failed during fw load\n"); | 439 | "URB status is failed during fw load\n"); |
429 | kfree_skb(skb); | 440 | kfree_skb(skb); |
430 | return; | 441 | return; |
@@ -437,7 +448,7 @@ static void if_usb_receive_fwload(struct urb *urb) | |||
437 | kfree_skb(skb); | 448 | kfree_skb(skb); |
438 | if_usb_submit_rx_urb_fwload(priv); | 449 | if_usb_submit_rx_urb_fwload(priv); |
439 | cardp->bootcmdresp = 1; | 450 | cardp->bootcmdresp = 1; |
440 | lbs_dev_dbg(1, &cardp->udev->dev, | 451 | lbs_deb_usbd(&cardp->udev->dev, |
441 | "Received valid boot command response\n"); | 452 | "Received valid boot command response\n"); |
442 | return; | 453 | return; |
443 | } | 454 | } |
@@ -455,7 +466,7 @@ static void if_usb_receive_fwload(struct urb *urb) | |||
455 | bootcmdresp.u8result); | 466 | bootcmdresp.u8result); |
456 | } else { | 467 | } else { |
457 | cardp->bootcmdresp = 1; | 468 | cardp->bootcmdresp = 1; |
458 | lbs_dev_dbg(1, &cardp->udev->dev, | 469 | lbs_deb_usbd(&cardp->udev->dev, |
459 | "Received valid boot command response\n"); | 470 | "Received valid boot command response\n"); |
460 | } | 471 | } |
461 | kfree_skb(skb); | 472 | kfree_skb(skb); |
@@ -465,7 +476,7 @@ static void if_usb_receive_fwload(struct urb *urb) | |||
465 | 476 | ||
466 | syncfwheader = kmalloc(sizeof(struct fwsyncheader), GFP_ATOMIC); | 477 | syncfwheader = kmalloc(sizeof(struct fwsyncheader), GFP_ATOMIC); |
467 | if (!syncfwheader) { | 478 | if (!syncfwheader) { |
468 | lbs_dev_dbg(1, &cardp->udev->dev, "Failure to allocate syncfwheader\n"); | 479 | lbs_deb_usbd(&cardp->udev->dev, "Failure to allocate syncfwheader\n"); |
469 | kfree_skb(skb); | 480 | kfree_skb(skb); |
470 | return; | 481 | return; |
471 | } | 482 | } |
@@ -474,14 +485,16 @@ static void if_usb_receive_fwload(struct urb *urb) | |||
474 | sizeof(struct fwsyncheader)); | 485 | sizeof(struct fwsyncheader)); |
475 | 486 | ||
476 | if (!syncfwheader->cmd) { | 487 | if (!syncfwheader->cmd) { |
477 | lbs_dev_dbg(2, &cardp->udev->dev, | 488 | /* |
489 | lbs_deb_usbd(&cardp->udev->dev, | ||
478 | "FW received Blk with correct CRC\n"); | 490 | "FW received Blk with correct CRC\n"); |
479 | lbs_dev_dbg(2, &cardp->udev->dev, | 491 | lbs_deb_usbd(&cardp->udev->dev, |
480 | "FW received Blk seqnum = %d\n", | 492 | "FW received Blk seqnum = %d\n", |
481 | syncfwheader->seqnum); | 493 | syncfwheader->seqnum); |
494 | */ | ||
482 | cardp->CRC_OK = 1; | 495 | cardp->CRC_OK = 1; |
483 | } else { | 496 | } else { |
484 | lbs_dev_dbg(1, &cardp->udev->dev, | 497 | lbs_deb_usbd(&cardp->udev->dev, |
485 | "FW received Blk with CRC error\n"); | 498 | "FW received Blk with CRC error\n"); |
486 | cardp->CRC_OK = 0; | 499 | cardp->CRC_OK = 0; |
487 | } | 500 | } |
@@ -511,7 +524,7 @@ static inline void process_cmdtypedata(int recvlength, struct sk_buff *skb, | |||
511 | { | 524 | { |
512 | if (recvlength > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + | 525 | if (recvlength > MRVDRV_ETH_RX_PACKET_BUFFER_SIZE + |
513 | MESSAGE_HEADER_LEN || recvlength < MRVDRV_MIN_PKT_LEN) { | 526 | MESSAGE_HEADER_LEN || recvlength < MRVDRV_MIN_PKT_LEN) { |
514 | lbs_dev_dbg(1, &cardp->udev->dev, | 527 | lbs_deb_usbd(&cardp->udev->dev, |
515 | "Packet length is Invalid\n"); | 528 | "Packet length is Invalid\n"); |
516 | kfree_skb(skb); | 529 | kfree_skb(skb); |
517 | return; | 530 | return; |
@@ -531,7 +544,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff, | |||
531 | { | 544 | { |
532 | u8 *cmdbuf; | 545 | u8 *cmdbuf; |
533 | if (recvlength > MRVDRV_SIZE_OF_CMD_BUFFER) { | 546 | if (recvlength > MRVDRV_SIZE_OF_CMD_BUFFER) { |
534 | lbs_dev_dbg(1, &cardp->udev->dev, | 547 | lbs_deb_usbd(&cardp->udev->dev, |
535 | "The receive buffer is too large\n"); | 548 | "The receive buffer is too large\n"); |
536 | kfree_skb(skb); | 549 | kfree_skb(skb); |
537 | return; | 550 | return; |
@@ -558,7 +571,7 @@ static inline void process_cmdrequest(int recvlength, u8 *recvbuff, | |||
558 | libertas_interrupt(priv->wlan_dev.netdev); | 571 | libertas_interrupt(priv->wlan_dev.netdev); |
559 | spin_unlock(&priv->adapter->driver_lock); | 572 | spin_unlock(&priv->adapter->driver_lock); |
560 | 573 | ||
561 | lbs_dev_dbg(1, &cardp->udev->dev, | 574 | lbs_deb_usbd(&cardp->udev->dev, |
562 | "Wake up main thread to handle cmd response\n"); | 575 | "Wake up main thread to handle cmd response\n"); |
563 | 576 | ||
564 | return; | 577 | return; |
@@ -582,11 +595,11 @@ static void if_usb_receive(struct urb *urb) | |||
582 | u8 *recvbuff = NULL; | 595 | u8 *recvbuff = NULL; |
583 | u32 recvtype; | 596 | u32 recvtype; |
584 | 597 | ||
585 | ENTER(); | 598 | lbs_deb_enter(LBS_DEB_USB); |
586 | 599 | ||
587 | if (recvlength) { | 600 | if (recvlength) { |
588 | if (urb->status) { | 601 | if (urb->status) { |
589 | lbs_dev_dbg(1, &cardp->udev->dev, | 602 | lbs_deb_usbd(&cardp->udev->dev, |
590 | "URB status is failed\n"); | 603 | "URB status is failed\n"); |
591 | kfree_skb(skb); | 604 | kfree_skb(skb); |
592 | goto setup_for_next; | 605 | goto setup_for_next; |
@@ -594,12 +607,12 @@ static void if_usb_receive(struct urb *urb) | |||
594 | 607 | ||
595 | recvbuff = skb->data + IPFIELD_ALIGN_OFFSET; | 608 | recvbuff = skb->data + IPFIELD_ALIGN_OFFSET; |
596 | memcpy(&recvtype, recvbuff, sizeof(u32)); | 609 | memcpy(&recvtype, recvbuff, sizeof(u32)); |
597 | lbs_dev_dbg(1, &cardp->udev->dev, | 610 | lbs_deb_usbd(&cardp->udev->dev, |
598 | "Recv length = 0x%x\n", recvlength); | 611 | "Recv length = 0x%x\n", recvlength); |
599 | lbs_dev_dbg(1, &cardp->udev->dev, | 612 | lbs_deb_usbd(&cardp->udev->dev, |
600 | "Receive type = 0x%X\n", recvtype); | 613 | "Receive type = 0x%X\n", recvtype); |
601 | recvtype = le32_to_cpu(recvtype); | 614 | recvtype = le32_to_cpu(recvtype); |
602 | lbs_dev_dbg(1, &cardp->udev->dev, | 615 | lbs_deb_usbd(&cardp->udev->dev, |
603 | "Receive type after = 0x%X\n", recvtype); | 616 | "Receive type after = 0x%X\n", recvtype); |
604 | } else if (urb->status) | 617 | } else if (urb->status) |
605 | goto rx_exit; | 618 | goto rx_exit; |
@@ -618,7 +631,7 @@ static void if_usb_receive(struct urb *urb) | |||
618 | /* Event cause handling */ | 631 | /* Event cause handling */ |
619 | spin_lock(&priv->adapter->driver_lock); | 632 | spin_lock(&priv->adapter->driver_lock); |
620 | cardp->usb_event_cause = *(u32 *) (recvbuff + MESSAGE_HEADER_LEN); | 633 | cardp->usb_event_cause = *(u32 *) (recvbuff + MESSAGE_HEADER_LEN); |
621 | lbs_dev_dbg(1, &cardp->udev->dev,"**EVENT** 0x%X\n", | 634 | lbs_deb_usbd(&cardp->udev->dev,"**EVENT** 0x%X\n", |
622 | cardp->usb_event_cause); | 635 | cardp->usb_event_cause); |
623 | if (cardp->usb_event_cause & 0xffff0000) { | 636 | if (cardp->usb_event_cause & 0xffff0000) { |
624 | libertas_send_tx_feedback(priv); | 637 | libertas_send_tx_feedback(priv); |
@@ -639,8 +652,7 @@ static void if_usb_receive(struct urb *urb) | |||
639 | setup_for_next: | 652 | setup_for_next: |
640 | if_usb_submit_rx_urb(priv); | 653 | if_usb_submit_rx_urb(priv); |
641 | rx_exit: | 654 | rx_exit: |
642 | LEAVE(); | 655 | lbs_deb_leave(LBS_DEB_USB); |
643 | return; | ||
644 | } | 656 | } |
645 | 657 | ||
646 | /** | 658 | /** |
@@ -657,8 +669,8 @@ int libertas_sbi_host_to_card(wlan_private * priv, u8 type, u8 * payload, u16 nb | |||
657 | u32 tmp; | 669 | u32 tmp; |
658 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; | 670 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; |
659 | 671 | ||
660 | lbs_dev_dbg(1, &cardp->udev->dev,"*** type = %u\n", type); | 672 | lbs_deb_usbd(&cardp->udev->dev,"*** type = %u\n", type); |
661 | lbs_dev_dbg(1, &cardp->udev->dev,"size after = %d\n", nb); | 673 | lbs_deb_usbd(&cardp->udev->dev,"size after = %d\n", nb); |
662 | 674 | ||
663 | if (type == MVMS_CMD) { | 675 | if (type == MVMS_CMD) { |
664 | tmp = cpu_to_le32(CMD_TYPE_REQUEST); | 676 | tmp = cpu_to_le32(CMD_TYPE_REQUEST); |
@@ -689,7 +701,7 @@ int libertas_sbi_get_int_status(wlan_private * priv, u8 * ireg) | |||
689 | *ireg = cardp->usb_int_cause; | 701 | *ireg = cardp->usb_int_cause; |
690 | cardp->usb_int_cause = 0; | 702 | cardp->usb_int_cause = 0; |
691 | 703 | ||
692 | lbs_dev_dbg(1, &cardp->udev->dev,"Int cause is 0x%X\n", *ireg); | 704 | lbs_deb_usbd(&cardp->udev->dev,"Int cause is 0x%X\n", *ireg); |
693 | 705 | ||
694 | return 0; | 706 | return 0; |
695 | } | 707 | } |
@@ -736,9 +748,9 @@ int libertas_sbi_unregister_dev(wlan_private * priv) | |||
736 | */ | 748 | */ |
737 | int libertas_sbi_register_dev(wlan_private * priv) | 749 | int libertas_sbi_register_dev(wlan_private * priv) |
738 | { | 750 | { |
739 | |||
740 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; | 751 | struct usb_card_rec *cardp = (struct usb_card_rec *)priv->wlan_dev.card; |
741 | ENTER(); | 752 | |
753 | lbs_deb_enter(LBS_DEB_USB); | ||
742 | 754 | ||
743 | cardp->priv = priv; | 755 | cardp->priv = priv; |
744 | cardp->eth_dev = priv->wlan_dev.netdev; | 756 | cardp->eth_dev = priv->wlan_dev.netdev; |
@@ -746,10 +758,10 @@ int libertas_sbi_register_dev(wlan_private * priv) | |||
746 | 758 | ||
747 | SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev)); | 759 | SET_NETDEV_DEV(cardp->eth_dev, &(cardp->udev->dev)); |
748 | 760 | ||
749 | lbs_dev_dbg(1, &cardp->udev->dev, "udev pointer is at %p\n", | 761 | lbs_deb_usbd(&cardp->udev->dev, "udev pointer is at %p\n", |
750 | cardp->udev); | 762 | cardp->udev); |
751 | 763 | ||
752 | LEAVE(); | 764 | lbs_deb_leave(LBS_DEB_USB); |
753 | return 0; | 765 | return 0; |
754 | } | 766 | } |
755 | 767 | ||
@@ -760,16 +772,17 @@ int libertas_sbi_prog_firmware(wlan_private * priv) | |||
760 | struct usb_card_rec *cardp = priv->wlan_dev.card; | 772 | struct usb_card_rec *cardp = priv->wlan_dev.card; |
761 | int i = 0; | 773 | int i = 0; |
762 | static int reset_count = 10; | 774 | static int reset_count = 10; |
775 | int ret = 0; | ||
763 | 776 | ||
764 | ENTER(); | 777 | lbs_deb_enter(LBS_DEB_USB); |
765 | 778 | ||
766 | cardp->rinfo.priv = priv; | 779 | cardp->rinfo.priv = priv; |
767 | 780 | ||
768 | restart: | 781 | restart: |
769 | if (if_usb_submit_rx_urb_fwload(priv) < 0) { | 782 | if (if_usb_submit_rx_urb_fwload(priv) < 0) { |
770 | lbs_dev_dbg(1, &cardp->udev->dev, "URB submission is failed\n"); | 783 | lbs_deb_usbd(&cardp->udev->dev, "URB submission is failed\n"); |
771 | LEAVE(); | 784 | ret = -1; |
772 | return -1; | 785 | goto done; |
773 | } | 786 | } |
774 | 787 | ||
775 | cardp->bootcmdresp = 0; | 788 | cardp->bootcmdresp = 0; |
@@ -807,7 +820,7 @@ restart: | |||
807 | if_prog_firmware(priv); | 820 | if_prog_firmware(priv); |
808 | 821 | ||
809 | do { | 822 | do { |
810 | lbs_dev_dbg(1, &cardp->udev->dev,"Wlan sched timeout\n"); | 823 | lbs_deb_usbd(&cardp->udev->dev,"Wlan sched timeout\n"); |
811 | i++; | 824 | i++; |
812 | msleep_interruptible(100); | 825 | msleep_interruptible(100); |
813 | if (priv->adapter->surpriseremoved || i >= 20) | 826 | if (priv->adapter->surpriseremoved || i >= 20) |
@@ -822,8 +835,8 @@ restart: | |||
822 | } | 835 | } |
823 | 836 | ||
824 | lbs_pr_info("FW download failure, time = %d ms\n", i * 100); | 837 | lbs_pr_info("FW download failure, time = %d ms\n", i * 100); |
825 | LEAVE(); | 838 | ret = -1; |
826 | return -1; | 839 | goto done; |
827 | } | 840 | } |
828 | 841 | ||
829 | if_usb_submit_rx_urb(priv); | 842 | if_usb_submit_rx_urb(priv); |
@@ -833,8 +846,9 @@ restart: | |||
833 | 846 | ||
834 | priv->adapter->fw_ready = 1; | 847 | priv->adapter->fw_ready = 1; |
835 | 848 | ||
836 | LEAVE(); | 849 | done: |
837 | return 0; | 850 | lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret); |
851 | return ret; | ||
838 | } | 852 | } |
839 | 853 | ||
840 | /** | 854 | /** |
@@ -854,7 +868,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) | |||
854 | struct usb_card_rec *cardp = usb_get_intfdata(intf); | 868 | struct usb_card_rec *cardp = usb_get_intfdata(intf); |
855 | wlan_private *priv = cardp->priv; | 869 | wlan_private *priv = cardp->priv; |
856 | 870 | ||
857 | ENTER(); | 871 | lbs_deb_enter(LBS_DEB_USB); |
858 | 872 | ||
859 | if (priv->adapter->psstate != PS_STATE_FULL_POWER) | 873 | if (priv->adapter->psstate != PS_STATE_FULL_POWER) |
860 | return -1; | 874 | return -1; |
@@ -867,7 +881,7 @@ static int if_usb_suspend(struct usb_interface *intf, pm_message_t message) | |||
867 | 881 | ||
868 | cardp->rx_urb_recall = 1; | 882 | cardp->rx_urb_recall = 1; |
869 | 883 | ||
870 | LEAVE(); | 884 | lbs_deb_leave(LBS_DEB_USB); |
871 | return 0; | 885 | return 0; |
872 | } | 886 | } |
873 | 887 | ||
@@ -875,7 +889,7 @@ static int if_usb_resume(struct usb_interface *intf) | |||
875 | { | 889 | { |
876 | struct usb_card_rec *cardp = usb_get_intfdata(intf); | 890 | struct usb_card_rec *cardp = usb_get_intfdata(intf); |
877 | 891 | ||
878 | ENTER(); | 892 | lbs_deb_enter(LBS_DEB_USB); |
879 | 893 | ||
880 | cardp->rx_urb_recall = 0; | 894 | cardp->rx_urb_recall = 0; |
881 | 895 | ||
@@ -883,7 +897,7 @@ static int if_usb_resume(struct usb_interface *intf) | |||
883 | 897 | ||
884 | netif_device_attach(cardp->eth_dev); | 898 | netif_device_attach(cardp->eth_dev); |
885 | 899 | ||
886 | LEAVE(); | 900 | lbs_deb_leave(LBS_DEB_USB); |
887 | return 0; | 901 | return 0; |
888 | } | 902 | } |
889 | #else | 903 | #else |