From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v5 0/3] Enable use of L2CAP_MODE_EXT_FLOWCTL
Date: Mon, 23 Mar 2020 13:34:55 -0700 [thread overview]
Message-ID: <20200323203458.24733-1-luiz.dentz@gmail.com> (raw)
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This enables use of BT_MODE_EXT_FLOWCTL with BT_MODE socketopt, in
addition to that add support for DEFER_SETUP to be used with client
sockets so they can be grouped and sent together.
BT_MODE is not compatible with L2CAP_OPTIONS so attempting to use them
both will cause an error to be returned to the applicatio.
This has been tested by introducing support for L2CAP_MODE_EXT_FLOWCTL
into l2cap-tester which now produces the following trace:
Enable ecred PDUs:
#echo 1 > /sys/module/bluetooth/parameters/enable_ecred
#sudo tools/l2cap-tester -p "L2CAP Ext-Flowctl"
L2CAP Ext-Flowctl Client - Success - init
Read Index List callback
Status: 0x00
New hciemu instance created
Index Added callback
Index: 0x0000
Read Info callback
Status: 0x00
Address: 00:AA:01:00:00:00
Version: 0x09
Manufacturer: 0x003f
Supported settings: 0x0001be1b
Current settings: 0x00000200
Class: 0x000000
Name:
Short name:
L2CAP Ext-Flowctl Client - Success - setup
Powering on controller
Controller powered on
Client set connectable status 0x00
L2CAP Ext-Flowctl Client - Success - setup complete
L2CAP Ext-Flowctl Client - Success - run
Connect in progress
Successfully connected
L2CAP Ext-Flowctl Client - Success - test passed
L2CAP Ext-Flowctl Client - Success - teardown
Index Removed callback
Index: 0x0000
L2CAP Ext-Flowctl Client - Success - teardown complete
L2CAP Ext-Flowctl Client - Success - done
L2CAP Ext-Flowctl Client, Direct Advertising - Success - init
Read Index List callback
Status: 0x00
New hciemu instance created
Index Added callback
Index: 0x0000
Read Info callback
Status: 0x00
Address: 00:AA:01:00:00:00
Version: 0x09
Manufacturer: 0x003f
Supported settings: 0x0001be1b
Current settings: 0x00000200
Class: 0x000000
Name:
Short name:
L2CAP Ext-Flowctl Client, Direct Advertising - Success - setup
Powering on controller
Controller powered on
Client set connectable status 0x00
L2CAP Ext-Flowctl Client, Direct Advertising - Success - setup complete
L2CAP Ext-Flowctl Client, Direct Advertising - Success - run
Connect in progress
Received advertising parameters HCI command
L2CAP Ext-Flowctl Client, Direct Advertising - Success - test passed
L2CAP Ext-Flowctl Client, Direct Advertising - Success - teardown
Index Removed callback
Index: 0x0000
L2CAP Ext-Flowctl Client, Direct Advertising - Success - teardown complete
L2CAP Ext-Flowctl Client, Direct Advertising - Success - done
L2CAP Ext-Flowctl Client SMP - Success - init
Read Index List callback
Status: 0x00
New hciemu instance created
Index Added callback
Index: 0x0000
Read Info callback
Status: 0x00
Address: 00:AA:01:00:00:00
Version: 0x09
Manufacturer: 0x003f
Supported settings: 0x0001be1b
Current settings: 0x00000200
Class: 0x000000
Name:
Short name:
L2CAP Ext-Flowctl Client SMP - Success - setup
Powering on controller
Controller powered on
Client set connectable status 0x00
L2CAP Ext-Flowctl Client SMP - Success - setup complete
L2CAP Ext-Flowctl Client SMP - Success - run
Connect in progress
Successfully connected
L2CAP Ext-Flowctl Client SMP - Success - test passed
L2CAP Ext-Flowctl Client SMP - Success - teardown
Index Removed callback
Index: 0x0000
L2CAP Ext-Flowctl Client SMP - Success - teardown complete
L2CAP Ext-Flowctl Client SMP - Success - done
L2CAP Ext-Flowctl Client - Command Reject - init
Read Index List callback
Status: 0x00
New hciemu instance created
Index Added callback
Index: 0x0000
Read Info callback
Status: 0x00
Address: 00:AA:01:00:00:00
Version: 0x09
Manufacturer: 0x003f
Supported settings: 0x0001be1b
Current settings: 0x00000200
Class: 0x000000
Name:
Short name:
L2CAP Ext-Flowctl Client - Command Reject - setup
Powering on controller
Controller powered on
Client set connectable status 0x00
L2CAP Ext-Flowctl Client - Command Reject - setup complete
L2CAP Ext-Flowctl Client - Command Reject - run
Connect in progress
New connection with handle 0x002a
Connect failed: Connection refused (111)
L2CAP Ext-Flowctl Client - Command Reject - test passed
L2CAP Ext-Flowctl Client - Command Reject - teardown
Index Removed callback
Index: 0x0000
L2CAP Ext-Flowctl Client - Command Reject - teardown complete
L2CAP Ext-Flowctl Client - Command Reject - done
L2CAP Ext-Flowctl Client - Open two sockets - init
Read Index List callback
Status: 0x00
New hciemu instance created
Index Added callback
Index: 0x0000
Read Info callback
Status: 0x00
Address: 00:AA:01:00:00:00
Version: 0x09
Manufacturer: 0x003f
Supported settings: 0x0001be1b
Current settings: 0x00000200
Class: 0x000000
Name:
Short name:
L2CAP Ext-Flowctl Client - Open two sockets - setup
Powering on controller
Controller powered on
L2CAP Ext-Flowctl Client - Open two sockets - setup complete
L2CAP Ext-Flowctl Client - Open two sockets - run
Connect in progress, sk = 19 (deferred)
HCI Command 0x200b length 7
HCI Command 0x200c length 2
Connect in progress, sk = 20
Client set connectable status 0x00
HCI Command 0x200c length 2
HCI Command 0x200d length 25
HCI Command 0x2016 length 2
Successfully connected
Successfully connected
L2CAP Ext-Flowctl Client - Open two sockets - test passed
L2CAP Ext-Flowctl Client - Open two sockets - teardown
Index Removed callback
Index: 0x0000
L2CAP Ext-Flowctl Client - Open two sockets - teardown complete
L2CAP Ext-Flowctl Client - Open two sockets - done
L2CAP Ext-Flowctl Client - Open two sockets close one - init
Read Index List callback
Status: 0x00
New hciemu instance created
Index Added callback
Index: 0x0000
Read Info callback
Status: 0x00
Address: 00:AA:01:00:00:00
Version: 0x09
Manufacturer: 0x003f
Supported settings: 0x0001be1b
Current settings: 0x00000200
Class: 0x000000
Name:
Short name:
L2CAP Ext-Flowctl Client - Open two sockets close one - setup
Powering on controller
Controller powered on
L2CAP Ext-Flowctl Client - Open two sockets close one - setup complete
L2CAP Ext-Flowctl Client - Open two sockets close one - run
Connect in progress, sk = 19 (deferred)
HCI Command 0x200b length 7
HCI Command 0x200c length 2
Connect in progress, sk = 20
Closing first socket! -1
Client set connectable status 0x00
HCI Command 0x200c length 2
HCI Command 0x200d length 25
HCI Command 0x2016 length 2
Successfully connected
L2CAP Ext-Flowctl Client - Open two sockets close one - test passed
L2CAP Ext-Flowctl Client - Open two sockets close one - teardown
Index Removed callback
Index: 0x0000
L2CAP Ext-Flowctl Client - Open two sockets close one - teardown complete
L2CAP Ext-Flowctl Client - Open two sockets close one - done
Test Summary
------------
L2CAP Ext-Flowctl Client - Success Passed 0.068 seconds
L2CAP Ext-Flowctl Client, Direct Advertising - Success Passed 0.023 seconds
L2CAP Ext-Flowctl Client SMP - Success Passed 0.027 seconds
L2CAP Ext-Flowctl Client - Command Reject Passed 0.046 seconds
L2CAP Ext-Flowctl Client - Open two sockets Passed 0.014 seconds
L2CAP Ext-Flowctl Client - Open two sockets close one Passed 0.066 seconds
Total: 6, Passed: 6 (100.0%), Failed: 0, Not Run: 0
Overall execution time: 0.247 seconds
Luiz Augusto von Dentz (3):
Bluetooth: L2CAP: Add get_peer_pid callback
Bluetooth: L2CAP: Use DEFER_SETUP to group ECRED connections
Bluetooth: Add BT_MODE socket option
include/net/bluetooth/bluetooth.h | 11 +++
include/net/bluetooth/l2cap.h | 5 ++
net/bluetooth/l2cap_core.c | 136 +++++++++++++++++++++++++++---
net/bluetooth/l2cap_sock.c | 104 +++++++++++++++++++++++
4 files changed, 246 insertions(+), 10 deletions(-)
--
2.21.1
next reply other threads:[~2020-03-23 20:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 20:34 Luiz Augusto von Dentz [this message]
2020-03-23 20:34 ` [PATCH v5 1/3] Bluetooth: L2CAP: Add get_peer_pid callback Luiz Augusto von Dentz
2020-03-24 8:48 ` Marcel Holtmann
2020-03-23 20:34 ` [PATCH v5 2/3] Bluetooth: L2CAP: Use DEFER_SETUP to group ECRED connections Luiz Augusto von Dentz
2020-03-24 8:47 ` Marcel Holtmann
2020-03-24 23:10 ` Luiz Augusto von Dentz
2020-03-23 20:34 ` [PATCH v5 3/3] Bluetooth: Add BT_MODE socket option Luiz Augusto von Dentz
2020-03-24 8:44 ` Marcel Holtmann
2020-03-24 16:56 ` Luiz Augusto von Dentz
2020-03-24 18:37 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200323203458.24733-1-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).