Merge branch 'linux-2.6'
[pandora-kernel.git] / drivers / net / tulip / de2104x.c
index bd04e93..1b5edd6 100644 (file)
@@ -264,10 +264,10 @@ struct de_srom_info_leaf {
 } __attribute__((packed));
 
 struct de_desc {
-       u32                     opts1;
-       u32                     opts2;
-       u32                     addr1;
-       u32                     addr2;
+       __le32                  opts1;
+       __le32                  opts2;
+       __le32                  addr1;
+       __le32                  addr2;
 };
 
 struct media_info {
@@ -842,7 +842,7 @@ static inline int de_is_running (struct de_private *de)
 static void de_stop_rxtx (struct de_private *de)
 {
        u32 macmode;
-       unsigned int work = 1000;
+       unsigned int i = 1300/100;
 
        macmode = dr32(MacMode);
        if (macmode & RxTx) {
@@ -850,10 +850,14 @@ static void de_stop_rxtx (struct de_private *de)
                dr32(MacMode);
        }
 
-       while (--work > 0) {
+       /* wait until in-flight frame completes.
+        * Max time @ 10BT: 1500*8b/10Mbps == 1200us (+ 100us margin)
+        * Typically expect this loop to end in < 50 us on 100BT.
+        */
+       while (--i) {
                if (!de_is_running(de))
                        return;
-               cpu_relax();
+               udelay(100);
        }
 
        printk(KERN_WARNING "%s: timeout expired stopping DMA\n", de->dev->name);
@@ -910,7 +914,8 @@ static void de_set_media (struct de_private *de)
        unsigned media = de->media_type;
        u32 macmode = dr32(MacMode);
 
-       BUG_ON(de_is_running(de));
+       if (de_is_running(de))
+               printk(KERN_WARNING "%s: chip is running while changing media!\n", de->dev->name);
 
        if (de->de21040)
                dw32(CSR11, FULL_DUPLEX_MAGIC);
@@ -1670,8 +1675,6 @@ static void de_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 
 static const struct ethtool_ops de_ethtool_ops = {
        .get_link               = ethtool_op_get_link,
-       .get_tx_csum            = ethtool_op_get_tx_csum,
-       .get_sg                 = ethtool_op_get_sg,
        .get_drvinfo            = de_get_drvinfo,
        .get_regs_len           = de_get_regs_len,
        .get_settings           = de_get_settings,
@@ -1773,8 +1776,8 @@ static void __devinit de21041_get_srom_info (struct de_private *de)
 
        /* download entire eeprom */
        for (i = 0; i < DE_EEPROM_WORDS; i++)
-               ((u16 *)ee_data)[i] =
-                       le16_to_cpu(tulip_read_eeprom(de->regs, i, ee_addr_size));
+               ((__le16 *)ee_data)[i] =
+                       cpu_to_le16(tulip_read_eeprom(de->regs, i, ee_addr_size));
 
        /* DEC now has a specification but early board makers
           just put the address in the first EEPROM locations. */
@@ -1931,6 +1934,7 @@ static int __devinit de_init_one (struct pci_dev *pdev,
        void __iomem *regs;
        unsigned long pciaddr;
        static int board_idx = -1;
+       DECLARE_MAC_BUF(mac);
 
        board_idx++;
 
@@ -2044,15 +2048,11 @@ static int __devinit de_init_one (struct pci_dev *pdev,
                goto err_out_iomap;
 
        /* print info about board and interface just registered */
-       printk (KERN_INFO "%s: %s at 0x%lx, "
-               "%02x:%02x:%02x:%02x:%02x:%02x, "
-               "IRQ %d\n",
+       printk (KERN_INFO "%s: %s at 0x%lx, %s, IRQ %d\n",
                dev->name,
                de->de21040 ? "21040" : "21041",
                dev->base_addr,
-               dev->dev_addr[0], dev->dev_addr[1],
-               dev->dev_addr[2], dev->dev_addr[3],
-               dev->dev_addr[4], dev->dev_addr[5],
+               print_mac(mac, dev->dev_addr),
                dev->irq);
 
        pci_set_drvdata(pdev, dev);