Bluetooth: Initial move of L2CAP socket to l2cap_sock.c
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v3 2/2 Bluetooth: Initial move of L2CAP socket to l2cap_sock.c
This patch tries to do the minimal to move l2cap_sock_create() and its dependencies to l2cap_sock.c. It create a API to initialize and cleanup the L2CAP sockets from l2cap_core.c through l2cap_init_sockets() and l2cap_cleanup_sockets().
Signed-off-by Gustavo F. Padovan <[email protected]>
--- include/net/bluetooth/l2cap.h | 12 +++ net/bluetooth/Makefile | 2 +- net/bluetooth/l2cap_core.c | 172 ++--------------------------------- net/bluetooth/l2cap_sock.c | 201 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 222 insertions(+), 165 deletions(-) create mode 100644 net/bluetooth/l2cap_sock.c
include/net/bluetooth/l2cap.h +12 -0
@@ -423,6 +423,18 @@ static inline int l2cap_tx_window_full(struct sock *sk)#define __is_sframe (ctrl) (ctrl) & L2CAP_CTRL_FRAME_TYPE#define __is_sar_start (ctrl) ((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START +extern int disable_ertm; +extern const struct proto_ops l2cap_sock_ops; +extern struct bt_sock_list l2cap_sk_list; + +int l2cap_init_sockets (void ); +void l2cap_cleanup_sockets (void ); + +void __l2cap_sock_close (struct sock *sk,int reason); +void l2cap_sock_kill (struct sock *sk); +void l2cap_sock_init (struct sock *sk,struct sock *parent); +struct sock *l2cap_sock_alloc (struct net *net,struct socket *sock,int proto,gfp_t prio); +void l2cap_load (void );#endif /* __L2CAP_H */
net/bluetooth/Makefile +1 -1
@@ -12,4 +12,4 @@ obj-$(CONFIG_BT_HIDP) += hidp/ bluetooth-objs := af_bluetooth.o hci_core.o hci_conn.o hci_event.o hci_sock.o hci_sysfs.o lib.o -l2cap-objs := l2cap_core.o +l2cap-objs := l2cap_core.o l2cap_sock.o
net/bluetooth/l2cap_core.c +8 -164
262 lines not on this page · raw message
net/bluetooth/l2cap_sock.c new file +201 -0
201 lines not on this page · raw message
Signature · 1 line
1.7.2.2