Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-mmc
[powerpc.git] / drivers / isdn / gigaset / isocdata.c
index 0b7e5b6..8667daa 100644 (file)
@@ -532,7 +532,7 @@ static inline void hdlc_putbyte(unsigned char c, struct bc_state *bcs)
                bcs->skb = NULL;
                return;
        }
-       *gigaset_skb_put_quick(bcs->skb, 1) = c;
+       *__skb_put(bcs->skb, 1) = c;
 }
 
 /* hdlc_flush
@@ -957,11 +957,11 @@ void gigaset_isoc_input(struct inbuf_t *inbuf)
 
                if (atomic_read(&cs->mstate) == MS_LOCKED) {
                        gigaset_dbg_buffer(DEBUG_LOCKCMD, "received response",
-                                          numbytes, src, 0);
+                                          numbytes, src);
                        gigaset_if_receive(inbuf->cs, src, numbytes);
                } else {
                        gigaset_dbg_buffer(DEBUG_CMD, "received response",
-                                          numbytes, src, 0);
+                                          numbytes, src);
                        cmd_loop(src, numbytes, inbuf);
                }
 
@@ -990,6 +990,13 @@ void gigaset_isoc_input(struct inbuf_t *inbuf)
 int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb)
 {
        int len = skb->len;
+       unsigned long flags;
+
+       spin_lock_irqsave(&bcs->cs->lock, flags);
+       if (!bcs->cs->connected) {
+               spin_unlock_irqrestore(&bcs->cs->lock, flags);
+               return -ENODEV;
+       }
 
        skb_queue_tail(&bcs->squeue, skb);
        gig_dbg(DEBUG_ISO, "%s: skb queued, qlen=%d",
@@ -997,6 +1004,7 @@ int gigaset_isoc_send_skb(struct bc_state *bcs, struct sk_buff *skb)
 
        /* tasklet submits URB if necessary */
        tasklet_schedule(&bcs->hw.bas->sent_tasklet);
+       spin_unlock_irqrestore(&bcs->cs->lock, flags);
 
        return len;     /* ok so far */
 }