diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/hamradio | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/hamradio')
-rw-r--r-- | drivers/net/hamradio/6pack.c | 22 | ||||
-rw-r--r-- | drivers/net/hamradio/baycom_epp.c | 6 | ||||
-rw-r--r-- | drivers/net/hamradio/baycom_ser_fdx.c | 2 | ||||
-rw-r--r-- | drivers/net/hamradio/bpqether.c | 14 | ||||
-rw-r--r-- | drivers/net/hamradio/dmascc.c | 9 | ||||
-rw-r--r-- | drivers/net/hamradio/hdlcdrv.c | 1 | ||||
-rw-r--r-- | drivers/net/hamradio/mkiss.c | 22 | ||||
-rw-r--r-- | drivers/net/hamradio/scc.c | 1 |
8 files changed, 60 insertions, 17 deletions
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index fb588301a05d..4b52c767ad05 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
25 | #include <linux/netdevice.h> | 25 | #include <linux/netdevice.h> |
26 | #include <linux/timer.h> | 26 | #include <linux/timer.h> |
27 | #include <linux/slab.h> | ||
27 | #include <net/ax25.h> | 28 | #include <net/ax25.h> |
28 | #include <linux/etherdevice.h> | 29 | #include <linux/etherdevice.h> |
29 | #include <linux/skbuff.h> | 30 | #include <linux/skbuff.h> |
@@ -34,6 +35,7 @@ | |||
34 | #include <linux/ip.h> | 35 | #include <linux/ip.h> |
35 | #include <linux/tcp.h> | 36 | #include <linux/tcp.h> |
36 | #include <linux/semaphore.h> | 37 | #include <linux/semaphore.h> |
38 | #include <linux/compat.h> | ||
37 | #include <asm/atomic.h> | 39 | #include <asm/atomic.h> |
38 | 40 | ||
39 | #define SIXPACK_VERSION "Revision: 0.3.0" | 41 | #define SIXPACK_VERSION "Revision: 0.3.0" |
@@ -777,6 +779,23 @@ static int sixpack_ioctl(struct tty_struct *tty, struct file *file, | |||
777 | return err; | 779 | return err; |
778 | } | 780 | } |
779 | 781 | ||
782 | #ifdef CONFIG_COMPAT | ||
783 | static long sixpack_compat_ioctl(struct tty_struct * tty, struct file * file, | ||
784 | unsigned int cmd, unsigned long arg) | ||
785 | { | ||
786 | switch (cmd) { | ||
787 | case SIOCGIFNAME: | ||
788 | case SIOCGIFENCAP: | ||
789 | case SIOCSIFENCAP: | ||
790 | case SIOCSIFHWADDR: | ||
791 | return sixpack_ioctl(tty, file, cmd, | ||
792 | (unsigned long)compat_ptr(arg)); | ||
793 | } | ||
794 | |||
795 | return -ENOIOCTLCMD; | ||
796 | } | ||
797 | #endif | ||
798 | |||
780 | static struct tty_ldisc_ops sp_ldisc = { | 799 | static struct tty_ldisc_ops sp_ldisc = { |
781 | .owner = THIS_MODULE, | 800 | .owner = THIS_MODULE, |
782 | .magic = TTY_LDISC_MAGIC, | 801 | .magic = TTY_LDISC_MAGIC, |
@@ -784,6 +803,9 @@ static struct tty_ldisc_ops sp_ldisc = { | |||
784 | .open = sixpack_open, | 803 | .open = sixpack_open, |
785 | .close = sixpack_close, | 804 | .close = sixpack_close, |
786 | .ioctl = sixpack_ioctl, | 805 | .ioctl = sixpack_ioctl, |
806 | #ifdef CONFIG_COMPAT | ||
807 | .compat_ioctl = sixpack_compat_ioctl, | ||
808 | #endif | ||
787 | .receive_buf = sixpack_receive_buf, | 809 | .receive_buf = sixpack_receive_buf, |
788 | .write_wakeup = sixpack_write_wakeup, | 810 | .write_wakeup = sixpack_write_wakeup, |
789 | }; | 811 | }; |
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index e344c84c0ef9..a3c0dc9d8b98 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c | |||
@@ -596,16 +596,16 @@ static int receive(struct net_device *dev, int cnt) | |||
596 | if (!(notbitstream & (0x1fc << j))) | 596 | if (!(notbitstream & (0x1fc << j))) |
597 | state = 0; | 597 | state = 0; |
598 | 598 | ||
599 | /* not flag received */ | 599 | /* flag received */ |
600 | else if (!(bitstream & (0x1fe << j)) != (0x0fc << j)) { | 600 | else if ((bitstream & (0x1fe << j)) == (0x0fc << j)) { |
601 | if (state) | 601 | if (state) |
602 | do_rxpacket(dev); | 602 | do_rxpacket(dev); |
603 | bc->hdlcrx.bufcnt = 0; | 603 | bc->hdlcrx.bufcnt = 0; |
604 | bc->hdlcrx.bufptr = bc->hdlcrx.buf; | 604 | bc->hdlcrx.bufptr = bc->hdlcrx.buf; |
605 | state = 1; | 605 | state = 1; |
606 | numbits = 7-j; | 606 | numbits = 7-j; |
607 | } | ||
608 | } | 607 | } |
608 | } | ||
609 | 609 | ||
610 | /* stuffed bit */ | 610 | /* stuffed bit */ |
611 | else if (unlikely((bitstream & (0x1f8 << j)) == (0xf8 << j))) { | 611 | else if (unlikely((bitstream & (0x1f8 << j)) == (0xf8 << j))) { |
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c index ed60fd664273..0cab992b3d1a 100644 --- a/drivers/net/hamradio/baycom_ser_fdx.c +++ b/drivers/net/hamradio/baycom_ser_fdx.c | |||
@@ -35,7 +35,7 @@ | |||
35 | * driver only supports standard serial hardware (8250, 16450, 16550A) | 35 | * driver only supports standard serial hardware (8250, 16450, 16550A) |
36 | * | 36 | * |
37 | * This modem usually draws its supply current out of the otherwise unused | 37 | * This modem usually draws its supply current out of the otherwise unused |
38 | * TXD pin of the serial port. Thus a contignuous stream of 0x00-bytes | 38 | * TXD pin of the serial port. Thus a contiguous stream of 0x00-bytes |
39 | * is transmitted to achieve a positive supply voltage. | 39 | * is transmitted to achieve a positive supply voltage. |
40 | * | 40 | * |
41 | * hsk: This is a 4800 baud FSK modem, designed for TNC use. It works fine | 41 | * hsk: This is a 4800 baud FSK modem, designed for TNC use. It works fine |
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c index fe893c91a01b..14f01d156db9 100644 --- a/drivers/net/hamradio/bpqether.c +++ b/drivers/net/hamradio/bpqether.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <linux/kernel.h> | 61 | #include <linux/kernel.h> |
62 | #include <linux/string.h> | 62 | #include <linux/string.h> |
63 | #include <linux/net.h> | 63 | #include <linux/net.h> |
64 | #include <linux/slab.h> | ||
64 | #include <net/ax25.h> | 65 | #include <net/ax25.h> |
65 | #include <linux/inet.h> | 66 | #include <linux/inet.h> |
66 | #include <linux/netdevice.h> | 67 | #include <linux/netdevice.h> |
@@ -167,10 +168,7 @@ static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev) | |||
167 | 168 | ||
168 | static inline int dev_is_ethdev(struct net_device *dev) | 169 | static inline int dev_is_ethdev(struct net_device *dev) |
169 | { | 170 | { |
170 | return ( | 171 | return (dev->type == ARPHRD_ETHER && strncmp(dev->name, "dummy", 5)); |
171 | dev->type == ARPHRD_ETHER | ||
172 | && strncmp(dev->name, "dummy", 5) | ||
173 | ); | ||
174 | } | 172 | } |
175 | 173 | ||
176 | /* ------------------------------------------------------------------------ */ | 174 | /* ------------------------------------------------------------------------ */ |
@@ -186,7 +184,7 @@ static int bpq_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_ty | |||
186 | struct ethhdr *eth; | 184 | struct ethhdr *eth; |
187 | struct bpqdev *bpq; | 185 | struct bpqdev *bpq; |
188 | 186 | ||
189 | if (dev_net(dev) != &init_net) | 187 | if (!net_eq(dev_net(dev), &init_net)) |
190 | goto drop; | 188 | goto drop; |
191 | 189 | ||
192 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) | 190 | if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) |
@@ -251,6 +249,7 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
251 | { | 249 | { |
252 | unsigned char *ptr; | 250 | unsigned char *ptr; |
253 | struct bpqdev *bpq; | 251 | struct bpqdev *bpq; |
252 | struct net_device *orig_dev; | ||
254 | int size; | 253 | int size; |
255 | 254 | ||
256 | /* | 255 | /* |
@@ -285,8 +284,9 @@ static netdev_tx_t bpq_xmit(struct sk_buff *skb, struct net_device *dev) | |||
285 | 284 | ||
286 | bpq = netdev_priv(dev); | 285 | bpq = netdev_priv(dev); |
287 | 286 | ||
287 | orig_dev = dev; | ||
288 | if ((dev = bpq_get_ether_dev(dev)) == NULL) { | 288 | if ((dev = bpq_get_ether_dev(dev)) == NULL) { |
289 | dev->stats.tx_dropped++; | 289 | orig_dev->stats.tx_dropped++; |
290 | kfree_skb(skb); | 290 | kfree_skb(skb); |
291 | return NETDEV_TX_OK; | 291 | return NETDEV_TX_OK; |
292 | } | 292 | } |
@@ -552,7 +552,7 @@ static int bpq_device_event(struct notifier_block *this,unsigned long event, voi | |||
552 | { | 552 | { |
553 | struct net_device *dev = (struct net_device *)ptr; | 553 | struct net_device *dev = (struct net_device *)ptr; |
554 | 554 | ||
555 | if (dev_net(dev) != &init_net) | 555 | if (!net_eq(dev_net(dev), &init_net)) |
556 | return NOTIFY_DONE; | 556 | return NOTIFY_DONE; |
557 | 557 | ||
558 | if (!dev_is_ethdev(dev)) | 558 | if (!dev_is_ethdev(dev)) |
diff --git a/drivers/net/hamradio/dmascc.c b/drivers/net/hamradio/dmascc.c index 950f3bb21f9d..52b14256e2c0 100644 --- a/drivers/net/hamradio/dmascc.c +++ b/drivers/net/hamradio/dmascc.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/kernel.h> | 32 | #include <linux/kernel.h> |
33 | #include <linux/mm.h> | 33 | #include <linux/mm.h> |
34 | #include <linux/netdevice.h> | 34 | #include <linux/netdevice.h> |
35 | #include <linux/slab.h> | ||
35 | #include <linux/rtnetlink.h> | 36 | #include <linux/rtnetlink.h> |
36 | #include <linux/sockios.h> | 37 | #include <linux/sockios.h> |
37 | #include <linux/workqueue.h> | 38 | #include <linux/workqueue.h> |
@@ -331,8 +332,8 @@ static int __init dmascc_init(void) | |||
331 | for (i = 0; i < MAX_NUM_DEVS && io[i]; i++) { | 332 | for (i = 0; i < MAX_NUM_DEVS && io[i]; i++) { |
332 | j = (io[i] - | 333 | j = (io[i] - |
333 | hw[h].io_region) / hw[h].io_delta; | 334 | hw[h].io_region) / hw[h].io_delta; |
334 | if (j >= 0 && j < hw[h].num_devs | 335 | if (j >= 0 && j < hw[h].num_devs && |
335 | && hw[h].io_region + | 336 | hw[h].io_region + |
336 | j * hw[h].io_delta == io[i]) { | 337 | j * hw[h].io_delta == io[i]) { |
337 | base[j] = io[i]; | 338 | base[j] = io[i]; |
338 | } | 339 | } |
@@ -396,8 +397,8 @@ static int __init dmascc_init(void) | |||
396 | t_val = | 397 | t_val = |
397 | inb(t1[i]) + (inb(t1[i]) << 8); | 398 | inb(t1[i]) + (inb(t1[i]) << 8); |
398 | /* Also check whether counter did wrap */ | 399 | /* Also check whether counter did wrap */ |
399 | if (t_val == 0 | 400 | if (t_val == 0 || |
400 | || t_val > TMR_0_HZ / HZ * 10) | 401 | t_val > TMR_0_HZ / HZ * 10) |
401 | counting[i] = 0; | 402 | counting[i] = 0; |
402 | delay[i] = jiffies - start[i]; | 403 | delay[i] = jiffies - start[i]; |
403 | } | 404 | } |
diff --git a/drivers/net/hamradio/hdlcdrv.c b/drivers/net/hamradio/hdlcdrv.c index 91c5790c9581..b8bdf9d51cd4 100644 --- a/drivers/net/hamradio/hdlcdrv.c +++ b/drivers/net/hamradio/hdlcdrv.c | |||
@@ -48,7 +48,6 @@ | |||
48 | #include <linux/net.h> | 48 | #include <linux/net.h> |
49 | #include <linux/in.h> | 49 | #include <linux/in.h> |
50 | #include <linux/if.h> | 50 | #include <linux/if.h> |
51 | #include <linux/slab.h> | ||
52 | #include <linux/errno.h> | 51 | #include <linux/errno.h> |
53 | #include <linux/init.h> | 52 | #include <linux/init.h> |
54 | #include <linux/bitops.h> | 53 | #include <linux/bitops.h> |
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index db4b7f1603f6..66e88bd59caa 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/in.h> | 27 | #include <linux/in.h> |
28 | #include <linux/inet.h> | 28 | #include <linux/inet.h> |
29 | #include <linux/slab.h> | ||
29 | #include <linux/tty.h> | 30 | #include <linux/tty.h> |
30 | #include <linux/errno.h> | 31 | #include <linux/errno.h> |
31 | #include <linux/netdevice.h> | 32 | #include <linux/netdevice.h> |
@@ -36,6 +37,7 @@ | |||
36 | #include <linux/skbuff.h> | 37 | #include <linux/skbuff.h> |
37 | #include <linux/if_arp.h> | 38 | #include <linux/if_arp.h> |
38 | #include <linux/jiffies.h> | 39 | #include <linux/jiffies.h> |
40 | #include <linux/compat.h> | ||
39 | 41 | ||
40 | #include <net/ax25.h> | 42 | #include <net/ax25.h> |
41 | 43 | ||
@@ -898,6 +900,23 @@ static int mkiss_ioctl(struct tty_struct *tty, struct file *file, | |||
898 | return err; | 900 | return err; |
899 | } | 901 | } |
900 | 902 | ||
903 | #ifdef CONFIG_COMPAT | ||
904 | static long mkiss_compat_ioctl(struct tty_struct *tty, struct file *file, | ||
905 | unsigned int cmd, unsigned long arg) | ||
906 | { | ||
907 | switch (cmd) { | ||
908 | case SIOCGIFNAME: | ||
909 | case SIOCGIFENCAP: | ||
910 | case SIOCSIFENCAP: | ||
911 | case SIOCSIFHWADDR: | ||
912 | return mkiss_ioctl(tty, file, cmd, | ||
913 | (unsigned long)compat_ptr(arg)); | ||
914 | } | ||
915 | |||
916 | return -ENOIOCTLCMD; | ||
917 | } | ||
918 | #endif | ||
919 | |||
901 | /* | 920 | /* |
902 | * Handle the 'receiver data ready' interrupt. | 921 | * Handle the 'receiver data ready' interrupt. |
903 | * This function is called by the 'tty_io' module in the kernel when | 922 | * This function is called by the 'tty_io' module in the kernel when |
@@ -972,6 +991,9 @@ static struct tty_ldisc_ops ax_ldisc = { | |||
972 | .open = mkiss_open, | 991 | .open = mkiss_open, |
973 | .close = mkiss_close, | 992 | .close = mkiss_close, |
974 | .ioctl = mkiss_ioctl, | 993 | .ioctl = mkiss_ioctl, |
994 | #ifdef CONFIG_COMPAT | ||
995 | .compat_ioctl = mkiss_compat_ioctl, | ||
996 | #endif | ||
975 | .receive_buf = mkiss_receive_buf, | 997 | .receive_buf = mkiss_receive_buf, |
976 | .write_wakeup = mkiss_write_wakeup | 998 | .write_wakeup = mkiss_write_wakeup |
977 | }; | 999 | }; |
diff --git a/drivers/net/hamradio/scc.c b/drivers/net/hamradio/scc.c index 35c936175bba..f3a96b843911 100644 --- a/drivers/net/hamradio/scc.c +++ b/drivers/net/hamradio/scc.c | |||
@@ -158,7 +158,6 @@ | |||
158 | #include <linux/in.h> | 158 | #include <linux/in.h> |
159 | #include <linux/fcntl.h> | 159 | #include <linux/fcntl.h> |
160 | #include <linux/ptrace.h> | 160 | #include <linux/ptrace.h> |
161 | #include <linux/slab.h> | ||
162 | #include <linux/delay.h> | 161 | #include <linux/delay.h> |
163 | #include <linux/skbuff.h> | 162 | #include <linux/skbuff.h> |
164 | #include <linux/netdevice.h> | 163 | #include <linux/netdevice.h> |