diff options
Diffstat (limited to 'drivers/net/3c509.c')
-rw-r--r-- | drivers/net/3c509.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index cbdae54f715f..48b99beb1e8b 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c | |||
@@ -28,7 +28,7 @@ | |||
28 | FIXES: | 28 | FIXES: |
29 | Alan Cox: Removed the 'Unexpected interrupt' bug. | 29 | Alan Cox: Removed the 'Unexpected interrupt' bug. |
30 | Michael Meskes: Upgraded to Donald Becker's version 1.07. | 30 | Michael Meskes: Upgraded to Donald Becker's version 1.07. |
31 | Alan Cox: Increased the eeprom delay. Regardless of | 31 | Alan Cox: Increased the eeprom delay. Regardless of |
32 | what the docs say some people definitely | 32 | what the docs say some people definitely |
33 | get problems with lower (but in card spec) | 33 | get problems with lower (but in card spec) |
34 | delays | 34 | delays |
@@ -162,7 +162,7 @@ enum RxFilter { | |||
162 | #define WN4_MEDIA 0x0A /* Window 4: Various transcvr/media bits. */ | 162 | #define WN4_MEDIA 0x0A /* Window 4: Various transcvr/media bits. */ |
163 | #define MEDIA_TP 0x00C0 /* Enable link beat and jabber for 10baseT. */ | 163 | #define MEDIA_TP 0x00C0 /* Enable link beat and jabber for 10baseT. */ |
164 | #define WN4_NETDIAG 0x06 /* Window 4: Net diagnostic */ | 164 | #define WN4_NETDIAG 0x06 /* Window 4: Net diagnostic */ |
165 | #define FD_ENABLE 0x8000 /* Enable full-duplex ("external loopback") */ | 165 | #define FD_ENABLE 0x8000 /* Enable full-duplex ("external loopback") */ |
166 | 166 | ||
167 | /* | 167 | /* |
168 | * Must be a power of two (we use a binary and in the | 168 | * Must be a power of two (we use a binary and in the |
@@ -350,7 +350,7 @@ static int __init el3_common_init(struct net_device *dev) | |||
350 | { | 350 | { |
351 | const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"}; | 351 | const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"}; |
352 | printk("%s: 3c5x9 found at %#3.3lx, %s port, address ", | 352 | printk("%s: 3c5x9 found at %#3.3lx, %s port, address ", |
353 | dev->name, dev->base_addr, | 353 | dev->name, dev->base_addr, |
354 | if_names[(dev->if_port & 0x03)]); | 354 | if_names[(dev->if_port & 0x03)]); |
355 | } | 355 | } |
356 | 356 | ||
@@ -528,7 +528,7 @@ no_pnp: | |||
528 | SET_MODULE_OWNER(dev); | 528 | SET_MODULE_OWNER(dev); |
529 | 529 | ||
530 | netdev_boot_setup_check(dev); | 530 | netdev_boot_setup_check(dev); |
531 | 531 | ||
532 | /* Set passed-in IRQ or I/O Addr. */ | 532 | /* Set passed-in IRQ or I/O Addr. */ |
533 | if (dev->irq > 1 && dev->irq < 16) | 533 | if (dev->irq > 1 && dev->irq < 16) |
534 | irq = dev->irq; | 534 | irq = dev->irq; |
@@ -630,7 +630,7 @@ static int __init el3_mca_probe(struct device *device) | |||
630 | if_port = pos4 & 0x03; | 630 | if_port = pos4 & 0x03; |
631 | 631 | ||
632 | irq = mca_device_transform_irq(mdev, irq); | 632 | irq = mca_device_transform_irq(mdev, irq); |
633 | ioaddr = mca_device_transform_ioport(mdev, ioaddr); | 633 | ioaddr = mca_device_transform_ioport(mdev, ioaddr); |
634 | if (el3_debug > 2) { | 634 | if (el3_debug > 2) { |
635 | printk("3c529: irq %d ioaddr 0x%x ifport %d\n", irq, ioaddr, if_port); | 635 | printk("3c529: irq %d ioaddr 0x%x ifport %d\n", irq, ioaddr, if_port); |
636 | } | 636 | } |
@@ -667,7 +667,7 @@ static int __init el3_mca_probe(struct device *device) | |||
667 | el3_cards++; | 667 | el3_cards++; |
668 | return 0; | 668 | return 0; |
669 | } | 669 | } |
670 | 670 | ||
671 | #endif /* CONFIG_MCA */ | 671 | #endif /* CONFIG_MCA */ |
672 | 672 | ||
673 | #ifdef CONFIG_EISA | 673 | #ifdef CONFIG_EISA |
@@ -684,7 +684,7 @@ static int __init el3_eisa_probe (struct device *device) | |||
684 | /* Yeepee, The driver framework is calling us ! */ | 684 | /* Yeepee, The driver framework is calling us ! */ |
685 | edev = to_eisa_device (device); | 685 | edev = to_eisa_device (device); |
686 | ioaddr = edev->base_addr; | 686 | ioaddr = edev->base_addr; |
687 | 687 | ||
688 | if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509")) | 688 | if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509")) |
689 | return -EBUSY; | 689 | return -EBUSY; |
690 | 690 | ||
@@ -751,7 +751,7 @@ static int __devexit el3_device_remove (struct device *device) | |||
751 | static ushort read_eeprom(int ioaddr, int index) | 751 | static ushort read_eeprom(int ioaddr, int index) |
752 | { | 752 | { |
753 | outw(EEPROM_READ + index, ioaddr + 10); | 753 | outw(EEPROM_READ + index, ioaddr + 10); |
754 | /* Pause for at least 162 us. for the read to take place. | 754 | /* Pause for at least 162 us. for the read to take place. |
755 | Some chips seem to require much longer */ | 755 | Some chips seem to require much longer */ |
756 | mdelay(2); | 756 | mdelay(2); |
757 | return inw(ioaddr + 12); | 757 | return inw(ioaddr + 12); |
@@ -769,7 +769,7 @@ static ushort __init id_read_eeprom(int index) | |||
769 | /* Pause for at least 162 us. for the read to take place. */ | 769 | /* Pause for at least 162 us. for the read to take place. */ |
770 | /* Some chips seem to require much longer */ | 770 | /* Some chips seem to require much longer */ |
771 | mdelay(4); | 771 | mdelay(4); |
772 | 772 | ||
773 | for (bit = 15; bit >= 0; bit--) | 773 | for (bit = 15; bit >= 0; bit--) |
774 | word = (word << 1) + (inb(id_port) & 0x01); | 774 | word = (word << 1) + (inb(id_port) & 0x01); |
775 | 775 | ||
@@ -838,7 +838,7 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
838 | netif_stop_queue (dev); | 838 | netif_stop_queue (dev); |
839 | 839 | ||
840 | lp->stats.tx_bytes += skb->len; | 840 | lp->stats.tx_bytes += skb->len; |
841 | 841 | ||
842 | if (el3_debug > 4) { | 842 | if (el3_debug > 4) { |
843 | printk("%s: el3_start_xmit(length = %u) called, status %4.4x.\n", | 843 | printk("%s: el3_start_xmit(length = %u) called, status %4.4x.\n", |
844 | dev->name, skb->len, inw(ioaddr + EL3_STATUS)); | 844 | dev->name, skb->len, inw(ioaddr + EL3_STATUS)); |
@@ -1024,7 +1024,7 @@ el3_get_stats(struct net_device *dev) | |||
1024 | * This is fast enough not to bother with disable IRQ | 1024 | * This is fast enough not to bother with disable IRQ |
1025 | * stuff. | 1025 | * stuff. |
1026 | */ | 1026 | */ |
1027 | 1027 | ||
1028 | spin_lock_irqsave(&lp->lock, flags); | 1028 | spin_lock_irqsave(&lp->lock, flags); |
1029 | update_stats(dev); | 1029 | update_stats(dev); |
1030 | spin_unlock_irqrestore(&lp->lock, flags); | 1030 | spin_unlock_irqrestore(&lp->lock, flags); |
@@ -1168,7 +1168,7 @@ el3_close(struct net_device *dev) | |||
1168 | { | 1168 | { |
1169 | int ioaddr = dev->base_addr; | 1169 | int ioaddr = dev->base_addr; |
1170 | struct el3_private *lp = netdev_priv(dev); | 1170 | struct el3_private *lp = netdev_priv(dev); |
1171 | 1171 | ||
1172 | if (el3_debug > 2) | 1172 | if (el3_debug > 2) |
1173 | printk("%s: Shutting down ethercard.\n", dev->name); | 1173 | printk("%s: Shutting down ethercard.\n", dev->name); |
1174 | 1174 | ||
@@ -1187,7 +1187,7 @@ el3_close(struct net_device *dev) | |||
1187 | return 0; | 1187 | return 0; |
1188 | } | 1188 | } |
1189 | 1189 | ||
1190 | static int | 1190 | static int |
1191 | el3_link_ok(struct net_device *dev) | 1191 | el3_link_ok(struct net_device *dev) |
1192 | { | 1192 | { |
1193 | int ioaddr = dev->base_addr; | 1193 | int ioaddr = dev->base_addr; |
@@ -1204,9 +1204,9 @@ el3_netdev_get_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd) | |||
1204 | { | 1204 | { |
1205 | u16 tmp; | 1205 | u16 tmp; |
1206 | int ioaddr = dev->base_addr; | 1206 | int ioaddr = dev->base_addr; |
1207 | 1207 | ||
1208 | EL3WINDOW(0); | 1208 | EL3WINDOW(0); |
1209 | /* obtain current transceiver via WN4_MEDIA? */ | 1209 | /* obtain current transceiver via WN4_MEDIA? */ |
1210 | tmp = inw(ioaddr + WN0_ADDR_CONF); | 1210 | tmp = inw(ioaddr + WN0_ADDR_CONF); |
1211 | ecmd->transceiver = XCVR_INTERNAL; | 1211 | ecmd->transceiver = XCVR_INTERNAL; |
1212 | switch (tmp >> 14) { | 1212 | switch (tmp >> 14) { |
@@ -1391,7 +1391,7 @@ el3_up(struct net_device *dev) | |||
1391 | { | 1391 | { |
1392 | int i, sw_info, net_diag; | 1392 | int i, sw_info, net_diag; |
1393 | int ioaddr = dev->base_addr; | 1393 | int ioaddr = dev->base_addr; |
1394 | 1394 | ||
1395 | /* Activating the board required and does no harm otherwise */ | 1395 | /* Activating the board required and does no harm otherwise */ |
1396 | outw(0x0001, ioaddr + 4); | 1396 | outw(0x0001, ioaddr + 4); |
1397 | 1397 | ||
@@ -1411,7 +1411,7 @@ el3_up(struct net_device *dev) | |||
1411 | /* Combine secondary sw_info word (the adapter level) and primary | 1411 | /* Combine secondary sw_info word (the adapter level) and primary |
1412 | sw_info word (duplex setting plus other useless bits) */ | 1412 | sw_info word (duplex setting plus other useless bits) */ |
1413 | EL3WINDOW(0); | 1413 | EL3WINDOW(0); |
1414 | sw_info = (read_eeprom(ioaddr, 0x14) & 0x400f) | | 1414 | sw_info = (read_eeprom(ioaddr, 0x14) & 0x400f) | |
1415 | (read_eeprom(ioaddr, 0x0d) & 0xBff0); | 1415 | (read_eeprom(ioaddr, 0x0d) & 0xBff0); |
1416 | 1416 | ||
1417 | EL3WINDOW(4); | 1417 | EL3WINDOW(4); |
@@ -1483,7 +1483,7 @@ el3_suspend(struct device *pdev, pm_message_t state) | |||
1483 | struct net_device *dev; | 1483 | struct net_device *dev; |
1484 | struct el3_private *lp; | 1484 | struct el3_private *lp; |
1485 | int ioaddr; | 1485 | int ioaddr; |
1486 | 1486 | ||
1487 | dev = pdev->driver_data; | 1487 | dev = pdev->driver_data; |
1488 | lp = netdev_priv(dev); | 1488 | lp = netdev_priv(dev); |
1489 | ioaddr = dev->base_addr; | 1489 | ioaddr = dev->base_addr; |
@@ -1507,7 +1507,7 @@ el3_resume(struct device *pdev) | |||
1507 | struct net_device *dev; | 1507 | struct net_device *dev; |
1508 | struct el3_private *lp; | 1508 | struct el3_private *lp; |
1509 | int ioaddr; | 1509 | int ioaddr; |
1510 | 1510 | ||
1511 | dev = pdev->driver_data; | 1511 | dev = pdev->driver_data; |
1512 | lp = netdev_priv(dev); | 1512 | lp = netdev_priv(dev); |
1513 | ioaddr = dev->base_addr; | 1513 | ioaddr = dev->base_addr; |
@@ -1519,7 +1519,7 @@ el3_resume(struct device *pdev) | |||
1519 | 1519 | ||
1520 | if (netif_running(dev)) | 1520 | if (netif_running(dev)) |
1521 | netif_device_attach(dev); | 1521 | netif_device_attach(dev); |
1522 | 1522 | ||
1523 | spin_unlock_irqrestore(&lp->lock, flags); | 1523 | spin_unlock_irqrestore(&lp->lock, flags); |
1524 | return 0; | 1524 | return 0; |
1525 | } | 1525 | } |