]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/isdn/hysdn/hysdn_sched.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
[linux-2.6-omap-h63xx.git] / drivers / isdn / hysdn / hysdn_sched.c
index 1fadf0133e9b6355e4e994b03e6f795d955bc130..81db4a190d410360e9544bb752bef801515898ad 100644 (file)
@@ -11,7 +11,6 @@
  *
  */
 
-#include <linux/sched.h>
 #include <linux/signal.h>
 #include <linux/kernel.h>
 #include <linux/ioport.h>
@@ -114,7 +113,8 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf,
            (skb = hysdn_tx_netget(card)) != NULL) 
        {
                if (skb->len <= maxlen) {
-                       memcpy(buf, skb->data, skb->len);       /* copy the packet to the buffer */
+                       /* copy the packet to the buffer */
+                       skb_copy_from_linear_data(skb, buf, skb->len);
                        *len = skb->len;
                        *chan = CHAN_NDIS_DATA;
                        card->net_tx_busy = 1;  /* we are busy sending network data */
@@ -127,7 +127,7 @@ hysdn_sched_tx(hysdn_card *card, unsigned char *buf,
            ((skb = hycapi_tx_capiget(card)) != NULL) )
        {
                if (skb->len <= maxlen) {
-                       memcpy(buf, skb->data, skb->len);
+                       skb_copy_from_linear_data(skb, buf, skb->len);
                        *len = skb->len;
                        *chan = CHAN_CAPI;
                        hycapi_tx_capiack(card);
@@ -155,21 +155,17 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg chan=%d len=%d", chan, strlen(line) + 1);
 
-       spin_lock_irqsave(&card->hysdn_lock, flags);
        while (card->async_busy) {
-               sti();
 
                if (card->debug_flags & LOG_SCHED_ASYN)
                        hysdn_addlog(card, "async tx-cfg delayed");
 
                msleep_interruptible(20);               /* Timeout 20ms */
-               if (!--cnt) {
-                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
+               if (!--cnt)
                        return (-ERR_ASYNC_TIME);       /* timed out */
-               }
-               cli();
        }                       /* wait for buffer to become free */
 
+       spin_lock_irqsave(&card->hysdn_lock, flags);
        strcpy(card->async_data, line);
        card->async_len = strlen(line) + 1;
        card->async_channel = chan;
@@ -177,30 +173,23 @@ hysdn_tx_cfgline(hysdn_card *card, unsigned char *line, unsigned short chan)
 
        /* now queue the task */
        schedule_work(&card->irq_queue);
-       sti();
+       spin_unlock_irqrestore(&card->hysdn_lock, flags);
 
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg data queued");
 
        cnt++;                  /* short delay */
-       cli();
 
        while (card->async_busy) {
-               sti();
 
                if (card->debug_flags & LOG_SCHED_ASYN)
                        hysdn_addlog(card, "async tx-cfg waiting for tx-ready");
 
                msleep_interruptible(20);               /* Timeout 20ms */
-               if (!--cnt) {
-                       spin_unlock_irqrestore(&card->hysdn_lock, flags);
+               if (!--cnt)
                        return (-ERR_ASYNC_TIME);       /* timed out */
-               }
-               cli();
        }                       /* wait for buffer to become free again */
 
-       spin_unlock_irqrestore(&card->hysdn_lock, flags);
-
        if (card->debug_flags & LOG_SCHED_ASYN)
                hysdn_addlog(card, "async tx-cfg data send");