From: "Gustavo F. Padovan" <padovan@profusion.mobi>
To: linux-bluetooth@vger.kernel.org
Subject: [bluetooth-next 07/16] Bluetooth: move l2cap_sock_getname() to l2cap_sock.c
Date: Fri, 4 Feb 2011 04:01:49 -0200 [thread overview]
Message-ID: <1296799318-5517-8-git-send-email-padovan@profusion.mobi> (raw)
In-Reply-To: <1296799318-5517-7-git-send-email-padovan@profusion.mobi>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
---
include/net/bluetooth/l2cap.h | 1 -
net/bluetooth/l2cap_core.c | 23 -----------------------
net/bluetooth/l2cap_sock.c | 23 +++++++++++++++++++++++
3 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7921b6b..0d0c180 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -439,7 +439,6 @@ struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
int proto, gfp_t prio);
int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags);
-int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer);
int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len);
int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags);
int l2cap_sock_shutdown(struct socket *sock, int how);
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 32a615a..6d0d81d 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -992,29 +992,6 @@ done:
return err;
}
-int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
-{
- struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr;
- struct sock *sk = sock->sk;
-
- BT_DBG("sock %p, sk %p", sock, sk);
-
- addr->sa_family = AF_BLUETOOTH;
- *len = sizeof(struct sockaddr_l2);
-
- if (peer) {
- la->l2_psm = l2cap_pi(sk)->psm;
- bacpy(&la->l2_bdaddr, &bt_sk(sk)->dst);
- la->l2_cid = cpu_to_le16(l2cap_pi(sk)->dcid);
- } else {
- la->l2_psm = l2cap_pi(sk)->sport;
- bacpy(&la->l2_bdaddr, &bt_sk(sk)->src);
- la->l2_cid = cpu_to_le16(l2cap_pi(sk)->scid);
- }
-
- return 0;
-}
-
static int __l2cap_wait_ack(struct sock *sk)
{
DECLARE_WAITQUEUE(wait, current);
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index b19a386..4c13f8b 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -253,6 +253,29 @@ done:
return err;
}
+static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer)
+{
+ struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr;
+ struct sock *sk = sock->sk;
+
+ BT_DBG("sock %p, sk %p", sock, sk);
+
+ addr->sa_family = AF_BLUETOOTH;
+ *len = sizeof(struct sockaddr_l2);
+
+ if (peer) {
+ la->l2_psm = l2cap_pi(sk)->psm;
+ bacpy(&la->l2_bdaddr, &bt_sk(sk)->dst);
+ la->l2_cid = cpu_to_le16(l2cap_pi(sk)->dcid);
+ } else {
+ la->l2_psm = l2cap_pi(sk)->sport;
+ bacpy(&la->l2_bdaddr, &bt_sk(sk)->src);
+ la->l2_cid = cpu_to_le16(l2cap_pi(sk)->scid);
+ }
+
+ return 0;
+}
+
static int l2cap_sock_release(struct socket *sock)
{
struct sock *sk = sock->sk;
--
1.7.4.rc3
next prev parent reply other threads:[~2011-02-04 6:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-04 6:01 [bluetooth-next 00/16] l2cap.c split Gustavo F. Padovan
[not found] ` <1296799318-5517-2-git-send-email-padovan@profusion.mobi>
2011-02-04 6:01 ` [bluetooth-next 02/16] Bluetooth: Initial work for L2CAP split Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 03/16] Bluetooth: move l2cap_sock_ops to l2cap_sock.c Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 04/16] Bluetooth: move l2cap_sock_release() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 05/16] Bluetooth: move l2cap_sock_bind()/listen() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 06/16] Bluetooth: move l2cap_sock_accept() " Gustavo F. Padovan
2011-02-04 6:01 ` Gustavo F. Padovan [this message]
2011-02-04 6:01 ` [bluetooth-next 08/16] Bluetooth: move l2cap_sock_setsockopt() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 09/16] Bluetooth: move l2cap_sock_getsockopt() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 10/16] Bluetooth: move l2cap_sock_connect() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 11/16] Bluetooth: move l2cap_sock_recvmsg() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 12/16] Bluetooth: move l2cap_sock_shutdown() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 13/16] Bluetooth: move l2cap_sock_sendmsg() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 14/16] Bluetooth: move L2CAP sock timers function " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 15/16] Bluetooth: move l2cap_sock_kill() " Gustavo F. Padovan
2011-02-04 6:01 ` [bluetooth-next 16/16] Bluetooth: move __l2cap_sock_close() " Gustavo F. Padovan
2011-02-04 12:38 ` [bluetooth-next 00/16] l2cap.c split Luiz Augusto von Dentz
2011-02-04 13:44 ` Gustavo F. Padovan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1296799318-5517-8-git-send-email-padovan@profusion.mobi \
--to=padovan@profusion.mobi \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).