* [Bluez-devel] L2CAP raw socket patch
@ 2004-02-10 11:49 Collin R. Mulliner
2004-02-10 22:16 ` Marcel Holtmann
0 siblings, 1 reply; 5+ messages in thread
From: Collin R. Mulliner @ 2004-02-10 11:49 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 694 bytes --]
Hi List,
I have written a small patch for l2cap.c to improve the capabilities of
L2CAP raw sockets. Currently only very few responses travel back to a
RAW socket (which is very bad if you need to see command responses).
The patch is very simple - it just puts all responses on the
Sig-Channel to all open RAW sockets. The owner of the raw socket just
needs to select his packets and in normal operation there shouldn't be
much use of RAW sockets so I don't think this is a performance issue.
I have attached the patch file to this email, hope this is ok.
thanks ... Collin
--
Collin Mulliner <collin@betaversion.net>
BATAVERSiON Systems [www.betaversion.net]
Don't ask why! Ask why not!
[-- Attachment #2: bluez_l2cap_rawsocket.patch --]
[-- Type: application/octet-stream, Size: 864 bytes --]
--- orig/l2cap.c 2003-08-25 13:44:44.000000000 +0200
+++ l2cap.c 2004-02-09 14:35:13.000000000 +0100
@@ -1663,6 +1663,12 @@
break;
}
+ /*
+ * for better low-level access
+ * put command to all raw sockets
+ */
+ l2cap_raw_recv(conn, skb);
+
switch (cmd.code) {
case L2CAP_CONN_REQ:
err = l2cap_connect_req(conn, &cmd, data);
@@ -1688,21 +1694,10 @@
err = l2cap_disconnect_rsp(conn, &cmd, data);
break;
- case L2CAP_COMMAND_REJ:
- /* FIXME: We should process this */
- l2cap_raw_recv(conn, skb);
- break;
-
case L2CAP_ECHO_REQ:
l2cap_send_rsp(conn, cmd.ident, L2CAP_ECHO_RSP, cmd.len, data);
break;
- case L2CAP_ECHO_RSP:
- case L2CAP_INFO_REQ:
- case L2CAP_INFO_RSP:
- l2cap_raw_recv(conn, skb);
- break;
-
default:
BT_ERR("Uknown signaling command 0x%2.2x", cmd.code);
err = -EINVAL;
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Bluez-devel] L2CAP raw socket patch
2004-02-10 11:49 [Bluez-devel] L2CAP raw socket patch Collin R. Mulliner
@ 2004-02-10 22:16 ` Marcel Holtmann
[not found] ` <20040210232330.4cf4935d.collin@betaversion.net>
0 siblings, 1 reply; 5+ messages in thread
From: Marcel Holtmann @ 2004-02-10 22:16 UTC (permalink / raw)
To: Collin R. Mulliner; +Cc: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 774 bytes --]
Hi Collin,
> I have written a small patch for l2cap.c to improve the capabilities of
> L2CAP raw sockets. Currently only very few responses travel back to a
> RAW socket (which is very bad if you need to see command responses).
> The patch is very simple - it just puts all responses on the
> Sig-Channel to all open RAW sockets. The owner of the raw socket just
> needs to select his packets and in normal operation there shouldn't be
> much use of RAW sockets so I don't think this is a performance issue.
do anyone have comments about this patch?
> I have attached the patch file to this email, hope this is ok.
BTW this patch is wrong, because we must keep the case statements.
Otherwise the kernel log will be filled with unneeded error messages.
Regards
Marcel
[-- Attachment #2: patch --]
[-- Type: text/x-patch, Size: 707 bytes --]
diff -urN linux-2.6.2/net/bluetooth/l2cap.c linux-2.6.2-mh/net/bluetooth/l2cap.c
--- linux-2.6.2/net/bluetooth/l2cap.c 2004-02-04 04:44:04.000000000 +0100
+++ linux-2.6.2-mh/net/bluetooth/l2cap.c 2004-02-10 23:04:49.000000000 +0100
@@ -1643,6 +1643,8 @@
break;
}
+ l2cap_raw_recv(conn, skb);
+
switch (cmd.code) {
case L2CAP_CONN_REQ:
err = l2cap_connect_req(conn, &cmd, data);
@@ -1670,7 +1672,6 @@
case L2CAP_COMMAND_REJ:
/* FIXME: We should process this */
- l2cap_raw_recv(conn, skb);
break;
case L2CAP_ECHO_REQ:
@@ -1680,7 +1681,6 @@
case L2CAP_ECHO_RSP:
case L2CAP_INFO_REQ:
case L2CAP_INFO_RSP:
- l2cap_raw_recv(conn, skb);
break;
default:
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-02-22 15:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-10 11:49 [Bluez-devel] L2CAP raw socket patch Collin R. Mulliner
2004-02-10 22:16 ` Marcel Holtmann
[not found] ` <20040210232330.4cf4935d.collin@betaversion.net>
2004-02-10 22:32 ` Marcel Holtmann
2004-02-10 23:07 ` Collin R. Mulliner
2004-02-22 15:31 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox