Bluetooth: Controller: Switch to Zephyr's hci.h for cmd handling
Continue using Zephyr's include/bluetooth/hci.h for HCI command handling in more of the commands. This commit cleans up hci_cmd_handle() to use the new macros added in previous commits. This is the fifth commit in a series that transitions from the structures in hci.c to the ones in hci.h. Jira: ZEP-726 Change-Id: I152e02ed15042d367e95432bdd07ae5c74935be8 Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
parent
69e1816868
commit
be2bbbae2d
1 changed files with 3 additions and 6 deletions
|
@ -1476,7 +1476,6 @@ static void hci_cmd_handle(struct bt_hci_cmd_hdr *cmd, uint8_t *len,
|
||||||
struct bt_hci_evt_hdr *evt;
|
struct bt_hci_evt_hdr *evt;
|
||||||
struct bt_hci_evt_cmd_complete *cc;
|
struct bt_hci_evt_cmd_complete *cc;
|
||||||
struct bt_hci_evt_cmd_status *cs;
|
struct bt_hci_evt_cmd_status *cs;
|
||||||
struct bt_hci_evt_cc_status *ccs;
|
|
||||||
int err;
|
int err;
|
||||||
uint16_t opcode;
|
uint16_t opcode;
|
||||||
uint8_t ocf;
|
uint8_t ocf;
|
||||||
|
@ -1485,10 +1484,8 @@ static void hci_cmd_handle(struct bt_hci_cmd_hdr *cmd, uint8_t *len,
|
||||||
*out = &hci_context.tx[0];
|
*out = &hci_context.tx[0];
|
||||||
hci_context.tx[0] = HCI_EVT;
|
hci_context.tx[0] = HCI_EVT;
|
||||||
evt = (void *)&hci_context.tx[1];
|
evt = (void *)&hci_context.tx[1];
|
||||||
cc = (void *)((uint8_t *)evt + sizeof(struct bt_hci_evt_hdr));
|
cc = HCI_CC(evt);
|
||||||
cs = (void *)((uint8_t *)evt + sizeof(struct bt_hci_evt_hdr));
|
cs = HCI_CS(evt);
|
||||||
ccs = (void *)((uint8_t *)cc +
|
|
||||||
sizeof(struct bt_hci_evt_cmd_complete));
|
|
||||||
|
|
||||||
opcode = sys_le16_to_cpu(cmd->opcode);
|
opcode = sys_le16_to_cpu(cmd->opcode);
|
||||||
ocf = BT_OCF(opcode);
|
ocf = BT_OCF(opcode);
|
||||||
|
@ -1518,7 +1515,7 @@ static void hci_cmd_handle(struct bt_hci_cmd_hdr *cmd, uint8_t *len,
|
||||||
if (err == -EINVAL) {
|
if (err == -EINVAL) {
|
||||||
evt->evt = BT_HCI_EVT_CMD_COMPLETE;
|
evt->evt = BT_HCI_EVT_CMD_COMPLETE;
|
||||||
evt->len = HCI_CC_LEN(bt_hci_evt_cc_status);
|
evt->len = HCI_CC_LEN(bt_hci_evt_cc_status);
|
||||||
ccs->status = BT_HCI_ERR_UNKNOWN_CMD;
|
HCI_CC_ST(evt)->status = BT_HCI_ERR_UNKNOWN_CMD;
|
||||||
*len = HCI_EVT_LEN(evt);
|
*len = HCI_EVT_LEN(evt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue