Bluetooth: Add socket option definitions for AMP
Subsystems (3)
PATCH 1/1 Bluetooth: Add socket option definitions for AMP
This adds a new BT_AMP socket option to control the use of AMP channels. It is for use with the SOL_BLUETOOTH option level on L2CAP sockets.
Available option values are defined as:
BT_AMP_REQUIRE_BR_EDR
* Default
* AMP controllers cannot be used
* Channel move requests from the remote device are denied
* If the L2CAP channel is currently using AMP, move the channel to BR/EDR
BT_AMP_PREFER_AMP
* Allow use of AMP controllers
* If the L2CAP channel is currently on BR/EDR and AMP controller resources are available, initiate a channel move to AMP
* Channel move requests from the remote device are allowed
* If the L2CAP socket has not been connected yet, try to create and configure the channel directly on an AMP controller rather than BR/EDR
BT_AMP_PREFER_BR_EDR
* Allow use of AMP controllers
* If the L2CAP channel is currently on AMP, move it to BR/EDR
* Channel move requests from the remote device are allowed
--- include/net/bluetooth/bluetooth.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
include/net/bluetooth/bluetooth.h +5 -0
@@ -64,6 +64,11 @@ struct bt_security {#define BT_DEFER_SETUP 7 +#define BT_AMP 8 +#define BT_AMP_REQUIRE_BR_EDR 0 +#define BT_AMP_PREFER_AMP 1 +#define BT_AMP_PREFER_BR_EDR 2 + #define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg) #define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg) #define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg)
Signature · 6 lines
1.7.1 -- Mat Martineau Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
Quoted 6 lines · Mat Martineau
This adds a new
BT_AMPsocket option to control the use of AMP channels. It is for use with theSOL_BLUETOOTHoption level on L2CAP sockets.Available option values are defined as:
[lots of nice documentation]
Why is none of this documentation in the code?
I believe we also agreed that this policy could be changed at any point in the life time of the channel so this should be documented as well.
Quoted 1 line
+#define
BT_AMP8
Suggest BT_AMP_POLICY, BT_AMP_POLICY_REQUIRE_BR_EDR etc. Just in case there are other AMP related socket options in the future.
include/net/bluetooth/bluetooth.h struct bt_security { · line 70
Quoted 3 lines
include/net/bluetooth/bluetooth.h +3
-0+#define BT_AMP_REQUIRE_BR_EDR 0 +#define BT_AMP_PREFER_AMP 1 +#define BT_AMP_PREFER_BR_EDR 2
David
Signature · 6 lines
David Vrabel, Senior Software Engineer, Drivers CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562 Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/ Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
David -
Quoted 13 lines · David Vrabel
Quoted 6 lines · Mat Martineau
This adds a new
BT_AMPsocket option to control the use of AMP channels. It is for use with theSOL_BLUETOOTHoption level on L2CAP sockets.Available option values are defined as:
[lots of nice documentation]
Why is none of this documentation in the code?
I believe we also agreed that this policy could be changed at any point in the life time of the channel so this should be documented as well.
Quoted 8 lines
Quoted 1 line
+#define
BT_AMP8Suggest
BT_AMP_POLICY,BT_AMP_POLICY_REQUIRE_BR_EDRetc. Just in case there are other AMP related socket options in the future.include/net/bluetooth/bluetooth.h struct bt_security { · line 70
Quoted 3 lines
include/net/bluetooth/bluetooth.h +3
-0+#define BT_AMP_REQUIRE_BR_EDR 0 +#define BT_AMP_PREFER_AMP 1 +#define BT_AMP_PREFER_BR_EDR 2
Thanks for the helpful feedback - I'll add the documentation, adjust the names, and repost.
--
Mat Martineau
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum