Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6559766ybc; Thu, 28 Nov 2019 01:20:28 -0800 (PST) X-Google-Smtp-Source: APXvYqwsrZKvG6UwYtE/lOhTa2Ho2tcA0Bvta5B+j5uv7PooF0DzyAT412iVrbJsEGSc/Dp6IJDz X-Received: by 2002:a17:906:d924:: with SMTP id rn4mr11691697ejb.213.1574932828862; Thu, 28 Nov 2019 01:20:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574932828; cv=none; d=google.com; s=arc-20160816; b=jQw0nhG8mKwxdYU+I6VIwhzy6fNjXwUzlA6UJaVz0gVyVrsWN/47VnG211Q41bru2J OehkmjjxVXOpgcY+H+yS/VWq0Wd+Zuu04lMV3LvuI/y9IJgNrzWpSdSHDm13gY1+B6Hg Ul4/a/dn/F9anfQIQqaiI33GGQAymM9Gh7/ipRsv3EjSpOJcgwyffuFK8tYIpC/8itZC 1fX4fYk7Q/GmosMw6N3jp89dFuTyZxvAbzIxzcPHy+GSsuOze8Ugj+NUwOILzZi+pSeP ewfWSWkGcRMBZMEi8ie5GmpI7mMIwjxcCGEJxSZqzuuBOFgF6X0fVCQr+kF5agroiLv5 7IqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=3kO1+94SCjfh/ohMmsUhGcrwMCWC3JcgJSgZ/p+JoOs=; b=ShbmMjMNVddY6u9WnKVXgToBPYN2Ju//fvViijpmmsK1qptB1Ss+qSlr8fuE2JaqUz /14N8J0H0/LHYCGIHveADXBXf6hryVBdyy+nnZr/RCet8YQMR4PyKcG994gHAOv7TErC fjOYeYoT9/msDU5R7mXw2jpB4p2z+23jCsCFvfl2pZsbSF8/2TFgdwPhh9ZN4SyKRfcF sslcWX+lytmnW4Tfh4gYVuaAfA/+/C8feM4xZaCec+c+HETx/mzvfub2Sn3WVSX4icpv /vOrzAC0gd5YIZQxRYMUpCouB1RBNAs8wyGXsmjxUaIILapVRdtV1bIFcdSh3K/fgfej rJ0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rnRRoR5F; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u2si11123218ejo.137.2019.11.28.01.20.03; Thu, 28 Nov 2019 01:20:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rnRRoR5F; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726856AbfK1JRl (ORCPT + 99 others); Thu, 28 Nov 2019 04:17:41 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37348 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbfK1JRl (ORCPT ); Thu, 28 Nov 2019 04:17:41 -0500 Received: by mail-pf1-f193.google.com with SMTP id p24so12841480pfn.4 for ; Thu, 28 Nov 2019 01:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3kO1+94SCjfh/ohMmsUhGcrwMCWC3JcgJSgZ/p+JoOs=; b=rnRRoR5FMfw5SaBwJKxx5osbc7al1E1dqwtmoE3e1SdbGKy1yIGsDhb411wdzmCkcQ cfOMZEpOm4rgPTVAuvTMPAwdnqTOYm2S7GgJ+pkqZ+89fqZhu830nfRbnq0SYt9XDxAx ecxsiXlw8D8gxr+eblzmsAp837iNzImRD7/TB0wcB/0iC7iBygH2yNMklb7Wjq5VHFg+ 0/4LmUq1iaLSdTJSKczXGDHtiVL1BLrVuznSra+NCh3zJbToUhWPwgCVohw+kADP44n6 EYX7oxmqPxkI+38L+GeM3FXOnWllYnvexQ4ZpCO/GYKYZbHumrhSvWc1tNB3LSw2zhMQ KPEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3kO1+94SCjfh/ohMmsUhGcrwMCWC3JcgJSgZ/p+JoOs=; b=i9ZE972HQKM8OzDwL9LEmyEo/XoGq2kurFrqbmyx4fE+RnmcsjXjKx4A1f1BgC/GiK NlHwEmudf7cV5bLwB9BhoLOwgkYDARoKS4EGfalgfxB3gUviaLDUGk6w3JfswdRUhJMs RNWYTlcyHmJA/LbhxY7vsNXbeML7ly/BgYHabm6cihSTyqyX4d+B7aLzRzSU4UaC0HI3 NhwRWu+48StWpSjmzaBSkv45l42OupMyb5j/oO5wKZt2Ei9fAVq7Nl7YwwbZIkGyOcJa VUViEbPKCHkMu3COFN8WkMmdrpqCTSnDpflwR5WCi2G2Nxd1ylEs4CO6YVdkkQ76jd9t JhGg== X-Gm-Message-State: APjAAAW4kh4tnUsC1jp0IGIVI5m5IueW/K7uE4tYzVOCZr9dFzN4eOM1 DLBT9snlwSswNiX3XaTs56bsRM8dyLQrMA== X-Received: by 2002:a63:4303:: with SMTP id q3mr10232320pga.439.1574932660397; Thu, 28 Nov 2019 01:17:40 -0800 (PST) Received: from nsathish-Latitude-7480.iind.intel.com (jfdmzpr05-ext.jf.intel.com. [134.134.139.74]) by smtp.gmail.com with ESMTPSA id a12sm18733577pga.11.2019.11.28.01.17.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2019 01:17:39 -0800 (PST) From: Sathish Narsimman X-Google-Original-From: Sathish Narsimman To: linux-bluetooth@vger.kernel.org Cc: Sathish Narsimman Subject: [PATCH v4 1/2] bluetooth: add support to notify SCO air mode Date: Thu, 28 Nov 2019 14:47:47 +0530 Message-Id: <20191128091748.24531-1-sathish.narasimman@intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org notifying HCI_NOTIFY_CONN_ADD for SCO connection is generic in case of msbc audio. To differnetiate SCO air mode audio introducing HCI_NOTIFY_SCO_CVSD and HCI_NOTIFY_SCO_TRASP. Signed-off-by: Sathish Narsimman --- include/net/bluetooth/hci.h | 2 ++ include/net/bluetooth/hci_core.h | 3 +++ net/bluetooth/hci_event.c | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 5bc1e30dedde..26af112b1f2c 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -52,6 +52,8 @@ #define HCI_NOTIFY_CONN_ADD 1 #define HCI_NOTIFY_CONN_DEL 2 #define HCI_NOTIFY_VOICE_SETTING 3 +#define HCI_NOTIFY_ENABLE_SCO_CVSD 4 +#define HCI_NOTIFY_ENABLE_SCO_TRANSP 5 /* HCI bus types */ #define HCI_VIRTUAL 0 diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index b689aceb636b..9258e19f8cc5 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -1604,4 +1604,7 @@ void hci_copy_identity_address(struct hci_dev *hdev, bdaddr_t *bdaddr, #define SCO_AIRMODE_CVSD 0x0000 #define SCO_AIRMODE_TRANSP 0x0003 +#define SCO_CODED_CVSD 0x02 +#define SCO_CODED_TRANSP 0x03 + #endif /* __HCI_CORE_H */ diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index c1d3a303d97f..ecad696db139 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -4231,6 +4231,15 @@ static void hci_sync_conn_complete_evt(struct hci_dev *hdev, break; } + BT_DBG("sco connected with air mode: %02x", ev->air_mode); + if (ev->air_mode == SCO_CODED_CVSD) { + if (hdev->notify) + hdev->notify(hdev, HCI_NOTIFY_ENABLE_SCO_CVSD); + } else if (ev->air_mode == SCO_CODED_TRANSP) { + if (hdev->notify) + hdev->notify(hdev, HCI_NOTIFY_ENABLE_SCO_TRANSP); + } + hci_connect_cfm(conn, ev->status); if (ev->status) hci_conn_del(conn); -- 2.17.1