Commit 23691d75 authored by Gustavo F. Padovan's avatar Gustavo F. Padovan

Bluetooth: Remove l2cap_sk_list

A new list was added to replace the socket based one. This new list
doesn't depent on sock and then fits better inside l2cap_core.c code.

It also rename l2cap_chan_alloc() to l2cap_chan_create() and
l2cap_chan_free() to l2cap_chan_destroy)
Signed-off-by: default avatarGustavo F. Padovan <padovan@profusion.mobi>
parent 73b2ec18
...@@ -350,6 +350,7 @@ struct l2cap_chan { ...@@ -350,6 +350,7 @@ struct l2cap_chan {
struct list_head srej_l; struct list_head srej_l;
struct list_head list; struct list_head list;
struct list_head global_l;
}; };
struct l2cap_conn { struct l2cap_conn {
...@@ -441,7 +442,6 @@ static inline int l2cap_tx_window_full(struct l2cap_chan *ch) ...@@ -441,7 +442,6 @@ static inline int l2cap_tx_window_full(struct l2cap_chan *ch)
#define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) #define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START)
extern int disable_ertm; extern int disable_ertm;
extern struct bt_sock_list l2cap_sk_list;
int l2cap_init_sockets(void); int l2cap_init_sockets(void);
void l2cap_cleanup_sockets(void); void l2cap_cleanup_sockets(void);
...@@ -469,9 +469,9 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent); ...@@ -469,9 +469,9 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent);
struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
int proto, gfp_t prio); int proto, gfp_t prio);
void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err); void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err);
struct l2cap_chan *l2cap_chan_alloc(struct sock *sk); struct l2cap_chan *l2cap_chan_create(struct sock *sk);
void l2cap_chan_del(struct l2cap_chan *chan, int err); void l2cap_chan_del(struct l2cap_chan *chan, int err);
void l2cap_chan_free(struct l2cap_chan *chan); void l2cap_chan_destroy(struct l2cap_chan *chan);
int l2cap_chan_connect(struct l2cap_chan *chan); int l2cap_chan_connect(struct l2cap_chan *chan);
#endif /* __L2CAP_H */ #endif /* __L2CAP_H */
This diff is collapsed.
...@@ -808,8 +808,7 @@ void l2cap_sock_kill(struct sock *sk) ...@@ -808,8 +808,7 @@ void l2cap_sock_kill(struct sock *sk)
/* Kill poor orphan */ /* Kill poor orphan */
l2cap_chan_free(l2cap_pi(sk)->chan); l2cap_chan_destroy(l2cap_pi(sk)->chan);
bt_sock_unlink(&l2cap_sk_list, sk);
sock_set_flag(sk, SOCK_DEAD); sock_set_flag(sk, SOCK_DEAD);
sock_put(sk); sock_put(sk);
} }
...@@ -1025,7 +1024,6 @@ struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int proto, g ...@@ -1025,7 +1024,6 @@ struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, int proto, g
setup_timer(&sk->sk_timer, l2cap_sock_timeout, (unsigned long) sk); setup_timer(&sk->sk_timer, l2cap_sock_timeout, (unsigned long) sk);
bt_sock_link(&l2cap_sk_list, sk);
return sk; return sk;
} }
...@@ -1052,7 +1050,7 @@ static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol, ...@@ -1052,7 +1050,7 @@ static int l2cap_sock_create(struct net *net, struct socket *sock, int protocol,
if (!sk) if (!sk)
return -ENOMEM; return -ENOMEM;
chan = l2cap_chan_alloc(sk); chan = l2cap_chan_create(sk);
if (!chan) { if (!chan) {
l2cap_sock_kill(sk); l2cap_sock_kill(sk);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment