Bluetooth: controller: removed node_rx for big create/terminate
Removed the node_rx argument for the BIG create/terminate functions. The event should not be sent right after the command, but needs to wait for transmissions of empty BIS packets or BIG terminate indications. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
parent
b32af6a643
commit
47e716ba83
4 changed files with 12 additions and 20 deletions
|
@ -1379,8 +1379,7 @@ static void le_set_adv_enable(struct net_buf *buf, struct net_buf **evt)
|
|||
}
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_ADV_ISO)
|
||||
static void le_create_big(struct net_buf *buf, struct net_buf **evt,
|
||||
void **node_rx)
|
||||
static void le_create_big(struct net_buf *buf, struct net_buf **evt)
|
||||
{
|
||||
struct bt_hci_cp_le_create_big *cmd = (void *)buf->data;
|
||||
uint8_t status;
|
||||
|
@ -1409,7 +1408,7 @@ static void le_create_big(struct net_buf *buf, struct net_buf **evt,
|
|||
status = ll_big_create(big_handle, adv_handle, cmd->num_bis,
|
||||
sdu_interval, max_sdu, max_latency, cmd->rtn,
|
||||
cmd->phy, cmd->packing, cmd->framing,
|
||||
cmd->encryption, cmd->bcode, node_rx);
|
||||
cmd->encryption, cmd->bcode);
|
||||
|
||||
*evt = cmd_status(status);
|
||||
}
|
||||
|
@ -1438,13 +1437,12 @@ static void le_create_big_test(struct net_buf *buf, struct net_buf **evt)
|
|||
*evt = cmd_status(status);
|
||||
}
|
||||
|
||||
static void le_terminate_big(struct net_buf *buf, struct net_buf **evt,
|
||||
void **node_rx)
|
||||
static void le_terminate_big(struct net_buf *buf, struct net_buf **evt)
|
||||
{
|
||||
struct bt_hci_cp_le_terminate_big *cmd = (void *)buf->data;
|
||||
uint8_t status;
|
||||
|
||||
status = ll_big_terminate(cmd->big_handle, cmd->reason, node_rx);
|
||||
status = ll_big_terminate(cmd->big_handle, cmd->reason);
|
||||
|
||||
*evt = cmd_status(status);
|
||||
}
|
||||
|
@ -3162,7 +3160,7 @@ static int controller_cmd_handle(uint16_t ocf, struct net_buf *cmd,
|
|||
|
||||
#if defined(CONFIG_BT_CTLR_ADV_ISO)
|
||||
case BT_OCF(BT_HCI_OP_LE_CREATE_BIG):
|
||||
le_create_big(cmd, evt, node_rx);
|
||||
le_create_big(cmd, evt);
|
||||
break;
|
||||
|
||||
case BT_OCF(BT_HCI_OP_LE_CREATE_BIG_TEST):
|
||||
|
@ -3170,7 +3168,7 @@ static int controller_cmd_handle(uint16_t ocf, struct net_buf *cmd,
|
|||
break;
|
||||
|
||||
case BT_OCF(BT_HCI_OP_LE_TERMINATE_BIG):
|
||||
le_terminate_big(cmd, evt, node_rx);
|
||||
le_terminate_big(cmd, evt);
|
||||
break;
|
||||
#endif /* CONFIG_BT_CTLR_ADV_ISO */
|
||||
#endif /* CONFIG_BT_BROADCASTER */
|
||||
|
|
|
@ -104,14 +104,14 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
|||
uint32_t sdu_interval, uint16_t max_sdu,
|
||||
uint16_t max_latency, uint8_t rtn, uint8_t phy,
|
||||
uint8_t packing, uint8_t framing, uint8_t encryption,
|
||||
uint8_t *bcode, void **node_rx);
|
||||
uint8_t *bcode);
|
||||
uint8_t ll_big_test_create(uint8_t big_handle, uint8_t adv_handle,
|
||||
uint8_t num_bis, uint32_t sdu_interval,
|
||||
uint16_t iso_interval, uint8_t nse, uint16_t max_sdu,
|
||||
uint16_t max_pdu, uint8_t phy, uint8_t packing,
|
||||
uint8_t framing, uint8_t bn, uint8_t irc,
|
||||
uint8_t pto, uint8_t encryption, uint8_t *bcode);
|
||||
uint8_t ll_big_terminate(uint8_t big_handle, uint8_t reason, void **node_rx);
|
||||
uint8_t ll_big_terminate(uint8_t big_handle, uint8_t reason);
|
||||
|
||||
uint8_t ll_scan_params_set(uint8_t type, uint16_t interval, uint16_t window,
|
||||
uint8_t own_addr_type, uint8_t filter_policy);
|
||||
|
|
|
@ -49,7 +49,7 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
|||
uint32_t sdu_interval, uint16_t max_sdu,
|
||||
uint16_t max_latency, uint8_t rtn, uint8_t phy,
|
||||
uint8_t packing, uint8_t framing, uint8_t encryption,
|
||||
uint8_t *bcode, void **rx)
|
||||
uint8_t *bcode)
|
||||
{
|
||||
struct ll_adv_iso *adv_iso;
|
||||
struct ll_adv_set *adv;
|
||||
|
@ -166,8 +166,6 @@ uint8_t ll_big_create(uint8_t big_handle, uint8_t adv_handle, uint8_t num_bis,
|
|||
node_rx->hdr.handle = big_handle;
|
||||
node_rx->hdr.rx_ftr.param = adv_iso;
|
||||
|
||||
*rx = node_rx;
|
||||
|
||||
return BT_HCI_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -199,7 +197,7 @@ uint8_t ll_big_test_create(uint8_t big_handle, uint8_t adv_handle,
|
|||
return BT_HCI_ERR_CMD_DISALLOWED;
|
||||
}
|
||||
|
||||
uint8_t ll_big_terminate(uint8_t big_handle, uint8_t reason, void **rx)
|
||||
uint8_t ll_big_terminate(uint8_t big_handle, uint8_t reason)
|
||||
{
|
||||
struct ll_adv_iso *adv_iso;
|
||||
struct node_rx_pdu *node_rx;
|
||||
|
@ -226,8 +224,6 @@ uint8_t ll_big_terminate(uint8_t big_handle, uint8_t reason, void **rx)
|
|||
node_rx->hdr.rx_ftr.param = adv_iso;
|
||||
*((uint8_t *)node_rx->pdu) = reason;
|
||||
|
||||
*rx = node_rx;
|
||||
|
||||
return BT_HCI_ERR_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,6 @@ static void test_iso_main(void)
|
|||
uint8_t framing = 0;
|
||||
uint8_t encryption = 0;
|
||||
uint8_t bcode[16] = { 0 };
|
||||
void *node_rx;
|
||||
|
||||
/* Assume that index == handle */
|
||||
index = bt_le_ext_adv_get_index(adv);
|
||||
|
@ -102,7 +101,7 @@ static void test_iso_main(void)
|
|||
printk("Creating BIG...\n");
|
||||
err = ll_big_create(big_handle, index, bis_count, sdu_interval, max_sdu,
|
||||
max_latency, rtn, phy, packing, framing, encryption,
|
||||
bcode, &node_rx);
|
||||
bcode);
|
||||
if (err) {
|
||||
FAIL("Could not create BIG: %d\n", err);
|
||||
return;
|
||||
|
@ -112,8 +111,7 @@ static void test_iso_main(void)
|
|||
k_sleep(K_MSEC(5000));
|
||||
|
||||
printk("Terminating BIG...\n");
|
||||
err = ll_big_terminate(big_handle, BT_HCI_ERR_LOCALHOST_TERM_CONN,
|
||||
&node_rx);
|
||||
err = ll_big_terminate(big_handle, BT_HCI_ERR_LOCALHOST_TERM_CONN);
|
||||
if (err) {
|
||||
FAIL("Could not terminate BIG: %d\n", err);
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue