diff options
author | Dan Carpenter <error27@gmail.com> | 2010-12-06 02:03:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-06 19:09:45 -0500 |
commit | 07a7f68800a490bc1140de778e196f66ef4596d9 (patch) | |
tree | 1797d6d7327bc28b300b15cb7ce47aa591cb7b08 | |
parent | 6b74705e15d5c87181008f1ac984df7faaad55c9 (diff) |
Staging: Beceem: improve debug printk statements
These are just small changes. Some grammar and wording changes. I added
new lines to the end of all the print statements.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/bcm/InterfaceInit.c | 66 |
1 files changed, 43 insertions, 23 deletions
diff --git a/drivers/staging/bcm/InterfaceInit.c b/drivers/staging/bcm/InterfaceInit.c index b4d22562d060..d236b2a054e5 100644 --- a/drivers/staging/bcm/InterfaceInit.c +++ b/drivers/staging/bcm/InterfaceInit.c | |||
@@ -40,7 +40,7 @@ static void InterfaceAdapterFree(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
40 | */ | 40 | */ |
41 | while (psIntfAdapter->psAdapter->DeviceAccess) { | 41 | while (psIntfAdapter->psAdapter->DeviceAccess) { |
42 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, | 42 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
43 | "Device is being Accessed \n"); | 43 | "Device is being accessed.\n"); |
44 | msleep(100); | 44 | msleep(100); |
45 | } | 45 | } |
46 | /* Free interrupt URB */ | 46 | /* Free interrupt URB */ |
@@ -96,7 +96,8 @@ static void ConfigureEndPointTypesThroughEEPROM(PMINI_ADAPTER Adapter) | |||
96 | 96 | ||
97 | /* Program TX EP as interrupt(Alternate Setting) */ | 97 | /* Program TX EP as interrupt(Alternate Setting) */ |
98 | if (rdmalt(Adapter, 0x0F0110F8, (PUINT)&ulReg, 4)) { | 98 | if (rdmalt(Adapter, 0x0F0110F8, (PUINT)&ulReg, 4)) { |
99 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "reading of Tx EP is failing"); | 99 | BCM_DEBUG_PRINT(Adapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
100 | "reading of Tx EP failed\n"); | ||
100 | return; | 101 | return; |
101 | } | 102 | } |
102 | ulReg |= 0x6; | 103 | ulReg |= 0x6; |
@@ -202,7 +203,8 @@ usbbcm_device_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
202 | psIntfAdapter->interface = intf; | 203 | psIntfAdapter->interface = intf; |
203 | usb_set_intfdata(intf, psIntfAdapter); | 204 | usb_set_intfdata(intf, psIntfAdapter); |
204 | 205 | ||
205 | BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "psIntfAdapter 0x%p", psIntfAdapter); | 206 | BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
207 | "psIntfAdapter 0x%p\n", psIntfAdapter); | ||
206 | retval = InterfaceAdapterInit(psIntfAdapter); | 208 | retval = InterfaceAdapterInit(psIntfAdapter); |
207 | if (retval) { | 209 | if (retval) { |
208 | /* If the Firmware/Cfg File is not present | 210 | /* If the Firmware/Cfg File is not present |
@@ -210,10 +212,12 @@ usbbcm_device_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
210 | * download the files. | 212 | * download the files. |
211 | */ | 213 | */ |
212 | if (-ENOENT == retval) { | 214 | if (-ENOENT == retval) { |
213 | BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "File Not Found, Use App to Download\n"); | 215 | BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
216 | "File Not Found. Use app to download.\n"); | ||
214 | return STATUS_SUCCESS; | 217 | return STATUS_SUCCESS; |
215 | } | 218 | } |
216 | BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "InterfaceAdapterInit Failed \n"); | 219 | BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
220 | "InterfaceAdapterInit failed.\n"); | ||
217 | usb_set_intfdata(intf, NULL); | 221 | usb_set_intfdata(intf, NULL); |
218 | udev = interface_to_usbdev(intf); | 222 | udev = interface_to_usbdev(intf); |
219 | usb_put_dev(udev); | 223 | usb_put_dev(udev); |
@@ -238,7 +242,8 @@ usbbcm_device_probe(struct usb_interface *intf, const struct usb_device_id *id) | |||
238 | usb_enable_autosuspend(udev); | 242 | usb_enable_autosuspend(udev); |
239 | device_init_wakeup(&intf->dev, 1); | 243 | device_init_wakeup(&intf->dev, 1); |
240 | INIT_WORK(&psIntfAdapter->usbSuspendWork, putUsbSuspend); | 244 | INIT_WORK(&psIntfAdapter->usbSuspendWork, putUsbSuspend); |
241 | BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Enabling USB Auto-Suspend\n"); | 245 | BCM_DEBUG_PRINT(psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
246 | "Enabling USB Auto-Suspend\n"); | ||
242 | #endif | 247 | #endif |
243 | } else { | 248 | } else { |
244 | intf->needs_remote_wakeup = 0; | 249 | intf->needs_remote_wakeup = 0; |
@@ -278,7 +283,8 @@ static int AllocUsbCb(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
278 | for (i = 0; i < MAXIMUM_USB_TCB; i++) { | 283 | for (i = 0; i < MAXIMUM_USB_TCB; i++) { |
279 | if ((psIntfAdapter->asUsbTcb[i].urb = | 284 | if ((psIntfAdapter->asUsbTcb[i].urb = |
280 | usb_alloc_urb(0, GFP_KERNEL)) == NULL) { | 285 | usb_alloc_urb(0, GFP_KERNEL)) == NULL) { |
281 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Cant allocate Tx urb for index %d", i); | 286 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, |
287 | "Can't allocate Tx urb for index %d\n", i); | ||
282 | return -ENOMEM; | 288 | return -ENOMEM; |
283 | } | 289 | } |
284 | } | 290 | } |
@@ -286,12 +292,14 @@ static int AllocUsbCb(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
286 | for (i = 0; i < MAXIMUM_USB_RCB; i++) { | 292 | for (i = 0; i < MAXIMUM_USB_RCB; i++) { |
287 | if ((psIntfAdapter->asUsbRcb[i].urb = | 293 | if ((psIntfAdapter->asUsbRcb[i].urb = |
288 | usb_alloc_urb(0, GFP_KERNEL)) == NULL) { | 294 | usb_alloc_urb(0, GFP_KERNEL)) == NULL) { |
289 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Cant allocate Rx urb for index %d", i); | 295 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, |
296 | "Can't allocate Rx urb for index %d\n", i); | ||
290 | return -ENOMEM; | 297 | return -ENOMEM; |
291 | } | 298 | } |
292 | if ((psIntfAdapter->asUsbRcb[i].urb->transfer_buffer = | 299 | if ((psIntfAdapter->asUsbRcb[i].urb->transfer_buffer = |
293 | kmalloc(MAX_DATA_BUFFER_SIZE, GFP_KERNEL)) == NULL) { | 300 | kmalloc(MAX_DATA_BUFFER_SIZE, GFP_KERNEL)) == NULL) { |
294 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Cant allocate Rx buffer for index %d", i); | 301 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, |
302 | "Can't allocate Rx buffer for index %d\n", i); | ||
295 | return -ENOMEM; | 303 | return -ENOMEM; |
296 | } | 304 | } |
297 | psIntfAdapter->asUsbRcb[i].urb->transfer_buffer_length = MAX_DATA_BUFFER_SIZE; | 305 | psIntfAdapter->asUsbRcb[i].urb->transfer_buffer_length = MAX_DATA_BUFFER_SIZE; |
@@ -311,7 +319,8 @@ static int device_run(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
311 | } | 319 | } |
312 | if (TRUE == psIntfAdapter->psAdapter->fw_download_done) { | 320 | if (TRUE == psIntfAdapter->psAdapter->fw_download_done) { |
313 | if (StartInterruptUrb(psIntfAdapter)) { | 321 | if (StartInterruptUrb(psIntfAdapter)) { |
314 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Cannot send interrupt in URB"); | 322 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
323 | "Cannot send interrupt in URB\n"); | ||
315 | } | 324 | } |
316 | 325 | ||
317 | /* | 326 | /* |
@@ -323,10 +332,10 @@ static int device_run(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
323 | psIntfAdapter->psAdapter->waiting_to_fw_download_done, 5*HZ); | 332 | psIntfAdapter->psAdapter->waiting_to_fw_download_done, 5*HZ); |
324 | 333 | ||
325 | if (value == 0) | 334 | if (value == 0) |
326 | pr_err(DRV_NAME ": Mailbox Interrupt has not reached to Driver..\n"); | 335 | pr_err(DRV_NAME ": Timeout waiting for mailbox interrupt.\n"); |
327 | 336 | ||
328 | if (register_control_device_interface(psIntfAdapter->psAdapter) < 0) { | 337 | if (register_control_device_interface(psIntfAdapter->psAdapter) < 0) { |
329 | pr_err(DRV_NAME ": Register Control Device failed...\n"); | 338 | pr_err(DRV_NAME ": Register Control Device failed.\n"); |
330 | return -EIO; | 339 | return -EIO; |
331 | } | 340 | } |
332 | } | 341 | } |
@@ -452,18 +461,21 @@ static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
452 | /* selecting alternate setting one as a default setting for High Speed modem. */ | 461 | /* selecting alternate setting one as a default setting for High Speed modem. */ |
453 | if (psIntfAdapter->bHighSpeedDevice) | 462 | if (psIntfAdapter->bHighSpeedDevice) |
454 | retval= usb_set_interface(psIntfAdapter->udev, DEFAULT_SETTING_0, ALTERNATE_SETTING_1); | 463 | retval= usb_set_interface(psIntfAdapter->udev, DEFAULT_SETTING_0, ALTERNATE_SETTING_1); |
455 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "BCM16 is Applicable on this dongle"); | 464 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
465 | "BCM16 is applicable on this dongle\n"); | ||
456 | if (retval || (psIntfAdapter->bHighSpeedDevice == FALSE)) { | 466 | if (retval || (psIntfAdapter->bHighSpeedDevice == FALSE)) { |
457 | usedIntOutForBulkTransfer = EP2 ; | 467 | usedIntOutForBulkTransfer = EP2 ; |
458 | endpoint = &iface_desc->endpoint[EP2].desc; | 468 | endpoint = &iface_desc->endpoint[EP2].desc; |
459 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Interface altsetting got failed or Moemd is configured to FS.hence will work on default setting 0 \n"); | 469 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
470 | "Interface altsetting failed or modem is configured to Full Speed, hence will work on default setting 0\n"); | ||
460 | /* | 471 | /* |
461 | * If Modem is high speed device EP2 should be INT OUT End point | 472 | * If Modem is high speed device EP2 should be INT OUT End point |
462 | * If Mode is FS then EP2 should be bulk end point | 473 | * If Mode is FS then EP2 should be bulk end point |
463 | */ | 474 | */ |
464 | if (((psIntfAdapter->bHighSpeedDevice == TRUE) && (bcm_usb_endpoint_is_int_out(endpoint) == FALSE)) | 475 | if (((psIntfAdapter->bHighSpeedDevice == TRUE) && (bcm_usb_endpoint_is_int_out(endpoint) == FALSE)) |
465 | || ((psIntfAdapter->bHighSpeedDevice == FALSE) && (bcm_usb_endpoint_is_bulk_out(endpoint) == FALSE))) { | 476 | || ((psIntfAdapter->bHighSpeedDevice == FALSE) && (bcm_usb_endpoint_is_bulk_out(endpoint) == FALSE))) { |
466 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Configuring the EEPROM "); | 477 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
478 | "Configuring the EEPROM\n"); | ||
467 | /* change the EP2, EP4 to INT OUT end point */ | 479 | /* change the EP2, EP4 to INT OUT end point */ |
468 | ConfigureEndPointTypesThroughEEPROM(psIntfAdapter->psAdapter); | 480 | ConfigureEndPointTypesThroughEEPROM(psIntfAdapter->psAdapter); |
469 | 481 | ||
@@ -474,7 +486,8 @@ static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
474 | */ | 486 | */ |
475 | retval = usb_reset_device(psIntfAdapter->udev); | 487 | retval = usb_reset_device(psIntfAdapter->udev); |
476 | if (retval) { | 488 | if (retval) { |
477 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "reset got failed. hence Re-enumerating the device \n"); | 489 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
490 | "reset failed. Re-enumerating the device.\n"); | ||
478 | return retval ; | 491 | return retval ; |
479 | } | 492 | } |
480 | 493 | ||
@@ -482,15 +495,18 @@ static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
482 | if ((psIntfAdapter->bHighSpeedDevice == FALSE) && bcm_usb_endpoint_is_bulk_out(endpoint)) { | 495 | if ((psIntfAdapter->bHighSpeedDevice == FALSE) && bcm_usb_endpoint_is_bulk_out(endpoint)) { |
483 | /* Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail. */ | 496 | /* Once BULK is selected in FS mode. Revert it back to INT. Else USB_IF will fail. */ |
484 | UINT _uiData = ntohl(EP2_CFG_INT); | 497 | UINT _uiData = ntohl(EP2_CFG_INT); |
485 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Reverting Bulk to INT as it is FS MODE"); | 498 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
499 | "Reverting Bulk to INT as it is in Full Speed mode.\n"); | ||
486 | BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter, (PUCHAR)&_uiData, 0x136, 4, TRUE); | 500 | BeceemEEPROMBulkWrite(psIntfAdapter->psAdapter, (PUCHAR)&_uiData, 0x136, 4, TRUE); |
487 | } | 501 | } |
488 | } else { | 502 | } else { |
489 | usedIntOutForBulkTransfer = EP4 ; | 503 | usedIntOutForBulkTransfer = EP4 ; |
490 | endpoint = &iface_desc->endpoint[EP4].desc; | 504 | endpoint = &iface_desc->endpoint[EP4].desc; |
491 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Choosing AltSetting as a default setting"); | 505 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
506 | "Choosing AltSetting as a default setting.\n"); | ||
492 | if (bcm_usb_endpoint_is_int_out(endpoint) == FALSE) { | 507 | if (bcm_usb_endpoint_is_int_out(endpoint) == FALSE) { |
493 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, " Dongle does not have BCM16 Fix"); | 508 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
509 | "Dongle does not have BCM16 Fix.\n"); | ||
494 | /* change the EP2, EP4 to INT OUT end point and use EP4 in altsetting */ | 510 | /* change the EP2, EP4 to INT OUT end point and use EP4 in altsetting */ |
495 | ConfigureEndPointTypesThroughEEPROM(psIntfAdapter->psAdapter); | 511 | ConfigureEndPointTypesThroughEEPROM(psIntfAdapter->psAdapter); |
496 | 512 | ||
@@ -501,7 +517,8 @@ static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
501 | */ | 517 | */ |
502 | retval = usb_reset_device(psIntfAdapter->udev); | 518 | retval = usb_reset_device(psIntfAdapter->udev); |
503 | if (retval) { | 519 | if (retval) { |
504 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "reset got failed. hence Re-enumerating the device \n"); | 520 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
521 | "reset failed. Re-enumerating the device.\n"); | ||
505 | return retval; | 522 | return retval; |
506 | } | 523 | } |
507 | 524 | ||
@@ -580,7 +597,8 @@ static int InterfaceAdapterInit(PS_INTERFACE_ADAPTER psIntfAdapter) | |||
580 | retval = CreateInterruptUrb(psIntfAdapter); | 597 | retval = CreateInterruptUrb(psIntfAdapter); |
581 | 598 | ||
582 | if (retval) { | 599 | if (retval) { |
583 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Cannot create interrupt urb"); | 600 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, |
601 | "Cannot create interrupt urb\n"); | ||
584 | return retval; | 602 | return retval; |
585 | } | 603 | } |
586 | 604 | ||
@@ -603,10 +621,12 @@ static int InterfaceSuspend(struct usb_interface *intf, pm_message_t message) | |||
603 | 621 | ||
604 | if (psIntfAdapter->psAdapter->LinkStatus == LINKUP_DONE) { | 622 | if (psIntfAdapter->psAdapter->LinkStatus == LINKUP_DONE) { |
605 | psIntfAdapter->psAdapter->IdleMode = TRUE ; | 623 | psIntfAdapter->psAdapter->IdleMode = TRUE ; |
606 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Host Entered in PMU Idle Mode.."); | 624 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
625 | "Host Entered in PMU Idle Mode.\n"); | ||
607 | } else { | 626 | } else { |
608 | psIntfAdapter->psAdapter->bShutStatus = TRUE; | 627 | psIntfAdapter->psAdapter->bShutStatus = TRUE; |
609 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Host Entered in PMU Shutdown Mode.."); | 628 | BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, |
629 | "Host Entered in PMU Shutdown Mode.\n"); | ||
610 | } | 630 | } |
611 | } | 631 | } |
612 | psIntfAdapter->psAdapter->bPreparingForLowPowerMode = FALSE; | 632 | psIntfAdapter->psAdapter->bPreparingForLowPowerMode = FALSE; |