nimble/ll: Cleanup transport handlers

ble_ll_hci seems like a good place for rx functions to be declared.
Also they do not need extra arg parameter as it's never used. And add
ISO handler as well.
This commit is contained in:
Andrzej Kaczmarek
2023-06-09 09:49:11 +02:00
parent b2ebf7630d
commit 2a566fa86f
4 changed files with 26 additions and 19 deletions
@@ -57,6 +57,10 @@ struct ble_ll_hci_vs_cmd {
/* Initialize LL HCI */
void ble_ll_hci_init(void);
int ble_ll_hci_cmd_rx(uint8_t *cmdbuf);
int ble_ll_hci_acl_rx(struct os_mbuf *om);
int ble_ll_hci_iso_rx(struct os_mbuf *om);
/* Used to determine if the LE event is enabled/disabled */
bool ble_ll_hci_is_le_event_enabled(unsigned int subev);
+8 -2
View File
@@ -1966,13 +1966,19 @@ ble_ll_init(void)
int
ble_transport_to_ll_cmd_impl(void *buf)
{
return ble_ll_hci_cmd_rx(buf, NULL);
return ble_ll_hci_cmd_rx(buf);
}
int
ble_transport_to_ll_acl_impl(struct os_mbuf *om)
{
return ble_ll_hci_acl_rx(om, NULL);
return ble_ll_hci_acl_rx(om);
}
int
ble_transport_to_ll_iso_impl(struct os_mbuf *om)
{
return ble_ll_hci_iso_rx(om);
}
void
-3
View File
@@ -260,9 +260,6 @@ int ble_ll_conn_set_data_len(struct ble_ll_conn_sm *connsm,
void ble_ll_conn_itvl_to_ticks(uint32_t itvl,
uint32_t *itvl_ticks, uint8_t *itvl_usecs);
int ble_ll_hci_cmd_rx(uint8_t *cmd, void *arg);
int ble_ll_hci_acl_rx(struct os_mbuf *om, void *arg);
int ble_ll_conn_hci_le_rd_phy(const uint8_t *cmdbuf, uint8_t len,
uint8_t *rsp, uint8_t *rsplen);
int ble_ll_conn_hci_le_set_phy(const uint8_t *cmdbuf, uint8_t len);
+14 -14
View File
@@ -1895,19 +1895,8 @@ send_cc_cs:
BLE_LL_DEBUG_GPIO(HCI_CMD, 0);
}
/**
* Sends an HCI command to the controller. On success, the supplied buffer is
* relinquished to the controller task. On failure, the caller must free the
* buffer.
*
* @param cmd A flat buffer containing the HCI command to
* send.
*
* @return 0 on success;
* BLE_ERR_MEM_CAPACITY on HCI buffer exhaustion.
*/
int
ble_ll_hci_cmd_rx(uint8_t *cmdbuf, void *arg)
ble_ll_hci_cmd_rx(uint8_t *cmdbuf)
{
struct ble_npl_event *ev;
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_CTRL_TO_HOST_FLOW_CONTROL)
@@ -1948,9 +1937,8 @@ ble_ll_hci_cmd_rx(uint8_t *cmdbuf, void *arg)
return 0;
}
/* Send ACL data from host to contoller */
int
ble_ll_hci_acl_rx(struct os_mbuf *om, void *arg)
ble_ll_hci_acl_rx(struct os_mbuf *om)
{
#if MYNEWT_VAL(BLE_LL_ROLE_PERIPHERAL) || MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
ble_ll_acl_data_in(om);
@@ -1961,6 +1949,18 @@ ble_ll_hci_acl_rx(struct os_mbuf *om, void *arg)
return 0;
}
int
ble_ll_hci_iso_rx(struct os_mbuf *om)
{
#if MYNEWT_VAL(BLE_LL_ISO)
/* FIXME send to isoal... */
os_mbuf_free_chain(om);
#else
os_mbuf_free_chain(om);
#endif
return 0;
}
/**
* Initalize the LL HCI.
*