diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:43:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:43:29 -0400 |
commit | db6d8c7a4027b48d797b369a53f8470aaeed7063 (patch) | |
tree | e140c104a89abc2154e1f41a7db8ebecbb6fa0b4 /net/bluetooth/rfcomm/sock.c | |
parent | 3a533374283aea50eab3976d8a6d30532175f009 (diff) | |
parent | fb65a7c091529bfffb1262515252c0d0f6241c5c (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (1232 commits)
iucv: Fix bad merging.
net_sched: Add size table for qdiscs
net_sched: Add accessor function for packet length for qdiscs
net_sched: Add qdisc_enqueue wrapper
highmem: Export totalhigh_pages.
ipv6 mcast: Omit redundant address family checks in ip6_mc_source().
net: Use standard structures for generic socket address structures.
ipv6 netns: Make several "global" sysctl variables namespace aware.
netns: Use net_eq() to compare net-namespaces for optimization.
ipv6: remove unused macros from net/ipv6.h
ipv6: remove unused parameter from ip6_ra_control
tcp: fix kernel panic with listening_get_next
tcp: Remove redundant checks when setting eff_sacks
tcp: options clean up
tcp: Fix MD5 signatures for non-linear skbs
sctp: Update sctp global memory limit allocations.
sctp: remove unnecessary byteshifting, calculate directly in big-endian
sctp: Allow only 1 listening socket with SO_REUSEADDR
sctp: Do not leak memory on multiple listen() calls
sctp: Support ipv6only AF_INET6 sockets.
...
Diffstat (limited to 'net/bluetooth/rfcomm/sock.c')
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index 5083adcbfae5..8a972b6ba85f 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -23,8 +23,6 @@ | |||
23 | 23 | ||
24 | /* | 24 | /* |
25 | * RFCOMM sockets. | 25 | * RFCOMM sockets. |
26 | * | ||
27 | * $Id: sock.c,v 1.24 2002/10/03 01:00:34 maxk Exp $ | ||
28 | */ | 26 | */ |
29 | 27 | ||
30 | #include <linux/module.h> | 28 | #include <linux/module.h> |
@@ -309,13 +307,13 @@ static struct sock *rfcomm_sock_alloc(struct net *net, struct socket *sock, int | |||
309 | sk->sk_destruct = rfcomm_sock_destruct; | 307 | sk->sk_destruct = rfcomm_sock_destruct; |
310 | sk->sk_sndtimeo = RFCOMM_CONN_TIMEOUT; | 308 | sk->sk_sndtimeo = RFCOMM_CONN_TIMEOUT; |
311 | 309 | ||
312 | sk->sk_sndbuf = RFCOMM_MAX_CREDITS * RFCOMM_DEFAULT_MTU * 10; | 310 | sk->sk_sndbuf = RFCOMM_MAX_CREDITS * RFCOMM_DEFAULT_MTU * 10; |
313 | sk->sk_rcvbuf = RFCOMM_MAX_CREDITS * RFCOMM_DEFAULT_MTU * 10; | 311 | sk->sk_rcvbuf = RFCOMM_MAX_CREDITS * RFCOMM_DEFAULT_MTU * 10; |
314 | 312 | ||
315 | sock_reset_flag(sk, SOCK_ZAPPED); | 313 | sock_reset_flag(sk, SOCK_ZAPPED); |
316 | 314 | ||
317 | sk->sk_protocol = proto; | 315 | sk->sk_protocol = proto; |
318 | sk->sk_state = BT_OPEN; | 316 | sk->sk_state = BT_OPEN; |
319 | 317 | ||
320 | bt_sock_link(&rfcomm_sk_list, sk); | 318 | bt_sock_link(&rfcomm_sk_list, sk); |
321 | 319 | ||
@@ -413,6 +411,8 @@ static int rfcomm_sock_connect(struct socket *sock, struct sockaddr *addr, int a | |||
413 | bacpy(&bt_sk(sk)->dst, &sa->rc_bdaddr); | 411 | bacpy(&bt_sk(sk)->dst, &sa->rc_bdaddr); |
414 | rfcomm_pi(sk)->channel = sa->rc_channel; | 412 | rfcomm_pi(sk)->channel = sa->rc_channel; |
415 | 413 | ||
414 | d->link_mode = rfcomm_pi(sk)->link_mode; | ||
415 | |||
416 | err = rfcomm_dlc_open(d, &bt_sk(sk)->src, &sa->rc_bdaddr, sa->rc_channel); | 416 | err = rfcomm_dlc_open(d, &bt_sk(sk)->src, &sa->rc_bdaddr, sa->rc_channel); |
417 | if (!err) | 417 | if (!err) |
418 | err = bt_sock_wait_state(sk, BT_CONNECTED, | 418 | err = bt_sock_wait_state(sk, BT_CONNECTED, |
@@ -688,6 +688,8 @@ static int rfcomm_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
688 | copied += chunk; | 688 | copied += chunk; |
689 | size -= chunk; | 689 | size -= chunk; |
690 | 690 | ||
691 | sock_recv_timestamp(msg, sk, skb); | ||
692 | |||
691 | if (!(flags & MSG_PEEK)) { | 693 | if (!(flags & MSG_PEEK)) { |
692 | atomic_sub(chunk, &sk->sk_rmem_alloc); | 694 | atomic_sub(chunk, &sk->sk_rmem_alloc); |
693 | 695 | ||
@@ -793,15 +795,20 @@ static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned lon | |||
793 | struct sock *sk = sock->sk; | 795 | struct sock *sk = sock->sk; |
794 | int err; | 796 | int err; |
795 | 797 | ||
796 | lock_sock(sk); | 798 | BT_DBG("sk %p cmd %x arg %lx", sk, cmd, arg); |
799 | |||
800 | err = bt_sock_ioctl(sock, cmd, arg); | ||
797 | 801 | ||
802 | if (err == -ENOIOCTLCMD) { | ||
798 | #ifdef CONFIG_BT_RFCOMM_TTY | 803 | #ifdef CONFIG_BT_RFCOMM_TTY |
799 | err = rfcomm_dev_ioctl(sk, cmd, (void __user *)arg); | 804 | lock_sock(sk); |
805 | err = rfcomm_dev_ioctl(sk, cmd, (void __user *) arg); | ||
806 | release_sock(sk); | ||
800 | #else | 807 | #else |
801 | err = -EOPNOTSUPP; | 808 | err = -EOPNOTSUPP; |
802 | #endif | 809 | #endif |
810 | } | ||
803 | 811 | ||
804 | release_sock(sk); | ||
805 | return err; | 812 | return err; |
806 | } | 813 | } |
807 | 814 | ||