Skip to contentSkip to conversation

Bluetooth: Rename l2cap.c to l2cap_core.c

PATCH In review Gustavo F. Padovan 3 participants 4 messages Sep 4, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Bluetooth: Rename l2cap.c to l2cap_core.c

From: Gustavo F. Padovan <[email protected]>

This is a preparation for the l2cap.c split. New code is coming and we don't want such a big file.

---
 net/bluetooth/Makefile     |    2 +
 net/bluetooth/l2cap.c      | 4874 --------------------------------------------
 net/bluetooth/l2cap_core.c | 4874 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 4876 insertions(+), 4874 deletions(-)
 delete mode 100644 net/bluetooth/l2cap.c
 create mode 100644 net/bluetooth/l2cap_core.c
net/bluetooth/Makefile +2 -0
index d1e433f..94e1f57 100644
@@ -11,3 +11,5 @@ obj-$(CONFIG_BT_CMTP)	+= cmtp/
 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
net/bluetooth/l2cap.c deleted +0 -4874

2,995 lines not on this page · raw message

net/bluetooth/l2cap_core.c new file +4874 -0

4,874 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.1.1

Part of the diff is not shown here. View the raw message.

#1 lore raw

PATCH 2/2 Bluetooth: Initial move of L2CAP socket to l2cap_sock.c

From: Gustavo F. Padovan <[email protected]>

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().

---
 include/net/bluetooth/l2cap.h |   12 +++
 net/bluetooth/Makefile        |    2 +-
 net/bluetooth/l2cap_core.c    |  148 ++----------------------------
 net/bluetooth/l2cap_sock.c    |  201 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 223 insertions(+), 140 deletions(-)
 create mode 100644 net/bluetooth/l2cap_sock.c
include/net/bluetooth/l2cap.h +12 -0
index 6c24144..0bc0329 100644
@@ -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
index 94e1f57..6d1b1a3 100644
@@ -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 +9 -139

232 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.1.1
#2 lore raw

Re: [PATCH bluetooth-next-2.6 2/2] Bluetooth: Initial move of L2CAP socket to l2cap_sock.c

On Sat, Sep 4, 2010 at 5:18 AM, Gustavo F. Padovan <[email protected]> wr= ote:

Quoted 27 lines
net/bluetooth/l2cap_core.c +0 -0
index f2062aa..1f6d448 100644
@@ -57,24 +57,21 @@
 

=A0#define VERSION "2.15"

net/bluetooth/l2cap_core.c +1 -1
-static int disable_ertm =3D 0;
+int disable_ertm =3D 0;

=A0static u32 l2cap_feat_mask =3D L2CAP_FEAT_FIXED_CHAN; =A0static u8 l2cap_fixed_chan[8] =3D { 0x02, };

net/bluetooth/l2cap_core.c +0 -2
-static const struct proto_ops l2cap_sock_ops;
-

=A0static struct workqueue_struct *_busy_wq;

net/bluetooth/l2cap_core.c +1 -1
-static struct bt_sock_list l2cap_sk_list =3D {
+struct bt_sock_list l2cap_sk_list =3D {

=A0 =A0 =A0 =A0.lock =3D __RW_LOCK_UNLOCKED(l2cap_sk_list.lock) =A0};

=A0static void l2cap_busy_work(struct work_struct *work);

-static void __l2cap_sock_close(struct sock *sk, int reason); =A0static void l2cap_sock_close(struct sock *sk);

net/bluetooth/l2cap_core.c line 74

Quoted 2 lines
net/bluetooth/l2cap_core.c +1 -1
-static void l2cap_sock_kill(struct sock *sk);
+void l2cap_sock_kill(struct sock *sk);

If l2cap_core.c includes net/bluetooth/l2cap.h, you don't need the declaration above.

Regards,
--=20
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil

#3 lore raw

Re: [PATCH bluetooth-next-2.6 2/2] Bluetooth: Initial move of L2CAP socket to l2cap_sock.c

* Anderson Lizardo <[email protected]> [2010-09-04 09:14:56 -0= 400]:

Quoted 1 line

On Sat, Sep 4, 2010 at 5:18 AM, Gustavo F. Padovan <[email protected]> =

Quoted 25 lines · wrote:
Quoted 25 lines
net/bluetooth/l2cap_core.c +0 -0
index f2062aa..1f6d448 100644
@@ -57,24 +57,21 @@
 

=A0#define VERSION "2.15"

net/bluetooth/l2cap_core.c +1 -1
-static int disable_ertm =3D 0;
+int disable_ertm =3D 0;

=A0static u32 l2cap_feat_mask =3D L2CAP_FEAT_FIXED_CHAN; =A0static u8 l2cap_fixed_chan[8] =3D { 0x02, };

net/bluetooth/l2cap_core.c +0 -2
-static const struct proto_ops l2cap_sock_ops;
-

=A0static struct workqueue_struct *_busy_wq;

net/bluetooth/l2cap_core.c +1 -1
-static struct bt_sock_list l2cap_sk_list =3D {
+struct bt_sock_list l2cap_sk_list =3D {

=A0 =A0 =A0 =A0.lock =3D __RW_LOCK_UNLOCKED(l2cap_sk_list.lock) =A0};

=A0static void l2cap_busy_work(struct work_struct *work);

Quoted 7 lines

net/bluetooth/l2cap_core.c line 74

Quoted 4 lines

-static void __l2cap_sock_close(struct sock *sk, int reason); =A0static void l2cap_sock_close(struct sock *sk);

net/bluetooth/l2cap_core.c +1 -1
-static void l2cap_sock_kill(struct sock *sk);
+void l2cap_sock_kill(struct sock *sk);

=20
If l2cap_core.c includes net/bluetooth/l2cap.h, you don't need the declaration above.

Yes, you are right. Thanks for the review.

--=20
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi