Bluetooth: L2CAP: Try harder to accept device not knowing options
Subsystems (2)
PATCH 1/1 Bluetooth: L2CAP: Try harder to accept device not knowing options
The current implementation of L2CAP options negotiation will continue the negotiation when a device responds with L2CAP_CONF_UNACCEPT ("unaccepted options"), but not when the device replies with L2CAP_CONF_UNKNOWN ("unknown options").
Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797) to connect.
btmon before patch:
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #64 [hci0] 59.182702
L2CAP: Connection Response (0x03) ident 2 len 8
Destination CID: 64
Source CID: 64
Result: Connection successful (0x0000)
Status: No further information available (0x0000)< ACL Data TX: Handle 256 flags 0x00 dlen 23 #65 [hci0] 59.182744
L2CAP: Configure Request (0x04) ident 3 len 15
Destination CID: 64
Flags: 0x0000
Option: Retransmission and Flow Control (0x04) [mandatory]
Mode: Basic (0x00)
TX window size: 0
Max transmit: 0
Retransmission timeout: 0
Monitor timeout: 0
Maximum PDU size: 0
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #66 [hci0] 59.183948
L2CAP: Configure Request (0x04) ident 1 len 8
Destination CID: 64
Flags: 0x0000
Option: Maximum Transmission Unit (0x01) [mandatory]
MTU: 1480
< ACL Data TX: Handle 256 flags 0x00 dlen 18 #67 [hci0] 59.183994
L2CAP: Configure Response (0x05) ident 1 len 10
Source CID: 64
Flags: 0x0000
Result: Success (0x0000)
Option: Maximum Transmission Unit (0x01) [mandatory]
MTU: 1480Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 15 #69 [hci0] 59.187676
L2CAP: Configure Response (0x05) ident 3 len 7
Source CID: 64
Flags: 0x0000
Result: Failure - unknown options (0x0003)
04 .< ACL Data TX: Handle 256 flags 0x00 dlen 12 #70 [hci0] 59.187722
L2CAP: Disconnection Request (0x06) ident 4 len 4
Destination CID: 64
Source CID: 64
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 12 #73 [hci0] 59.192714
L2CAP: Disconnection Response (0x07) ident 4 len 4
Destination CID: 64
Source CID: 64
btmon after patch:
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #248 [hci0] 103.502970
L2CAP: Connection Response (0x03) ident 5 len 8
Destination CID: 65
Source CID: 65
Result: Connection pending (0x0001)
Status: No further information available (0x0000)Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #249 [hci0] 103.504184
L2CAP: Connection Response (0x03) ident 5 len 8
Destination CID: 65
Source CID: 65
Result: Connection successful (0x0000)
Status: No further information available (0x0000)< ACL Data TX: Handle 256 flags 0x00 dlen 23 #250 [hci0] 103.504398
L2CAP: Configure Request (0x04) ident 6 len 15
Destination CID: 65
Flags: 0x0000
Option: Retransmission and Flow Control (0x04) [mandatory]
Mode: Basic (0x00)
TX window size: 0
Max transmit: 0
Retransmission timeout: 0
Monitor timeout: 0
Maximum PDU size: 0
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #251 [hci0] 103.505472
L2CAP: Configure Request (0x04) ident 3 len 8
Destination CID: 65
Flags: 0x0000
Option: Maximum Transmission Unit (0x01) [mandatory]
MTU: 1480
< ACL Data TX: Handle 256 flags 0x00 dlen 18 #252 [hci0] 103.505689
L2CAP: Configure Response (0x05) ident 3 len 10
Source CID: 65
Flags: 0x0000
Result: Success (0x0000)
Option: Maximum Transmission Unit (0x01) [mandatory]
MTU: 1480Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 15 #254 [hci0] 103.509165
L2CAP: Configure Response (0x05) ident 6 len 7
Source CID: 65
Flags: 0x0000
Result: Failure - unknown options (0x0003)
04 .
< ACL Data TX: Handle 256 flags 0x00 dlen 12 #255 [hci0] 103.509426
L2CAP: Configure Request (0x04) ident 7 len 4
Destination CID: 65
Flags: 0x0000
< ACL Data TX: Handle 256 flags 0x00 dlen 12 #257 [hci0] 103.511870
L2CAP: Connection Request (0x02) ident 8 len 4
PSM: 1 (0x0001)
Source CID: 66Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 14 #259 [hci0] 103.514121
L2CAP: Configure Response (0x05) ident 7 len 6
Source CID: 65
Flags: 0x0000
Result: Success (0x0000)--- net/bluetooth/l2cap_core.c | 1 + 1 file changed, 1 insertion(+)
net/bluetooth/l2cap_core.c +1 -0
@@ -4513,6 +4513,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, } goto done; +case L2CAP_CONF_UNKNOWN :case L2CAP_CONF_UNACCEPT :if (chan->num_conf_rsp <=L2CAP_CONF_MAX_CONF_RSP ) {char req[64 ];
Signature · 1 line
2.29.2
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=398401
---Test result---
##############################
Test: CheckPatch - FAIL
Output:
Bluetooth: L2CAP: Try harder to accept device not knowing options
WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #8:
the negotiation when a device responds with L2CAP_CONF_UNACCEPT ("unaccepted
WARNING: Co-developed-by: must be immediately followed by Signed-off-by:
#120:
ERROR: Missing Signed-off-by: line by nominal patch author 'Bastien Nocera <[email protected]>'
total: 1 errors, 2 warnings, 0 checks, 7 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
"[PATCH] Bluetooth: L2CAP: Try harder to accept device not knowing" has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: CheckGitLint - FAIL
Output:
Bluetooth: L2CAP: Try harder to accept device not knowing options
13: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 16 #64 [hci0] 59.182702" 19: B1 Line exceeds max length (92>80): "< ACL Data TX: Handle 256 flags 0x00 dlen 23 #65 [hci0] 59.182744" 30: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 16 #66 [hci0] 59.183948" 36: B1 Line exceeds max length (92>80): "< ACL Data TX: Handle 256 flags 0x00 dlen 18 #67 [hci0] 59.183994" 43: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 15 #69 [hci0] 59.187676" 49: B1 Line exceeds max length (92>80): "< ACL Data TX: Handle 256 flags 0x00 dlen 12 #70 [hci0] 59.187722" 53: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 12 #73 [hci0] 59.192714" 59: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 16 #248 [hci0] 103.502970" 65: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 16 #249 [hci0] 103.504184" 71: B1 Line exceeds max length (92>80): "< ACL Data TX: Handle 256 flags 0x00 dlen 23 #250 [hci0] 103.504398" 82: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 16 #251 [hci0] 103.505472" 88: B1 Line exceeds max length (92>80): "< ACL Data TX: Handle 256 flags 0x00 dlen 18 #252 [hci0] 103.505689" 95: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 15 #254 [hci0] 103.509165" 101: B1 Line exceeds max length (92>80): "< ACL Data TX: Handle 256 flags 0x00 dlen 12 #255 [hci0] 103.509426" 105: B1 Line exceeds max length (92>80): "< ACL Data TX: Handle 256 flags 0x00 dlen 12 #257 [hci0] 103.511870" 109: B1 Line exceeds max length (92>80): "> ACL Data RX: Handle 256 flags 0x02 dlen 14 #259 [hci0] 103.514121"
##############################
Test: CheckBuildK - PASS
---
Regards,
Linux Bluetooth
A message that is not in the archive (sent off-list or not yet received): CABBYNZJNTDek+kKS5wtrr67Xx8DmFGvcV13cLSxULgJRa5N+3g@mail.gmail.com
Quoted 23 lines · Luiz Augusto von Dentz
Hi Bastien,
Quoted 9 lines · Bastien Nocera
The current implementation of L2CAP options negotiation will continue
the negotiation when a device responds withL2CAP_CONF_UNACCEPT("unaccepted
options"), but not when the device replies withL2CAP_CONF_UNKNOWN("unknown
options").Quoted 4 lines
Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797)
to connect.While the bellow traces looks fine we need to confirm that it doesn't break the qualification tests e.g:
L2CAP/COS/CFD/BV-14-C [Unknown Mandatory Options Request]
Quoted 8 lines
• Test Purpose Verify that the IUT can give the appropriate error code
when the Lower Tester proposes any number of unknown options where at least one is mandatory.Afaik it should be fine to continue with another round of configuration given that it only expects the error
0x0003, but we better confirm PTS doesn't expect a L2CAP Disconnect after it.
I have a Windows machine, and the PTS dongle. How do I set up the qualification test and run it against the Linux machine before and after the patch?
Luiz Augusto von Dentz
maintainerHi Tedd,
Quoted 30 lines · Bastien Nocera
Quoted 28 lines · Luiz Augusto von Dentz
Hi Bastien,
Quoted 9 lines · Bastien Nocera
The current implementation of L2CAP options negotiation will continue
the negotiation when a device responds withL2CAP_CONF_UNACCEPT("unaccepted
options"), but not when the device replies withL2CAP_CONF_UNKNOWN("unknown
options").Quoted 4 lines
Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797)
to connect.While the bellow traces looks fine we need to confirm that it doesn't break the qualification tests e.g:
L2CAP/COS/CFD/BV-14-C [Unknown Mandatory Options Request]
• Test Purpose Verify that the IUT can give the appropriate error code
when the Lower Tester proposes any number of unknown options where at least one is mandatory.
Quoted 7 lines
Quoted 3 lines
Afaik it should be fine to continue with another round of configuration given that it only expects the error
0x0003, but we better confirm PTS doesn't expect a L2CAP Disconnect after it.I have a Windows machine, and the PTS dongle. How do I set up the qualification test and run it against the Linux machine before and after the patch?
@Tedd: Do we happen to autopts working with BlueZ for L2CAP tests? Or perhaps anything that Bastien can use as a reference to test his changes.
@Batien: We would like to have autopts
(https://github.com/intel/auto-pts) to handle the qualification but there is still some work pending in order to enable it to work with L2CAP. Ultimately we could even attempt to integrate autopts on CI to run it automatically, but in order to do that we need:
1. We need to emulate the PTS dongle (USB emulator?)
2. Run a Windows VM on CI, attach the emulated dongle to it and run PTS on top (not sure if github actions do allow this)
3. Identify what tests need to run e.g. L2CAP changes should trigger only L2CAP tests
Signature · 1 line
Luiz Augusto von Dentz
Quoted 23 lines · Luiz Augusto von Dentz
Hi Bastien,
Quoted 9 lines · Bastien Nocera
The current implementation of L2CAP options negotiation will continue
the negotiation when a device responds withL2CAP_CONF_UNACCEPT("unaccepted
options"), but not when the device replies withL2CAP_CONF_UNKNOWN("unknown
options").Quoted 4 lines
Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797)
to connect.While the bellow traces looks fine we need to confirm that it doesn't break the qualification tests e.g:
L2CAP/COS/CFD/BV-14-C [Unknown Mandatory Options Request]
Quoted 8 lines
• Test Purpose Verify that the IUT can give the appropriate error code
when the Lower Tester proposes any number of unknown options where at least one is mandatory.Afaik it should be fine to continue with another round of configuration given that it only expects the error
0x0003, but we better confirm PTS doesn't expect a L2CAP Disconnect after it.
The tests fail for me in the same on a kernel with and without the patch:
- Expected that the IUT transmits an L2CAP_ConfigRsp includes the unsupported option that Lower Tester sent.
Final Verdict:FAIL
L2CAP/COS/CFD/BV-14-C finished
Is this expected? I was using an 5.10-rc7 kernel with and without the patch I sent. I can send you the full results off-list if you want them.
Quoted 9 lines · Bastien Nocera
<snip>
The tests fail for me in the same on a kernel with and without the
patch:
- Expected that the IUT transmits anL2CAP_ConfigRspincludes the unsupported option that Lower Tester sent.
Final Verdict:FAIL
L2CAP/COS/CFD/BV-14-C finished
Quoted 3 lines
Is this expected? I was using an 5.10-rc7 kernel with and without the patch I sent. I can send you the full results off-list if you want them.
Any news on that? Is the error expected, should I test with a newer version of the kernel? I'd really like to finally land this...
Hi Bastien,
For the test L2CAP/COS/CFD/BV-14-C, this patch is required to pass it.
https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=5b8ec15d02f12148ef0185825217162b3bc341f4
I don't think it is merged yet into 5.10, so you might need to apply the patch yourself.
Thanks,
Archie
Quoted 18 lines · Bastien Nocera
Quoted 9 lines · Bastien Nocera
<snip>
The tests fail for me in the same on a kernel with and without the
patch:
- Expected that the IUT transmits anL2CAP_ConfigRspincludes the unsupported option that Lower Tester sent.
Final Verdict:FAIL
L2CAP/COS/CFD/BV-14-C finishedQuoted 3 lines
Is this expected? I was using an 5.10-rc7 kernel with and without the patch I sent. I can send you the full results off-list if you want them.
Any news on that? Is the error expected, should I test with a newer version of the kernel? I'd really like to finally land this...
Quoted 11 lines · Archie Pusaka
Hi Bastien,
For the test L2CAP/COS/CFD/BV-14-C, this patch is required to pass it.
https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=5b8ec15d02f12148ef0185825217162b3bc341f4I don't think it is merged yet into 5.10, so you might need to apply the patch yourself.
Thanks,
Archie
Thank you Archie, much appreciated.
I'll rebuild my test kernels and report back.
Quoted 23 lines · Luiz Augusto von Dentz
Hi Bastien,
Quoted 9 lines · Bastien Nocera
The current implementation of L2CAP options negotiation will continue
the negotiation when a device responds withL2CAP_CONF_UNACCEPT("unaccepted
options"), but not when the device replies withL2CAP_CONF_UNKNOWN("unknown
options").Quoted 4 lines
Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797)
to connect.While the bellow traces looks fine we need to confirm that it doesn't break the qualification tests e.g:
L2CAP/COS/CFD/BV-14-C [Unknown Mandatory Options Request]
Quoted 8 lines
• Test Purpose Verify that the IUT can give the appropriate error code
when the Lower Tester proposes any number of unknown options where at least one is mandatory.Afaik it should be fine to continue with another round of configuration given that it only expects the error
0x0003, but we better confirm PTS doesn't expect a L2CAP Disconnect after it.
I tested this today using Fedora's kernel-5.11.0-0.rc2.114.fc34:
https://koji.fedoraproject.org/koji/buildinfo?buildID=1664670
And a local build using the same source kernel with this patch on top.
Both managed to pass the test without any problems.
I'll send the results of the test privately to you and Marcel.
Cheers
Hi,
Quoted 107 lines · Bastien Nocera
The current implementation of L2CAP options negotiation will continue the negotiation when a device responds with
L2CAP_CONF_UNACCEPT("unaccepted options"), but not when the device replies withL2CAP_CONF_UNKNOWN("unknown options").Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797) to connect.
btmon before patch:
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #64 [hci0] 59.182702L2CAP: Connection Response (0x03) ident 2 len 8 Destination CID: 64 Source CID: 64 Result: Connection successful (0x0000) Status: No further information available (0x0000)< ACL Data TX: Handle 256 flags
0x00dlen 23 #65 [hci0] 59.182744
L2CAP: Configure Request (0x04) ident 3 len 15
Destination CID: 64
Flags:0x0000
Option: Retransmission and Flow Control (0x04) [mandatory]
Mode: Basic (0x00)
TX window size: 0
Max transmit: 0
Retransmission timeout: 0
Monitor timeout: 0
Maximum PDU size: 0Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #66 [hci0] 59.183948L2CAP: Configure Request (0x04) ident 1 len 8 Destination CID: 64 Flags: 0x0000 Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 1480 < ACL Data TX: Handle 256 flags 0x00 dlen 18 #67 [hci0] 59.183994 L2CAP: Configure Response (0x05) ident 1 len 10 Source CID: 64 Flags: 0x0000 Result: Success (0x0000) Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 1480Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 15 #69 [hci0] 59.187676L2CAP: Configure Response (0x05) ident 3 len 7 Source CID: 64 Flags: 0x0000 Result: Failure - unknown options (0x0003) 04 .< ACL Data TX: Handle 256 flags
0x00dlen 12 #70 [hci0] 59.187722
L2CAP: Disconnection Request (0x06) ident 4 len 4
Destination CID: 64
Source CID: 64Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 12 #73 [hci0] 59.192714L2CAP: Disconnection Response (
0x07) ident 4 len 4
Destination CID: 64
Source CID: 64btmon after patch:
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #248 [hci0] 103.502970L2CAP: Connection Response (0x03) ident 5 len 8 Destination CID: 65 Source CID: 65 Result: Connection pending (0x0001) Status: No further information available (0x0000)Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #249 [hci0] 103.504184L2CAP: Connection Response (0x03) ident 5 len 8 Destination CID: 65 Source CID: 65 Result: Connection successful (0x0000) Status: No further information available (0x0000)< ACL Data TX: Handle 256 flags
0x00dlen 23 #250 [hci0] 103.504398
L2CAP: Configure Request (0x04) ident 6 len 15
Destination CID: 65
Flags:0x0000
Option: Retransmission and Flow Control (0x04) [mandatory]
Mode: Basic (0x00)
TX window size: 0
Max transmit: 0
Retransmission timeout: 0
Monitor timeout: 0
Maximum PDU size: 0Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #251 [hci0] 103.505472L2CAP: Configure Request (0x04) ident 3 len 8 Destination CID: 65 Flags: 0x0000 Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 1480 < ACL Data TX: Handle 256 flags 0x00 dlen 18 #252 [hci0] 103.505689 L2CAP: Configure Response (0x05) ident 3 len 10 Source CID: 65 Flags: 0x0000 Result: Success (0x0000) Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 1480Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 15 #254 [hci0] 103.509165L2CAP: Configure Response (0x05) ident 6 len 7 Source CID: 65 Flags: 0x0000 Result: Failure - unknown options (0x0003) 04 . < ACL Data TX: Handle 256 flags 0x00 dlen 12 #255 [hci0] 103.509426 L2CAP: Configure Request (0x04) ident 7 len 4 Destination CID: 65 Flags: 0x0000 < ACL Data TX: Handle 256 flags 0x00 dlen 12 #257 [hci0] 103.511870 L2CAP: Connection Request (0x02) ident 8 len 4 PSM: 1 (0x0001) Source CID: 66
Quoted 8 lines
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 14 #259 [hci0] 103.514121L2CAP: Configure Response (0x05) ident 7 len 6 Source CID: 65 Flags: 0x0000 Result: Success (0x0000)Signed-off-by Florian Dollinger <[email protected]>Co-developed-by Florian Dollinger <[email protected]>
Quoted 19 lines
--- net/bluetooth/l2cap_core.c | 1 + 1 file changed, 1 insertion(+)net/bluetooth/l2cap_core.c +1
-1@@ -4513,6 +4513,7 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, } goto done; +case L2CAP_CONF_UNKNOWN :case L2CAP_CONF_UNACCEPT :if (chan->num_conf_rsp <=L2CAP_CONF_MAX_CONF_RSP ) {char req[64 ]; --2.29.2
Signature · 1 line
Luiz Augusto von Dentz
Quoted 13 lines · Luiz Augusto von Dentz
Hi,
Quoted 9 lines · Bastien Nocera
The current implementation of L2CAP options negotiation will continue
the negotiation when a device responds withL2CAP_CONF_UNACCEPT("unaccepted
options"), but not when the device replies withL2CAP_CONF_UNKNOWN("unknown
options").
Quoted 6 lines
Quoted 4 lines
Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797)
to connect.<snip>
Reviewed-by Luiz Augusto Von Dentz <[email protected]>
Marcel? Anything else that would need to be done to land this?
Cheers
Quoted 18 lines · Luiz Augusto von Dentz
Hi,
Quoted 14 lines · Bastien Nocera
The current implementation of L2CAP options negotiation will continue
the negotiation when a device responds withL2CAP_CONF_UNACCEPT("unaccepted
options"), but not when the device replies withL2CAP_CONF_UNKNOWN("unknown
options").Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797)
to connect.
Quoted 5 lines
Quoted 3 lines
<snip>
Signed-off-by Florian Dollinger <[email protected]>Co-developed-by Florian Dollinger <[email protected]>Reviewed-by Luiz Augusto Von Dentz <[email protected]>
Marcel, any chance of a review on this one? I've sent you the results of the PTS tests privately, but looks like you weren't CC:ed on the earlier mail thread.
Cheers
Quoted 5 lines · Bastien Nocera
<snip>
Marcel, any chance of a review on this one? I've sent you the results
of the PTS tests privately, but looks like you weren't CC:ed on the earlier mail thread.
Our e-mails only just crossed paths.
Thanks for merging it!
Marcel Holtmann
maintainerHi Bastien,
Quoted 112 lines
The current implementation of L2CAP options negotiation will continue the negotiation when a device responds with
L2CAP_CONF_UNACCEPT("unaccepted options"), but not when the device replies withL2CAP_CONF_UNKNOWN("unknown options").Trying to continue the negotiation without ERTM support will allow Bluetooth-capable XBox One controllers (notably models 1708 and 1797) to connect.
btmon before patch:
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #64 [hci0] 59.182702L2CAP: Connection Response (0x03) ident 2 len 8 Destination CID: 64 Source CID: 64 Result: Connection successful (0x0000) Status: No further information available (0x0000)< ACL Data TX: Handle 256 flags
0x00dlen 23 #65 [hci0] 59.182744
L2CAP: Configure Request (0x04) ident 3 len 15
Destination CID: 64
Flags:0x0000
Option: Retransmission and Flow Control (0x04) [mandatory]
Mode: Basic (0x00)
TX window size: 0
Max transmit: 0
Retransmission timeout: 0
Monitor timeout: 0
Maximum PDU size: 0Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #66 [hci0] 59.183948L2CAP: Configure Request (0x04) ident 1 len 8 Destination CID: 64 Flags: 0x0000 Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 1480 < ACL Data TX: Handle 256 flags 0x00 dlen 18 #67 [hci0] 59.183994 L2CAP: Configure Response (0x05) ident 1 len 10 Source CID: 64 Flags: 0x0000 Result: Success (0x0000) Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 1480Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 15 #69 [hci0] 59.187676L2CAP: Configure Response (0x05) ident 3 len 7 Source CID: 64 Flags: 0x0000 Result: Failure - unknown options (0x0003) 04 .< ACL Data TX: Handle 256 flags
0x00dlen 12 #70 [hci0] 59.187722
L2CAP: Disconnection Request (0x06) ident 4 len 4
Destination CID: 64
Source CID: 64Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 12 #73 [hci0] 59.192714L2CAP: Disconnection Response (
0x07) ident 4 len 4
Destination CID: 64
Source CID: 64btmon after patch:
Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #248 [hci0] 103.502970L2CAP: Connection Response (0x03) ident 5 len 8 Destination CID: 65 Source CID: 65 Result: Connection pending (0x0001) Status: No further information available (0x0000)Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #249 [hci0] 103.504184L2CAP: Connection Response (0x03) ident 5 len 8 Destination CID: 65 Source CID: 65 Result: Connection successful (0x0000) Status: No further information available (0x0000)< ACL Data TX: Handle 256 flags
0x00dlen 23 #250 [hci0] 103.504398
L2CAP: Configure Request (0x04) ident 6 len 15
Destination CID: 65
Flags:0x0000
Option: Retransmission and Flow Control (0x04) [mandatory]
Mode: Basic (0x00)
TX window size: 0
Max transmit: 0
Retransmission timeout: 0
Monitor timeout: 0
Maximum PDU size: 0Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 16 #251 [hci0] 103.505472L2CAP: Configure Request (0x04) ident 3 len 8 Destination CID: 65 Flags: 0x0000 Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 1480 < ACL Data TX: Handle 256 flags 0x00 dlen 18 #252 [hci0] 103.505689 L2CAP: Configure Response (0x05) ident 3 len 10 Source CID: 65 Flags: 0x0000 Result: Success (0x0000) Option: Maximum Transmission Unit (0x01) [mandatory] MTU: 1480Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 15 #254 [hci0] 103.509165L2CAP: Configure Response (0x05) ident 6 len 7 Source CID: 65 Flags: 0x0000 Result: Failure - unknown options (0x0003) 04 . < ACL Data TX: Handle 256 flags 0x00 dlen 12 #255 [hci0] 103.509426 L2CAP: Configure Request (0x04) ident 7 len 4 Destination CID: 65 Flags: 0x0000 < ACL Data TX: Handle 256 flags 0x00 dlen 12 #257 [hci0] 103.511870 L2CAP: Connection Request (0x02) ident 8 len 4 PSM: 1 (0x0001) Source CID: 66Quoted 1 line
ACL Data RX: Handle 256 flags
0x02dlen 14 #259 [hci0] 103.514121L2CAP: Configure Response (0x05) ident 7 len 6 Source CID: 65 Flags: 0x0000 Result: Success (0x0000)
Quoted 5 lines
Signed-off-by Florian Dollinger <[email protected]>Co-developed-by Florian Dollinger <[email protected]>---
net/bluetooth/l2cap_core.c| 1 +1 file changed, 1 insertion(+)
patch has been applied to bluetooth-next tree.
Regards
Marcel