]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/skge.c
Merge branch 'linux-2.6'
[linux-2.6-omap-h63xx.git] / drivers / net / skge.c
index 5513907e8393d4188dd727aeea1f484d7598bd92..45283f3f95e4a345e4c769d2181432c0deba0082 100644 (file)
@@ -60,7 +60,7 @@
 #define LINK_HZ                        (HZ/2)
 
 MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver");
-MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>");
+MODULE_AUTHOR("Stephen Hemminger <shemminger@linux-foundation.org>");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
 
@@ -749,7 +749,7 @@ static int skge_ring_alloc(struct skge_ring *ring, void *vaddr, u32 base)
        struct skge_element *e;
        int i;
 
-       ring->start = kcalloc(sizeof(*e), ring->count, GFP_KERNEL);
+       ring->start = kcalloc(ring->count, sizeof(*e), GFP_KERNEL);
        if (!ring->start)
                return -ENOMEM;
 
@@ -1327,10 +1327,11 @@ static void xm_check_link(struct net_device *dev)
  * Since internal PHY is wired to a level triggered pin, can't
  * get an interrupt when carrier is detected.
  */
-static void xm_link_timer(void *arg)
+static void xm_link_timer(struct work_struct *work)
 {
-       struct net_device *dev = arg;
-       struct skge_port *skge = netdev_priv(arg);
+       struct skge_port *skge =
+               container_of(work, struct skge_port, link_thread.work);
+       struct net_device *dev = skge->netdev;
        struct skge_hw *hw = skge->hw;
        int port = skge->port;
 
@@ -2919,6 +2920,7 @@ static int skge_poll(struct net_device *dev, int *budget)
        struct skge_hw *hw = skge->hw;
        struct skge_ring *ring = &skge->rx_ring;
        struct skge_element *e;
+       unsigned long flags;
        int to_do = min(dev->quota, *budget);
        int work_done = 0;
 
@@ -2956,12 +2958,12 @@ static int skge_poll(struct net_device *dev, int *budget)
        if (work_done >=  to_do)
                return 1; /* not done */
 
-       spin_lock_irq(&hw->hw_lock);
+       spin_lock_irqsave(&hw->hw_lock, flags);
        __netif_rx_complete(dev);
        hw->intr_mask |= irqmask[skge->port];
        skge_write32(hw, B0_IMSK, hw->intr_mask);
        skge_read32(hw, B0_IMSK);
-       spin_unlock_irq(&hw->hw_lock);
+       spin_unlock_irqrestore(&hw->hw_lock, flags);
 
        return 0;
 }
@@ -3072,9 +3074,9 @@ static void skge_error_irq(struct skge_hw *hw)
  * because accessing phy registers requires spin wait which might
  * cause excess interrupt latency.
  */
-static void skge_extirq(void *arg)
+static void skge_extirq(struct work_struct *work)
 {
-       struct skge_hw *hw = arg;
+       struct skge_hw *hw = container_of(work, struct skge_hw, phy_work);
        int port;
 
        mutex_lock(&hw->phy_mutex);
@@ -3456,7 +3458,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
        skge->port = port;
 
        /* Only used for Genesis XMAC */
-       INIT_WORK(&skge->link_thread, xm_link_timer, dev);
+       INIT_DELAYED_WORK(&skge->link_thread, xm_link_timer);
 
        if (hw->chip_id != CHIP_ID_GENESIS) {
                dev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
@@ -3543,7 +3545,7 @@ static int __devinit skge_probe(struct pci_dev *pdev,
 
        hw->pdev = pdev;
        mutex_init(&hw->phy_mutex);
-       INIT_WORK(&hw->phy_work, skge_extirq, hw);
+       INIT_WORK(&hw->phy_work, skge_extirq);
        spin_lock_init(&hw->hw_lock);
 
        hw->regs = ioremap_nocache(pci_resource_start(pdev, 0), 0x4000);