Skip to contentSkip to conversation

Bluetooth: Add SCO fallback for invalid LMP parameters error

PATCH In review Hsin-Yu Chao 2 participants 2 messages May 15, 2020 – May 18, 2020

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

PATCH 1/1 Bluetooth: Add SCO fallback for invalid LMP parameters error

From: Hsin-Yu Chao <[email protected]>

Bluetooth PTS test case HFP/AG/ACC/BI-12-I accepts SCO connection with invalid parameter at the first SCO request expecting AG to attempt another SCO request with the use of "safe settings" for given codec, base on section 5.7.1.2 of HFP 1.7 specification.

This patch addresses it by adding "Invalid LMP Parameters" (0x1e) to the SCO fallback case. Verified with below log:

< HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
Handle: 256
Transmit bandwidth: 8000
Receive bandwidth: 8000
Max latency: 13
Setting: 0x0003
Input Coding: Linear
Input Data Format: 1's complement
Input Sample Size: 8-bit
# of bits padding at MSB: 0
Air Coding Format: Transparent Data
Retransmission effort: Optimize for link quality (0x02) Packet type: 0x0380
3-EV3 may not be used
2-EV5 may not be used
3-EV5 may not be used

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

      Setup Synchronous Connection (0x01|0x0028) ncmd 1
        Status: Success (0x00)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 256
Count: 1

Quoted 1 line

HCI Event: Max Slots Change (0x1b) plen 3

Handle: 256
Max slots: 1

Quoted 1 line

HCI Event: Synchronous Connect Complete (0x2c) plen 17

        Status: Invalid LMP Parameters / Invalid LL Parameters (0x1e)
        Handle: 0
        Address: 00:1B:DC:F2:21:59 (OUI 00-1B-DC)
        Link type: eSCO (0x02)
        Transmission interval: 0x00
        Retransmission window: 0x02
        RX packet length: 0
        TX packet length: 0
        Air mode: Transparent (0x03)

< HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
Handle: 256
Transmit bandwidth: 8000
Receive bandwidth: 8000
Max latency: 8
Setting: 0x0003
Input Coding: Linear
Input Data Format: 1's complement
Input Sample Size: 8-bit
# of bits padding at MSB: 0
Air Coding Format: Transparent Data
Retransmission effort: Optimize for link quality (0x02) Packet type: 0x03c8
EV3 may be used
2-EV3 may not be used
3-EV3 may not be used
2-EV5 may not be used
3-EV5 may not be used

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

      Setup Synchronous Connection (0x01|0x0028) ncmd 1
        Status: Success (0x00)
Quoted 1 line

HCI Event: Max Slots Change (0x1b) plen 3

Handle: 256
Max slots: 5

Quoted 1 line

HCI Event: Max Slots Change (0x1b) plen 3

Handle: 256
Max slots: 1

Quoted 1 line

HCI Event: Synchronous Connect Complete (0x2c) plen 17

        Status: Success (0x00)
        Handle: 257
        Address: 00:1B:DC:F2:21:59 (OUI 00-1B-DC)
        Link type: eSCO (0x02)
        Transmission interval: 0x06
        Retransmission window: 0x04
        RX packet length: 30
        TX packet length: 30
        Air mode: Transparent (0x03)
---
 net/bluetooth/hci_event.c | 1 +
 1 file changed, 1 insertion(+)
net/bluetooth/hci_event.c +1 -0
index 73aabca0064b7..f024b3d57a1c7 100644
@@ -4337,6 +4337,7 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev,
 	case 0x11:	/* Unsupported Feature or Parameter Value */
 	case 0x1c:	/* SCO interval rejected */
 	case 0x1a:	/* Unsupported Remote Feature */
+	case 0x1e:	/* Invalid LMP Parameters */
 	case 0x1f:	/* Unspecified error */
 	case 0x20:	/* Unsupported LMP Parameter value */
 		if (conn->out) {
Signature · 1 line
2.24.1
maintainer
#1 lore raw

Hi Hsin-Yu,

Quoted 82 lines

Bluetooth PTS test case HFP/AG/ACC/BI-12-I accepts SCO connection with invalid parameter at the first SCO request expecting AG to attempt another SCO request with the use of "safe settings" for given codec, base on section 5.7.1.2 of HFP 1.7 specification.

This patch addresses it by adding "Invalid LMP Parameters" (0x1e) to the SCO fallback case. Verified with below log:

< HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
Handle: 256
Transmit bandwidth: 8000
Receive bandwidth: 8000
Max latency: 13
Setting: 0x0003
Input Coding: Linear
Input Data Format: 1's complement
Input Sample Size: 8-bit
# of bits padding at MSB: 0
Air Coding Format: Transparent Data
Retransmission effort: Optimize for link quality (0x02) Packet type: 0x0380
3-EV3 may not be used
2-EV5 may not be used
3-EV5 may not be used

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

     Setup Synchronous Connection (0x01|0x0028) ncmd 1
       Status: Success (0x00)
Quoted 1 line

HCI Event: Number of Completed Packets (0x13) plen 5

Num handles: 1
Handle: 256
Count: 1

Quoted 1 line

HCI Event: Max Slots Change (0x1b) plen 3

Handle: 256
Max slots: 1

Quoted 1 line

HCI Event: Synchronous Connect Complete (0x2c) plen 17

       Status: Invalid LMP Parameters / Invalid LL Parameters (0x1e)
       Handle: 0
       Address: 00:1B:DC:F2:21:59 (OUI 00-1B-DC)
       Link type: eSCO (0x02)
       Transmission interval: 0x00
       Retransmission window: 0x02
       RX packet length: 0
       TX packet length: 0
       Air mode: Transparent (0x03)

< HCI Command: Setup Synchronous Connection (0x01|0x0028) plen 17
Handle: 256
Transmit bandwidth: 8000
Receive bandwidth: 8000
Max latency: 8
Setting: 0x0003
Input Coding: Linear
Input Data Format: 1's complement
Input Sample Size: 8-bit
# of bits padding at MSB: 0
Air Coding Format: Transparent Data
Retransmission effort: Optimize for link quality (0x02) Packet type: 0x03c8
EV3 may be used
2-EV3 may not be used
3-EV3 may not be used
2-EV5 may not be used
3-EV5 may not be used

Quoted 1 line

HCI Event: Command Status (0x0f) plen 4

     Setup Synchronous Connection (0x01|0x0028) ncmd 1
       Status: Success (0x00)
Quoted 1 line

HCI Event: Max Slots Change (0x1b) plen 3

Handle: 256
Max slots: 5

Quoted 1 line

HCI Event: Max Slots Change (0x1b) plen 3

Handle: 256
Max slots: 1

Quoted 1 line

HCI Event: Synchronous Connect Complete (0x2c) plen 17

       Status: Success (0x00)
       Handle: 257
       Address: 00:1B:DC:F2:21:59 (OUI 00-1B-DC)
       Link type: eSCO (0x02)
       Transmission interval: 0x06
       Retransmission window: 0x04
       RX packet length: 30
       TX packet length: 30
       Air mode: Transparent (0x03)
Quoted 4 lines

---
net/bluetooth/hci_event.c | 1 +

1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel