1 /* Copyright (c) 2015 The Chromium OS Authors. All rights reserved. 2 * Use of this source code is governed by a BSD-style license that can be 3 * found in the LICENSE file. 4 */ 5 6 /* Definitions from Linux bluetooth directory that are useful for 7 * bluetotoh audio. 8 * TODO(hychao): Remove this file when there is bluetooth user 9 * space header provided. 10 */ 11 12 #include <unistd.h> 13 14 #define HCI_VIRTUAL 0 15 #define HCI_USB 1 16 #define HCI_PCCARD 2 17 #define HCI_UART 3 18 #define HCI_RS232 4 19 #define HCI_PCI 5 20 #define HCI_SDIO 6 21 #define HCI_BUS_MAX 7 22 23 #define BTPROTO_HCI 1 24 #define BTPROTO_SCO 2 25 26 #define SCO_OPTIONS 0x01 27 #define SOL_SCO 17 28 29 #define HCIGETDEVINFO _IOR('H', 211, int) 30 31 typedef struct { 32 uint8_t b[6]; 33 } __attribute__((packed)) bdaddr_t; 34 35 struct hci_dev_stats { 36 uint32_t err_rx; 37 uint32_t err_tx; 38 uint32_t cmd_tx; 39 uint32_t evt_rx; 40 uint32_t acl_tx; 41 uint32_t acl_rx; 42 uint32_t sco_tx; 43 uint32_t sco_rx; 44 uint32_t byte_rx; 45 uint32_t byte_tx; 46 }; 47 48 struct hci_dev_info { 49 uint16_t dev_id; 50 char name[8]; 51 bdaddr_t bdaddr; 52 uint32_t flags; 53 uint8_t type; 54 uint8_t features[8]; 55 uint32_t pkt_type; 56 uint32_t link_policy; 57 uint32_t link_mode; 58 uint16_t acl_mtu; 59 uint16_t acl_pkts; 60 uint16_t sco_mtu; 61 uint16_t sco_pkts; 62 struct hci_dev_stats stat; 63 }; 64 65 struct sco_options { 66 uint16_t mtu; 67 }; 68 69 #define SOL_BLUETOOTH 274 70 71 #define BT_VOICE 11 72 struct bt_voice { 73 uint16_t setting; 74 }; 75 76 #define BT_VOICE_TRANSPARENT 0x0003 77