Skip to content

Commit

Permalink
nimble/ll: remove unsupported ISO code and configs
Browse files Browse the repository at this point in the history
This patch removes boilerplate for ISO code. This code causes conflicts
when proper implementation is introduced, as new LL flags are
introduced.

This causes bugs like duplicated case for
BLE_HCI_OCF_LE_READ_ISO_TX_SYNC OP Code.

Unsupported functions were removed, along with BLE_LL_CFG_FEAT_LL_ISO
and BLE_LL_CFG_FEAT_LL_ISO_TEST flag (BLE_LL_ISO and BLE_LL_ISO_TEST are
currently used). BLE_ISO_BROADCAST flag was introduced, and
BLE_LL_ISO_BROADCASTER inherits its value, by default. Similary, BLE_LL_ISO
inherits default value from BLE_ISO now.
  • Loading branch information
KKopyscinski committed Oct 17, 2023
1 parent 1299680 commit d20c010
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 269 deletions.
6 changes: 0 additions & 6 deletions nimble/controller/src/ble_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -1925,12 +1925,6 @@ ble_ll_init(void)
features |= BLE_LL_FEAT_SCA_UPDATE;
#endif

#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO)
features |= BLE_LL_FEAT_CIS_CENTRAL;
features |= BLE_LL_FEAT_CIS_PERIPH;
features |= BLE_LL_FEAT_CIS_HOST;
#endif

#if MYNEWT_VAL(BLE_LL_ISO_BROADCASTER)
features |= BLE_LL_FEAT_ISO_BROADCASTER;
#endif
Expand Down
47 changes: 0 additions & 47 deletions nimble/controller/src/ble_ll_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1296,27 +1296,6 @@ ble_ll_ctrl_rx_subrate_ind(struct ble_ll_conn_sm *connsm, uint8_t *req,
}
#endif

#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO)
static uint8_t
ble_ll_ctrl_rx_cis_req(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
uint8_t *rspdata)
{
return BLE_LL_CTRL_UNKNOWN_RSP;
}

static uint8_t
ble_ll_ctrl_rx_cis_rsp(struct ble_ll_conn_sm *connsm, uint8_t *dptr,
uint8_t *rspdata)
{
return BLE_LL_CTRL_UNKNOWN_RSP;
}

static uint8_t
ble_ll_ctrl_rx_cis_ind(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
{
return BLE_LL_CTRL_UNKNOWN_RSP;
}
#endif
/**
* Create a link layer length request or length response PDU.
*
Expand Down Expand Up @@ -1522,15 +1501,6 @@ ble_ll_ctrl_start_enc_send(struct ble_ll_conn_sm *connsm)
return rc;
}

#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO)
static void
ble_ll_ctrl_cis_create(struct ble_ll_conn_sm *connsm, uint8_t *dptr)
{
/* TODO Implement */
return;
}
#endif

/**
* Create a link layer control "encrypt request" PDU.
*
Expand Down Expand Up @@ -2544,12 +2514,6 @@ ble_ll_ctrl_proc_init(struct ble_ll_conn_sm *connsm, int ctrl_proc, void *data)
ble_ll_ctrl_sca_req_rsp_make(connsm, ctrdata);
break;
#endif
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO)
case BLE_LL_CTRL_PROC_CIS_CREATE:
opcode = BLE_LL_CTRL_CIS_REQ;
ble_ll_ctrl_cis_create(connsm, ctrdata);
break;
#endif
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ENHANCED_CONN_UPDATE)
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL)
case BLE_LL_CTRL_PROC_SUBRATE_REQ:
Expand Down Expand Up @@ -3013,17 +2977,6 @@ ble_ll_ctrl_rx_pdu(struct ble_ll_conn_sm *connsm, struct os_mbuf *om)
break;
#endif

#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO)
case BLE_LL_CTRL_CIS_REQ:
rsp_opcode = ble_ll_ctrl_rx_cis_req(connsm, dptr, rspdata);
break;
case BLE_LL_CTRL_CIS_RSP:
rsp_opcode = ble_ll_ctrl_rx_cis_rsp(connsm, dptr, rspdata);
break;
case BLE_LL_CTRL_CIS_IND:
rsp_opcode = ble_ll_ctrl_rx_cis_ind(connsm, dptr);
break;
#endif
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PERIODIC_ADV_SYNC_TRANSFER)
case BLE_LL_CTRL_PERIODIC_SYNC_IND:
rsp_opcode = ble_ll_ctrl_rx_periodic_sync_ind(connsm, dptr);
Expand Down
52 changes: 0 additions & 52 deletions nimble/controller/src/ble_ll_hci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1275,32 +1275,6 @@ ble_ll_hci_le_cmd_proc(const uint8_t *cmdbuf, uint8_t len, uint16_t ocf,
rc = ble_ll_iso_big_hci_terminate(cmdbuf, len);
break;
#endif /* BLE_LL_ISO_BROADCASTER */
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO)
case BLE_HCI_OCF_LE_READ_ISO_TX_SYNC:
rc = ble_ll_iso_read_tx_sync(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_SET_CIG_PARAMS:
rc = ble_ll_iso_set_cig_param(cmdbuf, len, rspbuf, rsplen);
break;
case BLE_HCI_OCF_LE_CREATE_CIS:
rc = ble_ll_iso_create_cis(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_REMOVE_CIG:
rc = ble_ll_iso_remove_cig(cmdbuf, len, rspbuf, rsplen);
break;
case BLE_HCI_OCF_LE_ACCEPT_CIS_REQ:
rc = ble_ll_iso_accept_cis_req(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_REJECT_CIS_REQ:
rc = ble_ll_iso_reject_cis_req(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_BIG_CREATE_SYNC:
rc = ble_ll_iso_big_create_sync(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_BIG_TERMINATE_SYNC:
rc = ble_ll_iso_big_terminate_sync(cmdbuf,len);
break;
#endif
#if MYNEWT_VAL(BLE_LL_ISO)
case BLE_HCI_OCF_LE_SETUP_ISO_DATA_PATH:
rc = ble_ll_isoal_hci_setup_iso_data_path(cmdbuf, len, rspbuf, rsplen);
Expand All @@ -1317,26 +1291,6 @@ ble_ll_hci_le_cmd_proc(const uint8_t *cmdbuf, uint8_t len, uint16_t ocf,
}
break;
#endif /* BLE_LL_ISO */
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO_TEST)
case BLE_HCI_OCF_LE_SET_CIG_PARAMS_TEST:
rc = ble_ll_iso_set_cig_param_test(cmdbuf, len, rspbuf, rsplen);
break;
case BLE_HCI_OCF_LE_CREATE_BIG_TEST:
rc = ble_ll_iso_create_big_test(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_ISO_TRANSMIT_TEST:
rc = ble_ll_iso_transmit_test(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_ISO_RECEIVE_TEST:
rc = ble_ll_iso_receive_test(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_ISO_READ_TEST_COUNTERS:
rc = ble_ll_iso_read_counters_test(cmdbuf, len);
break;
case BLE_HCI_OCF_LE_ISO_TEST_END:
rc = ble_ll_iso_end_test(cmdbuf, len);
break;
#endif
#if MYNEWT_VAL(BLE_VERSION) >= 52
case BLE_HCI_OCF_LE_SET_HOST_FEATURE:
rc = ble_ll_set_host_feat(cmdbuf, len);
Expand Down Expand Up @@ -1385,12 +1339,6 @@ ble_ll_hci_disconnect(const uint8_t *cmdbuf, uint8_t len)
return BLE_ERR_INV_HCI_CMD_PARMS;
}

#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_ISO)
if (le16toh(cmd->conn_handle) >= BLE_LL_CONN_HANDLE_ISO_OFFSET) {
return ble_ll_iso_disconnect_cmd(cmd);
}
#endif

return ble_ll_conn_hci_disconnect_cmd(cmd);
}
#endif
Expand Down
146 changes: 0 additions & 146 deletions nimble/controller/src/ble_ll_iso.c

This file was deleted.

19 changes: 2 additions & 17 deletions nimble/controller/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -348,21 +348,6 @@ syscfg.defs:
restrictions:
- '(BLE_VERSION >= 53) if 1'

BLE_LL_CFG_FEAT_LL_ISO:
description: >
This option is used to enable/disable support for LE Isochronous Channels
as per Bluetooth v5.2 channels
value: MYNEWT_VAL(BLE_ISO)
restrictions:
- '(BLE_VERSION >= 52) if 1'

BLE_LL_CFG_FEAT_LL_ISO_TEST:
description: >
This option is used to enable/disbale test commands for ISO support
value: MYNEWT_VAL(BLE_ISO_TEST)
restrictions:
- 'BLE_LL_CFG_FEAT_LL_ISO if 1'

BLE_LL_PERIODIC_ADV_SYNC_BIGINFO_REPORTS:
description: >
This option is used to enable/disable support for
Expand Down Expand Up @@ -479,14 +464,14 @@ syscfg.defs:
data, particular ISO features have to be enabled separately.
restrictions:
- (BLE_VERSION >= 52) if 1
value: 0
value: MYNEWT_VAL(BLE_ISO)
state: experimental
BLE_LL_ISO_BROADCASTER:
description: >
Enable support for Isochronous Broadcasting state.
restrictions:
- BLE_LL_ISO if 1
value: 0
value: MYNEWT_VAL(BLE_ISO_BROADCASTER)
state: experimental

BLE_LL_SYSINIT_STAGE:
Expand Down
7 changes: 6 additions & 1 deletion nimble/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ syscfg.defs:
value: 0
restrictions:
- '(BLE_VERSION >= 52) if 1'

BLE_ISO_BROADCASTER:
description: >
This enables LE Audio Broadcaster feature
value: 0
restrictions:
- '(BLE_VERSION >= 52) if 1'
BLE_ISO_TEST:
description: >
Enables BLE ISO Testing commands
Expand Down

0 comments on commit d20c010

Please sign in to comment.