aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/p54usb.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2008-11-29 16:39:08 -0500
committerJohn W. Linville <linville@tuxdriver.com>2008-12-05 09:35:45 -0500
commit02e37ba1298359baa123cf71ffa03d92abd259b2 (patch)
tree793af4434fafb347d03b870165661ac9bf6ef145 /drivers/net/wireless/p54/p54usb.c
parentb2023ddcfa6b79f26ef459867324f3d32b91aa07 (diff)
p54: per-device names
This patch replaces the static "p54:" strings in front of most printk's with their corresponding per-device names. It was always a bit of a hassle to check which device was generating all the messages. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54/p54usb.c')
-rw-r--r--drivers/net/wireless/p54/p54usb.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 21ba526a45bf..e9630b949256 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -405,7 +405,8 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
405 405
406 tmp = buf = kmalloc(P54U_FW_BLOCK, GFP_KERNEL); 406 tmp = buf = kmalloc(P54U_FW_BLOCK, GFP_KERNEL);
407 if (!buf) { 407 if (!buf) {
408 printk(KERN_ERR "p54usb: cannot allocate firmware upload buffer!\n"); 408 dev_err(&priv->udev->dev, "(p54usb) cannot allocate firmware"
409 "upload buffer!\n");
409 err = -ENOMEM; 410 err = -ENOMEM;
410 goto err_bufalloc; 411 goto err_bufalloc;
411 } 412 }
@@ -413,13 +414,14 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
413 memcpy(buf, start_string, 4); 414 memcpy(buf, start_string, 4);
414 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, 4); 415 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, 4);
415 if (err) { 416 if (err) {
416 printk(KERN_ERR "p54usb: reset failed! (%d)\n", err); 417 dev_err(&priv->udev->dev, "(p54usb) reset failed! (%d)\n", err);
417 goto err_reset; 418 goto err_reset;
418 } 419 }
419 420
420 err = request_firmware(&fw_entry, "isl3887usb", &priv->udev->dev); 421 err = request_firmware(&fw_entry, "isl3887usb", &priv->udev->dev);
421 if (err) { 422 if (err) {
422 printk(KERN_ERR "p54usb: cannot find firmware (isl3887usb)\n"); 423 dev_err(&priv->udev->dev, "p54usb: cannot find firmware "
424 "(isl3887usb)\n");
423 err = request_firmware(&fw_entry, "isl3887usb_bare", 425 err = request_firmware(&fw_entry, "isl3887usb_bare",
424 &priv->udev->dev); 426 &priv->udev->dev);
425 if (err) 427 if (err)
@@ -474,7 +476,8 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
474 476
475 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, block_size); 477 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, block_size);
476 if (err) { 478 if (err) {
477 printk(KERN_ERR "p54usb: firmware upload failed!\n"); 479 dev_err(&priv->udev->dev, "(p54usb) firmware "
480 "upload failed!\n");
478 goto err_upload_failed; 481 goto err_upload_failed;
479 } 482 }
480 483
@@ -485,10 +488,9 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
485 *((__le32 *)buf) = cpu_to_le32(~crc32_le(~0, fw_entry->data, fw_entry->size)); 488 *((__le32 *)buf) = cpu_to_le32(~crc32_le(~0, fw_entry->data, fw_entry->size));
486 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, sizeof(u32)); 489 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, sizeof(u32));
487 if (err) { 490 if (err) {
488 printk(KERN_ERR "p54usb: firmware upload failed!\n"); 491 dev_err(&priv->udev->dev, "(p54usb) firmware upload failed!\n");
489 goto err_upload_failed; 492 goto err_upload_failed;
490 } 493 }
491
492 timeout = jiffies + msecs_to_jiffies(1000); 494 timeout = jiffies + msecs_to_jiffies(1000);
493 while (!(err = usb_bulk_msg(priv->udev, 495 while (!(err = usb_bulk_msg(priv->udev,
494 usb_rcvbulkpipe(priv->udev, P54U_PIPE_DATA), buf, 128, &alen, 1000))) { 496 usb_rcvbulkpipe(priv->udev, P54U_PIPE_DATA), buf, 128, &alen, 1000))) {
@@ -496,25 +498,27 @@ static int p54u_upload_firmware_3887(struct ieee80211_hw *dev)
496 break; 498 break;
497 499
498 if (alen > 5 && !memcmp(buf, "ERROR", 5)) { 500 if (alen > 5 && !memcmp(buf, "ERROR", 5)) {
499 printk(KERN_INFO "p54usb: firmware upload failed!\n");
500 err = -EINVAL; 501 err = -EINVAL;
501 break; 502 break;
502 } 503 }
503 504
504 if (time_after(jiffies, timeout)) { 505 if (time_after(jiffies, timeout)) {
505 printk(KERN_ERR "p54usb: firmware boot timed out!\n"); 506 dev_err(&priv->udev->dev, "(p54usb) firmware boot "
507 "timed out!\n");
506 err = -ETIMEDOUT; 508 err = -ETIMEDOUT;
507 break; 509 break;
508 } 510 }
509 } 511 }
510 if (err) 512 if (err) {
513 dev_err(&priv->udev->dev, "(p54usb) firmware upload failed!\n");
511 goto err_upload_failed; 514 goto err_upload_failed;
515 }
512 516
513 buf[0] = 'g'; 517 buf[0] = 'g';
514 buf[1] = '\r'; 518 buf[1] = '\r';
515 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, 2); 519 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, 2);
516 if (err) { 520 if (err) {
517 printk(KERN_ERR "p54usb: firmware boot failed!\n"); 521 dev_err(&priv->udev->dev, "(p54usb) firmware boot failed!\n");
518 goto err_upload_failed; 522 goto err_upload_failed;
519 } 523 }
520 524
@@ -554,13 +558,15 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev)
554 558
555 buf = kmalloc(512, GFP_KERNEL); 559 buf = kmalloc(512, GFP_KERNEL);
556 if (!buf) { 560 if (!buf) {
557 printk(KERN_ERR "p54usb: firmware buffer alloc failed!\n"); 561 dev_err(&priv->udev->dev, "(p54usb) firmware buffer "
562 "alloc failed!\n");
558 return -ENOMEM; 563 return -ENOMEM;
559 } 564 }
560 565
561 err = request_firmware(&fw_entry, "isl3886usb", &priv->udev->dev); 566 err = request_firmware(&fw_entry, "isl3886usb", &priv->udev->dev);
562 if (err) { 567 if (err) {
563 printk(KERN_ERR "p54usb: cannot find firmware (isl3886usb)\n"); 568 dev_err(&priv->udev->dev, "(p54usb) cannot find firmware "
569 "(isl3886usb)\n");
564 err = request_firmware(&fw_entry, "isl3890usb", 570 err = request_firmware(&fw_entry, "isl3890usb",
565 &priv->udev->dev); 571 &priv->udev->dev);
566 if (err) { 572 if (err) {
@@ -685,8 +691,8 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev)
685 691
686 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, block_len); 692 err = p54u_bulk_msg(priv, P54U_PIPE_DATA, buf, block_len);
687 if (err) { 693 if (err) {
688 printk(KERN_ERR "p54usb: firmware block upload " 694 dev_err(&priv->udev->dev, "(p54usb) firmware block "
689 "failed\n"); 695 "upload failed\n");
690 goto fail; 696 goto fail;
691 } 697 }
692 698
@@ -719,8 +725,8 @@ static int p54u_upload_firmware_net2280(struct ieee80211_hw *dev)
719 0x002C | (unsigned long)&devreg->direct_mem_win); 725 0x002C | (unsigned long)&devreg->direct_mem_win);
720 if (!(reg & cpu_to_le32(ISL38XX_DMA_STATUS_DONE)) || 726 if (!(reg & cpu_to_le32(ISL38XX_DMA_STATUS_DONE)) ||
721 !(reg & cpu_to_le32(ISL38XX_DMA_STATUS_READY))) { 727 !(reg & cpu_to_le32(ISL38XX_DMA_STATUS_READY))) {
722 printk(KERN_ERR "p54usb: firmware DMA transfer " 728 dev_err(&priv->udev->dev, "(p54usb) firmware DMA "
723 "failed\n"); 729 "transfer failed\n");
724 goto fail; 730 goto fail;
725 } 731 }
726 732
@@ -825,8 +831,9 @@ static int __devinit p54u_probe(struct usb_interface *intf,
825 unsigned int i, recognized_pipes; 831 unsigned int i, recognized_pipes;
826 832
827 dev = p54_init_common(sizeof(*priv)); 833 dev = p54_init_common(sizeof(*priv));
834
828 if (!dev) { 835 if (!dev) {
829 printk(KERN_ERR "p54usb: ieee80211 alloc failed\n"); 836 dev_err(&udev->dev, "(p54usb) ieee80211 alloc failed\n");
830 return -ENOMEM; 837 return -ENOMEM;
831 } 838 }
832 839
@@ -887,7 +894,7 @@ static int __devinit p54u_probe(struct usb_interface *intf,
887 894
888 err = ieee80211_register_hw(dev); 895 err = ieee80211_register_hw(dev);
889 if (err) { 896 if (err) {
890 printk(KERN_ERR "p54usb: Cannot register netdevice\n"); 897 dev_err(&udev->dev, "(p54usb) Cannot register netdevice\n");
891 goto err_free_dev; 898 goto err_free_dev;
892 } 899 }
893 900