Skip to contentSkip to conversation

Bluetooth: Add retransmission effort into SCO parameter table

PATCH In review [email protected] 1 participant 3 messages Sep 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Bluetooth: Add retransmission effort into SCO parameter table

From: Johan Hedberg <[email protected]>

It is expected that new parameter combinations will have the retransmission effort value different between some entries, so it makes sense to move it into the table instead of having it hard coded based on the selected SCO_AIRMODE_*.

---
 net/bluetooth/hci_conn.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
net/bluetooth/hci_conn.c +9 -9
index e3d7ae9e2edd..2c3d11bbb4f7 100644
@@ -36,19 +36,20 @@
 struct sco_param {
 	u16 pkt_type;
 	u16 max_latency;
+	u8  retrans_effort;
 };
 
 static const struct sco_param sco_param_cvsd[] = {
-	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x000a }, /* S3 */
-	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x0007 }, /* S2 */
-	{ EDR_ESCO_MASK | ESCO_EV3,   0x0007 }, /* S1 */
-	{ EDR_ESCO_MASK | ESCO_HV3,   0xffff }, /* D1 */
-	{ EDR_ESCO_MASK | ESCO_HV1,   0xffff }, /* D0 */
+	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x000a,	0x01 }, /* S3 */
+	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x0007,	0x01 }, /* S2 */
+	{ EDR_ESCO_MASK | ESCO_EV3,   0x0007,	0x01 }, /* S1 */
+	{ EDR_ESCO_MASK | ESCO_HV3,   0xffff,	0x01 }, /* D1 */
+	{ EDR_ESCO_MASK | ESCO_HV1,   0xffff,	0x01 }, /* D0 */
 };
 
 static const struct sco_param sco_param_wideband[] = {
-	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x000d }, /* T2 */
-	{ EDR_ESCO_MASK | ESCO_EV3,   0x0008 }, /* T1 */
+	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x000d,	0x02 }, /* T2 */
+	{ EDR_ESCO_MASK | ESCO_EV3,   0x0008,	0x02 }, /* T1 */
 };
 
 static void hci_le_create_connection_cancel(struct hci_conn *conn)
@@ -203,19 +204,18 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle)
 	case SCO_AIRMODE_TRANSP:
 		if (conn->attempt > ARRAY_SIZE(sco_param_wideband))
 			return false;
-		cp.retrans_effort = 0x02;
 		param = &sco_param_wideband[conn->attempt - 1];
 		break;
 	case SCO_AIRMODE_CVSD:
 		if (conn->attempt > ARRAY_SIZE(sco_param_cvsd))
 			return false;
-		cp.retrans_effort = 0x01;
 		param = &sco_param_cvsd[conn->attempt - 1];
 		break;
 	default:
 		return false;
 	}
 
+	cp.retrans_effort = param->retrans_effort;
 	cp.pkt_type = __cpu_to_le16(param->pkt_type);
 	cp.max_latency = __cpu_to_le16(param->max_latency);
 
Signature · 1 line
1.9.3
#1 lore raw

PATCH 2/2 Bluetooth: Add S4 configuration parameter set for CVSD

From: Johan Hedberg <[email protected]>

The HFP 1.7 specification recommends a new S4 parameter set for CVSD SCO connections over BR/EDR Secure Connections based links. This patch adds this set to the sco_param_cvsd table and ensures that it is skipped for any link that's not using BR/EDR Secure Connections.

---
 net/bluetooth/hci_conn.c | 5 +++++
 1 file changed, 5 insertions(+)
net/bluetooth/hci_conn.c +5 -0
index 2c3d11bbb4f7..2e955ea0d3ef 100644
@@ -40,6 +40,7 @@ struct sco_param {
 };
 
 static const struct sco_param sco_param_cvsd[] = {
+	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x000c,	0x02 }, /* S4 */
 	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x000a,	0x01 }, /* S3 */
 	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x0007,	0x01 }, /* S2 */
 	{ EDR_ESCO_MASK | ESCO_EV3,   0x0007,	0x01 }, /* S1 */
@@ -209,6 +210,10 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle)
 	case SCO_AIRMODE_CVSD:
 		if (conn->attempt > ARRAY_SIZE(sco_param_cvsd))
 			return false;
+		/* Skip S4 for non-SC connections */
+		if (conn->attempt == 1 && !test_bit(HCI_CONN_FIPS,
+						    &conn->link->flags))
+			conn->attempt++;
 		param = &sco_param_cvsd[conn->attempt - 1];
 		break;
 	default:
Signature · 1 line
1.9.3
#2 lore raw

Re: [PATCH 2/2] Bluetooth: Add S4 configuration parameter set for CVSD

Hi,

Quoted 23 lines · On Fri, Sep 19, 2014, [email protected] wrote:

The HFP 1.7 specification recommends a new S4 parameter set for CVSD SCO connections over BR/EDR Secure Connections based links. This patch adds this set to the sco_param_cvsd table and ensures that it is skipped for any link that's not using BR/EDR Secure Connections.

---
 net/bluetooth/hci_conn.c | 5 +++++
 1 file changed, 5 insertions(+)
net/bluetooth/hci_conn.c +1 -0
index 2c3d11bbb4f7..2e955ea0d3ef 100644
@@ -40,6 +40,7 @@ struct sco_param {
 };
 
 static const struct sco_param sco_param_cvsd[] = {
+	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x000c,	0x02 }, /* S4 */
 	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x000a,	0x01 }, /* S3 */
 	{ EDR_ESCO_MASK & ~ESCO_2EV3, 0x0007,	0x01 }, /* S2 */
 	{ EDR_ESCO_MASK | ESCO_EV3,   0x0007,	0x01 }, /* S1 */

net/bluetooth/hci_conn.c bool hci_setup_sync(struct hci_conn *conn, __u16 handle) · line 216

Quoted 7 lines
net/bluetooth/hci_conn.c +4 -0
@@ -209,6 +210,10 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle)
 	case SCO_AIRMODE_CVSD:
 		if (conn->attempt > ARRAY_SIZE(sco_param_cvsd))
 			return false;
+		/* Skip S4 for non-SC connections */
+		if (conn->attempt == 1 && !test_bit(HCI_CONN_FIPS,
+						    &conn->link->flags))
+			conn->attempt++;

This SC-specific condition can probably be dropped since the HFP 1.7 spec mentions several different conditions for using S4:

"It is recommended to use the S4 or T2 settings when BR/EDR Secure Connections is in use, when using complicated topologies, or when a device wants to improve coexistence with other wireless technologies. Note that devices qualified to earlier versions of this profile may refuse the S4 setting, in which case the use of S3 is recommended."

So please ignore this patch as it is right now.

Johan