aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/de2104x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/tulip/de2104x.c')
-rw-r--r--drivers/net/tulip/de2104x.c170
1 files changed, 83 insertions, 87 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 74e5ba42d38d..19cafc2b418d 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -42,6 +42,7 @@
42#include <linux/compiler.h> 42#include <linux/compiler.h>
43#include <linux/rtnetlink.h> 43#include <linux/rtnetlink.h>
44#include <linux/crc32.h> 44#include <linux/crc32.h>
45#include <linux/slab.h>
45 46
46#include <asm/io.h> 47#include <asm/io.h>
47#include <asm/irq.h> 48#include <asm/irq.h>
@@ -62,9 +63,9 @@ module_param (debug, int, 0);
62MODULE_PARM_DESC (debug, "de2104x bitmapped message enable number"); 63MODULE_PARM_DESC (debug, "de2104x bitmapped message enable number");
63 64
64/* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */ 65/* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */
65#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \ 66#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) || \
66 || defined(CONFIG_SPARC) || defined(__ia64__) \ 67 defined(CONFIG_SPARC) || defined(__ia64__) || \
67 || defined(__sh__) || defined(__mips__) 68 defined(__sh__) || defined(__mips__)
68static int rx_copybreak = 1518; 69static int rx_copybreak = 1518;
69#else 70#else
70static int rx_copybreak = 100; 71static int rx_copybreak = 100;
@@ -337,7 +338,7 @@ static void de21041_media_timer (unsigned long data);
337static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media); 338static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media);
338 339
339 340
340static struct pci_device_id de_pci_tbl[] = { 341static DEFINE_PCI_DEVICE_TABLE(de_pci_tbl) = {
341 { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP, 342 { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP,
342 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, 343 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
343 { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_PLUS, 344 { PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_TULIP_PLUS,
@@ -382,9 +383,9 @@ static void de_rx_err_acct (struct de_private *de, unsigned rx_tail,
382 /* Ingore earlier buffers. */ 383 /* Ingore earlier buffers. */
383 if ((status & 0xffff) != 0x7fff) { 384 if ((status & 0xffff) != 0x7fff) {
384 if (netif_msg_rx_err(de)) 385 if (netif_msg_rx_err(de))
385 printk(KERN_WARNING "%s: Oversized Ethernet frame " 386 dev_warn(&de->dev->dev,
386 "spanned multiple buffers, status %8.8x!\n", 387 "Oversized Ethernet frame spanned multiple buffers, status %08x!\n",
387 de->dev->name, status); 388 status);
388 de->net_stats.rx_length_errors++; 389 de->net_stats.rx_length_errors++;
389 } 390 }
390 } else if (status & RxError) { 391 } else if (status & RxError) {
@@ -487,7 +488,7 @@ rx_next:
487 } 488 }
488 489
489 if (!rx_work) 490 if (!rx_work)
490 printk(KERN_WARNING "%s: rx work limit reached\n", de->dev->name); 491 dev_warn(&de->dev->dev, "rx work limit reached\n");
491 492
492 de->rx_tail = rx_tail; 493 de->rx_tail = rx_tail;
493} 494}
@@ -504,7 +505,8 @@ static irqreturn_t de_interrupt (int irq, void *dev_instance)
504 505
505 if (netif_msg_intr(de)) 506 if (netif_msg_intr(de))
506 printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n", 507 printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n",
507 dev->name, status, dr32(MacMode), de->rx_tail, de->tx_head, de->tx_tail); 508 dev->name, status, dr32(MacMode),
509 de->rx_tail, de->tx_head, de->tx_tail);
508 510
509 dw32(MacStatus, status); 511 dw32(MacStatus, status);
510 512
@@ -529,8 +531,9 @@ static irqreturn_t de_interrupt (int irq, void *dev_instance)
529 531
530 pci_read_config_word(de->pdev, PCI_STATUS, &pci_status); 532 pci_read_config_word(de->pdev, PCI_STATUS, &pci_status);
531 pci_write_config_word(de->pdev, PCI_STATUS, pci_status); 533 pci_write_config_word(de->pdev, PCI_STATUS, pci_status);
532 printk(KERN_ERR "%s: PCI bus error, status=%08x, PCI status=%04x\n", 534 dev_err(&de->dev->dev,
533 dev->name, status, pci_status); 535 "PCI bus error, status=%08x, PCI status=%04x\n",
536 status, pci_status);
534 } 537 }
535 538
536 return IRQ_HANDLED; 539 return IRQ_HANDLED;
@@ -582,7 +585,8 @@ static void de_tx (struct de_private *de)
582 de->net_stats.tx_packets++; 585 de->net_stats.tx_packets++;
583 de->net_stats.tx_bytes += skb->len; 586 de->net_stats.tx_bytes += skb->len;
584 if (netif_msg_tx_done(de)) 587 if (netif_msg_tx_done(de))
585 printk(KERN_DEBUG "%s: tx done, slot %d\n", de->dev->name, tx_tail); 588 printk(KERN_DEBUG "%s: tx done, slot %d\n",
589 de->dev->name, tx_tail);
586 } 590 }
587 dev_kfree_skb_irq(skb); 591 dev_kfree_skb_irq(skb);
588 } 592 }
@@ -674,18 +678,17 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
674 memset(hash_table, 0, sizeof(hash_table)); 678 memset(hash_table, 0, sizeof(hash_table));
675 set_bit_le(255, hash_table); /* Broadcast entry */ 679 set_bit_le(255, hash_table); /* Broadcast entry */
676 /* This should work on big-endian machines as well. */ 680 /* This should work on big-endian machines as well. */
677 for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count; 681 netdev_for_each_mc_addr(mclist, dev) {
678 i++, mclist = mclist->next) {
679 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff; 682 int index = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x1ff;
680 683
681 set_bit_le(index, hash_table); 684 set_bit_le(index, hash_table);
685 }
682 686
683 for (i = 0; i < 32; i++) { 687 for (i = 0; i < 32; i++) {
684 *setup_frm++ = hash_table[i]; 688 *setup_frm++ = hash_table[i];
685 *setup_frm++ = hash_table[i]; 689 *setup_frm++ = hash_table[i];
686 }
687 setup_frm = &de->setup_frame[13*6];
688 } 690 }
691 setup_frm = &de->setup_frame[13*6];
689 692
690 /* Fill the final entry with our physical address. */ 693 /* Fill the final entry with our physical address. */
691 eaddrs = (u16 *)dev->dev_addr; 694 eaddrs = (u16 *)dev->dev_addr;
@@ -698,20 +701,18 @@ static void build_setup_frame_perfect(u16 *setup_frm, struct net_device *dev)
698{ 701{
699 struct de_private *de = netdev_priv(dev); 702 struct de_private *de = netdev_priv(dev);
700 struct dev_mc_list *mclist; 703 struct dev_mc_list *mclist;
701 int i;
702 u16 *eaddrs; 704 u16 *eaddrs;
703 705
704 /* We have <= 14 addresses so we can use the wonderful 706 /* We have <= 14 addresses so we can use the wonderful
705 16 address perfect filtering of the Tulip. */ 707 16 address perfect filtering of the Tulip. */
706 for (i = 0, mclist = dev->mc_list; i < dev->mc_count; 708 netdev_for_each_mc_addr(mclist, dev) {
707 i++, mclist = mclist->next) {
708 eaddrs = (u16 *)mclist->dmi_addr; 709 eaddrs = (u16 *)mclist->dmi_addr;
709 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 710 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
710 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 711 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
711 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++; 712 *setup_frm++ = *eaddrs; *setup_frm++ = *eaddrs++;
712 } 713 }
713 /* Fill the unused entries with the broadcast address. */ 714 /* Fill the unused entries with the broadcast address. */
714 memset(setup_frm, 0xff, (15-i)*12); 715 memset(setup_frm, 0xff, (15 - netdev_mc_count(dev)) * 12);
715 setup_frm = &de->setup_frame[15*6]; 716 setup_frm = &de->setup_frame[15*6];
716 717
717 /* Fill the final entry with our physical address. */ 718 /* Fill the final entry with our physical address. */
@@ -738,7 +739,7 @@ static void __de_set_rx_mode (struct net_device *dev)
738 goto out; 739 goto out;
739 } 740 }
740 741
741 if ((dev->mc_count > 1000) || (dev->flags & IFF_ALLMULTI)) { 742 if ((netdev_mc_count(dev) > 1000) || (dev->flags & IFF_ALLMULTI)) {
742 /* Too many to filter well -- accept all multicasts. */ 743 /* Too many to filter well -- accept all multicasts. */
743 macmode |= AcceptAllMulticast; 744 macmode |= AcceptAllMulticast;
744 goto out; 745 goto out;
@@ -746,7 +747,7 @@ static void __de_set_rx_mode (struct net_device *dev)
746 747
747 /* Note that only the low-address shortword of setup_frame is valid! 748 /* Note that only the low-address shortword of setup_frame is valid!
748 The values are doubled for big-endian architectures. */ 749 The values are doubled for big-endian architectures. */
749 if (dev->mc_count > 14) /* Must use a multicast hash table. */ 750 if (netdev_mc_count(dev) > 14) /* Must use a multicast hash table. */
750 build_setup_frame_hash (de->setup_frame, dev); 751 build_setup_frame_hash (de->setup_frame, dev);
751 else 752 else
752 build_setup_frame_perfect (de->setup_frame, dev); 753 build_setup_frame_perfect (de->setup_frame, dev);
@@ -870,7 +871,7 @@ static void de_stop_rxtx (struct de_private *de)
870 udelay(100); 871 udelay(100);
871 } 872 }
872 873
873 printk(KERN_WARNING "%s: timeout expired stopping DMA\n", de->dev->name); 874 dev_warn(&de->dev->dev, "timeout expired stopping DMA\n");
874} 875}
875 876
876static inline void de_start_rxtx (struct de_private *de) 877static inline void de_start_rxtx (struct de_private *de)
@@ -905,8 +906,8 @@ static void de_link_up(struct de_private *de)
905 if (!netif_carrier_ok(de->dev)) { 906 if (!netif_carrier_ok(de->dev)) {
906 netif_carrier_on(de->dev); 907 netif_carrier_on(de->dev);
907 if (netif_msg_link(de)) 908 if (netif_msg_link(de))
908 printk(KERN_INFO "%s: link up, media %s\n", 909 dev_info(&de->dev->dev, "link up, media %s\n",
909 de->dev->name, media_name[de->media_type]); 910 media_name[de->media_type]);
910 } 911 }
911} 912}
912 913
@@ -915,7 +916,7 @@ static void de_link_down(struct de_private *de)
915 if (netif_carrier_ok(de->dev)) { 916 if (netif_carrier_ok(de->dev)) {
916 netif_carrier_off(de->dev); 917 netif_carrier_off(de->dev);
917 if (netif_msg_link(de)) 918 if (netif_msg_link(de))
918 printk(KERN_INFO "%s: link down\n", de->dev->name); 919 dev_info(&de->dev->dev, "link down\n");
919 } 920 }
920} 921}
921 922
@@ -925,7 +926,8 @@ static void de_set_media (struct de_private *de)
925 u32 macmode = dr32(MacMode); 926 u32 macmode = dr32(MacMode);
926 927
927 if (de_is_running(de)) 928 if (de_is_running(de))
928 printk(KERN_WARNING "%s: chip is running while changing media!\n", de->dev->name); 929 dev_warn(&de->dev->dev,
930 "chip is running while changing media!\n");
929 931
930 if (de->de21040) 932 if (de->de21040)
931 dw32(CSR11, FULL_DUPLEX_MAGIC); 933 dw32(CSR11, FULL_DUPLEX_MAGIC);
@@ -945,15 +947,15 @@ static void de_set_media (struct de_private *de)
945 macmode &= ~FullDuplex; 947 macmode &= ~FullDuplex;
946 948
947 if (netif_msg_link(de)) { 949 if (netif_msg_link(de)) {
948 printk(KERN_INFO 950 dev_info(&de->dev->dev, "set link %s\n", media_name[media]);
949 "%s: set link %s\n" 951 dev_info(&de->dev->dev, "mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n",
950 "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" 952 dr32(MacMode), dr32(SIAStatus),
951 "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", 953 dr32(CSR13), dr32(CSR14), dr32(CSR15));
952 de->dev->name, media_name[media], 954
953 de->dev->name, dr32(MacMode), dr32(SIAStatus), 955 dev_info(&de->dev->dev,
954 dr32(CSR13), dr32(CSR14), dr32(CSR15), 956 "set mode 0x%x, set sia 0x%x,0x%x,0x%x\n",
955 de->dev->name, macmode, de->media[media].csr13, 957 macmode, de->media[media].csr13,
956 de->media[media].csr14, de->media[media].csr15); 958 de->media[media].csr14, de->media[media].csr15);
957 } 959 }
958 if (macmode != dr32(MacMode)) 960 if (macmode != dr32(MacMode))
959 dw32(MacMode, macmode); 961 dw32(MacMode, macmode);
@@ -992,9 +994,8 @@ static void de21040_media_timer (unsigned long data)
992 de_link_up(de); 994 de_link_up(de);
993 else 995 else
994 if (netif_msg_timer(de)) 996 if (netif_msg_timer(de))
995 printk(KERN_INFO "%s: %s link ok, status %x\n", 997 dev_info(&dev->dev, "%s link ok, status %x\n",
996 dev->name, media_name[de->media_type], 998 media_name[de->media_type], status);
997 status);
998 return; 999 return;
999 } 1000 }
1000 1001
@@ -1022,8 +1023,8 @@ no_link_yet:
1022 add_timer(&de->media_timer); 1023 add_timer(&de->media_timer);
1023 1024
1024 if (netif_msg_timer(de)) 1025 if (netif_msg_timer(de))
1025 printk(KERN_INFO "%s: no link, trying media %s, status %x\n", 1026 dev_info(&dev->dev, "no link, trying media %s, status %x\n",
1026 dev->name, media_name[de->media_type], status); 1027 media_name[de->media_type], status);
1027} 1028}
1028 1029
1029static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media) 1030static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media)
@@ -1079,9 +1080,10 @@ static void de21041_media_timer (unsigned long data)
1079 de_link_up(de); 1080 de_link_up(de);
1080 else 1081 else
1081 if (netif_msg_timer(de)) 1082 if (netif_msg_timer(de))
1082 printk(KERN_INFO "%s: %s link ok, mode %x status %x\n", 1083 dev_info(&dev->dev,
1083 dev->name, media_name[de->media_type], 1084 "%s link ok, mode %x status %x\n",
1084 dr32(MacMode), status); 1085 media_name[de->media_type],
1086 dr32(MacMode), status);
1085 return; 1087 return;
1086 } 1088 }
1087 1089
@@ -1150,8 +1152,8 @@ no_link_yet:
1150 add_timer(&de->media_timer); 1152 add_timer(&de->media_timer);
1151 1153
1152 if (netif_msg_timer(de)) 1154 if (netif_msg_timer(de))
1153 printk(KERN_INFO "%s: no link, trying media %s, status %x\n", 1155 dev_info(&dev->dev, "no link, trying media %s, status %x\n",
1154 dev->name, media_name[de->media_type], status); 1156 media_name[de->media_type], status);
1155} 1157}
1156 1158
1157static void de_media_interrupt (struct de_private *de, u32 status) 1159static void de_media_interrupt (struct de_private *de, u32 status)
@@ -1378,8 +1380,7 @@ static int de_open (struct net_device *dev)
1378 1380
1379 rc = de_alloc_rings(de); 1381 rc = de_alloc_rings(de);
1380 if (rc) { 1382 if (rc) {
1381 printk(KERN_ERR "%s: ring allocation failure, err=%d\n", 1383 dev_err(&dev->dev, "ring allocation failure, err=%d\n", rc);
1382 dev->name, rc);
1383 return rc; 1384 return rc;
1384 } 1385 }
1385 1386
@@ -1387,15 +1388,14 @@ static int de_open (struct net_device *dev)
1387 1388
1388 rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev); 1389 rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev);
1389 if (rc) { 1390 if (rc) {
1390 printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", 1391 dev_err(&dev->dev, "IRQ %d request failure, err=%d\n",
1391 dev->name, dev->irq, rc); 1392 dev->irq, rc);
1392 goto err_out_free; 1393 goto err_out_free;
1393 } 1394 }
1394 1395
1395 rc = de_init_hw(de); 1396 rc = de_init_hw(de);
1396 if (rc) { 1397 if (rc) {
1397 printk(KERN_ERR "%s: h/w init failure, err=%d\n", 1398 dev_err(&dev->dev, "h/w init failure, err=%d\n", rc);
1398 dev->name, rc);
1399 goto err_out_free_irq; 1399 goto err_out_free_irq;
1400 } 1400 }
1401 1401
@@ -1666,8 +1666,8 @@ static int de_nway_reset(struct net_device *dev)
1666 status = dr32(SIAStatus); 1666 status = dr32(SIAStatus);
1667 dw32(SIAStatus, (status & ~NWayState) | NWayRestart); 1667 dw32(SIAStatus, (status & ~NWayState) | NWayRestart);
1668 if (netif_msg_link(de)) 1668 if (netif_msg_link(de))
1669 printk(KERN_INFO "%s: link nway restart, status %x,%x\n", 1669 dev_info(&de->dev->dev, "link nway restart, status %x,%x\n",
1670 de->dev->name, status, dr32(SIAStatus)); 1670 status, dr32(SIAStatus));
1671 return 0; 1671 return 0;
1672} 1672}
1673 1673
@@ -1711,7 +1711,7 @@ static void __devinit de21040_get_mac_address (struct de_private *de)
1711 de->dev->dev_addr[i] = value; 1711 de->dev->dev_addr[i] = value;
1712 udelay(1); 1712 udelay(1);
1713 if (boguscnt <= 0) 1713 if (boguscnt <= 0)
1714 printk(KERN_WARNING PFX "timeout reading 21040 MAC address byte %u\n", i); 1714 pr_warning(PFX "timeout reading 21040 MAC address byte %u\n", i);
1715 } 1715 }
1716} 1716}
1717 1717
@@ -1830,9 +1830,8 @@ static void __devinit de21041_get_srom_info (struct de_private *de)
1830 } 1830 }
1831 1831
1832 if (netif_msg_probe(de)) 1832 if (netif_msg_probe(de))
1833 printk(KERN_INFO "de%d: SROM leaf offset %u, default media %s\n", 1833 pr_info("de%d: SROM leaf offset %u, default media %s\n",
1834 de->board_idx, ofs, 1834 de->board_idx, ofs, media_name[de->media_type]);
1835 media_name[de->media_type]);
1836 1835
1837 /* init SIA register values to defaults */ 1836 /* init SIA register values to defaults */
1838 for (i = 0; i < DE_MAX_MEDIA; i++) { 1837 for (i = 0; i < DE_MAX_MEDIA; i++) {
@@ -1879,9 +1878,9 @@ static void __devinit de21041_get_srom_info (struct de_private *de)
1879 de->media[idx].type = idx; 1878 de->media[idx].type = idx;
1880 1879
1881 if (netif_msg_probe(de)) 1880 if (netif_msg_probe(de))
1882 printk(KERN_INFO "de%d: media block #%u: %s", 1881 pr_info("de%d: media block #%u: %s",
1883 de->board_idx, i, 1882 de->board_idx, i,
1884 media_name[de->media[idx].type]); 1883 media_name[de->media[idx].type]);
1885 1884
1886 bufp += sizeof (ib->opts); 1885 bufp += sizeof (ib->opts);
1887 1886
@@ -1893,13 +1892,13 @@ static void __devinit de21041_get_srom_info (struct de_private *de)
1893 sizeof(ib->csr15); 1892 sizeof(ib->csr15);
1894 1893
1895 if (netif_msg_probe(de)) 1894 if (netif_msg_probe(de))
1896 printk(" (%x,%x,%x)\n", 1895 pr_cont(" (%x,%x,%x)\n",
1897 de->media[idx].csr13, 1896 de->media[idx].csr13,
1898 de->media[idx].csr14, 1897 de->media[idx].csr14,
1899 de->media[idx].csr15); 1898 de->media[idx].csr15);
1900 1899
1901 } else if (netif_msg_probe(de)) 1900 } else if (netif_msg_probe(de))
1902 printk("\n"); 1901 pr_cont("\n");
1903 1902
1904 if (bufp > ((void *)&ee_data[DE_EEPROM_SIZE - 3])) 1903 if (bufp > ((void *)&ee_data[DE_EEPROM_SIZE - 3]))
1905 break; 1904 break;
@@ -2005,7 +2004,7 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2005 /* check for invalid IRQ value */ 2004 /* check for invalid IRQ value */
2006 if (pdev->irq < 2) { 2005 if (pdev->irq < 2) {
2007 rc = -EIO; 2006 rc = -EIO;
2008 printk(KERN_ERR PFX "invalid irq (%d) for pci dev %s\n", 2007 pr_err(PFX "invalid irq (%d) for pci dev %s\n",
2009 pdev->irq, pci_name(pdev)); 2008 pdev->irq, pci_name(pdev));
2010 goto err_out_res; 2009 goto err_out_res;
2011 } 2010 }
@@ -2016,14 +2015,14 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2016 pciaddr = pci_resource_start(pdev, 1); 2015 pciaddr = pci_resource_start(pdev, 1);
2017 if (!pciaddr) { 2016 if (!pciaddr) {
2018 rc = -EIO; 2017 rc = -EIO;
2019 printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n", 2018 pr_err(PFX "no MMIO resource for pci dev %s\n", pci_name(pdev));
2020 pci_name(pdev));
2021 goto err_out_res; 2019 goto err_out_res;
2022 } 2020 }
2023 if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) { 2021 if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) {
2024 rc = -EIO; 2022 rc = -EIO;
2025 printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n", 2023 pr_err(PFX "MMIO resource (%llx) too small on pci dev %s\n",
2026 (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev)); 2024 (unsigned long long)pci_resource_len(pdev, 1),
2025 pci_name(pdev));
2027 goto err_out_res; 2026 goto err_out_res;
2028 } 2027 }
2029 2028
@@ -2031,9 +2030,9 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2031 regs = ioremap_nocache(pciaddr, DE_REGS_SIZE); 2030 regs = ioremap_nocache(pciaddr, DE_REGS_SIZE);
2032 if (!regs) { 2031 if (!regs) {
2033 rc = -EIO; 2032 rc = -EIO;
2034 printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%lx) on pci dev %s\n", 2033 pr_err(PFX "Cannot map PCI MMIO (%llx@%lx) on pci dev %s\n",
2035 (unsigned long long)pci_resource_len(pdev, 1), 2034 (unsigned long long)pci_resource_len(pdev, 1),
2036 pciaddr, pci_name(pdev)); 2035 pciaddr, pci_name(pdev));
2037 goto err_out_res; 2036 goto err_out_res;
2038 } 2037 }
2039 dev->base_addr = (unsigned long) regs; 2038 dev->base_addr = (unsigned long) regs;
@@ -2044,8 +2043,7 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2044 /* make sure hardware is not running */ 2043 /* make sure hardware is not running */
2045 rc = de_reset_mac(de); 2044 rc = de_reset_mac(de);
2046 if (rc) { 2045 if (rc) {
2047 printk(KERN_ERR PFX "Cannot reset MAC, pci dev %s\n", 2046 pr_err(PFX "Cannot reset MAC, pci dev %s\n", pci_name(pdev));
2048 pci_name(pdev));
2049 goto err_out_iomap; 2047 goto err_out_iomap;
2050 } 2048 }
2051 2049
@@ -2065,12 +2063,11 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2065 goto err_out_iomap; 2063 goto err_out_iomap;
2066 2064
2067 /* print info about board and interface just registered */ 2065 /* print info about board and interface just registered */
2068 printk (KERN_INFO "%s: %s at 0x%lx, %pM, IRQ %d\n", 2066 dev_info(&dev->dev, "%s at 0x%lx, %pM, IRQ %d\n",
2069 dev->name, 2067 de->de21040 ? "21040" : "21041",
2070 de->de21040 ? "21040" : "21041", 2068 dev->base_addr,
2071 dev->base_addr, 2069 dev->dev_addr,
2072 dev->dev_addr, 2070 dev->irq);
2073 dev->irq);
2074 2071
2075 pci_set_drvdata(pdev, dev); 2072 pci_set_drvdata(pdev, dev);
2076 2073
@@ -2158,8 +2155,7 @@ static int de_resume (struct pci_dev *pdev)
2158 if (!netif_running(dev)) 2155 if (!netif_running(dev))
2159 goto out_attach; 2156 goto out_attach;
2160 if ((retval = pci_enable_device(pdev))) { 2157 if ((retval = pci_enable_device(pdev))) {
2161 printk (KERN_ERR "%s: pci_enable_device failed in resume\n", 2158 dev_err(&dev->dev, "pci_enable_device failed in resume\n");
2162 dev->name);
2163 goto out; 2159 goto out;
2164 } 2160 }
2165 de_init_hw(de); 2161 de_init_hw(de);