Merge to Fedora kernel-2.6.7-1.441
[linux-2.6.git] / drivers / net / tg3.c
index 20ba895..6b2a168 100644 (file)
@@ -56,8 +56,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.5"
-#define DRV_MODULE_RELDATE     "May 25, 2004"
+#define DRV_MODULE_VERSION     "3.6"
+#define DRV_MODULE_RELDATE     "June 12, 2004"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -177,6 +177,8 @@ static struct pci_device_id tg3_pci_tbl[] = {
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5788,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+       { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5789,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5901_2,
@@ -195,6 +197,10 @@ static struct pci_device_id tg3_pci_tbl[] = {
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5750M,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+       { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751M,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+       { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5751F,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX,
@@ -6678,7 +6684,7 @@ static void tg3_get_ethtool_stats (struct net_device *dev,
 
 static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-       struct mii_ioctl_data *data = (struct mii_ioctl_data *)&ifr->ifr_data;
+       struct mii_ioctl_data *data = if_mii(ifr);
        struct tg3 *tp = netdev_priv(dev);
        int err;
 
@@ -7536,6 +7542,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        udelay(50);
        tg3_nvram_init(tp);
 
+       /* Always use host TXDs, it performs better in particular
+        * with multi-frag packets.  The tests below are kept here
+        * as documentation should we change this decision again
+        * in the future.
+        */
+       tp->tg3_flags |= TG3_FLAG_HOST_TXDS;
+
+#if 0
        /* Determine if TX descriptors will reside in
         * main memory or in the chip SRAM.
         */
@@ -7543,6 +7557,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
            GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705 ||
            GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750)
                tp->tg3_flags |= TG3_FLAG_HOST_TXDS;
+#endif
 
        grc_misc_cfg = tr32(GRC_MISC_CFG);
        grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK;
@@ -7565,7 +7580,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
             tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM &&
             (tp->pdev->device == PCI_DEVICE_ID_TIGON3_5901 ||
              tp->pdev->device == PCI_DEVICE_ID_TIGON3_5901_2 ||
-             tp->pdev->device == PCI_DEVICE_ID_TIGON3_5705F)))
+             tp->pdev->device == PCI_DEVICE_ID_TIGON3_5705F)) ||
+           (tp->pdev->vendor == PCI_VENDOR_ID_BROADCOM &&
+            tp->pdev->device == PCI_DEVICE_ID_TIGON3_5751F))
                tp->tg3_flags |= TG3_FLAG_10_100_ONLY;
 
        err = tg3_phy_probe(tp);
@@ -8446,6 +8463,8 @@ static int tg3_resume(struct pci_dev *pdev)
        if (!netif_running(dev))
                return 0;
 
+       pci_restore_state(tp->pdev, tp->pci_cfg_state);
+
        err = tg3_set_power_state(tp, 0);
        if (err)
                return err;