wl1251: rename reg.h to wl1251_reg.h
[safe/jmp/linux-2.6] / drivers / net / ns83820.c
index 46b0772..1576ac0 100644 (file)
@@ -409,7 +409,7 @@ static int lnksts = 0;              /* CFG_LNKSTS bit polarity */
 struct rx_info {
        spinlock_t      lock;
        int             up;
-       long            idle;
+       unsigned long   idle;
 
        struct sk_buff  *skbs[NR_RX_DESC];
 
@@ -822,8 +822,7 @@ static void ns83820_cleanup_rx(struct ns83820 *dev)
                struct sk_buff *skb = dev->rx_info.skbs[i];
                dev->rx_info.skbs[i] = NULL;
                clear_rx_desc(dev, i);
-               if (skb)
-                       kfree_skb(skb);
+               kfree_skb(skb);
        }
 }
 
@@ -1098,7 +1097,7 @@ again:
        if (unlikely(dev->CFG_cache & CFG_LNKSTS)) {
                netif_stop_queue(ndev);
                if (unlikely(dev->CFG_cache & CFG_LNKSTS))
-                       return 1;
+                       return NETDEV_TX_BUSY;
                netif_start_queue(ndev);
        }
 
@@ -1116,7 +1115,7 @@ again:
                        netif_start_queue(ndev);
                        goto again;
                }
-               return 1;
+               return NETDEV_TX_BUSY;
        }
 
        if (free_idx == dev->tx_intr_idx) {
@@ -1205,9 +1204,7 @@ again:
        if (stopped && (dev->tx_done_idx != tx_done_idx) && start_tx_okay(dev))
                netif_start_queue(ndev);
 
-       /* set the transmit start time to catch transmit timeouts */
-       ndev->trans_start = jiffies;
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 static void ns83820_update_stats(struct ns83820 *dev)
@@ -1627,7 +1624,7 @@ static void ns83820_tx_watch(unsigned long data)
                );
 #endif
 
-       if (time_after(jiffies, ndev->trans_start + 1*HZ) &&
+       if (time_after(jiffies, dev_trans_start(ndev) + 1*HZ) &&
            dev->tx_done_idx != dev->tx_free_idx) {
                printk(KERN_DEBUG "%s: ns83820_tx_watch: %u %u %d\n",
                        ndev->name,
@@ -1956,7 +1953,11 @@ 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_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,
@@ -1970,9 +1971,9 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
 
        /* See if we can set the dma mask early on; failure is fatal. */
        if (sizeof(dma_addr_t) == 8 &&
-               !pci_set_dma_mask(pci_dev, DMA_64BIT_MASK)) {
+               !pci_set_dma_mask(pci_dev, DMA_BIT_MASK(64))) {
                using_dac = 1;
-       } else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
+       } else if (!pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32))) {
                using_dac = 0;
        } else {
                dev_warn(&pci_dev->dev, "pci_set_dma_mask failed!\n");
@@ -2216,7 +2217,6 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev,
 #ifdef NS83820_VLAN_ACCEL_SUPPORT
        /* We also support hardware vlan acceleration */
        ndev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
-       ndev->vlan_rx_register = ns83820_vlan_rx_register;
 #endif
 
        if (using_dac) {