]> Pileus Git - ~andy/linux/blobdiff - drivers/net/ethernet/adaptec/starfire.c
Merge tag 'dlm-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm
[~andy/linux] / drivers / net / ethernet / adaptec / starfire.c
index 6d9f6911000ffad9d2b8a299c6ae5fd82ebfcfe6..d896816512ca952f943b9bbe04e27686a0bab7fd 100644 (file)
@@ -607,7 +607,7 @@ static const struct ethtool_ops ethtool_ops;
 
 
 #ifdef VLAN_SUPPORT
-static void netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
+static int netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
 {
        struct netdev_private *np = netdev_priv(dev);
 
@@ -617,9 +617,11 @@ static void netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
        set_bit(vid, np->active_vlans);
        set_rx_mode(dev);
        spin_unlock(&np->lock);
+
+       return 0;
 }
 
-static void netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
+static int netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 {
        struct netdev_private *np = netdev_priv(dev);
 
@@ -629,6 +631,8 @@ static void netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
        clear_bit(vid, np->active_vlans);
        set_rx_mode(dev);
        spin_unlock(&np->lock);
+
+       return 0;
 }
 #endif /* VLAN_SUPPORT */
 
@@ -682,10 +686,9 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
        }
 
        dev = alloc_etherdev(sizeof(*np));
-       if (!dev) {
-               printk(KERN_ERR DRV_NAME " %d: cannot alloc etherdev, aborting\n", card_idx);
+       if (!dev)
                return -ENOMEM;
-       }
+
        SET_NETDEV_DEV(dev, &pdev->dev);
 
        irq = pdev->irq;
@@ -1176,12 +1179,11 @@ static void init_ring(struct net_device *dev)
 
        /* Fill in the Rx buffers.  Handle allocation failure gracefully. */
        for (i = 0; i < RX_RING_SIZE; i++) {
-               struct sk_buff *skb = dev_alloc_skb(np->rx_buf_sz);
+               struct sk_buff *skb = netdev_alloc_skb(dev, np->rx_buf_sz);
                np->rx_info[i].skb = skb;
                if (skb == NULL)
                        break;
                np->rx_info[i].mapping = pci_map_single(np->pci_dev, skb->data, np->rx_buf_sz, PCI_DMA_FROMDEVICE);
-               skb->dev = dev;                 /* Mark as being used by this device. */
                /* Grrr, we cannot offset to correctly align the IP header. */
                np->rx_ring[i].rxaddr = cpu_to_dma(np->rx_info[i].mapping | RxDescValid);
        }
@@ -1469,7 +1471,7 @@ static int __netdev_rx(struct net_device *dev, int *quota)
                /* Check if the packet is long enough to accept without copying
                   to a minimally-sized skbuff. */
                if (pkt_len < rx_copybreak &&
-                   (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
+                   (skb = netdev_alloc_skb(dev, pkt_len + 2)) != NULL) {
                        skb_reserve(skb, 2);    /* 16 byte align the IP header */
                        pci_dma_sync_single_for_cpu(np->pci_dev,
                                                    np->rx_info[entry].mapping,
@@ -1593,13 +1595,12 @@ static void refill_rx_ring(struct net_device *dev)
        for (; np->cur_rx - np->dirty_rx > 0; np->dirty_rx++) {
                entry = np->dirty_rx % RX_RING_SIZE;
                if (np->rx_info[entry].skb == NULL) {
-                       skb = dev_alloc_skb(np->rx_buf_sz);
+                       skb = netdev_alloc_skb(dev, np->rx_buf_sz);
                        np->rx_info[entry].skb = skb;
                        if (skb == NULL)
                                break;  /* Better luck next round. */
                        np->rx_info[entry].mapping =
                                pci_map_single(np->pci_dev, skb->data, np->rx_buf_sz, PCI_DMA_FROMDEVICE);
-                       skb->dev = dev; /* Mark as being used by this device. */
                        np->rx_ring[entry].rxaddr =
                                cpu_to_dma(np->rx_info[entry].mapping | RxDescValid);
                }
@@ -1842,9 +1843,9 @@ static int check_if_running(struct net_device *dev)
 static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
        struct netdev_private *np = netdev_priv(dev);
-       strcpy(info->driver, DRV_NAME);
-       strcpy(info->version, DRV_VERSION);
-       strcpy(info->bus_info, pci_name(np->pci_dev));
+       strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
+       strlcpy(info->version, DRV_VERSION, sizeof(info->version));
+       strlcpy(info->bus_info, pci_name(np->pci_dev), sizeof(info->bus_info));
 }
 
 static int get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)