]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/tlan.c
[SK_BUFF]: Introduce skb_copy_from_linear_data{_offset}
[net-next-2.6.git] / drivers / net / tlan.c
index 8d807bf603a036963a7ffcfd9ac8d2cf1b0bbe3c..106dc1ef0acb95c37e3c8d21f2721858239c8585 100644 (file)
@@ -289,13 +289,14 @@ static void       TLan_Eisa_Cleanup( void );
 static int      TLan_Init( struct net_device * );
 static int     TLan_Open( struct net_device *dev );
 static int     TLan_StartTx( struct sk_buff *, struct net_device *);
-static irqreturn_t TLan_HandleInterrupt( int, void *, struct pt_regs *);
+static irqreturn_t TLan_HandleInterrupt( int, void *);
 static int     TLan_Close( struct net_device *);
 static struct  net_device_stats *TLan_GetStats( struct net_device *);
 static void    TLan_SetMulticastList( struct net_device *);
 static int     TLan_ioctl( struct net_device *dev, struct ifreq *rq, int cmd);
 static int      TLan_probe1( struct pci_dev *pdev, long ioaddr, int irq, int rev, const struct pci_device_id *ent);
 static void    TLan_tx_timeout( struct net_device *dev);
+static void    TLan_tx_timeout_work(struct work_struct *work);
 static int     tlan_init_one( struct pci_dev *pdev, const struct pci_device_id *ent);
 
 static u32     TLan_HandleInvalid( struct net_device *, u16 );
@@ -562,6 +563,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
        priv = netdev_priv(dev);
 
        priv->pciDev = pdev;
+       priv->dev = dev;
 
        /* Is this a PCI device? */
        if (pdev) {
@@ -634,7 +636,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
 
        /* This will be used when we get an adapter error from
         * within our irq handler */
-       INIT_WORK(&priv->tlan_tqueue, (void *)(void*)TLan_tx_timeout, dev);
+       INIT_WORK(&priv->tlan_tqueue, TLan_tx_timeout_work);
 
        spin_lock_init(&priv->lock);
 
@@ -824,7 +826,7 @@ static void  __init TLan_EisaProbe (void)
 static void TLan_Poll(struct net_device *dev)
 {
        disable_irq(dev->irq);
-       TLan_HandleInterrupt(dev->irq, dev, NULL);
+       TLan_HandleInterrupt(dev->irq, dev);
        enable_irq(dev->irq);
 }
 #endif
@@ -1040,6 +1042,25 @@ static void TLan_tx_timeout(struct net_device *dev)
 }
 
 
+       /***************************************************************
+        *      TLan_tx_timeout_work
+        *
+        *      Returns: nothing
+        *
+        *      Params:
+        *              work    work item of device which timed out
+        *
+        **************************************************************/
+
+static void TLan_tx_timeout_work(struct work_struct *work)
+{
+       TLanPrivateInfo *priv =
+               container_of(work, TLanPrivateInfo, tlan_tqueue);
+
+       TLan_tx_timeout(priv->dev);
+}
+
+
 
        /***************************************************************
         *      TLan_StartTx
@@ -1091,7 +1112,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
 
        if ( bbuf ) {
                tail_buffer = priv->txBuffer + ( priv->txTail * TLAN_MAX_FRAME_SIZE );
-               memcpy( tail_buffer, skb->data, skb->len );
+               skb_copy_from_linear_data(skb, tail_buffer, skb->len);
        } else {
                tail_list->buffer[0].address = pci_map_single(priv->pciDev, skb->data, skb->len, PCI_DMA_TODEVICE);
                TLan_StoreSKB(tail_list, skb);
@@ -1151,7 +1172,6 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
         *                      occurred.
         *              dev_id  A pointer to the device assigned to
         *                      this irq line.
-        *              regs    ???
         *
         *      This function handles an interrupt generated by its
         *      assigned TLAN adapter.  The function deactivates
@@ -1162,7 +1182,7 @@ static int TLan_StartTx( struct sk_buff *skb, struct net_device *dev )
         *
         **************************************************************/
 
-static irqreturn_t TLan_HandleInterrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t TLan_HandleInterrupt(int irq, void *dev_id)
 {
        u32             ack;
        struct net_device       *dev;
@@ -1557,7 +1577,6 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
                                printk(KERN_INFO "TLAN: Couldn't allocate memory for received data.\n");
                        else {
                                head_buffer = priv->rxBuffer + (priv->rxHead * TLAN_MAX_FRAME_SIZE);
-                               skb->dev = dev;
                                skb_reserve(skb, 2);
                                t = (void *) skb_put(skb, frameSize);
 
@@ -1588,7 +1607,6 @@ u32 TLan_HandleRxEOF( struct net_device *dev, u16 host_int )
                                skb->protocol = eth_type_trans( skb, dev );
                                netif_rx( skb );
 
-                               new_skb->dev = dev;
                                skb_reserve( new_skb, 2 );
                                t = (void *) skb_put( new_skb, TLAN_MAX_FRAME_SIZE );
                                head_list->buffer[0].address = pci_map_single(priv->pciDev, new_skb->data, TLAN_MAX_FRAME_SIZE, PCI_DMA_FROMDEVICE);