MAINTAINERS: remove Adam Fritzler, remove his email address in other sources
[linux-2.6.git] / drivers / net / tokenring / tms380tr.c
index 9a543fe..d07c452 100644 (file)
@@ -30,7 +30,7 @@
  *  Maintainer(s):
  *    JS       Jay Schulist            jschlst@samba.org
  *    CG       Christoph Goos          cgoos@syskonnect.de
- *    AF       Adam Fritzler           mid@auk.cx
+ *    AF       Adam Fritzler
  *    MLP       Mike Phillips           phillim@amtrak.com
  *    JF       Jochen Friedrich        jochen@scram.de
  *     
@@ -644,7 +644,7 @@ static int tms380tr_hardware_send_packet(struct sk_buff *skb, struct net_device
                dmabuf  = 0;
                i       = tp->TplFree->TPLIndex;
                buf     = tp->LocalTxBuffers[i];
-               memcpy(buf, skb->data, length);
+               skb_copy_from_linear_data(skb, buf, length);
                newbuf  = ((char *)buf - (char *)tp) + tp->dmabuffer;
        }
        else {
@@ -744,18 +744,13 @@ static void tms380tr_timer_chk(unsigned long data)
 /*
  * The typical workload of the driver: Handle the network interface interrupts.
  */
-irqreturn_t tms380tr_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+irqreturn_t tms380tr_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = dev_id;
        struct net_local *tp;
        unsigned short irq_type;
        int handled = 0;
 
-       if(dev == NULL) {
-               printk(KERN_INFO "%s: irq %d for unknown device.\n", dev->name, irq);
-               return IRQ_NONE;
-       }
-
        tp = netdev_priv(dev);
 
        irq_type = SIFREADW(SIFSTS);
@@ -1243,8 +1238,7 @@ void tms380tr_wait(unsigned long time)
        
        tmp = jiffies + time/(1000000/HZ);
        do {
-               current->state          = TASK_INTERRUPTIBLE;
-               tmp = schedule_timeout(tmp);
+               tmp = schedule_timeout_interruptible(tmp);
        } while(time_after(tmp, jiffies));
 #else
        udelay(time);
@@ -2130,7 +2124,7 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
                /* Get the frame size (Byte swap for Intel).
                 * Do this early (see workaround comment below)
                 */
-               Length = be16_to_cpu((unsigned short)rpl->FrameSize);
+               Length = be16_to_cpu(rpl->FrameSize);
 
                /* Check if the Frame_Start, Frame_End and
                 * Frame_Complete bits are set.
@@ -2146,7 +2140,7 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
                         * Length2 is there because there have also been
                         * cases where the FrameSize was partially written
                         */
-                       Length2 = be16_to_cpu((unsigned short)rpl->FrameSize);
+                       Length2 = be16_to_cpu(rpl->FrameSize);
 
                        if(Length == 0 || Length != Length2)
                        {
@@ -2174,7 +2168,6 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
                                }
                                else
                                {
-                                       skb->dev        = dev;
                                        skb_put(skb, tp->MaxPacketSize);
                                        rpl->SkbStat    = SKB_DATA_COPY;
                                        ReceiveDataPtr  = rpl->MData;
@@ -2185,7 +2178,8 @@ static void tms380tr_rcv_status_irq(struct net_device *dev)
                                || rpl->SkbStat == SKB_DMA_DIRECT))
                        {
                                if(rpl->SkbStat == SKB_DATA_COPY)
-                                       memcpy(skb->data, ReceiveDataPtr, Length);
+                                       skb_copy_to_linear_data(skb, ReceiveDataPtr,
+                                                      Length);
 
                                /* Deliver frame to system */
                                rpl->Skb = NULL;
@@ -2333,19 +2327,22 @@ void tmsdev_term(struct net_device *dev)
                DMA_BIDIRECTIONAL);
 }
 
-int tmsdev_init(struct net_device *dev, unsigned long dmalimit, 
-               struct device *pdev)
+int tmsdev_init(struct net_device *dev, struct device *pdev)
 {
        struct net_local *tms_local;
 
        memset(dev->priv, 0, sizeof(struct net_local));
        tms_local = netdev_priv(dev);
        init_waitqueue_head(&tms_local->wait_for_tok_int);
-       tms_local->dmalimit = dmalimit;
+       if (pdev->dma_mask)
+               tms_local->dmalimit = *pdev->dma_mask;
+       else
+               return -ENOMEM;
        tms_local->pdev = pdev;
        tms_local->dmabuffer = dma_map_single(pdev, (void *)tms_local,
            sizeof(struct net_local), DMA_BIDIRECTIONAL);
-       if (tms_local->dmabuffer + sizeof(struct net_local) > dmalimit)
+       if (tms_local->dmabuffer + sizeof(struct net_local) > 
+                       tms_local->dmalimit)
        {
                printk(KERN_INFO "%s: Memory not accessible for DMA\n",
                        dev->name);