Linux-Bluetooth Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] Bluetooth: Add SCO fallback for invalid LMP parameters error
@ 2020-05-15  9:27 Hsin-Yu Chao
  2020-05-18  8:01 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Hsin-Yu Chao @ 2020-05-15  9:27 UTC (permalink / raw)
  To: linux-bluetooth, marcel
  Cc: chromeos-bluetooth-upstreaming, alainm, linux-kernel, Hsin-Yu Chao

From: Hsin-Yu Chao <hychao@chromium.org>

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
> HCI Event: Command Status (0x0f) plen 4
      Setup Synchronous Connection (0x01|0x0028) ncmd 1
        Status: Success (0x00)
> HCI Event: Number of Completed Packets (0x13) plen 5
        Num handles: 1
        Handle: 256
        Count: 1
> HCI Event: Max Slots Change (0x1b) plen 3
        Handle: 256
        Max slots: 1
> 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
> HCI Event: Command Status (0x0f) plen 4
      Setup Synchronous Connection (0x01|0x0028) ncmd 1
        Status: Success (0x00)
> HCI Event: Max Slots Change (0x1b) plen 3
        Handle: 256
        Max slots: 5
> HCI Event: Max Slots Change (0x1b) plen 3
        Handle: 256
        Max slots: 1
> 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)

Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
---
 net/bluetooth/hci_event.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 73aabca0064b7..f024b3d57a1c7 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -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) {
-- 
2.24.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Add SCO fallback for invalid LMP parameters error
  2020-05-15  9:27 [PATCH] Bluetooth: Add SCO fallback for invalid LMP parameters error Hsin-Yu Chao
@ 2020-05-18  8:01 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2020-05-18  8:01 UTC (permalink / raw)
  To: Hsin-Yu Chao
  Cc: linux-bluetooth, chromeos-bluetooth-upstreaming, alainm, linux-kernel

Hi Hsin-Yu,

> 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
>> HCI Event: Command Status (0x0f) plen 4
>      Setup Synchronous Connection (0x01|0x0028) ncmd 1
>        Status: Success (0x00)
>> HCI Event: Number of Completed Packets (0x13) plen 5
>        Num handles: 1
>        Handle: 256
>        Count: 1
>> HCI Event: Max Slots Change (0x1b) plen 3
>        Handle: 256
>        Max slots: 1
>> 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
>> HCI Event: Command Status (0x0f) plen 4
>      Setup Synchronous Connection (0x01|0x0028) ncmd 1
>        Status: Success (0x00)
>> HCI Event: Max Slots Change (0x1b) plen 3
>        Handle: 256
>        Max slots: 5
>> HCI Event: Max Slots Change (0x1b) plen 3
>        Handle: 256
>        Max slots: 1
>> 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)
> 
> Signed-off-by: Hsin-Yu Chao <hychao@chromium.org>
> ---
> net/bluetooth/hci_event.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15  9:27 [PATCH] Bluetooth: Add SCO fallback for invalid LMP parameters error Hsin-Yu Chao
2020-05-18  8:01 ` Marcel Holtmann

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org
	public-inbox-index linux-bluetooth

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git