ramoops: move dump_oops into platform data
[linux-2.6.git] / drivers / net / ns83820.c
index 84134c7..e736aec 100644 (file)
 #include <linux/delay.h>
 #include <linux/workqueue.h>
 #include <linux/init.h>
+#include <linux/interrupt.h>
 #include <linux/ip.h>  /* for iph */
 #include <linux/in.h>  /* for IPPROTO_... */
 #include <linux/compiler.h>
@@ -429,10 +430,6 @@ struct ns83820 {
        struct pci_dev          *pci_dev;
        struct net_device       *ndev;
 
-#ifdef NS83820_VLAN_ACCEL_SUPPORT
-       struct vlan_group       *vlgrp;
-#endif
-
        struct rx_info          rx_info;
        struct tasklet_struct   rx_tasklet;
 
@@ -493,26 +490,10 @@ static inline void kick_rx(struct net_device *ndev)
 #define start_tx_okay(dev)     \
        (((NR_TX_DESC-2 + dev->tx_done_idx - dev->tx_free_idx) % NR_TX_DESC) > MIN_TX_DESC_FREE)
 
-
-#ifdef NS83820_VLAN_ACCEL_SUPPORT
-static void ns83820_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp)
-{
-       struct ns83820 *dev = PRIV(ndev);
-
-       spin_lock_irq(&dev->misc_lock);
-       spin_lock(&dev->tx_lock);
-
-       dev->vlgrp = grp;
-
-       spin_unlock(&dev->tx_lock);
-       spin_unlock_irq(&dev->misc_lock);
-}
-#endif
-
 /* Packet Receiver
  *
  * The hardware supports linked lists of receive descriptors for
- * which ownership is transfered back and forth by means of an
+ * which ownership is transferred back and forth by means of an
  * ownership bit.  While the hardware does support the use of a
  * ring for receive descriptors, we only make use of a chain in
  * an attempt to reduce bus traffic under heavy load scenarios.
@@ -929,14 +910,12 @@ static void rx_irq(struct net_device *ndev)
 #ifdef NS83820_VLAN_ACCEL_SUPPORT
                        if(extsts & EXTSTS_VPKT) {
                                unsigned short tag;
+
                                tag = ntohs(extsts & EXTSTS_VTG_MASK);
-                               rx_rc = vlan_hwaccel_rx(skb,dev->vlgrp,tag);
-                       } else {
-                               rx_rc = netif_rx(skb);
+                               __vlan_hwaccel_put_tag(skb, tag);
                        }
-#else
-                       rx_rc = netif_rx(skb);
 #endif
+                       rx_rc = netif_rx(skb);
                        if (NET_RX_DROP == rx_rc) {
 netdev_mangle_me_harder_failed:
                                ndev->stats.rx_dropped++;
@@ -1147,7 +1126,7 @@ again:
 #ifdef NS83820_VLAN_ACCEL_SUPPORT
        if(vlan_tx_tag_present(skb)) {
                /* fetch the vlan tag info out of the
-                * ancilliary data if the vlan code
+                * ancillary data if the vlan code
                 * is using hw vlan acceleration
                 */
                short tag = vlan_tx_tag_get(skb);
@@ -1251,7 +1230,7 @@ static int ns83820_get_settings(struct net_device *ndev,
        /*
         * Here's the list of available ethtool commands from other drivers:
         *      cmd->advertising =
-        *      cmd->speed =
+        *      ethtool_cmd_speed_set(cmd, ...)
         *      cmd->duplex =
         *      cmd->port = 0;
         *      cmd->phy_address =
@@ -1289,13 +1268,13 @@ static int ns83820_get_settings(struct net_device *ndev,
        cmd->duplex = fullduplex ? DUPLEX_FULL : DUPLEX_HALF;
        switch (cfg / CFG_SPDSTS0 & 3) {
        case 2:
-               cmd->speed = SPEED_1000;
+               ethtool_cmd_speed_set(cmd, SPEED_1000);
                break;
        case 1:
-               cmd->speed = SPEED_100;
+               ethtool_cmd_speed_set(cmd, SPEED_100);
                break;
        default:
-               cmd->speed = SPEED_10;
+               ethtool_cmd_speed_set(cmd, SPEED_10);
                break;
        }
        cmd->autoneg = (tbicr & TBICR_MR_AN_ENABLE)
@@ -1960,11 +1939,8 @@ static const struct net_device_ops netdev_ops = {
        .ndo_change_mtu         = ns83820_change_mtu,
        .ndo_set_multicast_list = ns83820_set_multicast,
        .ndo_validate_addr      = eth_validate_addr,
-       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_set_mac_address    = eth_mac_addr,
        .ndo_tx_timeout         = ns83820_tx_timeout,
-#ifdef NS83820_VLAN_ACCEL_SUPPORT
-       .ndo_vlan_rx_register   = ns83820_vlan_rx_register,
-#endif
 };
 
 static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
@@ -1988,12 +1964,11 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
        }
 
        ndev = alloc_etherdev(sizeof(struct ns83820));
-       dev = PRIV(ndev);
-
        err = -ENOMEM;
-       if (!dev)
+       if (!ndev)
                goto out;
 
+       dev = PRIV(ndev);
        dev->ndev = ndev;
 
        spin_lock_init(&dev->rx_info.lock);