Re: [PATCH RFC] bluetooth: add support for some old headsets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sergey,

> The MediaTek Bluetooth platform (MT6630 etc.) has a peculiar implementation
> for the eSCO/SCO connection via BT/EDR: the host controller returns error
> code 0x20 (LMP feature not supported) for HCI_Setup_Synchronous_Connection
> (0x0028) command without actually trying to setup connection with a remote
> device in case such device (like Digma BT-14 headset) didn't advertise its
> supported features.  Even though this doesn't break compatibility with the
> Bluetooth standard it breaks the compatibility with the Hands-Free Profile
> (HFP).
> 
> This patch returns the compatibility with the HFP profile and actually
> tries to check all available connection parameters despite of the specific
> MediaTek implementation. Without it one was unable to establish eSCO/SCO
> connection with some headsets.

please include the parts of btmon output that show this issue.

> Based on the patch by Ildar Kamaletdinov <i.kamaletdinov@xxxxxxxxxxxx>.
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@xxxxxxxxxxxx>
> 
> ---
> This patch is against the 'bluetooth-next.git' repo.
> 
> net/bluetooth/hci_event.c |    8 ++++++++
> 1 file changed, 8 insertions(+)
> 
> Index: bluetooth-next/net/bluetooth/hci_event.c
> ===================================================================
> --- bluetooth-next.orig/net/bluetooth/hci_event.c
> +++ bluetooth-next/net/bluetooth/hci_event.c
> @@ -2187,6 +2187,13 @@ static void hci_cs_setup_sync_conn(struc
> 	if (acl) {
> 		sco = acl->link;
> 		if (sco) {
> +			if (status == 0x20 && /* Unsupported LMP Parameter value */
> +			    sco->out) {
> +				sco->pkt_type = (hdev->esco_type & SCO_ESCO_MASK) |
> +						(hdev->esco_type & EDR_ESCO_MASK);
> +				if (hci_setup_sync(sco, sco->link->handle))
> +					goto unlock;
> +			}
> 			sco->state = BT_CLOSED;

since this is the command status event, I doubt that sco->out check is needed. And I would start with a switch statement right away.

I also think that we need to re-structure this hci_cs_setup_sync_conn function a little to avoid the deep indentation. Make it look more like hci_sync_conn_complete_evt also use a switch statement even if right now we only have one entry.

Regards

Marcel




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux