Skip to contentSkip to conversation

Bluetooth: Add socket option definitions for AMP

PATCH Superseded Mat Martineau 2 participants 2 messages Sep 8, 2010

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 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 |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
include/net/bluetooth/bluetooth.h +25 -0
index 27a902d..5e8b6c3 100644
@@ -64,6 +64,31 @@ struct bt_security {
 
 #define BT_DEFER_SETUP	7
 
+
+#define BT_AMP_POLICY		8
+/* Require BR/EDR (default policy)
+ *   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
+ */
+#define BT_AMP_POLICY_REQUIRE_BR_EDR	0
+/* 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
+ */
+#define BT_AMP_POLICY_PREFER_AMP	1
+/* 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
+ */
+#define BT_AMP_POLICY_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 · 1 line
1.7.1
#1 lore raw

Hi Mat,

Quoted 36 lines · Mat Martineau

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 |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
include/net/bluetooth/bluetooth.h +0 -0
index 27a902d..5e8b6c3 100644

include/net/bluetooth/bluetooth.h struct bt_security { · line 68

Quoted 5 lines
include/net/bluetooth/bluetooth.h +2 -0
@@ -64,6 +64,31 @@ struct bt_security {
 
 #define BT_DEFER_SETUP	7
 
+
+#define BT_AMP_POLICY		8

Please add a empty line here.

include/net/bluetooth/bluetooth.h struct bt_security { · line 74

Quoted 6 lines
include/net/bluetooth/bluetooth.h +6 -0
+/* Require BR/EDR (default policy)
+ *   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
+ */
+#define BT_AMP_POLICY_REQUIRE_BR_EDR	0

And here.

include/net/bluetooth/bluetooth.h struct bt_security { · line 84

Quoted 10 lines
include/net/bluetooth/bluetooth.h +10 -0
+/* 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
+ */
+#define BT_AMP_POLICY_PREFER_AMP	1

And here.

Quoted 17 lines
include/net/bluetooth/bluetooth.h +7 -0
+/* 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
+ */
+#define BT_AMP_POLICY_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

--
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
roFUSION embedded systems - http://profusion.mobi