drivers/video/msm: update to new kernel
[safe/jmp/linux-2.6] / drivers / net / starfire.c
index 57fb1f7..a36e2b5 100644 (file)
@@ -178,9 +178,9 @@ static int full_duplex[MAX_UNITS] = {0, };
 #define FIRMWARE_TX    "adaptec/starfire_tx.bin"
 
 /* These identify the driver base version and may not be removed. */
-static char version[] =
+static const char version[] __devinitconst =
 KERN_INFO "starfire.c:v1.03 7/26/2000  Written by Donald Becker <becker@scyld.com>\n"
-KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
+" (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
 
 MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
 MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver");
@@ -595,7 +595,7 @@ static int  netdev_open(struct net_device *dev);
 static void    check_duplex(struct net_device *dev);
 static void    tx_timeout(struct net_device *dev);
 static void    init_ring(struct net_device *dev);
-static int     start_tx(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev);
 static irqreturn_t intr_handler(int irq, void *dev_instance);
 static void    netdev_error(struct net_device *dev, int intr_status);
 static int     __netdev_rx(struct net_device *dev, int *quota);
@@ -648,6 +648,24 @@ static void netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 #endif /* VLAN_SUPPORT */
 
 
+static const struct net_device_ops netdev_ops = {
+       .ndo_open               = netdev_open,
+       .ndo_stop               = netdev_close,
+       .ndo_start_xmit         = start_tx,
+       .ndo_tx_timeout         = tx_timeout,
+       .ndo_get_stats          = get_stats,
+       .ndo_set_multicast_list = &set_rx_mode,
+       .ndo_do_ioctl           = netdev_ioctl,
+       .ndo_change_mtu         = eth_change_mtu,
+       .ndo_set_mac_address    = eth_mac_addr,
+       .ndo_validate_addr      = eth_validate_addr,
+#ifdef VLAN_SUPPORT
+       .ndo_vlan_rx_register   = netdev_vlan_rx_register,
+       .ndo_vlan_rx_add_vid    = netdev_vlan_rx_add_vid,
+       .ndo_vlan_rx_kill_vid   = netdev_vlan_rx_kill_vid,
+#endif
+};
+
 static int __devinit starfire_init_one(struct pci_dev *pdev,
                                       const struct pci_device_id *ent)
 {
@@ -710,11 +728,9 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
        if (enable_hw_cksum)
                dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
 #endif /* ZEROCOPY */
+
 #ifdef VLAN_SUPPORT
        dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
-       dev->vlan_rx_register = netdev_vlan_rx_register;
-       dev->vlan_rx_add_vid = netdev_vlan_rx_add_vid;
-       dev->vlan_rx_kill_vid = netdev_vlan_rx_kill_vid;
 #endif /* VLAN_RX_KILL_VID */
 #ifdef ADDR_64BITS
        dev->features |= NETIF_F_HIGHDMA;
@@ -810,18 +826,12 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
                }
        }
 
-       /* The chip-specific entries in the device structure. */
-       dev->open = &netdev_open;
-       dev->hard_start_xmit = &start_tx;
-       dev->tx_timeout = tx_timeout;
+       dev->netdev_ops = &netdev_ops;
        dev->watchdog_timeo = TX_TIMEOUT;
-       netif_napi_add(dev, &np->napi, netdev_poll, max_interrupt_work);
-       dev->stop = &netdev_close;
-       dev->get_stats = &get_stats;
-       dev->set_multicast_list = &set_rx_mode;
-       dev->do_ioctl = &netdev_ioctl;
        SET_ETHTOOL_OPS(dev, &ethtool_ops);
 
+       netif_napi_add(dev, &np->napi, netdev_poll, max_interrupt_work);
+
        if (mtu)
                dev->mtu = mtu;
 
@@ -1213,7 +1223,7 @@ static void init_ring(struct net_device *dev)
 }
 
 
-static int start_tx(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t start_tx(struct sk_buff *skb, struct net_device *dev)
 {
        struct netdev_private *np = netdev_priv(dev);
        unsigned int entry;
@@ -1226,7 +1236,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
         */
        if ((np->cur_tx - np->dirty_tx) + skb_num_frags(skb) * 2 > TX_RING_SIZE) {
                netif_stop_queue(dev);
-               return 1;
+               return NETDEV_TX_BUSY;
        }
 
 #if defined(ZEROCOPY) && defined(HAS_BROKEN_FIRMWARE)
@@ -1301,7 +1311,7 @@ static int start_tx(struct sk_buff *skb, struct net_device *dev)
 
        dev->trans_start = jiffies;
 
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 
@@ -1332,8 +1342,8 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
                if (intr_status & (IntrRxDone | IntrRxEmpty)) {
                        u32 enable;
 
-                       if (likely(netif_rx_schedule_prep(&np->napi))) {
-                               __netif_rx_schedule(&np->napi);
+                       if (likely(napi_schedule_prep(&np->napi))) {
+                               __napi_schedule(&np->napi);
                                enable = readl(ioaddr + IntrEnable);
                                enable &= ~(IntrRxDone | IntrRxEmpty);
                                writel(enable, ioaddr + IntrEnable);
@@ -1577,7 +1587,7 @@ static int netdev_poll(struct napi_struct *napi, int budget)
                intr_status = readl(ioaddr + IntrStatus);
        } while (intr_status & (IntrRxDone | IntrRxEmpty));
 
-       netif_rx_complete(napi);
+       napi_complete(napi);
        intr_status = readl(ioaddr + IntrEnable);
        intr_status |= IntrRxDone | IntrRxEmpty;
        writel(intr_status, ioaddr + IntrEnable);