aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-01-28 15:59:17 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-01 02:26:51 -0500
commitd60bec4eb7076acfc940cca3f9f219e7653a1466 (patch)
tree7c1ecbafcd81033bc04bfae857a1233602c4226b /drivers/net/tulip
parent57dbb2d83d100ea601c54fe129bfde0678db5dee (diff)
tulip_core: Use dev_<level> and pr_<level>
Convert printks to dev_<level> where appropriate Convert printks to pr_<level> Change print formats with %d.dx to %0dx Coalesce long formats Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r--drivers/net/tulip/tulip_core.c162
1 files changed, 82 insertions, 80 deletions
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index da4fc458f90c..e1a5f03a49c5 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -41,7 +41,6 @@
41static char version[] __devinitdata = 41static char version[] __devinitdata =
42 "Linux Tulip driver version " DRV_VERSION " (" DRV_RELDATE ")\n"; 42 "Linux Tulip driver version " DRV_VERSION " (" DRV_RELDATE ")\n";
43 43
44
45/* A few user-configurable values. */ 44/* A few user-configurable values. */
46 45
47/* Maximum events (Rx packets, etc.) to handle at each interrupt. */ 46/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
@@ -326,7 +325,8 @@ static void tulip_up(struct net_device *dev)
326 udelay(100); 325 udelay(100);
327 326
328 if (tulip_debug > 1) 327 if (tulip_debug > 1)
329 printk(KERN_DEBUG "%s: tulip_up(), irq==%d.\n", dev->name, dev->irq); 328 printk(KERN_DEBUG "%s: tulip_up(), irq==%d\n",
329 dev->name, dev->irq);
330 330
331 iowrite32(tp->rx_ring_dma, ioaddr + CSR3); 331 iowrite32(tp->rx_ring_dma, ioaddr + CSR3);
332 iowrite32(tp->tx_ring_dma, ioaddr + CSR4); 332 iowrite32(tp->tx_ring_dma, ioaddr + CSR4);
@@ -387,8 +387,9 @@ static void tulip_up(struct net_device *dev)
387 (dev->if_port == 12 ? 0 : dev->if_port); 387 (dev->if_port == 12 ? 0 : dev->if_port);
388 for (i = 0; i < tp->mtable->leafcount; i++) 388 for (i = 0; i < tp->mtable->leafcount; i++)
389 if (tp->mtable->mleaf[i].media == looking_for) { 389 if (tp->mtable->mleaf[i].media == looking_for) {
390 printk(KERN_INFO "%s: Using user-specified media %s.\n", 390 dev_info(&dev->dev,
391 dev->name, medianame[dev->if_port]); 391 "Using user-specified media %s\n",
392 medianame[dev->if_port]);
392 goto media_picked; 393 goto media_picked;
393 } 394 }
394 } 395 }
@@ -396,8 +397,9 @@ static void tulip_up(struct net_device *dev)
396 int looking_for = tp->mtable->defaultmedia & MEDIA_MASK; 397 int looking_for = tp->mtable->defaultmedia & MEDIA_MASK;
397 for (i = 0; i < tp->mtable->leafcount; i++) 398 for (i = 0; i < tp->mtable->leafcount; i++)
398 if (tp->mtable->mleaf[i].media == looking_for) { 399 if (tp->mtable->mleaf[i].media == looking_for) {
399 printk(KERN_INFO "%s: Using EEPROM-set media %s.\n", 400 dev_info(&dev->dev,
400 dev->name, medianame[looking_for]); 401 "Using EEPROM-set media %s\n",
402 medianame[looking_for]);
401 goto media_picked; 403 goto media_picked;
402 } 404 }
403 } 405 }
@@ -424,9 +426,10 @@ media_picked:
424 if (tp->mii_cnt) { 426 if (tp->mii_cnt) {
425 tulip_select_media(dev, 1); 427 tulip_select_media(dev, 1);
426 if (tulip_debug > 1) 428 if (tulip_debug > 1)
427 printk(KERN_INFO "%s: Using MII transceiver %d, status " 429 dev_info(&dev->dev,
428 "%4.4x.\n", 430 "Using MII transceiver %d, status %04x\n",
429 dev->name, tp->phys[0], tulip_mdio_read(dev, tp->phys[0], 1)); 431 tp->phys[0],
432 tulip_mdio_read(dev, tp->phys[0], 1));
430 iowrite32(csr6_mask_defstate, ioaddr + CSR6); 433 iowrite32(csr6_mask_defstate, ioaddr + CSR6);
431 tp->csr6 = csr6_mask_hdcap; 434 tp->csr6 = csr6_mask_hdcap;
432 dev->if_port = 11; 435 dev->if_port = 11;
@@ -490,9 +493,10 @@ media_picked:
490 iowrite32(0, ioaddr + CSR2); /* Rx poll demand */ 493 iowrite32(0, ioaddr + CSR2); /* Rx poll demand */
491 494
492 if (tulip_debug > 2) { 495 if (tulip_debug > 2) {
493 printk(KERN_DEBUG "%s: Done tulip_up(), CSR0 %8.8x, CSR5 %8.8x CSR6 %8.8x.\n", 496 printk(KERN_DEBUG "%s: Done tulip_up(), CSR0 %08x, CSR5 %08x CSR6 %08x\n",
494 dev->name, ioread32(ioaddr + CSR0), ioread32(ioaddr + CSR5), 497 dev->name, ioread32(ioaddr + CSR0),
495 ioread32(ioaddr + CSR6)); 498 ioread32(ioaddr + CSR5),
499 ioread32(ioaddr + CSR6));
496 } 500 }
497 501
498 /* Set the timer to switch to check for link beat and perhaps switch 502 /* Set the timer to switch to check for link beat and perhaps switch
@@ -540,27 +544,30 @@ static void tulip_tx_timeout(struct net_device *dev)
540 if (tulip_media_cap[dev->if_port] & MediaIsMII) { 544 if (tulip_media_cap[dev->if_port] & MediaIsMII) {
541 /* Do nothing -- the media monitor should handle this. */ 545 /* Do nothing -- the media monitor should handle this. */
542 if (tulip_debug > 1) 546 if (tulip_debug > 1)
543 printk(KERN_WARNING "%s: Transmit timeout using MII device.\n", 547 dev_warn(&dev->dev,
544 dev->name); 548 "Transmit timeout using MII device\n");
545 } else if (tp->chip_id == DC21140 || tp->chip_id == DC21142 || 549 } else if (tp->chip_id == DC21140 || tp->chip_id == DC21142 ||
546 tp->chip_id == MX98713 || tp->chip_id == COMPEX9881 || 550 tp->chip_id == MX98713 || tp->chip_id == COMPEX9881 ||
547 tp->chip_id == DM910X) { 551 tp->chip_id == DM910X) {
548 printk(KERN_WARNING "%s: 21140 transmit timed out, status %8.8x, " 552 dev_warn(&dev->dev,
549 "SIA %8.8x %8.8x %8.8x %8.8x, resetting...\n", 553 "21140 transmit timed out, status %08x, SIA %08x %08x %08x %08x, resetting...\n",
550 dev->name, ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12), 554 ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12),
551 ioread32(ioaddr + CSR13), ioread32(ioaddr + CSR14), ioread32(ioaddr + CSR15)); 555 ioread32(ioaddr + CSR13), ioread32(ioaddr + CSR14),
556 ioread32(ioaddr + CSR15));
552 tp->timeout_recovery = 1; 557 tp->timeout_recovery = 1;
553 schedule_work(&tp->media_work); 558 schedule_work(&tp->media_work);
554 goto out_unlock; 559 goto out_unlock;
555 } else if (tp->chip_id == PNIC2) { 560 } else if (tp->chip_id == PNIC2) {
556 printk(KERN_WARNING "%s: PNIC2 transmit timed out, status %8.8x, " 561 dev_warn(&dev->dev,
557 "CSR6/7 %8.8x / %8.8x CSR12 %8.8x, resetting...\n", 562 "PNIC2 transmit timed out, status %08x, CSR6/7 %08x / %08x CSR12 %08x, resetting...\n",
558 dev->name, (int)ioread32(ioaddr + CSR5), (int)ioread32(ioaddr + CSR6), 563 (int)ioread32(ioaddr + CSR5),
559 (int)ioread32(ioaddr + CSR7), (int)ioread32(ioaddr + CSR12)); 564 (int)ioread32(ioaddr + CSR6),
565 (int)ioread32(ioaddr + CSR7),
566 (int)ioread32(ioaddr + CSR12));
560 } else { 567 } else {
561 printk(KERN_WARNING "%s: Transmit timed out, status %8.8x, CSR12 " 568 dev_warn(&dev->dev,
562 "%8.8x, resetting...\n", 569 "Transmit timed out, status %08x, CSR12 %08x, resetting...\n",
563 dev->name, ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12)); 570 ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12));
564 dev->if_port = 0; 571 dev->if_port = 0;
565 } 572 }
566 573
@@ -570,26 +577,26 @@ static void tulip_tx_timeout(struct net_device *dev)
570 for (i = 0; i < RX_RING_SIZE; i++) { 577 for (i = 0; i < RX_RING_SIZE; i++) {
571 u8 *buf = (u8 *)(tp->rx_ring[i].buffer1); 578 u8 *buf = (u8 *)(tp->rx_ring[i].buffer1);
572 int j; 579 int j;
573 printk(KERN_DEBUG "%2d: %8.8x %8.8x %8.8x %8.8x " 580 printk(KERN_DEBUG
574 "%2.2x %2.2x %2.2x.\n", 581 "%2d: %08x %08x %08x %08x %02x %02x %02x\n",
575 i, (unsigned int)tp->rx_ring[i].status, 582 i,
576 (unsigned int)tp->rx_ring[i].length, 583 (unsigned int)tp->rx_ring[i].status,
577 (unsigned int)tp->rx_ring[i].buffer1, 584 (unsigned int)tp->rx_ring[i].length,
578 (unsigned int)tp->rx_ring[i].buffer2, 585 (unsigned int)tp->rx_ring[i].buffer1,
579 buf[0], buf[1], buf[2]); 586 (unsigned int)tp->rx_ring[i].buffer2,
587 buf[0], buf[1], buf[2]);
580 for (j = 0; buf[j] != 0xee && j < 1600; j++) 588 for (j = 0; buf[j] != 0xee && j < 1600; j++)
581 if (j < 100) 589 if (j < 100)
582 printk(KERN_CONT " %2.2x", buf[j]); 590 pr_cont(" %02x", buf[j]);
583 printk(KERN_CONT " j=%d.\n", j); 591 pr_cont(" j=%d\n", j);
584 } 592 }
585 printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); 593 printk(KERN_DEBUG " Rx ring %08x: ", (int)tp->rx_ring);
586 for (i = 0; i < RX_RING_SIZE; i++) 594 for (i = 0; i < RX_RING_SIZE; i++)
587 printk(KERN_CONT " %8.8x", 595 pr_cont(" %08x", (unsigned int)tp->rx_ring[i].status);
588 (unsigned int)tp->rx_ring[i].status); 596 printk(KERN_DEBUG " Tx ring %08x: ", (int)tp->tx_ring);
589 printk(KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring);
590 for (i = 0; i < TX_RING_SIZE; i++) 597 for (i = 0; i < TX_RING_SIZE; i++)
591 printk(KERN_CONT " %8.8x", (unsigned int)tp->tx_ring[i].status); 598 pr_cont(" %08x", (unsigned int)tp->tx_ring[i].status);
592 printk(KERN_CONT "\n"); 599 pr_cont("\n");
593 } 600 }
594#endif 601#endif
595 602
@@ -832,8 +839,9 @@ static int tulip_close (struct net_device *dev)
832 tulip_down (dev); 839 tulip_down (dev);
833 840
834 if (tulip_debug > 1) 841 if (tulip_debug > 1)
835 printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", 842 dev_printk(KERN_DEBUG, &dev->dev,
836 dev->name, ioread32 (ioaddr + CSR5)); 843 "Shutting down ethercard, status was %02x\n",
844 ioread32 (ioaddr + CSR5));
837 845
838 free_irq (dev->irq, dev); 846 free_irq (dev->irq, dev);
839 847
@@ -1073,10 +1081,10 @@ static void set_rx_mode(struct net_device *dev)
1073 filterbit &= 0x3f; 1081 filterbit &= 0x3f;
1074 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); 1082 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31);
1075 if (tulip_debug > 2) 1083 if (tulip_debug > 2)
1076 printk(KERN_INFO "%s: Added filter for %pM" 1084 dev_info(&dev->dev,
1077 " %8.8x bit %d.\n", 1085 "Added filter for %pM %08x bit %d\n",
1078 dev->name, mclist->dmi_addr, 1086 mclist->dmi_addr,
1079 ether_crc(ETH_ALEN, mclist->dmi_addr), filterbit); 1087 ether_crc(ETH_ALEN, mclist->dmi_addr), filterbit);
1080 } 1088 }
1081 if (mc_filter[0] == tp->mc_filter[0] && 1089 if (mc_filter[0] == tp->mc_filter[0] &&
1082 mc_filter[1] == tp->mc_filter[1]) 1090 mc_filter[1] == tp->mc_filter[1])
@@ -1288,9 +1296,8 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1288 unsigned int force_csr0 = 0; 1296 unsigned int force_csr0 = 0;
1289 1297
1290#ifndef MODULE 1298#ifndef MODULE
1291 static int did_version; /* Already printed version info. */ 1299 if (tulip_debug > 0)
1292 if (tulip_debug > 0 && did_version++ == 0) 1300 printk_once(KERN_INFO "%s", version);
1293 printk (KERN_INFO "%s", version);
1294#endif 1301#endif
1295 1302
1296 board_idx++; 1303 board_idx++;
@@ -1301,7 +1308,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1301 */ 1308 */
1302 1309
1303 if (pdev->subsystem_vendor == PCI_VENDOR_ID_LMC) { 1310 if (pdev->subsystem_vendor == PCI_VENDOR_ID_LMC) {
1304 printk (KERN_ERR PFX "skipping LMC card.\n"); 1311 pr_err(PFX "skipping LMC card\n");
1305 return -ENODEV; 1312 return -ENODEV;
1306 } 1313 }
1307 1314
@@ -1317,15 +1324,13 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1317 1324
1318 if (pdev->vendor == 0x1282 && pdev->device == 0x9100 && 1325 if (pdev->vendor == 0x1282 && pdev->device == 0x9100 &&
1319 pdev->revision < 0x30) { 1326 pdev->revision < 0x30) {
1320 printk(KERN_INFO PFX 1327 pr_info(PFX "skipping early DM9100 with Crc bug (use dmfe)\n");
1321 "skipping early DM9100 with Crc bug (use dmfe)\n");
1322 return -ENODEV; 1328 return -ENODEV;
1323 } 1329 }
1324 1330
1325 dp = pci_device_to_OF_node(pdev); 1331 dp = pci_device_to_OF_node(pdev);
1326 if (!(dp && of_get_property(dp, "local-mac-address", NULL))) { 1332 if (!(dp && of_get_property(dp, "local-mac-address", NULL))) {
1327 printk(KERN_INFO PFX 1333 pr_info(PFX "skipping DM910x expansion card (use dmfe)\n");
1328 "skipping DM910x expansion card (use dmfe)\n");
1329 return -ENODEV; 1334 return -ENODEV;
1330 } 1335 }
1331 } 1336 }
@@ -1372,9 +1377,8 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1372 1377
1373 i = pci_enable_device(pdev); 1378 i = pci_enable_device(pdev);
1374 if (i) { 1379 if (i) {
1375 printk (KERN_ERR PFX 1380 pr_err(PFX "Cannot enable tulip board #%d, aborting\n",
1376 "Cannot enable tulip board #%d, aborting\n", 1381 board_idx);
1377 board_idx);
1378 return i; 1382 return i;
1379 } 1383 }
1380 1384
@@ -1383,22 +1387,22 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1383 /* alloc_etherdev ensures aligned and zeroed private structures */ 1387 /* alloc_etherdev ensures aligned and zeroed private structures */
1384 dev = alloc_etherdev (sizeof (*tp)); 1388 dev = alloc_etherdev (sizeof (*tp));
1385 if (!dev) { 1389 if (!dev) {
1386 printk (KERN_ERR PFX "ether device alloc failed, aborting\n"); 1390 pr_err(PFX "ether device alloc failed, aborting\n");
1387 return -ENOMEM; 1391 return -ENOMEM;
1388 } 1392 }
1389 1393
1390 SET_NETDEV_DEV(dev, &pdev->dev); 1394 SET_NETDEV_DEV(dev, &pdev->dev);
1391 if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) { 1395 if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) {
1392 printk (KERN_ERR PFX "%s: I/O region (0x%llx@0x%llx) too small, " 1396 pr_err(PFX "%s: I/O region (0x%llx@0x%llx) too small, aborting\n",
1393 "aborting\n", pci_name(pdev), 1397 pci_name(pdev),
1394 (unsigned long long)pci_resource_len (pdev, 0), 1398 (unsigned long long)pci_resource_len (pdev, 0),
1395 (unsigned long long)pci_resource_start (pdev, 0)); 1399 (unsigned long long)pci_resource_start (pdev, 0));
1396 goto err_out_free_netdev; 1400 goto err_out_free_netdev;
1397 } 1401 }
1398 1402
1399 /* grab all resources from both PIO and MMIO regions, as we 1403 /* grab all resources from both PIO and MMIO regions, as we
1400 * don't want anyone else messing around with our hardware */ 1404 * don't want anyone else messing around with our hardware */
1401 if (pci_request_regions (pdev, "tulip")) 1405 if (pci_request_regions (pdev, DRV_NAME))
1402 goto err_out_free_netdev; 1406 goto err_out_free_netdev;
1403 1407
1404 ioaddr = pci_iomap(pdev, TULIP_BAR, tulip_tbl[chip_idx].io_size); 1408 ioaddr = pci_iomap(pdev, TULIP_BAR, tulip_tbl[chip_idx].io_size);
@@ -1611,8 +1615,8 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1611 if (dev->mem_start & MEDIA_MASK) 1615 if (dev->mem_start & MEDIA_MASK)
1612 tp->default_port = dev->mem_start & MEDIA_MASK; 1616 tp->default_port = dev->mem_start & MEDIA_MASK;
1613 if (tp->default_port) { 1617 if (tp->default_port) {
1614 printk(KERN_INFO "tulip%d: Transceiver selection forced to %s.\n", 1618 pr_info(DRV_NAME "%d: Transceiver selection forced to %s\n",
1615 board_idx, medianame[tp->default_port & MEDIA_MASK]); 1619 board_idx, medianame[tp->default_port & MEDIA_MASK]);
1616 tp->medialock = 1; 1620 tp->medialock = 1;
1617 if (tulip_media_cap[tp->default_port] & MediaAlwaysFD) 1621 if (tulip_media_cap[tp->default_port] & MediaAlwaysFD)
1618 tp->full_duplex = 1; 1622 tp->full_duplex = 1;
@@ -1627,7 +1631,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1627 } 1631 }
1628 1632
1629 if (tp->flags & HAS_MEDIA_TABLE) { 1633 if (tp->flags & HAS_MEDIA_TABLE) {
1630 sprintf(dev->name, "tulip%d", board_idx); /* hack */ 1634 sprintf(dev->name, DRV_NAME "%d", board_idx); /* hack */
1631 tulip_parse_eeprom(dev); 1635 tulip_parse_eeprom(dev);
1632 strcpy(dev->name, "eth%d"); /* un-hack */ 1636 strcpy(dev->name, "eth%d"); /* un-hack */
1633 } 1637 }
@@ -1663,20 +1667,18 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1663 if (register_netdev(dev)) 1667 if (register_netdev(dev))
1664 goto err_out_free_ring; 1668 goto err_out_free_ring;
1665 1669
1666 printk(KERN_INFO "%s: %s rev %d at " 1670 pci_set_drvdata(pdev, dev);
1671
1672 dev_info(&dev->dev,
1667#ifdef CONFIG_TULIP_MMIO 1673#ifdef CONFIG_TULIP_MMIO
1668 "MMIO" 1674 "%s rev %d at MMIO %#llx,%s %pM, IRQ %d\n",
1669#else 1675#else
1670 "Port" 1676 "%s rev %d at Port %#llx,%s %pM, IRQ %d\n",
1671#endif 1677#endif
1672 " %#llx,", dev->name, chip_name, pdev->revision, 1678 chip_name, pdev->revision,
1673 (unsigned long long) pci_resource_start(pdev, TULIP_BAR)); 1679 (unsigned long long)pci_resource_start(pdev, TULIP_BAR),
1674 pci_set_drvdata(pdev, dev); 1680 eeprom_missing ? " EEPROM not present," : "",
1675 1681 dev->dev_addr, irq);
1676 if (eeprom_missing)
1677 printk(" EEPROM not present,");
1678 printk(" %pM", dev->dev_addr);
1679 printk(", IRQ %d.\n", irq);
1680 1682
1681 if (tp->chip_id == PNIC2) 1683 if (tp->chip_id == PNIC2)
1682 tp->link_change = pnic2_lnk_change; 1684 tp->link_change = pnic2_lnk_change;
@@ -1799,12 +1801,12 @@ static int tulip_resume(struct pci_dev *pdev)
1799 return 0; 1801 return 0;
1800 1802
1801 if ((retval = pci_enable_device(pdev))) { 1803 if ((retval = pci_enable_device(pdev))) {
1802 printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); 1804 pr_err(PFX "pci_enable_device failed in resume\n");
1803 return retval; 1805 return retval;
1804 } 1806 }
1805 1807
1806 if ((retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev))) { 1808 if ((retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev))) {
1807 printk (KERN_ERR "tulip: request_irq failed in resume\n"); 1809 pr_err(PFX "request_irq failed in resume\n");
1808 return retval; 1810 return retval;
1809 } 1811 }
1810 1812
@@ -1874,7 +1876,7 @@ static struct pci_driver tulip_driver = {
1874static int __init tulip_init (void) 1876static int __init tulip_init (void)
1875{ 1877{
1876#ifdef MODULE 1878#ifdef MODULE
1877 printk (KERN_INFO "%s", version); 1879 pr_info("%s", version);
1878#endif 1880#endif
1879 1881
1880 /* copy module parms into globals */ 1882 /* copy module parms into globals */