diff options
-rw-r--r-- | include/hci.h | 33 | ||||
-rw-r--r-- | include/hci_lib.h | 2 | ||||
-rw-r--r-- | src/hci.c | 55 |
3 files changed, 75 insertions, 15 deletions
diff --git a/include/hci.h b/include/hci.h index fc57bbca..ce5080ef 100644 --- a/include/hci.h +++ b/include/hci.h @@ -112,17 +112,31 @@ enum { #define HCI_UNKNOWN_PKT 0xff /* HCI Packet types */ -#define HCI_DM1 0x0008 -#define HCI_DM3 0x0400 -#define HCI_DM5 0x4000 -#define HCI_DH1 0x0010 -#define HCI_DH3 0x0800 -#define HCI_DH5 0x8000 +#define HCI_2DH1 0x0002 +#define HCI_3DH1 0x0004 +#define HCI_DM1 0x0008 +#define HCI_DH1 0x0010 +#define HCI_2DH3 0x0100 +#define HCI_3DH3 0x0200 +#define HCI_DM3 0x0400 +#define HCI_DH3 0x0800 +#define HCI_2DH5 0x1000 +#define HCI_3DH5 0x2000 +#define HCI_DM5 0x4000 +#define HCI_DH5 0x8000 #define HCI_HV1 0x0020 #define HCI_HV2 0x0040 #define HCI_HV3 0x0080 +#define HCI_EV3 0x0008 +#define HCI_EV4 0x0010 +#define HCI_EV5 0x0020 +#define HCI_2EV3 0x0040 +#define HCI_3EV3 0x0080 +#define HCI_2EV5 0x0100 +#define HCI_3EV5 0x0200 + #define SCO_PTYPE_MASK (HCI_HV1 | HCI_HV2 | HCI_HV3) #define ACL_PTYPE_MASK (~SCO_PTYPE_MASK) @@ -204,6 +218,8 @@ enum { #define LMP_TRSP_SCO 0x08 #define LMP_BCAST_ENC 0x80 +#define LMP_EDR_ACL_2M 0x02 +#define LMP_EDR_ACL_3M 0x04 #define LMP_ENH_ISCAN 0x08 #define LMP_ILACE_ISCAN 0x10 #define LMP_ILACE_PSCAN 0x20 @@ -214,9 +230,14 @@ enum { #define LMP_EV5 0x02 #define LMP_AFH_CAP_SLV 0x08 #define LMP_AFH_CLS_SLV 0x10 +#define LMP_EDR_3SLOT 0x80 +#define LMP_EDR_5SLOT 0x01 #define LMP_AFH_CAP_MST 0x08 #define LMP_AFH_CLS_MST 0x10 +#define LMP_EDR_ESCO_2M 0x20 +#define LMP_EDR_ESCO_3M 0x40 +#define LMP_EDR_3S_ESCO 0x80 #define LMP_EXT_FEAT 0x80 diff --git a/include/hci_lib.h b/include/hci_lib.h index e048375e..70d39264 100644 --- a/include/hci_lib.h +++ b/include/hci_lib.h @@ -96,6 +96,8 @@ char *hci_dtypetostr(int type); char *hci_dflagstostr(uint32_t flags); char *hci_ptypetostr(unsigned int ptype); int hci_strtoptype(char *str, unsigned int *val); +char *hci_scoptypetostr(unsigned int ptype); +int hci_strtoscoptype(char *str, unsigned int *val); char *hci_lptostr(unsigned int ptype); int hci_strtolp(char *str, unsigned int *val); char *hci_lmtostr(unsigned int ptype); @@ -200,15 +200,35 @@ char *hci_dflagstostr(uint32_t flags) /* HCI packet type mapping */ static hci_map pkt_type_map[] = { - { "DM1", HCI_DM1 }, - { "DM3", HCI_DM3 }, - { "DM5", HCI_DM5 }, - { "DH1", HCI_DH1 }, - { "DH3", HCI_DH3 }, - { "DH5", HCI_DH5 }, - { "HV1", HCI_HV1 }, - { "HV2", HCI_HV2 }, - { "HV3", HCI_HV3 }, + { "DM1", HCI_DM1 }, + { "DM3", HCI_DM3 }, + { "DM5", HCI_DM5 }, + { "DH1", HCI_DH1 }, + { "DH3", HCI_DH3 }, + { "DH5", HCI_DH5 }, + { "HV1", HCI_HV1 }, + { "HV2", HCI_HV2 }, + { "HV3", HCI_HV3 }, + { "2-DH1", HCI_2DH1 }, + { "2-DH3", HCI_2DH3 }, + { "2-DH5", HCI_2DH5 }, + { "3-DH1", HCI_3DH1 }, + { "3-DH3", HCI_3DH3 }, + { "3-DH5", HCI_3DH5 }, + { NULL } +}; + +static hci_map sco_ptype_map[] = { + { "HV1", 0x0001 }, + { "HV2", 0x0002 }, + { "HV3", 0x0004 }, + { "EV3", HCI_EV3 }, + { "EV4", HCI_EV4 }, + { "EV5", HCI_EV5 }, + { "2-EV3", HCI_2EV3 }, + { "2-EV5", HCI_2EV5 }, + { "3-EV3", HCI_3EV3 }, + { "3-EV5", HCI_3EV5 }, { NULL } }; @@ -222,6 +242,16 @@ int hci_strtoptype(char *str, unsigned int *val) return hci_str2bit(pkt_type_map, str, val); } +char *hci_scoptypetostr(unsigned int ptype) +{ + return hci_bit2str(sco_ptype_map, ptype); +} + +int hci_strtoscoptype(char *str, unsigned int *val) +{ + return hci_str2bit(sco_ptype_map, str, val); +} + /* Link policy mapping */ static hci_map link_policy_map[] = { { "NONE", 0 }, @@ -342,6 +372,8 @@ static hci_map lmp_features_map[8][9] = { { NULL } }, { /* Byte 3 */ + { "<EDR ACL 2 Mbps>", LMP_EDR_ACL_2M }, /* Bit 1 */ + { "<EDR ACL 3 Mbps>", LMP_EDR_ACL_3M }, /* Bit 2 */ { "<enhanced iscan>", LMP_ENH_ISCAN }, /* Bit 3 */ { "<interlaced iscan>", LMP_ILACE_ISCAN }, /* Bit 4 */ { "<interlaced pscan>", LMP_ILACE_PSCAN }, /* Bit 5 */ @@ -354,11 +386,16 @@ static hci_map lmp_features_map[8][9] = { { "<EV5 packets>", LMP_EV5 }, /* Bit 1 */ { "<AFH cap. slave>", LMP_AFH_CAP_SLV }, /* Bit 3 */ { "<AFH class. slave>", LMP_AFH_CLS_SLV }, /* Bit 4 */ + { "<3-slot EDR ACL>", LMP_EDR_3SLOT }, /* Bit 7 */ { NULL } }, { /* Byte 5 */ + { "<5-slot EDR ACL>", LMP_EDR_5SLOT }, /* Bit 0 */ { "<AFH cap. master>", LMP_AFH_CAP_MST }, /* Bit 3 */ { "<AFH class. master>",LMP_AFH_CLS_MST }, /* Bit 4 */ + { "<EDR eSCO 2 Mbps>", LMP_EDR_ESCO_2M }, /* Bit 5 */ + { "<EDR eSCO 3 Mbps>", LMP_EDR_ESCO_3M }, /* Bit 6 */ + { "<3-slot EDR eSCO>", LMP_EDR_3S_ESCO }, /* Bit 7 */ { NULL } }, { /* Byte 6 */ |