aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/x25_asy.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/wan/x25_asy.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/wan/x25_asy.c')
-rw-r--r--drivers/net/wan/x25_asy.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 27945049c9e1..80d5c5834a0b 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -33,6 +33,8 @@
33#include <linux/lapb.h> 33#include <linux/lapb.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/rtnetlink.h> 35#include <linux/rtnetlink.h>
36#include <linux/compat.h>
37#include <linux/slab.h>
36#include "x25_asy.h" 38#include "x25_asy.h"
37 39
38#include <net/x25device.h> 40#include <net/x25device.h>
@@ -656,8 +658,8 @@ static void x25_asy_unesc(struct x25_asy *sl, unsigned char s)
656 658
657 switch (s) { 659 switch (s) {
658 case X25_END: 660 case X25_END:
659 if (!test_and_clear_bit(SLF_ERROR, &sl->flags) 661 if (!test_and_clear_bit(SLF_ERROR, &sl->flags) &&
660 && sl->rcount > 2) 662 sl->rcount > 2)
661 x25_asy_bump(sl); 663 x25_asy_bump(sl);
662 clear_bit(SLF_ESCAPE, &sl->flags); 664 clear_bit(SLF_ESCAPE, &sl->flags);
663 sl->rcount = 0; 665 sl->rcount = 0;
@@ -705,6 +707,21 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
705 } 707 }
706} 708}
707 709
710#ifdef CONFIG_COMPAT
711static long x25_asy_compat_ioctl(struct tty_struct *tty, struct file *file,
712 unsigned int cmd, unsigned long arg)
713{
714 switch (cmd) {
715 case SIOCGIFNAME:
716 case SIOCSIFHWADDR:
717 return x25_asy_ioctl(tty, file, cmd,
718 (unsigned long)compat_ptr(arg));
719 }
720
721 return -ENOIOCTLCMD;
722}
723#endif
724
708static int x25_asy_open_dev(struct net_device *dev) 725static int x25_asy_open_dev(struct net_device *dev)
709{ 726{
710 struct x25_asy *sl = netdev_priv(dev); 727 struct x25_asy *sl = netdev_priv(dev);
@@ -754,6 +771,9 @@ static struct tty_ldisc_ops x25_ldisc = {
754 .open = x25_asy_open_tty, 771 .open = x25_asy_open_tty,
755 .close = x25_asy_close_tty, 772 .close = x25_asy_close_tty,
756 .ioctl = x25_asy_ioctl, 773 .ioctl = x25_asy_ioctl,
774#ifdef CONFIG_COMPAT
775 .compat_ioctl = x25_asy_compat_ioctl,
776#endif
757 .receive_buf = x25_asy_receive_buf, 777 .receive_buf = x25_asy_receive_buf,
758 .write_wakeup = x25_asy_write_wakeup, 778 .write_wakeup = x25_asy_write_wakeup,
759}; 779};