Skip to content

Commit

Permalink
Bluetooth: Use struct list_head for L2CAP channels list
Browse files Browse the repository at this point in the history
Use a well known Kernel API is always a good idea than implement your own
list.
In the future we might use RCU on this list.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
  • Loading branch information
Gustavo F. Padovan committed Apr 7, 2011
1 parent 4845407 commit baa7e1f
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 112 deletions.
12 changes: 3 additions & 9 deletions include/net/bluetooth/l2cap.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,9 @@ struct l2cap_conn_param_update_rsp {
#define L2CAP_CONN_PARAM_REJECTED 0x0001

/* ----- L2CAP channels and connections ----- */

struct l2cap_chan {
struct sock *sk;
struct l2cap_chan *next_c;
struct l2cap_chan *prev_c;
};

struct l2cap_chan_list {
struct l2cap_chan *head;
rwlock_t lock;
struct list_head list;
};

struct l2cap_conn {
Expand All @@ -312,7 +305,8 @@ struct l2cap_conn {

__u8 disc_reason;

struct l2cap_chan_list chan_list;
struct list_head chan_l;
rwlock_t chan_lock;
};

struct sock_del_list {
Expand Down
Loading

0 comments on commit baa7e1f

Please sign in to comment.