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.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index e3dd144d326b..5f743b972949 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -227,12 +227,12 @@ enum {
227 SROMC0InfoLeaf = 27, 227 SROMC0InfoLeaf = 27,
228 MediaBlockMask = 0x3f, 228 MediaBlockMask = 0x3f,
229 MediaCustomCSRs = (1 << 6), 229 MediaCustomCSRs = (1 << 6),
230 230
231 /* PCIPM bits */ 231 /* PCIPM bits */
232 PM_Sleep = (1 << 31), 232 PM_Sleep = (1 << 31),
233 PM_Snooze = (1 << 30), 233 PM_Snooze = (1 << 30),
234 PM_Mask = PM_Sleep | PM_Snooze, 234 PM_Mask = PM_Sleep | PM_Snooze,
235 235
236 /* SIAStatus bits */ 236 /* SIAStatus bits */
237 NWayState = (1 << 14) | (1 << 13) | (1 << 12), 237 NWayState = (1 << 14) | (1 << 13) | (1 << 12),
238 NWayRestart = (1 << 12), 238 NWayRestart = (1 << 12),
@@ -858,7 +858,7 @@ static void de_stop_rxtx (struct de_private *de)
858 return; 858 return;
859 cpu_relax(); 859 cpu_relax();
860 } 860 }
861 861
862 printk(KERN_WARNING "%s: timeout expired stopping DMA\n", de->dev->name); 862 printk(KERN_WARNING "%s: timeout expired stopping DMA\n", de->dev->name);
863} 863}
864 864
@@ -931,7 +931,7 @@ static void de_set_media (struct de_private *de)
931 macmode |= FullDuplex; 931 macmode |= FullDuplex;
932 else 932 else
933 macmode &= ~FullDuplex; 933 macmode &= ~FullDuplex;
934 934
935 if (netif_msg_link(de)) { 935 if (netif_msg_link(de)) {
936 printk(KERN_INFO "%s: set link %s\n" 936 printk(KERN_INFO "%s: set link %s\n"
937 KERN_INFO "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" 937 KERN_INFO "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n"
@@ -966,9 +966,9 @@ static void de21040_media_timer (unsigned long data)
966 u32 status = dr32(SIAStatus); 966 u32 status = dr32(SIAStatus);
967 unsigned int carrier; 967 unsigned int carrier;
968 unsigned long flags; 968 unsigned long flags;
969 969
970 carrier = (status & NetCxnErr) ? 0 : 1; 970 carrier = (status & NetCxnErr) ? 0 : 1;
971 971
972 if (carrier) { 972 if (carrier) {
973 if (de->media_type != DE_MEDIA_AUI && (status & LinkFailStatus)) 973 if (de->media_type != DE_MEDIA_AUI && (status & LinkFailStatus))
974 goto no_link_yet; 974 goto no_link_yet;
@@ -985,7 +985,7 @@ static void de21040_media_timer (unsigned long data)
985 return; 985 return;
986 } 986 }
987 987
988 de_link_down(de); 988 de_link_down(de);
989 989
990 if (de->media_lock) 990 if (de->media_lock)
991 return; 991 return;
@@ -1039,7 +1039,7 @@ static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media)
1039 return 0; 1039 return 0;
1040 break; 1040 break;
1041 } 1041 }
1042 1042
1043 return 1; 1043 return 1;
1044} 1044}
1045 1045
@@ -1050,9 +1050,9 @@ static void de21041_media_timer (unsigned long data)
1050 u32 status = dr32(SIAStatus); 1050 u32 status = dr32(SIAStatus);
1051 unsigned int carrier; 1051 unsigned int carrier;
1052 unsigned long flags; 1052 unsigned long flags;
1053 1053
1054 carrier = (status & NetCxnErr) ? 0 : 1; 1054 carrier = (status & NetCxnErr) ? 0 : 1;
1055 1055
1056 if (carrier) { 1056 if (carrier) {
1057 if ((de->media_type == DE_MEDIA_TP_AUTO || 1057 if ((de->media_type == DE_MEDIA_TP_AUTO ||
1058 de->media_type == DE_MEDIA_TP || 1058 de->media_type == DE_MEDIA_TP ||
@@ -1072,7 +1072,7 @@ static void de21041_media_timer (unsigned long data)
1072 return; 1072 return;
1073 } 1073 }
1074 1074
1075 de_link_down(de); 1075 de_link_down(de);
1076 1076
1077 /* if media type locked, don't switch media */ 1077 /* if media type locked, don't switch media */
1078 if (de->media_lock) 1078 if (de->media_lock)
@@ -1124,7 +1124,7 @@ static void de21041_media_timer (unsigned long data)
1124 u32 next_states[] = { DE_MEDIA_AUI, DE_MEDIA_BNC, DE_MEDIA_TP_AUTO }; 1124 u32 next_states[] = { DE_MEDIA_AUI, DE_MEDIA_BNC, DE_MEDIA_TP_AUTO };
1125 de_next_media(de, next_states, ARRAY_SIZE(next_states)); 1125 de_next_media(de, next_states, ARRAY_SIZE(next_states));
1126 } 1126 }
1127 1127
1128set_media: 1128set_media:
1129 spin_lock_irqsave(&de->lock, flags); 1129 spin_lock_irqsave(&de->lock, flags);
1130 de_stop_rxtx(de); 1130 de_stop_rxtx(de);
@@ -1148,7 +1148,7 @@ static void de_media_interrupt (struct de_private *de, u32 status)
1148 mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK); 1148 mod_timer(&de->media_timer, jiffies + DE_TIMER_LINK);
1149 return; 1149 return;
1150 } 1150 }
1151 1151
1152 BUG_ON(!(status & LinkFail)); 1152 BUG_ON(!(status & LinkFail));
1153 1153
1154 if (netif_carrier_ok(de->dev)) { 1154 if (netif_carrier_ok(de->dev)) {
@@ -1227,7 +1227,7 @@ static int de_init_hw (struct de_private *de)
1227 int rc; 1227 int rc;
1228 1228
1229 de_adapter_wake(de); 1229 de_adapter_wake(de);
1230 1230
1231 macmode = dr32(MacMode) & ~MacModeClear; 1231 macmode = dr32(MacMode) & ~MacModeClear;
1232 1232
1233 rc = de_reset_mac(de); 1233 rc = de_reset_mac(de);
@@ -1413,7 +1413,7 @@ static int de_close (struct net_device *dev)
1413 netif_stop_queue(dev); 1413 netif_stop_queue(dev);
1414 netif_carrier_off(dev); 1414 netif_carrier_off(dev);
1415 spin_unlock_irqrestore(&de->lock, flags); 1415 spin_unlock_irqrestore(&de->lock, flags);
1416 1416
1417 free_irq(dev->irq, dev); 1417 free_irq(dev->irq, dev);
1418 1418
1419 de_free_rings(de); 1419 de_free_rings(de);
@@ -1441,7 +1441,7 @@ static void de_tx_timeout (struct net_device *dev)
1441 1441
1442 spin_unlock_irq(&de->lock); 1442 spin_unlock_irq(&de->lock);
1443 enable_irq(dev->irq); 1443 enable_irq(dev->irq);
1444 1444
1445 /* Update the error counts. */ 1445 /* Update the error counts. */
1446 __de_get_stats(de); 1446 __de_get_stats(de);
1447 1447
@@ -1451,7 +1451,7 @@ static void de_tx_timeout (struct net_device *dev)
1451 de_init_rings(de); 1451 de_init_rings(de);
1452 1452
1453 de_init_hw(de); 1453 de_init_hw(de);
1454 1454
1455 netif_wake_queue(dev); 1455 netif_wake_queue(dev);
1456} 1456}
1457 1457
@@ -1459,7 +1459,7 @@ static void __de_get_regs(struct de_private *de, u8 *buf)
1459{ 1459{
1460 int i; 1460 int i;
1461 u32 *rbuf = (u32 *)buf; 1461 u32 *rbuf = (u32 *)buf;
1462 1462
1463 /* read all CSRs */ 1463 /* read all CSRs */
1464 for (i = 0; i < DE_NUM_REGS; i++) 1464 for (i = 0; i < DE_NUM_REGS; i++)
1465 rbuf[i] = dr32(i * 8); 1465 rbuf[i] = dr32(i * 8);
@@ -1474,7 +1474,7 @@ static int __de_get_settings(struct de_private *de, struct ethtool_cmd *ecmd)
1474 ecmd->transceiver = XCVR_INTERNAL; 1474 ecmd->transceiver = XCVR_INTERNAL;
1475 ecmd->phy_address = 0; 1475 ecmd->phy_address = 0;
1476 ecmd->advertising = de->media_advertise; 1476 ecmd->advertising = de->media_advertise;
1477 1477
1478 switch (de->media_type) { 1478 switch (de->media_type) {
1479 case DE_MEDIA_AUI: 1479 case DE_MEDIA_AUI:
1480 ecmd->port = PORT_AUI; 1480 ecmd->port = PORT_AUI;
@@ -1489,7 +1489,7 @@ static int __de_get_settings(struct de_private *de, struct ethtool_cmd *ecmd)
1489 ecmd->speed = SPEED_10; 1489 ecmd->speed = SPEED_10;
1490 break; 1490 break;
1491 } 1491 }
1492 1492
1493 if (dr32(MacMode) & FullDuplex) 1493 if (dr32(MacMode) & FullDuplex)
1494 ecmd->duplex = DUPLEX_FULL; 1494 ecmd->duplex = DUPLEX_FULL;
1495 else 1495 else
@@ -1529,7 +1529,7 @@ static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd)
1529 if (ecmd->autoneg == AUTONEG_ENABLE && 1529 if (ecmd->autoneg == AUTONEG_ENABLE &&
1530 (!(ecmd->advertising & ADVERTISED_Autoneg))) 1530 (!(ecmd->advertising & ADVERTISED_Autoneg)))
1531 return -EINVAL; 1531 return -EINVAL;
1532 1532
1533 switch (ecmd->port) { 1533 switch (ecmd->port) {
1534 case PORT_AUI: 1534 case PORT_AUI:
1535 new_media = DE_MEDIA_AUI; 1535 new_media = DE_MEDIA_AUI;
@@ -1554,22 +1554,22 @@ static int __de_set_settings(struct de_private *de, struct ethtool_cmd *ecmd)
1554 return -EINVAL; 1554 return -EINVAL;
1555 break; 1555 break;
1556 } 1556 }
1557 1557
1558 media_lock = (ecmd->autoneg == AUTONEG_ENABLE) ? 0 : 1; 1558 media_lock = (ecmd->autoneg == AUTONEG_ENABLE) ? 0 : 1;
1559 1559
1560 if ((new_media == de->media_type) && 1560 if ((new_media == de->media_type) &&
1561 (media_lock == de->media_lock) && 1561 (media_lock == de->media_lock) &&
1562 (ecmd->advertising == de->media_advertise)) 1562 (ecmd->advertising == de->media_advertise))
1563 return 0; /* nothing to change */ 1563 return 0; /* nothing to change */
1564 1564
1565 de_link_down(de); 1565 de_link_down(de);
1566 de_stop_rxtx(de); 1566 de_stop_rxtx(de);
1567 1567
1568 de->media_type = new_media; 1568 de->media_type = new_media;
1569 de->media_lock = media_lock; 1569 de->media_lock = media_lock;
1570 de->media_advertise = ecmd->advertising; 1570 de->media_advertise = ecmd->advertising;
1571 de_set_media(de); 1571 de_set_media(de);
1572 1572
1573 return 0; 1573 return 0;
1574} 1574}
1575 1575
@@ -1817,7 +1817,7 @@ static void __init de21041_get_srom_info (struct de_private *de)
1817 case 0x0204: de->media_type = DE_MEDIA_TP_FD; break; 1817 case 0x0204: de->media_type = DE_MEDIA_TP_FD; break;
1818 default: de->media_type = DE_MEDIA_TP_AUTO; break; 1818 default: de->media_type = DE_MEDIA_TP_AUTO; break;
1819 } 1819 }
1820 1820
1821 if (netif_msg_probe(de)) 1821 if (netif_msg_probe(de))
1822 printk(KERN_INFO "de%d: SROM leaf offset %u, default media %s\n", 1822 printk(KERN_INFO "de%d: SROM leaf offset %u, default media %s\n",
1823 de->board_idx, ofs, 1823 de->board_idx, ofs,
@@ -1886,7 +1886,7 @@ static void __init de21041_get_srom_info (struct de_private *de)
1886 de->media[idx].csr13, 1886 de->media[idx].csr13,
1887 de->media[idx].csr14, 1887 de->media[idx].csr14,
1888 de->media[idx].csr15); 1888 de->media[idx].csr15);
1889 1889
1890 } else if (netif_msg_probe(de)) 1890 } else if (netif_msg_probe(de))
1891 printk("\n"); 1891 printk("\n");
1892 1892
@@ -2118,7 +2118,7 @@ static int de_suspend (struct pci_dev *pdev, pm_message_t state)
2118 2118
2119 spin_unlock_irq(&de->lock); 2119 spin_unlock_irq(&de->lock);
2120 enable_irq(dev->irq); 2120 enable_irq(dev->irq);
2121 2121
2122 /* Update the error counts. */ 2122 /* Update the error counts. */
2123 __de_get_stats(de); 2123 __de_get_stats(de);
2124 2124