Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-mmc
[pandora-kernel.git] / drivers / net / sundance.c
index 0ab9c38..f13b2a1 100644 (file)
        Version LK1.10 (Philippe De Muyter phdm@macqel.be):
        - Make 'unblock interface after Tx underrun' work
 
+       Version LK1.11 (Pedro Alejandro Lopez-Valencia palopezv at gmail.com):
+       - Add support for IC Plus Corporation IP100A chipset
 */
 
 #define DRV_NAME       "sundance"
-#define DRV_VERSION    "1.01+LK1.10"
-#define DRV_RELDATE    "28-Oct-2005"
+#define DRV_VERSION    "1.01+LK1.11"
+#define DRV_RELDATE    "14-Jun-2006"
 
 
 /* The user-configurable values.
 static int debug = 1;                  /* 1 normal messages, 0 quiet .. 7 verbose. */
 /* Maximum number of multicast addresses to filter (vs. rx-all-multicast).
    Typical is a 64 element hash table based on the Ethernet CRC.  */
-static int multicast_filter_limit = 32;
+static const int multicast_filter_limit = 32;
 
 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
    Setting to > 1518 effectively disables this feature.
@@ -287,6 +289,7 @@ static struct pci_device_id sundance_pci_tbl[] = {
        {0x1186, 0x1002, 0x1186, 0x1040, 0, 0, 3},
        {0x1186, 0x1002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4},
        {0x13F0, 0x0201, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 5},
+       {0x13F0, 0x0200, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 6},
        {0,}
 };
 MODULE_DEVICE_TABLE(pci, sundance_pci_tbl);
@@ -298,13 +301,14 @@ enum {
 struct pci_id_info {
         const char *name;
 };
-static struct pci_id_info pci_id_tbl[] = {
+static const struct pci_id_info pci_id_tbl[] = {
        {"D-Link DFE-550TX FAST Ethernet Adapter"},
        {"D-Link DFE-550FX 100Mbps Fiber-optics Adapter"},
        {"D-Link DFE-580TX 4 port Server Adapter"},
        {"D-Link DFE-530TXS FAST Ethernet Adapter"},
        {"D-Link DL10050-based FAST Ethernet Adapter"},
        {"Sundance Technology Alta"},
+       {"IC Plus Corporation IP100A FAST Ethernet Adapter"},
        {NULL,},                        /* 0 terminated list. */
 };
 
@@ -633,9 +637,13 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
 
        np->phys[0] = 1;                /* Default setting */
        np->mii_preamble_required++;
+       /*
+        * It seems some phys doesn't deal well with address 0 being accessed
+        * first, so leave address zero to the end of the loop (32 & 31).
+        */
        for (phy = 1; phy <= 32 && phy_idx < MII_CNT; phy++) {
-               int mii_status = mdio_read(dev, phy, MII_BMSR);
                int phyx = phy & 0x1f;
+               int mii_status = mdio_read(dev, phyx, MII_BMSR);
                if (mii_status != 0xffff  &&  mii_status != 0x0000) {
                        np->phys[phy_idx++] = phyx;
                        np->mii_if.advertising = mdio_read(dev, phyx, MII_ADVERTISE);