diff options
Diffstat (limited to 'net/irda')
| -rw-r--r-- | net/irda/af_irda.c | 19 | ||||
| -rw-r--r-- | net/irda/discovery.c | 1 | ||||
| -rw-r--r-- | net/irda/ircomm/ircomm_core.c | 1 | ||||
| -rw-r--r-- | net/irda/ircomm/ircomm_lmp.c | 1 | ||||
| -rw-r--r-- | net/irda/ircomm/ircomm_param.c | 3 | ||||
| -rw-r--r-- | net/irda/ircomm/ircomm_tty.c | 7 | ||||
| -rw-r--r-- | net/irda/irda_device.c | 1 | ||||
| -rw-r--r-- | net/irda/iriap.c | 3 | ||||
| -rw-r--r-- | net/irda/iriap_event.c | 2 | ||||
| -rw-r--r-- | net/irda/irias_object.c | 1 | ||||
| -rw-r--r-- | net/irda/irlan/irlan_client.c | 1 | ||||
| -rw-r--r-- | net/irda/irlan/irlan_common.c | 31 | ||||
| -rw-r--r-- | net/irda/irlan/irlan_eth.c | 9 | ||||
| -rw-r--r-- | net/irda/irlan/irlan_provider.c | 1 | ||||
| -rw-r--r-- | net/irda/irlap_event.c | 1 | ||||
| -rw-r--r-- | net/irda/irlap_frame.c | 1 | ||||
| -rw-r--r-- | net/irda/irnet/irnet_irda.c | 4 | ||||
| -rw-r--r-- | net/irda/irnet/irnet_ppp.c | 18 | ||||
| -rw-r--r-- | net/irda/irnetlink.c | 3 | ||||
| -rw-r--r-- | net/irda/irqueue.c | 1 | ||||
| -rw-r--r-- | net/irda/irttp.c | 15 |
21 files changed, 60 insertions, 64 deletions
diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 10093aab6173..fd55b5135de5 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | #include <linux/smp_lock.h> | 48 | #include <linux/smp_lock.h> |
| 49 | #include <linux/socket.h> | 49 | #include <linux/socket.h> |
| 50 | #include <linux/sockios.h> | 50 | #include <linux/sockios.h> |
| 51 | #include <linux/slab.h> | ||
| 51 | #include <linux/init.h> | 52 | #include <linux/init.h> |
| 52 | #include <linux/net.h> | 53 | #include <linux/net.h> |
| 53 | #include <linux/irda.h> | 54 | #include <linux/irda.h> |
| @@ -346,7 +347,7 @@ static void irda_flow_indication(void *instance, void *sap, LOCAL_FLOW flow) | |||
| 346 | self->tx_flow = flow; | 347 | self->tx_flow = flow; |
| 347 | IRDA_DEBUG(1, "%s(), IrTTP wants us to start again\n", | 348 | IRDA_DEBUG(1, "%s(), IrTTP wants us to start again\n", |
| 348 | __func__); | 349 | __func__); |
| 349 | wake_up_interruptible(sk->sk_sleep); | 350 | wake_up_interruptible(sk_sleep(sk)); |
| 350 | break; | 351 | break; |
| 351 | default: | 352 | default: |
| 352 | IRDA_DEBUG(0, "%s(), Unknown flow command!\n", __func__); | 353 | IRDA_DEBUG(0, "%s(), Unknown flow command!\n", __func__); |
| @@ -823,8 +824,8 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | |||
| 823 | 824 | ||
| 824 | err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name); | 825 | err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name); |
| 825 | if (err < 0) { | 826 | if (err < 0) { |
| 826 | kfree(self->ias_obj->name); | 827 | irias_delete_object(self->ias_obj); |
| 827 | kfree(self->ias_obj); | 828 | self->ias_obj = NULL; |
| 828 | goto out; | 829 | goto out; |
| 829 | } | 830 | } |
| 830 | 831 | ||
| @@ -899,7 +900,7 @@ static int irda_accept(struct socket *sock, struct socket *newsock, int flags) | |||
| 899 | if (flags & O_NONBLOCK) | 900 | if (flags & O_NONBLOCK) |
| 900 | goto out; | 901 | goto out; |
| 901 | 902 | ||
| 902 | err = wait_event_interruptible(*(sk->sk_sleep), | 903 | err = wait_event_interruptible(*(sk_sleep(sk)), |
| 903 | skb_peek(&sk->sk_receive_queue)); | 904 | skb_peek(&sk->sk_receive_queue)); |
| 904 | if (err) | 905 | if (err) |
| 905 | goto out; | 906 | goto out; |
| @@ -1065,7 +1066,7 @@ static int irda_connect(struct socket *sock, struct sockaddr *uaddr, | |||
| 1065 | goto out; | 1066 | goto out; |
| 1066 | 1067 | ||
| 1067 | err = -ERESTARTSYS; | 1068 | err = -ERESTARTSYS; |
| 1068 | if (wait_event_interruptible(*(sk->sk_sleep), | 1069 | if (wait_event_interruptible(*(sk_sleep(sk)), |
| 1069 | (sk->sk_state != TCP_SYN_SENT))) | 1070 | (sk->sk_state != TCP_SYN_SENT))) |
| 1070 | goto out; | 1071 | goto out; |
| 1071 | 1072 | ||
| @@ -1317,7 +1318,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
| 1317 | 1318 | ||
| 1318 | /* Check if IrTTP is wants us to slow down */ | 1319 | /* Check if IrTTP is wants us to slow down */ |
| 1319 | 1320 | ||
| 1320 | if (wait_event_interruptible(*(sk->sk_sleep), | 1321 | if (wait_event_interruptible(*(sk_sleep(sk)), |
| 1321 | (self->tx_flow != FLOW_STOP || sk->sk_state != TCP_ESTABLISHED))) { | 1322 | (self->tx_flow != FLOW_STOP || sk->sk_state != TCP_ESTABLISHED))) { |
| 1322 | err = -ERESTARTSYS; | 1323 | err = -ERESTARTSYS; |
| 1323 | goto out; | 1324 | goto out; |
| @@ -1476,7 +1477,7 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock, | |||
| 1476 | if (copied >= target) | 1477 | if (copied >= target) |
| 1477 | break; | 1478 | break; |
| 1478 | 1479 | ||
| 1479 | prepare_to_wait_exclusive(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE); | 1480 | prepare_to_wait_exclusive(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
| 1480 | 1481 | ||
| 1481 | /* | 1482 | /* |
| 1482 | * POSIX 1003.1g mandates this order. | 1483 | * POSIX 1003.1g mandates this order. |
| @@ -1496,7 +1497,7 @@ static int irda_recvmsg_stream(struct kiocb *iocb, struct socket *sock, | |||
| 1496 | /* Wait process until data arrives */ | 1497 | /* Wait process until data arrives */ |
| 1497 | schedule(); | 1498 | schedule(); |
| 1498 | 1499 | ||
| 1499 | finish_wait(sk->sk_sleep, &wait); | 1500 | finish_wait(sk_sleep(sk), &wait); |
| 1500 | 1501 | ||
| 1501 | if (err) | 1502 | if (err) |
| 1502 | goto out; | 1503 | goto out; |
| @@ -1786,7 +1787,7 @@ static unsigned int irda_poll(struct file * file, struct socket *sock, | |||
| 1786 | IRDA_DEBUG(4, "%s()\n", __func__); | 1787 | IRDA_DEBUG(4, "%s()\n", __func__); |
| 1787 | 1788 | ||
| 1788 | lock_kernel(); | 1789 | lock_kernel(); |
| 1789 | poll_wait(file, sk->sk_sleep, wait); | 1790 | poll_wait(file, sk_sleep(sk), wait); |
| 1790 | mask = 0; | 1791 | mask = 0; |
| 1791 | 1792 | ||
| 1792 | /* Exceptional events? */ | 1793 | /* Exceptional events? */ |
diff --git a/net/irda/discovery.c b/net/irda/discovery.c index a6f99b5a1499..c1c8ae939126 100644 --- a/net/irda/discovery.c +++ b/net/irda/discovery.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/socket.h> | 34 | #include <linux/socket.h> |
| 35 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
| 36 | #include <linux/seq_file.h> | 36 | #include <linux/seq_file.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | 38 | ||
| 38 | #include <net/irda/irda.h> | 39 | #include <net/irda/irda.h> |
| 39 | #include <net/irda/irlmp.h> | 40 | #include <net/irda/irlmp.h> |
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index 018c92941aba..e97082017f4f 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
| 34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
| 35 | #include <linux/init.h> | 35 | #include <linux/init.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | 37 | ||
| 37 | #include <net/irda/irda.h> | 38 | #include <net/irda/irda.h> |
| 38 | #include <net/irda/irmod.h> | 39 | #include <net/irda/irmod.h> |
diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c index 7ba96618660e..08fb54dc8c41 100644 --- a/net/irda/ircomm/ircomm_lmp.c +++ b/net/irda/ircomm/ircomm_lmp.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | ********************************************************************/ | 31 | ********************************************************************/ |
| 32 | 32 | ||
| 33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 34 | #include <linux/gfp.h> | ||
| 34 | 35 | ||
| 35 | #include <net/irda/irda.h> | 36 | #include <net/irda/irda.h> |
| 36 | #include <net/irda/irlmp.h> | 37 | #include <net/irda/irlmp.h> |
diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c index d57aefd9fe77..8b915f3ac3b9 100644 --- a/net/irda/ircomm/ircomm_param.c +++ b/net/irda/ircomm/ircomm_param.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | * | 28 | * |
| 29 | ********************************************************************/ | 29 | ********************************************************************/ |
| 30 | 30 | ||
| 31 | #include <linux/gfp.h> | ||
| 31 | #include <linux/workqueue.h> | 32 | #include <linux/workqueue.h> |
| 32 | #include <linux/interrupt.h> | 33 | #include <linux/interrupt.h> |
| 33 | 34 | ||
| @@ -474,7 +475,7 @@ static int ircomm_param_dce(void *instance, irda_param_t *param, int get) | |||
| 474 | /* Check if any of the settings have changed */ | 475 | /* Check if any of the settings have changed */ |
| 475 | if (dce & 0x0f) { | 476 | if (dce & 0x0f) { |
| 476 | if (dce & IRCOMM_DELTA_CTS) { | 477 | if (dce & IRCOMM_DELTA_CTS) { |
| 477 | IRDA_DEBUG(2, "%s(), CTS \n", __func__ ); | 478 | IRDA_DEBUG(2, "%s(), CTS\n", __func__ ); |
| 478 | } | 479 | } |
| 479 | } | 480 | } |
| 480 | 481 | ||
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 811984d9324b..faa82ca2dfdc 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 34 | #include <linux/module.h> | 34 | #include <linux/module.h> |
| 35 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
| 36 | #include <linux/slab.h> | ||
| 36 | #include <linux/sched.h> | 37 | #include <linux/sched.h> |
| 37 | #include <linux/seq_file.h> | 38 | #include <linux/seq_file.h> |
| 38 | #include <linux/termios.h> | 39 | #include <linux/termios.h> |
| @@ -496,9 +497,6 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) | |||
| 496 | 497 | ||
| 497 | IRDA_DEBUG(0, "%s()\n", __func__ ); | 498 | IRDA_DEBUG(0, "%s()\n", __func__ ); |
| 498 | 499 | ||
| 499 | if (!tty) | ||
| 500 | return; | ||
| 501 | |||
| 502 | IRDA_ASSERT(self != NULL, return;); | 500 | IRDA_ASSERT(self != NULL, return;); |
| 503 | IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); | 501 | IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); |
| 504 | 502 | ||
| @@ -1007,9 +1005,6 @@ static void ircomm_tty_hangup(struct tty_struct *tty) | |||
| 1007 | IRDA_ASSERT(self != NULL, return;); | 1005 | IRDA_ASSERT(self != NULL, return;); |
| 1008 | IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); | 1006 | IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return;); |
| 1009 | 1007 | ||
| 1010 | if (!tty) | ||
| 1011 | return; | ||
| 1012 | |||
| 1013 | /* ircomm_tty_flush_buffer(tty); */ | 1008 | /* ircomm_tty_flush_buffer(tty); */ |
| 1014 | ircomm_tty_shutdown(self); | 1009 | ircomm_tty_shutdown(self); |
| 1015 | 1010 | ||
diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c index bf92e1473447..25cc2e695158 100644 --- a/net/irda/irda_device.c +++ b/net/irda/irda_device.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | #include <linux/tty.h> | 41 | #include <linux/tty.h> |
| 42 | #include <linux/kmod.h> | 42 | #include <linux/kmod.h> |
| 43 | #include <linux/spinlock.h> | 43 | #include <linux/spinlock.h> |
| 44 | #include <linux/slab.h> | ||
| 44 | 45 | ||
| 45 | #include <asm/ioctls.h> | 46 | #include <asm/ioctls.h> |
| 46 | #include <asm/uaccess.h> | 47 | #include <asm/uaccess.h> |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 294e34d3517c..fce364c6c71a 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/string.h> | 31 | #include <linux/string.h> |
| 32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
| 33 | #include <linux/seq_file.h> | 33 | #include <linux/seq_file.h> |
| 34 | #include <linux/slab.h> | ||
| 34 | 35 | ||
| 35 | #include <asm/byteorder.h> | 36 | #include <asm/byteorder.h> |
| 36 | #include <asm/unaligned.h> | 37 | #include <asm/unaligned.h> |
| @@ -684,8 +685,6 @@ static void iriap_getvaluebyclass_indication(struct iriap_cb *self, | |||
| 684 | /* We have a match; send the value. */ | 685 | /* We have a match; send the value. */ |
| 685 | iriap_getvaluebyclass_response(self, obj->id, IAS_SUCCESS, | 686 | iriap_getvaluebyclass_response(self, obj->id, IAS_SUCCESS, |
| 686 | attrib->value); | 687 | attrib->value); |
| 687 | |||
| 688 | return; | ||
| 689 | } | 688 | } |
| 690 | 689 | ||
| 691 | /* | 690 | /* |
diff --git a/net/irda/iriap_event.c b/net/irda/iriap_event.c index a301cbd93785..703774e29e32 100644 --- a/net/irda/iriap_event.c +++ b/net/irda/iriap_event.c | |||
| @@ -24,6 +24,8 @@ | |||
| 24 | * | 24 | * |
| 25 | ********************************************************************/ | 25 | ********************************************************************/ |
| 26 | 26 | ||
| 27 | #include <linux/slab.h> | ||
| 28 | |||
| 27 | #include <net/irda/irda.h> | 29 | #include <net/irda/irda.h> |
| 28 | #include <net/irda/irlmp.h> | 30 | #include <net/irda/irlmp.h> |
| 29 | #include <net/irda/iriap.h> | 31 | #include <net/irda/iriap.h> |
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index 99ebb96f1386..f07ed9fd5792 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | * | 22 | * |
| 23 | ********************************************************************/ | 23 | ********************************************************************/ |
| 24 | 24 | ||
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/string.h> | 26 | #include <linux/string.h> |
| 26 | #include <linux/socket.h> | 27 | #include <linux/socket.h> |
| 27 | #include <linux/module.h> | 28 | #include <linux/module.h> |
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c index 42f7d960d055..7ed3af957935 100644 --- a/net/irda/irlan/irlan_client.c +++ b/net/irda/irlan/irlan_client.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
| 30 | #include <linux/string.h> | 30 | #include <linux/string.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
| 32 | #include <linux/init.h> | 33 | #include <linux/init.h> |
| 33 | #include <linux/netdevice.h> | 34 | #include <linux/netdevice.h> |
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c index 315ead3cb926..6130f9d9dbe1 100644 --- a/net/irda/irlan/irlan_common.c +++ b/net/irda/irlan/irlan_common.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
| 29 | #include <linux/string.h> | 29 | #include <linux/string.h> |
| 30 | #include <linux/gfp.h> | ||
| 30 | #include <linux/init.h> | 31 | #include <linux/init.h> |
| 31 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
| 32 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
| @@ -1101,7 +1102,7 @@ int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len) | |||
| 1101 | memcpy(&val_len, buf+n, 2); /* To avoid alignment problems */ | 1102 | memcpy(&val_len, buf+n, 2); /* To avoid alignment problems */ |
| 1102 | le16_to_cpus(&val_len); n+=2; | 1103 | le16_to_cpus(&val_len); n+=2; |
| 1103 | 1104 | ||
| 1104 | if (val_len > 1016) { | 1105 | if (val_len >= 1016) { |
| 1105 | IRDA_DEBUG(2, "%s(), parameter length to long\n", __func__ ); | 1106 | IRDA_DEBUG(2, "%s(), parameter length to long\n", __func__ ); |
| 1106 | return -RSP_INVALID_COMMAND_FORMAT; | 1107 | return -RSP_INVALID_COMMAND_FORMAT; |
| 1107 | } | 1108 | } |
| @@ -1128,34 +1129,14 @@ int irlan_extract_param(__u8 *buf, char *name, char *value, __u16 *len) | |||
| 1128 | */ | 1129 | */ |
| 1129 | static void *irlan_seq_start(struct seq_file *seq, loff_t *pos) | 1130 | static void *irlan_seq_start(struct seq_file *seq, loff_t *pos) |
| 1130 | { | 1131 | { |
| 1131 | int i = 1; | ||
| 1132 | struct irlan_cb *self; | ||
| 1133 | |||
| 1134 | rcu_read_lock(); | 1132 | rcu_read_lock(); |
| 1135 | if (*pos == 0) | 1133 | return seq_list_start_head(&irlans, *pos); |
| 1136 | return SEQ_START_TOKEN; | ||
| 1137 | |||
| 1138 | list_for_each_entry(self, &irlans, dev_list) { | ||
| 1139 | if (*pos == i) | ||
| 1140 | return self; | ||
| 1141 | ++i; | ||
| 1142 | } | ||
| 1143 | return NULL; | ||
| 1144 | } | 1134 | } |
| 1145 | 1135 | ||
| 1146 | /* Return entry after v, and increment pos */ | 1136 | /* Return entry after v, and increment pos */ |
| 1147 | static void *irlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) | 1137 | static void *irlan_seq_next(struct seq_file *seq, void *v, loff_t *pos) |
| 1148 | { | 1138 | { |
| 1149 | struct list_head *nxt; | 1139 | return seq_list_next(v, &irlans, pos); |
| 1150 | |||
| 1151 | ++*pos; | ||
| 1152 | if (v == SEQ_START_TOKEN) | ||
| 1153 | nxt = irlans.next; | ||
| 1154 | else | ||
| 1155 | nxt = ((struct irlan_cb *)v)->dev_list.next; | ||
| 1156 | |||
| 1157 | return (nxt == &irlans) ? NULL | ||
| 1158 | : list_entry(nxt, struct irlan_cb, dev_list); | ||
| 1159 | } | 1140 | } |
| 1160 | 1141 | ||
| 1161 | /* End of reading /proc file */ | 1142 | /* End of reading /proc file */ |
| @@ -1170,10 +1151,10 @@ static void irlan_seq_stop(struct seq_file *seq, void *v) | |||
| 1170 | */ | 1151 | */ |
| 1171 | static int irlan_seq_show(struct seq_file *seq, void *v) | 1152 | static int irlan_seq_show(struct seq_file *seq, void *v) |
| 1172 | { | 1153 | { |
| 1173 | if (v == SEQ_START_TOKEN) | 1154 | if (v == &irlans) |
| 1174 | seq_puts(seq, "IrLAN instances:\n"); | 1155 | seq_puts(seq, "IrLAN instances:\n"); |
| 1175 | else { | 1156 | else { |
| 1176 | struct irlan_cb *self = v; | 1157 | struct irlan_cb *self = list_entry(v, struct irlan_cb, dev_list); |
| 1177 | 1158 | ||
| 1178 | IRDA_ASSERT(self != NULL, return -1;); | 1159 | IRDA_ASSERT(self != NULL, return -1;); |
| 1179 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); | 1160 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return -1;); |
diff --git a/net/irda/irlan/irlan_eth.c b/net/irda/irlan/irlan_eth.c index d340110f5c0c..5bb8353105cc 100644 --- a/net/irda/irlan/irlan_eth.c +++ b/net/irda/irlan/irlan_eth.c | |||
| @@ -169,6 +169,7 @@ static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb, | |||
| 169 | { | 169 | { |
| 170 | struct irlan_cb *self = netdev_priv(dev); | 170 | struct irlan_cb *self = netdev_priv(dev); |
| 171 | int ret; | 171 | int ret; |
| 172 | unsigned int len; | ||
| 172 | 173 | ||
| 173 | /* skb headroom large enough to contain all IrDA-headers? */ | 174 | /* skb headroom large enough to contain all IrDA-headers? */ |
| 174 | if ((skb_headroom(skb) < self->max_header_size) || (skb_shared(skb))) { | 175 | if ((skb_headroom(skb) < self->max_header_size) || (skb_shared(skb))) { |
| @@ -188,6 +189,7 @@ static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb, | |||
| 188 | 189 | ||
| 189 | dev->trans_start = jiffies; | 190 | dev->trans_start = jiffies; |
| 190 | 191 | ||
| 192 | len = skb->len; | ||
| 191 | /* Now queue the packet in the transport layer */ | 193 | /* Now queue the packet in the transport layer */ |
| 192 | if (self->use_udata) | 194 | if (self->use_udata) |
| 193 | ret = irttp_udata_request(self->tsap_data, skb); | 195 | ret = irttp_udata_request(self->tsap_data, skb); |
| @@ -209,7 +211,7 @@ static netdev_tx_t irlan_eth_xmit(struct sk_buff *skb, | |||
| 209 | self->stats.tx_dropped++; | 211 | self->stats.tx_dropped++; |
| 210 | } else { | 212 | } else { |
| 211 | self->stats.tx_packets++; | 213 | self->stats.tx_packets++; |
| 212 | self->stats.tx_bytes += skb->len; | 214 | self->stats.tx_bytes += len; |
| 213 | } | 215 | } |
| 214 | 216 | ||
| 215 | return NETDEV_TX_OK; | 217 | return NETDEV_TX_OK; |
| @@ -321,14 +323,15 @@ static void irlan_eth_set_multicast_list(struct net_device *dev) | |||
| 321 | /* Enable promiscuous mode */ | 323 | /* Enable promiscuous mode */ |
| 322 | IRDA_WARNING("Promiscuous mode not implemented by IrLAN!\n"); | 324 | IRDA_WARNING("Promiscuous mode not implemented by IrLAN!\n"); |
| 323 | } | 325 | } |
| 324 | else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) { | 326 | else if ((dev->flags & IFF_ALLMULTI) || |
| 327 | netdev_mc_count(dev) > HW_MAX_ADDRS) { | ||
| 325 | /* Disable promiscuous mode, use normal mode. */ | 328 | /* Disable promiscuous mode, use normal mode. */ |
| 326 | IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __func__ ); | 329 | IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __func__ ); |
| 327 | /* hardware_set_filter(NULL); */ | 330 | /* hardware_set_filter(NULL); */ |
| 328 | 331 | ||
| 329 | irlan_set_multicast_filter(self, TRUE); | 332 | irlan_set_multicast_filter(self, TRUE); |
| 330 | } | 333 | } |
| 331 | else if (dev->mc_count) { | 334 | else if (!netdev_mc_empty(dev)) { |
| 332 | IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __func__ ); | 335 | IRDA_DEBUG(4, "%s(), Setting multicast filter\n", __func__ ); |
| 333 | /* Walk the address list, and load the filter */ | 336 | /* Walk the address list, and load the filter */ |
| 334 | /* hardware_set_filter(dev->mc_list); */ | 337 | /* hardware_set_filter(dev->mc_list); */ |
diff --git a/net/irda/irlan/irlan_provider.c b/net/irda/irlan/irlan_provider.c index 3f81f81b2dfa..5cf5e6c872bb 100644 --- a/net/irda/irlan/irlan_provider.c +++ b/net/irda/irlan/irlan_provider.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/init.h> | 34 | #include <linux/init.h> |
| 35 | #include <linux/random.h> | 35 | #include <linux/random.h> |
| 36 | #include <linux/bitops.h> | 36 | #include <linux/bitops.h> |
| 37 | #include <linux/slab.h> | ||
| 37 | 38 | ||
| 38 | #include <asm/system.h> | 39 | #include <asm/system.h> |
| 39 | #include <asm/byteorder.h> | 40 | #include <asm/byteorder.h> |
diff --git a/net/irda/irlap_event.c b/net/irda/irlap_event.c index 94a9884d7146..d434c8880745 100644 --- a/net/irda/irlap_event.c +++ b/net/irda/irlap_event.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
| 30 | #include <linux/delay.h> | 30 | #include <linux/delay.h> |
| 31 | #include <linux/skbuff.h> | 31 | #include <linux/skbuff.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | 33 | ||
| 33 | #include <net/irda/irda.h> | 34 | #include <net/irda/irda.h> |
| 34 | #include <net/irda/irlap_event.h> | 35 | #include <net/irda/irlap_event.h> |
diff --git a/net/irda/irlap_frame.c b/net/irda/irlap_frame.c index 7af2e74deda8..688222cbf55b 100644 --- a/net/irda/irlap_frame.c +++ b/net/irda/irlap_frame.c | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/if_ether.h> | 29 | #include <linux/if_ether.h> |
| 30 | #include <linux/netdevice.h> | 30 | #include <linux/netdevice.h> |
| 31 | #include <linux/irda.h> | 31 | #include <linux/irda.h> |
| 32 | #include <linux/slab.h> | ||
| 32 | 33 | ||
| 33 | #include <net/pkt_sched.h> | 34 | #include <net/pkt_sched.h> |
| 34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c index b26dee784aba..e98e40d76f4f 100644 --- a/net/irda/irnet/irnet_irda.c +++ b/net/irda/irnet/irnet_irda.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include "irnet_irda.h" /* Private header */ | 11 | #include "irnet_irda.h" /* Private header */ |
| 12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
| 13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
| 14 | #include <linux/slab.h> | ||
| 14 | #include <asm/unaligned.h> | 15 | #include <asm/unaligned.h> |
| 15 | 16 | ||
| 16 | /* | 17 | /* |
| @@ -677,7 +678,6 @@ irda_irnet_destroy(irnet_socket * self) | |||
| 677 | self->stsap_sel = 0; | 678 | self->stsap_sel = 0; |
| 678 | 679 | ||
| 679 | DEXIT(IRDA_SOCK_TRACE, "\n"); | 680 | DEXIT(IRDA_SOCK_TRACE, "\n"); |
| 680 | return; | ||
| 681 | } | 681 | } |
| 682 | 682 | ||
| 683 | 683 | ||
| @@ -927,7 +927,6 @@ irnet_disconnect_server(irnet_socket * self, | |||
| 927 | irttp_listen(self->tsap); | 927 | irttp_listen(self->tsap); |
| 928 | 928 | ||
| 929 | DEXIT(IRDA_SERV_TRACE, "\n"); | 929 | DEXIT(IRDA_SERV_TRACE, "\n"); |
| 930 | return; | ||
| 931 | } | 930 | } |
| 932 | 931 | ||
| 933 | /*------------------------------------------------------------------*/ | 932 | /*------------------------------------------------------------------*/ |
| @@ -1012,7 +1011,6 @@ irnet_destroy_server(void) | |||
| 1012 | irda_irnet_destroy(&irnet_server.s); | 1011 | irda_irnet_destroy(&irnet_server.s); |
| 1013 | 1012 | ||
| 1014 | DEXIT(IRDA_SERV_TRACE, "\n"); | 1013 | DEXIT(IRDA_SERV_TRACE, "\n"); |
| 1015 | return; | ||
| 1016 | } | 1014 | } |
| 1017 | 1015 | ||
| 1018 | 1016 | ||
diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c index 156020d138b5..dfe7b38dd4af 100644 --- a/net/irda/irnet/irnet_ppp.c +++ b/net/irda/irnet/irnet_ppp.c | |||
| @@ -14,12 +14,13 @@ | |||
| 14 | */ | 14 | */ |
| 15 | 15 | ||
| 16 | #include <linux/sched.h> | 16 | #include <linux/sched.h> |
| 17 | #include <linux/slab.h> | ||
| 17 | #include <linux/smp_lock.h> | 18 | #include <linux/smp_lock.h> |
| 18 | #include "irnet_ppp.h" /* Private header */ | 19 | #include "irnet_ppp.h" /* Private header */ |
| 19 | /* Please put other headers in irnet.h - Thanks */ | 20 | /* Please put other headers in irnet.h - Thanks */ |
| 20 | 21 | ||
| 21 | /* Generic PPP callbacks (to call us) */ | 22 | /* Generic PPP callbacks (to call us) */ |
| 22 | static struct ppp_channel_ops irnet_ppp_ops = { | 23 | static const struct ppp_channel_ops irnet_ppp_ops = { |
| 23 | .start_xmit = ppp_irnet_send, | 24 | .start_xmit = ppp_irnet_send, |
| 24 | .ioctl = ppp_irnet_ioctl | 25 | .ioctl = ppp_irnet_ioctl |
| 25 | }; | 26 | }; |
| @@ -526,7 +527,7 @@ static int | |||
| 526 | dev_irnet_close(struct inode * inode, | 527 | dev_irnet_close(struct inode * inode, |
| 527 | struct file * file) | 528 | struct file * file) |
| 528 | { | 529 | { |
| 529 | irnet_socket * ap = (struct irnet_socket *) file->private_data; | 530 | irnet_socket * ap = file->private_data; |
| 530 | 531 | ||
| 531 | DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n", | 532 | DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n", |
| 532 | file, ap); | 533 | file, ap); |
| @@ -563,7 +564,7 @@ dev_irnet_write(struct file * file, | |||
| 563 | size_t count, | 564 | size_t count, |
| 564 | loff_t * ppos) | 565 | loff_t * ppos) |
| 565 | { | 566 | { |
| 566 | irnet_socket * ap = (struct irnet_socket *) file->private_data; | 567 | irnet_socket * ap = file->private_data; |
| 567 | 568 | ||
| 568 | DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n", | 569 | DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n", |
| 569 | file, ap, count); | 570 | file, ap, count); |
| @@ -587,7 +588,7 @@ dev_irnet_read(struct file * file, | |||
| 587 | size_t count, | 588 | size_t count, |
| 588 | loff_t * ppos) | 589 | loff_t * ppos) |
| 589 | { | 590 | { |
| 590 | irnet_socket * ap = (struct irnet_socket *) file->private_data; | 591 | irnet_socket * ap = file->private_data; |
| 591 | 592 | ||
| 592 | DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n", | 593 | DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n", |
| 593 | file, ap, count); | 594 | file, ap, count); |
| @@ -608,7 +609,7 @@ static unsigned int | |||
| 608 | dev_irnet_poll(struct file * file, | 609 | dev_irnet_poll(struct file * file, |
| 609 | poll_table * wait) | 610 | poll_table * wait) |
| 610 | { | 611 | { |
| 611 | irnet_socket * ap = (struct irnet_socket *) file->private_data; | 612 | irnet_socket * ap = file->private_data; |
| 612 | unsigned int mask; | 613 | unsigned int mask; |
| 613 | 614 | ||
| 614 | DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n", | 615 | DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n", |
| @@ -637,7 +638,7 @@ dev_irnet_ioctl( | |||
| 637 | unsigned int cmd, | 638 | unsigned int cmd, |
| 638 | unsigned long arg) | 639 | unsigned long arg) |
| 639 | { | 640 | { |
| 640 | irnet_socket * ap = (struct irnet_socket *) file->private_data; | 641 | irnet_socket * ap = file->private_data; |
| 641 | int err; | 642 | int err; |
| 642 | int val; | 643 | int val; |
| 643 | void __user *argp = (void __user *)arg; | 644 | void __user *argp = (void __user *)arg; |
| @@ -698,15 +699,18 @@ dev_irnet_ioctl( | |||
| 698 | 699 | ||
| 699 | /* Query PPP channel and unit number */ | 700 | /* Query PPP channel and unit number */ |
| 700 | case PPPIOCGCHAN: | 701 | case PPPIOCGCHAN: |
| 702 | lock_kernel(); | ||
| 701 | if(ap->ppp_open && !put_user(ppp_channel_index(&ap->chan), | 703 | if(ap->ppp_open && !put_user(ppp_channel_index(&ap->chan), |
| 702 | (int __user *)argp)) | 704 | (int __user *)argp)) |
| 703 | err = 0; | 705 | err = 0; |
| 706 | unlock_kernel(); | ||
| 704 | break; | 707 | break; |
| 705 | case PPPIOCGUNIT: | 708 | case PPPIOCGUNIT: |
| 706 | lock_kernel(); | 709 | lock_kernel(); |
| 707 | if(ap->ppp_open && !put_user(ppp_unit_number(&ap->chan), | 710 | if(ap->ppp_open && !put_user(ppp_unit_number(&ap->chan), |
| 708 | (int __user *)argp)) | 711 | (int __user *)argp)) |
| 709 | err = 0; | 712 | err = 0; |
| 713 | unlock_kernel(); | ||
| 710 | break; | 714 | break; |
| 711 | 715 | ||
| 712 | /* All these ioctls can be passed both directly and from ppp_generic, | 716 | /* All these ioctls can be passed both directly and from ppp_generic, |
diff --git a/net/irda/irnetlink.c b/net/irda/irnetlink.c index 476b307bd801..6c7c4b92e4f8 100644 --- a/net/irda/irnetlink.c +++ b/net/irda/irnetlink.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/socket.h> | 16 | #include <linux/socket.h> |
| 17 | #include <linux/irda.h> | 17 | #include <linux/irda.h> |
| 18 | #include <linux/gfp.h> | ||
| 18 | #include <net/net_namespace.h> | 19 | #include <net/net_namespace.h> |
| 19 | #include <net/sock.h> | 20 | #include <net/sock.h> |
| 20 | #include <net/irda/irda.h> | 21 | #include <net/irda/irda.h> |
| @@ -124,7 +125,7 @@ static int irda_nl_get_mode(struct sk_buff *skb, struct genl_info *info) | |||
| 124 | return ret; | 125 | return ret; |
| 125 | } | 126 | } |
| 126 | 127 | ||
| 127 | static struct nla_policy irda_nl_policy[IRDA_NL_ATTR_MAX + 1] = { | 128 | static const struct nla_policy irda_nl_policy[IRDA_NL_ATTR_MAX + 1] = { |
| 128 | [IRDA_NL_ATTR_IFNAME] = { .type = NLA_NUL_STRING, | 129 | [IRDA_NL_ATTR_IFNAME] = { .type = NLA_NUL_STRING, |
| 129 | .len = IFNAMSIZ-1 }, | 130 | .len = IFNAMSIZ-1 }, |
| 130 | [IRDA_NL_ATTR_MODE] = { .type = NLA_U32 }, | 131 | [IRDA_NL_ATTR_MODE] = { .type = NLA_U32 }, |
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c index ba01938becb5..849aaf0dabb5 100644 --- a/net/irda/irqueue.c +++ b/net/irda/irqueue.c | |||
| @@ -192,6 +192,7 @@ | |||
| 192 | * Jean II | 192 | * Jean II |
| 193 | */ | 193 | */ |
| 194 | #include <linux/module.h> | 194 | #include <linux/module.h> |
| 195 | #include <linux/slab.h> | ||
| 195 | 196 | ||
| 196 | #include <net/irda/irda.h> | 197 | #include <net/irda/irda.h> |
| 197 | #include <net/irda/irqueue.h> | 198 | #include <net/irda/irqueue.h> |
diff --git a/net/irda/irttp.c b/net/irda/irttp.c index 9cb79f95bf63..285761e77d90 100644 --- a/net/irda/irttp.c +++ b/net/irda/irttp.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
| 29 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
| 30 | #include <linux/seq_file.h> | 30 | #include <linux/seq_file.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | 32 | ||
| 32 | #include <asm/byteorder.h> | 33 | #include <asm/byteorder.h> |
| 33 | #include <asm/unaligned.h> | 34 | #include <asm/unaligned.h> |
| @@ -1852,23 +1853,23 @@ static int irttp_seq_show(struct seq_file *seq, void *v) | |||
| 1852 | self->remote_credit); | 1853 | self->remote_credit); |
| 1853 | seq_printf(seq, "send credit: %d\n", | 1854 | seq_printf(seq, "send credit: %d\n", |
| 1854 | self->send_credit); | 1855 | self->send_credit); |
| 1855 | seq_printf(seq, " tx packets: %ld, ", | 1856 | seq_printf(seq, " tx packets: %lu, ", |
| 1856 | self->stats.tx_packets); | 1857 | self->stats.tx_packets); |
| 1857 | seq_printf(seq, "rx packets: %ld, ", | 1858 | seq_printf(seq, "rx packets: %lu, ", |
| 1858 | self->stats.rx_packets); | 1859 | self->stats.rx_packets); |
| 1859 | seq_printf(seq, "tx_queue len: %d ", | 1860 | seq_printf(seq, "tx_queue len: %u ", |
| 1860 | skb_queue_len(&self->tx_queue)); | 1861 | skb_queue_len(&self->tx_queue)); |
| 1861 | seq_printf(seq, "rx_queue len: %d\n", | 1862 | seq_printf(seq, "rx_queue len: %u\n", |
| 1862 | skb_queue_len(&self->rx_queue)); | 1863 | skb_queue_len(&self->rx_queue)); |
| 1863 | seq_printf(seq, " tx_sdu_busy: %s, ", | 1864 | seq_printf(seq, " tx_sdu_busy: %s, ", |
| 1864 | self->tx_sdu_busy? "TRUE":"FALSE"); | 1865 | self->tx_sdu_busy? "TRUE":"FALSE"); |
| 1865 | seq_printf(seq, "rx_sdu_busy: %s\n", | 1866 | seq_printf(seq, "rx_sdu_busy: %s\n", |
| 1866 | self->rx_sdu_busy? "TRUE":"FALSE"); | 1867 | self->rx_sdu_busy? "TRUE":"FALSE"); |
| 1867 | seq_printf(seq, " max_seg_size: %d, ", | 1868 | seq_printf(seq, " max_seg_size: %u, ", |
| 1868 | self->max_seg_size); | 1869 | self->max_seg_size); |
| 1869 | seq_printf(seq, "tx_max_sdu_size: %d, ", | 1870 | seq_printf(seq, "tx_max_sdu_size: %u, ", |
| 1870 | self->tx_max_sdu_size); | 1871 | self->tx_max_sdu_size); |
| 1871 | seq_printf(seq, "rx_max_sdu_size: %d\n", | 1872 | seq_printf(seq, "rx_max_sdu_size: %u\n", |
| 1872 | self->rx_max_sdu_size); | 1873 | self->rx_max_sdu_size); |
| 1873 | 1874 | ||
| 1874 | seq_printf(seq, " Used by (%s)\n\n", | 1875 | seq_printf(seq, " Used by (%s)\n\n", |
