Bluetooth: Add MGMT command to set SCO settings 25/317425/1
authorSudha Bheemanna <b.sudha@samsung.com>
Tue, 6 Sep 2016 11:08:36 +0000 (16:38 +0530)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 2 Jan 2025 06:08:39 +0000 (15:08 +0900)
Added code to set sco settings.

Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
[remove sco link policy part]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Change-Id: I28e7aa4e9170a8c4d75ecbb05d105c3e31102390

include/net/bluetooth/hci.h
include/net/bluetooth/hci_core.h
include/net/bluetooth/mgmt_tizen.h
include/net/bluetooth/sco.h

index d6f506236bc6e9a76b70d3ce342e38ac0beeb192..551eda4dcbc3a2ac2fc0613eb174a59e89b2a33e 100644 (file)
@@ -2190,6 +2190,29 @@ struct hci_cc_rp_get_raw_rssi {
        __le16  conn_handle;
        __s8    rssi_dbm;
 } __packed;
+
+#define HCI_BCM_ENABLE_WBS_REQ         0xfc7e
+struct hci_cp_bcm_wbs_req {
+       __u8    role;
+       __le16  pkt_type;
+} __packed;
+
+#define HCI_BCM_I2C_PCM_REQ            0xfc6d
+struct hci_cp_i2c_pcm_req {
+       __u8    i2c_enable;
+       __u8    is_master;
+       __u8    pcm_rate;
+       __u8    clock_rate;
+} __packed;
+
+#define HCI_BCM_SCO_PCM_REQ            0xfc1c
+struct hci_cp_sco_pcm_req {
+       __u8    sco_routing;
+       __u8    pcm_rate;
+       __u8    frame_type;
+       __u8    sync_mode;
+       __u8    clock_mode;
+} __packed;
 #endif
 
 /* ---- HCI Events ---- */
index cca4c1d8be1f6632ec5d45516e24d9ab417ad7a7..0449d3ec3362468423f26d9c804a084e661a47a3 100644 (file)
@@ -763,6 +763,8 @@ struct hci_conn {
 
 #ifdef TIZEN_BT
        bool            rssi_monitored;
+       __u8            sco_role;
+       __u16           voice_setting;
 #endif
        struct list_head link_list;
        struct hci_conn *parent;
@@ -1491,6 +1493,23 @@ static inline int hci_conn_hash_lookup_rssi_count(struct hci_dev *hdev)
 
 bool hci_le_discovery_active(struct hci_dev *hdev);
 void hci_le_discovery_set_state(struct hci_dev *hdev, int state);
+
+static inline struct hci_conn *hci_conn_hash_lookup_sco(struct hci_dev *hdev)
+{
+       struct hci_conn_hash *h = &hdev->conn_hash;
+       struct hci_conn  *c;
+
+       rcu_read_lock();
+       list_for_each_entry_rcu(c, &h->list, list) {
+               if (c->type == SCO_LINK || c->type == ESCO_LINK) {
+                       rcu_read_unlock();
+                       return c;
+               }
+       }
+       rcu_read_unlock();
+
+       return NULL;
+}
 #endif
 
 int hci_disconnect(struct hci_conn *conn, __u8 reason);
index 504c2d47b07d4dd9c6a4b717a7abb385fc24a2ed..4eaa867bb12696f3e73d7725f593a0ad059050cb 100644 (file)
@@ -151,6 +151,16 @@ struct mgmt_cp_le_set_scan_params {
 } __packed;
 #define MGMT_LE_SET_SCAN_PARAMS_SIZE           5
 
+#define MGMT_SCO_ROLE_HANDSFREE                        0x00
+#define MGMT_SCO_ROLE_AUDIO_GATEWAY            0x01
+#define MGMT_OP_SET_VOICE_SETTING              (TIZEN_OP_CODE_BASE + 0x10)
+struct mgmt_cp_set_voice_setting {
+       bdaddr_t        bdaddr;
+       uint8_t         sco_role;
+       uint16_t        voice_setting;
+} __packed;
+#define MGMT_SET_VOICE_SETTING_SIZE            9
+
 /* EVENTS */
 
 /* For device name update changes */
index f40ddb4264fc3c18fa59e86e24f9c2c1bc9b1522..bca05bf7bc314c5c5e7fd85712ec6101f4718d77 100644 (file)
@@ -46,4 +46,11 @@ struct sco_conninfo {
        __u8  dev_class[3];
 };
 
+#ifdef TIZEN_BT
+void sco_connect_set_gw_nbc(struct hci_dev *hdev);
+void sco_connect_set_gw_wbc(struct hci_dev *hdev);
+void sco_connect_set_nbc(struct hci_dev *hdev);
+void sco_connect_set_wbc(struct hci_dev *hdev);
+#endif
+
 #endif /* __SCO_H */