diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-03 23:43:46 -0500 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-02-07 22:43:30 -0500 |
commit | d7175d55255cb0a576844bc6e986000e0d7f8e9d (patch) | |
tree | e63d445a79fefab0a17d2b69ab86503450481c13 | |
parent | c47b7c724bc7106acf602b2ce99922a2d14ea62b (diff) |
Bluetooth: move l2cap_sock_getname() to l2cap_sock.c
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r-- | include/net/bluetooth/l2cap.h | 1 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 23 | ||||
-rw-r--r-- | 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 7921b6b980cb..0d0c18014a54 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, | |||
439 | int proto, gfp_t prio); | 439 | int proto, gfp_t prio); |
440 | 440 | ||
441 | int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags); | 441 | int l2cap_sock_connect(struct socket *sock, struct sockaddr *addr, int alen, int flags); |
442 | int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer); | ||
443 | int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len); | 442 | int l2cap_sock_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len); |
444 | int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); | 443 | int l2cap_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); |
445 | int l2cap_sock_shutdown(struct socket *sock, int how); | 444 | int l2cap_sock_shutdown(struct socket *sock, int how); |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index ff6a54ffed89..bd46cacc165a 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -993,29 +993,6 @@ done: | |||
993 | return err; | 993 | return err; |
994 | } | 994 | } |
995 | 995 | ||
996 | int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer) | ||
997 | { | ||
998 | struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr; | ||
999 | struct sock *sk = sock->sk; | ||
1000 | |||
1001 | BT_DBG("sock %p, sk %p", sock, sk); | ||
1002 | |||
1003 | addr->sa_family = AF_BLUETOOTH; | ||
1004 | *len = sizeof(struct sockaddr_l2); | ||
1005 | |||
1006 | if (peer) { | ||
1007 | la->l2_psm = l2cap_pi(sk)->psm; | ||
1008 | bacpy(&la->l2_bdaddr, &bt_sk(sk)->dst); | ||
1009 | la->l2_cid = cpu_to_le16(l2cap_pi(sk)->dcid); | ||
1010 | } else { | ||
1011 | la->l2_psm = l2cap_pi(sk)->sport; | ||
1012 | bacpy(&la->l2_bdaddr, &bt_sk(sk)->src); | ||
1013 | la->l2_cid = cpu_to_le16(l2cap_pi(sk)->scid); | ||
1014 | } | ||
1015 | |||
1016 | return 0; | ||
1017 | } | ||
1018 | |||
1019 | static int __l2cap_wait_ack(struct sock *sk) | 996 | static int __l2cap_wait_ack(struct sock *sk) |
1020 | { | 997 | { |
1021 | DECLARE_WAITQUEUE(wait, current); | 998 | DECLARE_WAITQUEUE(wait, current); |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index b19a386332fc..4c13f8bc1b18 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
@@ -253,6 +253,29 @@ done: | |||
253 | return err; | 253 | return err; |
254 | } | 254 | } |
255 | 255 | ||
256 | static int l2cap_sock_getname(struct socket *sock, struct sockaddr *addr, int *len, int peer) | ||
257 | { | ||
258 | struct sockaddr_l2 *la = (struct sockaddr_l2 *) addr; | ||
259 | struct sock *sk = sock->sk; | ||
260 | |||
261 | BT_DBG("sock %p, sk %p", sock, sk); | ||
262 | |||
263 | addr->sa_family = AF_BLUETOOTH; | ||
264 | *len = sizeof(struct sockaddr_l2); | ||
265 | |||
266 | if (peer) { | ||
267 | la->l2_psm = l2cap_pi(sk)->psm; | ||
268 | bacpy(&la->l2_bdaddr, &bt_sk(sk)->dst); | ||
269 | la->l2_cid = cpu_to_le16(l2cap_pi(sk)->dcid); | ||
270 | } else { | ||
271 | la->l2_psm = l2cap_pi(sk)->sport; | ||
272 | bacpy(&la->l2_bdaddr, &bt_sk(sk)->src); | ||
273 | la->l2_cid = cpu_to_le16(l2cap_pi(sk)->scid); | ||
274 | } | ||
275 | |||
276 | return 0; | ||
277 | } | ||
278 | |||
256 | static int l2cap_sock_release(struct socket *sock) | 279 | static int l2cap_sock_release(struct socket *sock) |
257 | { | 280 | { |
258 | struct sock *sk = sock->sk; | 281 | struct sock *sk = sock->sk; |