]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/dl2k.c
pasemi_mac: implement sg support
[linux-2.6-omap-h63xx.git] / drivers / net / dl2k.c
index a4ace071f1cb5f1794b13d8b49b150d9ca11dbc2..e91b7096838a2352a862c9d993ca90b6ddf9e711 100644 (file)
@@ -10,9 +10,9 @@
     (at your option) any later version.
 */
 
-#define DRV_NAME       "D-Link DL2000-based linux driver"
-#define DRV_VERSION    "v1.18"
-#define DRV_RELDATE    "2006/06/27"
+#define DRV_NAME       "DL2000/TC902x-based linux driver"
+#define DRV_VERSION    "v1.19"
+#define DRV_RELDATE    "2007/08/12"
 #include "dl2k.h"
 #include <linux/dma-mapping.h>
 
@@ -97,6 +97,7 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
        static int version_printed;
        void *ring_space;
        dma_addr_t ring_dma;
+       DECLARE_MAC_BUF(mac);
 
        if (!version_printed++)
                printk ("%s", version);
@@ -116,7 +117,6 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
                err = -ENOMEM;
                goto err_out_res;
        }
-       SET_MODULE_OWNER (dev);
        SET_NETDEV_DEV(dev, &pdev->dev);
 
 #ifdef MEM_MAPPING
@@ -250,7 +250,6 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
                        np->an_enable = 1;
                mii_set_media (dev);
        }
-       pci_read_config_byte(pdev, PCI_REVISION_ID, &np->pci_rev_id);
 
        err = register_netdev (dev);
        if (err)
@@ -258,10 +257,8 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
 
        card_idx++;
 
-       printk (KERN_INFO "%s: %s, %02x:%02x:%02x:%02x:%02x:%02x, IRQ %d\n",
-               dev->name, np->name,
-               dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
-               dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5], irq);
+       printk (KERN_INFO "%s: %s, %s, IRQ %d\n",
+               dev->name, np->name, print_mac(mac, dev->dev_addr), irq);
        if (tx_coalesce > 1)
                printk(KERN_INFO "tx_coalesce:\t%d packets\n",
                                tx_coalesce);
@@ -340,17 +337,24 @@ parse_eeprom (struct net_device *dev)
 #ifdef MEM_MAPPING
        ioaddr = dev->base_addr;
 #endif
-       /* Check CRC */
-       crc = ~ether_crc_le (256 - 4, sromdata);
-       if (psrom->crc != crc) {
-               printk (KERN_ERR "%s: EEPROM data CRC error.\n", dev->name);
-               return -1;
+       if (np->pdev->vendor == PCI_VENDOR_ID_DLINK) {  /* D-Link Only */
+               /* Check CRC */
+               crc = ~ether_crc_le (256 - 4, sromdata);
+               if (psrom->crc != crc) {
+                       printk (KERN_ERR "%s: EEPROM data CRC error.\n",
+                                       dev->name);
+                       return -1;
+               }
        }
 
        /* Set MAC address */
        for (i = 0; i < 6; i++)
                dev->dev_addr[i] = psrom->mac_addr[i];
 
+       if (np->pdev->vendor != PCI_VENDOR_ID_DLINK) {
+               return 0;
+       }
+
        /* Parse Software Information Block */
        i = 0x30;
        psib = (u8 *) sromdata;
@@ -879,7 +883,7 @@ receive_packet (struct net_device *dev)
                        skb->protocol = eth_type_trans (skb, dev);
 #if 0
                        /* Checksum done by hw, but csum value unavailable. */
-                       if (np->pci_rev_id >= 0x0c &&
+                       if (np->pdev->pci_rev_id >= 0x0c &&
                                !(frame_status & (TCPError | UDPError | IPError))) {
                                skb->ip_summed = CHECKSUM_UNNECESSARY;
                        }