Bluetooth: Add dedicated pool for HCI_Num_Completed_Packets HCI event
This event is a priority one, so it's not safe to have it use the RX buffer pool which may be depleted due to non-priority events (e.g. advertising events). Since the event is consumed synchronously it's safe to have a single-buffer pool for it. Also introduce a new bt_buf_get_evt() API for HCI drivers to simplify the driver-side code, this effectively also deprecates bt_buf_get_cmd_complete() which now has no in-tree HCI driver users anymore. Fixes #16864 Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
766ad9f96c
commit
fc2fcd10cf
12 changed files with 75 additions and 41 deletions
|
@ -114,12 +114,8 @@ void TM_EvtReceivedCb(TL_EvtPacket_t *hcievt)
|
|||
BT_ERR("Unknown evtcode type 0x%02x",
|
||||
hcievt->evtserial.evt.evtcode);
|
||||
goto out;
|
||||
case BT_HCI_EVT_CMD_COMPLETE:
|
||||
case BT_HCI_EVT_CMD_STATUS:
|
||||
buf = bt_buf_get_cmd_complete(K_FOREVER);
|
||||
break;
|
||||
default:
|
||||
buf = bt_buf_get_rx(BT_BUF_EVT, K_FOREVER);
|
||||
buf = bt_buf_get_evt(evtserial.evt.evtcode, K_FOREVER);
|
||||
break;
|
||||
}
|
||||
net_buf_add_mem(buf, &hcievt->evtserial.evt,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue