aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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
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')
-rw-r--r--drivers/net/wireless/p54/p54common.c59
-rw-r--r--drivers/net/wireless/p54/p54usb.c43
2 files changed, 55 insertions, 47 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 06c8321f4e3e..89968a5bff84 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -158,21 +158,21 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
158 priv->fw_interface = be32_to_cpup((__be32 *) 158 priv->fw_interface = be32_to_cpup((__be32 *)
159 bootrec->data); 159 bootrec->data);
160 switch (priv->fw_interface) { 160 switch (priv->fw_interface) {
161 case FW_FMAC:
162 printk(KERN_INFO "p54: FreeMAC firmware\n");
163 break;
164 case FW_LM20:
165 printk(KERN_INFO "p54: LM20 firmware\n");
166 break;
167 case FW_LM86: 161 case FW_LM86:
168 printk(KERN_INFO "p54: LM86 firmware\n"); 162 case FW_LM20:
169 break; 163 case FW_LM87: {
170 case FW_LM87: 164 char *iftype = (char *)bootrec->data;
171 printk(KERN_INFO "p54: LM87 firmware\n"); 165 printk(KERN_INFO "%s: p54 detected a LM%c%c "
166 "firmware\n",
167 wiphy_name(dev->wiphy),
168 iftype[2], iftype[3]);
172 break; 169 break;
170 }
171 case FW_FMAC:
173 default: 172 default:
174 printk(KERN_INFO "p54: unknown firmware\n"); 173 printk(KERN_ERR "%s: unsupported firmware\n",
175 break; 174 wiphy_name(dev->wiphy));
175 return -ENODEV;
176 } 176 }
177 break; 177 break;
178 case BR_CODE_COMPONENT_VERSION: 178 case BR_CODE_COMPONENT_VERSION:
@@ -216,13 +216,15 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
216 } 216 }
217 217
218 if (fw_version) 218 if (fw_version)
219 printk(KERN_INFO "p54: FW rev %s - Softmac protocol %x.%x\n", 219 printk(KERN_INFO "%s: FW rev %s - Softmac protocol %x.%x\n",
220 fw_version, priv->fw_var >> 8, priv->fw_var & 0xff); 220 wiphy_name(dev->wiphy), fw_version,
221 priv->fw_var >> 8, priv->fw_var & 0xff);
221 222
222 if (priv->fw_var < 0x500) 223 if (priv->fw_var < 0x500)
223 printk(KERN_INFO "p54: you are using an obsolete firmware. " 224 printk(KERN_INFO "%s: you are using an obsolete firmware. "
224 "visit http://wireless.kernel.org/en/users/Drivers/p54 " 225 "visit http://wireless.kernel.org/en/users/Drivers/p54 "
225 "and grab one for \"kernel >= 2.6.28\"!\n"); 226 "and grab one for \"kernel >= 2.6.28\"!\n",
227 wiphy_name(dev->wiphy));
226 228
227 if (priv->fw_var >= 0x300) { 229 if (priv->fw_var >= 0x300) {
228 /* Firmware supports QoS, use it! */ 230 /* Firmware supports QoS, use it! */
@@ -399,8 +401,9 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
399 err = p54_convert_rev1(dev, curve_data); 401 err = p54_convert_rev1(dev, curve_data);
400 break; 402 break;
401 default: 403 default:
402 printk(KERN_ERR "p54: unknown curve data " 404 printk(KERN_ERR "%s: unknown curve data "
403 "revision %d\n", 405 "revision %d\n",
406 wiphy_name(dev->wiphy),
404 curve_data->cal_method_rev); 407 curve_data->cal_method_rev);
405 err = -ENODEV; 408 err = -ENODEV;
406 break; 409 break;
@@ -460,7 +463,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
460 case PDR_PER_CHANNEL_BASEBAND_REGISTERS: 463 case PDR_PER_CHANNEL_BASEBAND_REGISTERS:
461 break; 464 break;
462 default: 465 default:
463 printk(KERN_INFO "p54: unknown eeprom code : 0x%x\n", 466 printk(KERN_INFO "%s: unknown eeprom code : 0x%x\n",
467 wiphy_name(dev->wiphy),
464 le16_to_cpu(entry->code)); 468 le16_to_cpu(entry->code));
465 break; 469 break;
466 } 470 }
@@ -470,7 +474,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
470 474
471 if (!synth || !priv->iq_autocal || !priv->output_limit || 475 if (!synth || !priv->iq_autocal || !priv->output_limit ||
472 !priv->curve_data) { 476 !priv->curve_data) {
473 printk(KERN_ERR "p54: not all required entries found in eeprom!\n"); 477 printk(KERN_ERR "%s: not all required entries found in eeprom!\n",
478 wiphy_name(dev->wiphy));
474 err = -EINVAL; 479 err = -EINVAL;
475 goto err; 480 goto err;
476 } 481 }
@@ -515,7 +520,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
515 priv->curve_data = NULL; 520 priv->curve_data = NULL;
516 } 521 }
517 522
518 printk(KERN_ERR "p54: eeprom parse failed!\n"); 523 printk(KERN_ERR "%s: eeprom parse failed!\n",
524 wiphy_name(dev->wiphy));
519 return err; 525 return err;
520} 526}
521 527
@@ -1573,28 +1579,23 @@ static int p54_beacon_tim(struct sk_buff *skb)
1573 struct ieee80211_mgmt *mgmt = (void *)skb->data; 1579 struct ieee80211_mgmt *mgmt = (void *)skb->data;
1574 u8 *pos, *end; 1580 u8 *pos, *end;
1575 1581
1576 if (skb->len <= sizeof(mgmt)) { 1582 if (skb->len <= sizeof(mgmt))
1577 printk(KERN_ERR "p54: beacon is too short!\n");
1578 return -EINVAL; 1583 return -EINVAL;
1579 }
1580 1584
1581 pos = (u8 *)mgmt->u.beacon.variable; 1585 pos = (u8 *)mgmt->u.beacon.variable;
1582 end = skb->data + skb->len; 1586 end = skb->data + skb->len;
1583 while (pos < end) { 1587 while (pos < end) {
1584 if (pos + 2 + pos[1] > end) { 1588 if (pos + 2 + pos[1] > end)
1585 printk(KERN_ERR "p54: parsing beacon failed\n");
1586 return -EINVAL; 1589 return -EINVAL;
1587 }
1588 1590
1589 if (pos[0] == WLAN_EID_TIM) { 1591 if (pos[0] == WLAN_EID_TIM) {
1590 u8 dtim_len = pos[1]; 1592 u8 dtim_len = pos[1];
1591 u8 dtim_period = pos[3]; 1593 u8 dtim_period = pos[3];
1592 u8 *next = pos + 2 + dtim_len; 1594 u8 *next = pos + 2 + dtim_len;
1593 1595
1594 if (dtim_len < 3) { 1596 if (dtim_len < 3)
1595 printk(KERN_ERR "p54: invalid dtim len!\n");
1596 return -EINVAL; 1597 return -EINVAL;
1597 } 1598
1598 memmove(pos, next, end - next); 1599 memmove(pos, next, end - next);
1599 1600
1600 if (dtim_len > 3) 1601 if (dtim_len > 3)
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