From 214244f1cb9a8fbf6e2ba5ae2849f74a5d95b472 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 29 Oct 2012 16:09:38 -0700 Subject: [PATCH] emulator: Handle the local AMP info command --- emulator/btdev.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/emulator/btdev.c b/emulator/btdev.c index f2b025504..b1cc77f64 100644 --- a/emulator/btdev.c +++ b/emulator/btdev.c @@ -35,7 +35,9 @@ #include "btdev.h" #define le16_to_cpu(val) (val) +#define le32_to_cpu(val) (val) #define cpu_to_le16(val) (val) +#define cpu_to_le32(val) (val) struct btdev { enum btdev_type type; @@ -653,6 +655,7 @@ static void process_cmd(struct btdev *btdev, const void *data, uint16_t len) struct bt_hci_rsp_read_country_code rcc; struct bt_hci_rsp_read_bd_addr rba; struct bt_hci_rsp_read_data_block_size rdbs; + struct bt_hci_rsp_read_local_amp_info rlai; struct bt_hci_rsp_le_read_buffer_size lrbs; struct bt_hci_rsp_le_read_local_features lrlf; struct bt_hci_rsp_le_read_supported_states lrss; @@ -1037,6 +1040,21 @@ static void process_cmd(struct btdev *btdev, const void *data, uint16_t len) cmd_complete(btdev, opcode, &rdbs, sizeof(rdbs)); break; + case BT_HCI_CMD_READ_LOCAL_AMP_INFO: + rlai.status = BT_HCI_ERR_SUCCESS; + rlai.amp_status = 0x01; /* Used for Bluetooth only */ + rlai.total_bw = cpu_to_le32(0); + rlai.max_bw = cpu_to_le32(0); + rlai.min_latency = cpu_to_le32(0); + rlai.max_pdu = cpu_to_le32(672); + rlai.amp_type = 0x01; /* 802.11 AMP Controller */ + rlai.pal_cap = cpu_to_le16(0x0000); + rlai.max_assoc_size = cpu_to_le16(512); + rlai.max_flush_to = cpu_to_le32(0xffffffff); + rlai.be_flush_to = cpu_to_le32(0xffffffff); + cmd_complete(btdev, opcode, &rlai, sizeof(rlai)); + break; + case BT_HCI_CMD_LE_SET_EVENT_MASK: lsem = data + sizeof(*hdr); memcpy(btdev->le_event_mask, lsem->mask, 8); -- 2.47.3