Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / drivers / char / pcmcia / synclink_cs.c
index 5833564..d1fceab 100644 (file)
@@ -503,20 +503,9 @@ static void* mgslpc_get_text_ptr(void)
  * The wrappers maintain line discipline references
  * while calling into the line discipline.
  *
- * ldisc_flush_buffer - flush line discipline receive buffers
  * ldisc_receive_buf  - pass receive data to line discipline
  */
 
-static void ldisc_flush_buffer(struct tty_struct *tty)
-{
-       struct tty_ldisc *ld = tty_ldisc_ref(tty);
-       if (ld) {
-               if (ld->flush_buffer)
-                       ld->flush_buffer(tty);
-               tty_ldisc_deref(ld);
-       }
-}
-
 static void ldisc_receive_buf(struct tty_struct *tty,
                              const __u8 *data, char *flags, int count)
 {
@@ -525,8 +514,8 @@ static void ldisc_receive_buf(struct tty_struct *tty,
                return;
        ld = tty_ldisc_ref(tty);
        if (ld) {
-               if (ld->receive_buf)
-                       ld->receive_buf(tty, data, flags, count);
+               if (ld->ops->receive_buf)
+                       ld->ops->receive_buf(tty, data, flags, count);
                tty_ldisc_deref(ld);
        }
 }
@@ -1556,7 +1545,7 @@ static void mgslpc_change_params(MGSLPC_INFO *info)
 
 /* Add a character to the transmit buffer
  */
-static void mgslpc_put_char(struct tty_struct *tty, unsigned char ch)
+static int mgslpc_put_char(struct tty_struct *tty, unsigned char ch)
 {
        MGSLPC_INFO *info = (MGSLPC_INFO *)tty->driver_data;
        unsigned long flags;
@@ -1567,10 +1556,10 @@ static void mgslpc_put_char(struct tty_struct *tty, unsigned char ch)
        }
 
        if (mgslpc_paranoia_check(info, tty->name, "mgslpc_put_char"))
-               return;
+               return 0;
 
        if (!info->tx_buf)
-               return;
+               return 0;
 
        spin_lock_irqsave(&info->lock,flags);
 
@@ -1583,6 +1572,7 @@ static void mgslpc_put_char(struct tty_struct *tty, unsigned char ch)
        }
 
        spin_unlock_irqrestore(&info->lock,flags);
+       return 1;
 }
 
 /* Enable transmitter so remaining characters in the
@@ -2240,7 +2230,7 @@ static int tiocmset(struct tty_struct *tty, struct file *file,
  * Arguments:          tty             pointer to tty instance data
  *                     break_state     -1=set break condition, 0=clear
  */
-static void mgslpc_break(struct tty_struct *tty, int break_state)
+static int mgslpc_break(struct tty_struct *tty, int break_state)
 {
        MGSLPC_INFO * info = (MGSLPC_INFO *)tty->driver_data;
        unsigned long flags;
@@ -2250,7 +2240,7 @@ static void mgslpc_break(struct tty_struct *tty, int break_state)
                         __FILE__,__LINE__, info->device_name, break_state);
 
        if (mgslpc_paranoia_check(info, tty->name, "mgslpc_break"))
-               return;
+               return -EINVAL;
 
        spin_lock_irqsave(&info->lock,flags);
        if (break_state == -1)
@@ -2258,6 +2248,7 @@ static void mgslpc_break(struct tty_struct *tty, int break_state)
        else
                clear_reg_bits(info, CHA+DAFO, BIT6);
        spin_unlock_irqrestore(&info->lock,flags);
+       return 0;
 }
 
 /* Service an IOCTL request
@@ -2467,10 +2458,9 @@ static void mgslpc_close(struct tty_struct *tty, struct file * filp)
        if (info->flags & ASYNC_INITIALIZED)
                mgslpc_wait_until_sent(tty, info->timeout);
 
-       if (tty->driver->flush_buffer)
-               tty->driver->flush_buffer(tty);
+       mgslpc_flush_buffer(tty);
 
-       ldisc_flush_buffer(tty);
+       tty_ldisc_flush(tty);
 
        shutdown(info);
 
@@ -3897,9 +3887,8 @@ static bool rx_get_frame(MGSLPC_INFO *info)
                framesize = 0;
 #if SYNCLINK_GENERIC_HDLC
                {
-                       struct net_device_stats *stats = hdlc_stats(info->netdev);
-                       stats->rx_errors++;
-                       stats->rx_frame_errors++;
+                       info->netdev->stats.rx_errors++;
+                       info->netdev->stats.rx_frame_errors++;
                }
 #endif
        } else
@@ -4155,7 +4144,6 @@ static int hdlcdev_attach(struct net_device *dev, unsigned short encoding,
 static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        MGSLPC_INFO *info = dev_to_port(dev);
-       struct net_device_stats *stats = hdlc_stats(dev);
        unsigned long flags;
 
        if (debug_level >= DEBUG_LEVEL_INFO)
@@ -4170,8 +4158,8 @@ static int hdlcdev_xmit(struct sk_buff *skb, struct net_device *dev)
        info->tx_put = info->tx_count = skb->len;
 
        /* update network statistics */
-       stats->tx_packets++;
-       stats->tx_bytes += skb->len;
+       dev->stats.tx_packets++;
+       dev->stats.tx_bytes += skb->len;
 
        /* done with socket buffer, so free it */
        dev_kfree_skb(skb);
@@ -4387,14 +4375,13 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 static void hdlcdev_tx_timeout(struct net_device *dev)
 {
        MGSLPC_INFO *info = dev_to_port(dev);
-       struct net_device_stats *stats = hdlc_stats(dev);
        unsigned long flags;
 
        if (debug_level >= DEBUG_LEVEL_INFO)
                printk("hdlcdev_tx_timeout(%s)\n",dev->name);
 
-       stats->tx_errors++;
-       stats->tx_aborted_errors++;
+       dev->stats.tx_errors++;
+       dev->stats.tx_aborted_errors++;
 
        spin_lock_irqsave(&info->lock,flags);
        tx_stop(info);
@@ -4427,27 +4414,26 @@ static void hdlcdev_rx(MGSLPC_INFO *info, char *buf, int size)
 {
        struct sk_buff *skb = dev_alloc_skb(size);
        struct net_device *dev = info->netdev;
-       struct net_device_stats *stats = hdlc_stats(dev);
 
        if (debug_level >= DEBUG_LEVEL_INFO)
                printk("hdlcdev_rx(%s)\n",dev->name);
 
        if (skb == NULL) {
                printk(KERN_NOTICE "%s: can't alloc skb, dropping packet\n", dev->name);
-               stats->rx_dropped++;
+               dev->stats.rx_dropped++;
                return;
        }
 
-       memcpy(skb_put(skb, size),buf,size);
+       memcpy(skb_put(skb, size), buf, size);
 
-       skb->protocol = hdlc_type_trans(skb, info->netdev);
+       skb->protocol = hdlc_type_trans(skb, dev);
 
-       stats->rx_packets++;
-       stats->rx_bytes += size;
+       dev->stats.rx_packets++;
+       dev->stats.rx_bytes += size;
 
        netif_rx(skb);
 
-       info->netdev->last_rx = jiffies;
+       dev->last_rx = jiffies;
 }
 
 /**