diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-07-14 14:13:50 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-07-14 14:13:50 -0400 |
commit | 3241ad820dbb172021e0268b5611031991431626 (patch) | |
tree | 628c3fbdc88f9de6c996358ebcb551176da38f1f /net/bluetooth/rfcomm | |
parent | 40be492fe4fab829951681860c2bb26fa1d5fe4a (diff) |
[Bluetooth] Add timestamp support to L2CAP, RFCOMM and SCO
Enable the common timestamp functionality that the network subsystem
provides for L2CAP, RFCOMM and SCO sockets. It is possible to either
use SO_TIMESTAMP or the IOCTLs to retrieve the timestamp of the
current packet.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/rfcomm')
-rw-r--r-- | net/bluetooth/rfcomm/sock.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index cacb1ab51f99..c3ed076481d8 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -690,6 +690,8 @@ static int rfcomm_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
690 | copied += chunk; | 690 | copied += chunk; |
691 | size -= chunk; | 691 | size -= chunk; |
692 | 692 | ||
693 | sock_recv_timestamp(msg, sk, skb); | ||
694 | |||
693 | if (!(flags & MSG_PEEK)) { | 695 | if (!(flags & MSG_PEEK)) { |
694 | atomic_sub(chunk, &sk->sk_rmem_alloc); | 696 | atomic_sub(chunk, &sk->sk_rmem_alloc); |
695 | 697 | ||
@@ -795,15 +797,20 @@ static int rfcomm_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned lon | |||
795 | struct sock *sk = sock->sk; | 797 | struct sock *sk = sock->sk; |
796 | int err; | 798 | int err; |
797 | 799 | ||
798 | lock_sock(sk); | 800 | BT_DBG("sk %p cmd %x arg %lx", sk, cmd, arg); |
799 | 801 | ||
802 | err = bt_sock_ioctl(sock, cmd, arg); | ||
803 | |||
804 | if (err == -ENOIOCTLCMD) { | ||
800 | #ifdef CONFIG_BT_RFCOMM_TTY | 805 | #ifdef CONFIG_BT_RFCOMM_TTY |
801 | err = rfcomm_dev_ioctl(sk, cmd, (void __user *)arg); | 806 | lock_sock(sk); |
807 | err = rfcomm_dev_ioctl(sk, cmd, (void __user *) arg); | ||
808 | release_sock(sk); | ||
802 | #else | 809 | #else |
803 | err = -EOPNOTSUPP; | 810 | err = -EOPNOTSUPP; |
804 | #endif | 811 | #endif |
812 | } | ||
805 | 813 | ||
806 | release_sock(sk); | ||
807 | return err; | 814 | return err; |
808 | } | 815 | } |
809 | 816 | ||