ERMT and Streaming mode in L2CAP
Hi,
I'm programming a MCAP library for Bluez, (it is in beta state yet). I need add support for ERTM and Streaming mode to L2CAP sockets and i've seen some work included in l2cap kernel module by Gustavo F. Padovan. I have downloaded the kernel source fromgit://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
<http://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git>
and compiled it enabling ERTM module parameter to test my current implementation of MCAP profile.
I would like to know which is the current state of ERTM and Streaming mode in l2cap and if you are planning to continue the development task in above mentioned retransmission modes.
My tests using ERTM results in kernel oops messages when i try to send/receive a buffer data. I tested Streaming mode too but it does not do anything when data is sent over L2CAP sockets.
In [1] i adjunct the kernel oops message when ERTM is used.
Is it possible that i'm doing something wrong?. Next is the code that i'm using to set ERTM and Streaming mode in l2cap:
static int set_sock_options (int sock, uint16_t imtu, uint16_t omtu, uint8_t mode) {
struct l2cap_options opts;
int err;
socklen_t optlen = sizeof(opts);
err = getsockopt( sock, SOL_L2CAP, L2CAP_OPTIONS, &opts, &optlen );
if (!err) {
opts.omtu = omtu;
opts.imtu = imtu;
opts.mode = mode;
MCAP_DBG("Mode %d, fcs %d", opts.mode, opts.fcs);
err = setsockopt( sock, SOL_L2CAP, L2CAP_OPTIONS, &opts, optlen );
}
return err;}
i'm using L2CAP_MODE_ERTM and L2CAP_MODE_STREAMING macros to set the l2cap option mode field.
Best regards
[1] http://www.kerneloops.org/submitresult.php?number=858407
<http://www.kerneloops.org/submitresult.php?number=858407>
Next is the output that i got before kernel error is shown:
HCI sniffer - Bluetooth packet analyzer ver 1.42
device: hci0 snap_len: 1028 filter: 0xffffffff
Quoted 1 line
HCI Event: Connect Request (
0x04) plen 10
bdaddr 00:0A:94:02:CE:87 class 0x4a0100 type ACL
< HCI Command: Accept Connection Request (0x01|0x0009) plen 7
bdaddr 00:0A:94:02:CE:87 role 0x00
Role: Master
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
Accept Connection Request (0x01|0x0009) status 0x00 ncmd 1
Quoted 1 line
HCI Event: Role Change (
0x12) plen 8
status 0x00 bdaddr 00:0A:94:02:CE:87 role 0x00
Role: Master
Quoted 1 line
HCI Event: Connect Complete (
0x03) plen 11
status 0x00 handle 46 bdaddr 00:0A:94:02:CE:87 type ACL encrypt 0x00
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
handle 46
Quoted 1 line
HCI Event: Page Scan Repetition Mode Change (
0x20) plen 7
bdaddr 00:0A:94:02:CE:87 mode 1
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
Read Remote Supported Features (0x01|0x001b) status 0x00 ncmd 0
Quoted 1 line
HCI Event: Max Slots Change (
0x1b) plen 3
handle 46 slots 5
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
Unknown (0x00|0x0000) status 0x00 ncmd 1
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
bdaddr 00:0A:94:02:CE:87 mode 2 clkoffset 0x0000
Quoted 1 line
HCI Event: Read Remote Supported Features (
0x0b) plen 11
status 0x00 handle 46
Features: 0xff 0xff 0x8f 0xfe 0x9b 0xf9 0x00 0x80
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4
Remote Name Request (0x01|0x0019) status 0x00 ncmd 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 10
L2CAP(s): Info req: type 2
< ACL data: handle 46 flags 0x02 dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x00b8
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 10
L2CAP(s): Info req: type 3
< ACL data: handle 46 flags 0x02 dlen 20
L2CAP(s): Info rsp: type 3 result 0
Unknown (len 8)
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 12
L2CAP(s): Connect req: psm 4097 scid 0x0040
< ACL data: handle 46 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 1 status 0
Connection pending - No futher information available
< ACL data: handle 46 flags 0x02 dlen 10
L2CAP(s): Info req: type 2
Quoted 1 line
HCI Event: Remote Name Req Complete (
0x07) plen 255
status 0x00 bdaddr 00:0A:94:02:CE:87 name 'blueztester-0'
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask 0x00b8
< ACL data: handle 46 flags 0x02 dlen 10
L2CAP(s): Info req: type 3
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 20
L2CAP(s): Info rsp: type 3 result 0
Unknown (len 8)
< ACL data: handle 46 flags 0x02 dlen 16
L2CAP(s): Connect rsp: dcid 0x0040 scid 0x0040 result 0 status 0
Connection successful
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 23
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 11
RFC 0x03 (Reserved)
< ACL data: handle 46 flags 0x02 dlen 29
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 15
MTU 672 RFC 0x03 (Reserved)
< ACL data: handle 46 flags 0x02 dlen 23
L2CAP(s): Config req: dcid 0x0040 flags 0x00 clen 11
RFC 0x03 (Reserved)Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5
handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 29
L2CAP(s): Config rsp: scid 0x0040 flags 0x00 result 0 clen 15
MTU 672 RFC 0x03 (Reserved)
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 13
L2CAP(d): cid 0x0040 len 9 ctrl 0x0000 fcs 0x33e3 [psm 4097]
I-frame: Unsegmented TxSeq 0 ReqSeq 0
0000: 01 01 00 01 01 .....
< ACL data: handle 46 flags 0x02 dlen 13
L2CAP(d): cid 0x0040 len 9 ctrl 0x0000 fcs 0x9ff6 [psm 4097]
I-frame: Unsegmented TxSeq 0 ReqSeq 0
0000: 02 00 01 00 01 .....
Message from syslogd@XXXX at Oct 29 11:15:02 ...
kernel:[ 7162.427921] ------------[ cut here ]------------
Hi sancane,
Quoted 137 lines · sancane
Hi,
I'm programming a MCAP library for Bluez, (it is in beta state yet). I need add support for ERTM and Streaming mode to L2CAP sockets and i've seen some work included in l2cap kernel module by Gustavo F. Padovan. I have downloaded the kernel source fromgit://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
<http://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git>
and compiled it enabling ERTM module parameter to test my current implementation of MCAP profile.
I would like to know which is the current state of ERTM and Streaming mode in l2cap and if you are planning to continue the development task in above mentioned retransmission modes.
My tests using ERTM results in kernel oops messages when i try to send/receive a buffer data. I tested Streaming mode too but it does not do anything when data is sent over L2CAP sockets.
In [1] i adjunct the kernel oops message when ERTM is used.Is it possible that i'm doing something wrong?. Next is the code that i'm using to set ERTM and Streaming mode in l2cap:
static int
set_sock_options(int sock,uint16_timtu,uint16_tomtu,uint8_tmode) {
structl2cap_optionsopts;
int err;
socklen_toptlen = sizeof(opts);err =
getsockopt( sock, SOL_L2CAP, L2CAP_OPTIONS, &opts, &optlen ); if (!err) {
opts.omtu = omtu;
opts.imtu = imtu;
opts.mode = mode;
MCAP_DBG("Mode %d, fcs %d", opts.mode, opts.fcs);
err =setsockopt( sock, SOL_L2CAP, L2CAP_OPTIONS, &opts, optlen ); }
return err;}
i'm using
L2CAP_MODE_ERTMandL2CAP_MODE_STREAMINGmacros to set the l2cap option mode field.Best regards
[1] http://www.kerneloops.org/submitresult.php?number=858407
<http://www.kerneloops.org/submitresult.php?number=858407>Next is the output that i got before kernel error is shown:
HCI sniffer - Bluetooth packet analyzer ver 1.42
device: hci0snap_len: 1028 filter:0xffffffffQuoted 1 line
HCI Event: Connect Request (
0x04) plen 10bdaddr 00:0A:94:02:CE:87 class
0x4a0100type ACL < HCI Command: Accept Connection Request (0x01|0x0009) plen 7 bdaddr 00:0A:94:02:CE:87 role0x00
Role: MasterQuoted 1 line
HCI Event: Command Status (
0x0f) plen 4Accept Connection Request (0x01|0x0009) status
0x00ncmd 1Quoted 1 line
HCI Event: Role Change (
0x12) plen 8status
0x00bdaddr 00:0A:94:02:CE:87 role0x00
Role: MasterQuoted 1 line
HCI Event: Connect Complete (
0x03) plen 11status
0x00handle 46 bdaddr 00:0A:94:02:CE:87 type ACL encrypt0x00< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2 handle 46Quoted 1 line
HCI Event: Page Scan Repetition Mode Change (
0x20) plen 7bdaddr 00:0A:94:02:CE:87 mode 1
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4Read Remote Supported Features (0x01|0x001b) status
0x00ncmd 0Quoted 1 line
HCI Event: Max Slots Change (
0x1b) plen 3handle 46 slots 5
Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4Unknown (0x00|0x0000) status
0x00ncmd 1
< HCI Command: Remote Name Request (0x01|0x0019) plen 10 bdaddr 00:0A:94:02:CE:87 mode 2 clkoffset0x0000Quoted 1 line
HCI Event: Read Remote Supported Features (
0x0b) plen 11status
0x00handle 46
Features:0xff0xff0x8f0xfe0x9b0xf90x000x80Quoted 1 line
HCI Event: Command Status (
0x0f) plen 4Remote Name Request (0x01|0x0019) status
0x00ncmd 1Quoted 1 line
ACL data: handle 46 flags
0x02dlen 10L2CAP(s): Info req: type 2
< ACL data: handle 46 flags0x02dlen 16
L2CAP(s): Info rsp: type 2 result 0
Extended feature mask0x00b8Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 10L2CAP(s): Info req: type 3
< ACL data: handle 46 flags0x02dlen 20
L2CAP(s): Info rsp: type 3 result 0
Unknown (len 8)Quoted 1 line
ACL data: handle 46 flags
0x02dlen 12L2CAP(s): Connect req: psm 4097 scid
0x0040
< ACL data: handle 46 flags0x02dlen 16
L2CAP(s): Connect rsp: dcid0x0040scid0x0040result 1 status 0 Connection pending - No futher information available < ACL data: handle 46 flags0x02dlen 10
L2CAP(s): Info req: type 2Quoted 1 line
HCI Event: Remote Name Req Complete (
0x07) plen 255status
0x00bdaddr 00:0A:94:02:CE:87 name 'blueztester-0'Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 16L2CAP(s): Info rsp: type 2 result 0
Extended feature mask0x00b8
< ACL data: handle 46 flags0x02dlen 10
L2CAP(s): Info req: type 3Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 20L2CAP(s): Info rsp: type 3 result 0
Unknown (len 8)
< ACL data: handle 46 flags0x02dlen 16
L2CAP(s): Connect rsp: dcid0x0040scid0x0040result 0 status 0 Connection successfulQuoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 23L2CAP(s): Config req: dcid
0x0040flags0x00clen 11 RFC0x03(Reserved)
< ACL data: handle 46 flags0x02dlen 29
L2CAP(s): Config rsp: scid0x0040flags0x00result 0 clen 15 MTU 672 RFC0x03(Reserved)
< ACL data: handle 46 flags0x02dlen 23
L2CAP(s): Config req: dcid0x0040flags0x00clen 11 RFC0x03(Reserved)Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
HCI Event: Number of Completed Packets (
0x13) plen 5handle 46 packets 1
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 29L2CAP(s): Config rsp: scid
0x0040flags0x00result 0 clen 15 MTU 672 RFC0x03(Reserved)
Quoted 8 lines
Quoted 1 line
ACL data: handle 46 flags
0x02dlen 13L2CAP(d): cid
0x0040len 9 ctrl0x0000fcs0x33e3[psm 4097]
I-frame: Unsegmented TxSeq 0 ReqSeq 0
0000: 01 01 00 01 01 ..... < ACL data: handle 46 flags0x02dlen 13
L2CAP(d): cid0x0040len 9 ctrl0x0000fcs0x9ff6[psm 4097]
I-frame: Unsegmented TxSeq 0 ReqSeq 0
0000: 02 00 01 00 01
It looks you are using a duplex channel. This code doesn't support that. You need the patches I sent to mailing list on Oct 3.
.....
Quoted 8 lines
Message from syslogd@XXXX at Oct 29 11:15:02 ...
kernel:[ 7162.427921] ------------[ cut here ]------------
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Gustavo F. Padovan http://padovan.org
Hi Gustavo
Quoted 21 lines
Hi sancane,
Quoted 8 lines · sancane
Hi,
I'm programming a MCAP library for Bluez, (it is in beta state yet). I need add support for ERTM and Streaming mode to L2CAP sockets and i've seen some work included in l2cap kernel module by Gustavo F. Padovan. I have downloaded the kernel source fromgit://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
<http://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git>
and compiled it enabling ERTM module parameter to test my currentQuoted 8 lines
implementation of MCAP profile.
I would like to know which is the current state of ERTM and Streaming mode in l2cap and if you are planning to continue the development task in above mentioned retransmission modes.
My tests using ERTM results in kernel oops messages when i try to send/receive a buffer data. I tested Streaming mode too but it does not do anything when data is sent over L2CAP sockets.
......
Quoted 3 lines
It looks you are using a duplex channel. This code doesn't support that. You need the patches I sent to mailing list on Oct 3.
Thanks for your reply.
I'm finishing my MCAP implementation and i would like to test it against other implementations. I'll release my code when i think that it is in stable state although i can release it before if somebody is interested in it. It will be GPL and i'll announce here in the hope that it will be useful by other developer who want test it or used to implement other profiles like HDP.
I saw that you have been working in ERTM and Streming mode since August, i suppose that you have a l2cap module implementation more advanced, i would like to know if you have a git repository to get it, or if you can give me a local copy to use it for my tests.
Best regards
Hi sancane
Quoted 25 lines · sancane
Hi Gustavo
Quoted 21 lines
Hi sancane,
Quoted 8 lines · sancane
Hi,
I'm programming a MCAP library for Bluez, (it is in beta state yet). I need add support for ERTM and Streaming mode to L2CAP sockets and i've seen some work included in l2cap kernel module by Gustavo F. Padovan. I have downloaded the kernel source fromgit://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git
<http://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6.git>
and compiled it enabling ERTM module parameter to test my currentQuoted 8 lines
implementation of MCAP profile.
I would like to know which is the current state of ERTM and Streaming mode in l2cap and if you are planning to continue the development task in above mentioned retransmission modes.
My tests using ERTM results in kernel oops messages when i try to send/receive a buffer data. I tested Streaming mode too but it does not do anything when data is sent over L2CAP sockets.
......Quoted 3 lines
It looks you are using a duplex channel. This code doesn't support that. You need the patches I sent to mailing list on Oct 3.
Quoted 11 lines
Thanks for your reply.
I'm finishing my MCAP implementation and i would like to test it against other implementations. I'll release my code when i think that it is in stable state although i can release it before if somebody is interested in it. It will be GPL and i'll announce here in the hope that it will be useful by other developer who want test it or used to implement other profiles like HDP.
I saw that you have been working in ERTM and Streming mode since August, i suppose that you have a l2cap module implementation more advanced, i would like to know if you have a git repository to get it, or if you can give me a local copy to use it for my tests.
All my code except the patches of Oct 3 are on the bluetooth-testing.git tree. You can get this tree and apply my patches.
Quoted 7 lines
Best regards
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Gustavo F. Padovan http://padovan.org