|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Weak link stubs standing in for the NimBLE transport core. More...
#include <stdint.h>Go to the source code of this file.
Functions | |
| void * | ble_transport_alloc_evt (int discardable) |
| Allocate an HCI event buffer (upstream ble_transport.h). | |
| struct os_mbuf * | ble_transport_alloc_acl_from_ll (void) |
| Allocate an ACL mbuf for the LL-to-host direction. | |
| void | ble_transport_free (void *buf) |
| Release a buffer obtained from ble_transport_alloc_evt(). | |
| int | ble_transport_to_hs_evt (void *buf) |
| Push an HCI event up to the host stack. | |
| int | ble_transport_to_hs_acl (struct os_mbuf *om) |
| Push an ACL packet up to the host stack. | |
| int | os_mbuf_append (struct os_mbuf *om, const void *data, uint16_t len) |
| Append bytes to an mbuf chain (upstream os_mbuf.h). | |
| int | os_mbuf_free_chain (struct os_mbuf *om) |
| Free every mbuf in a chain. | |
| uint16_t | os_mbuf_len (const struct os_mbuf *om) |
| Total payload length of an mbuf chain. | |
| int | os_mbuf_copydata (const struct os_mbuf *om, int off, int len, void *dst) |
| Copy a byte range out of an mbuf chain. | |
| int | ble_transport_to_ll_cmd (void *buf) |
| Host-to-controller HCI command entry point. | |
| int | ble_transport_to_ll_acl (struct os_mbuf *om) |
| Host-to-controller ACL entry point. | |
| void | ble_transport_ll_init (void) |
| Bring this port's controller-side transport up. | |
| int | ble_transport_to_ll_cmd_impl (void *buf) |
| Controller-side handler for an HCI command from the host. | |
| int | ble_transport_to_ll_acl_impl (struct os_mbuf *om) |
| Controller-side handler for an ACL packet from the host. | |
| int | ble_transport_to_ll_iso_impl (struct os_mbuf *om) |
| Controller-side handler for an ISO packet from the host. | |
Weak link stubs standing in for the NimBLE transport core.
The build compiles no upstream NimBLE source at all – not the nimble/transport object library, and not the host or NPL either (cmake/nimble.cmake contributes include directories only). So the symbols those libraries would define are missing at link time while ble_hci_ra8_ble.c still references them. nimble_npl_threadx.c supplies weak no-op definitions to close the link; the linker prefers the strong upstream symbols the moment the real TUs are added to the build, so nothing here has to be removed first.
These prototypes cannot come from upstream. The declarations live in nimble/transport.h, nimble/transport_impl.h and os/os_mbuf.h, and reaching them means pulling in the whole Mynewt porting layer (os/os_mempool.h hard-errors without a matching OS_ALIGNMENT) – precisely the dependency the curated build is avoiding. So the port declares what the port defines, which is also what puts a prototype in front of each definition: without one, a stub whose signature drifts from the upstream contract it is standing in for compiles clean and fails at link, or worse, links against a mismatched ABI.
Signatures here are copied from the upstream headers named above and must stay identical to them.
Definition in file nimble_transport_stubs.h.
| struct os_mbuf * ble_transport_alloc_acl_from_ll | ( | void | ) |
Allocate an ACL mbuf for the LL-to-host direction.
Stub: no mbuf pool exists in the curated build.
| NULL | Always, in the stub build. |
Definition at line 581 of file nimble_npl_threadx.c.
Referenced by internal_acl_cb().
| void * ble_transport_alloc_evt | ( | int | discardable | ) |
Allocate an HCI event buffer (upstream ble_transport.h).
Stub: the curated build has no transport buffer pool, so the allocation always fails and the caller drops the event.
| [in] | discardable | Non-zero when the caller can tolerate a NULL return (low-priority event). Unused by the stub, kept for ABI parity with upstream. |
| NULL | Always, in the stub build. |
Definition at line 575 of file nimble_npl_threadx.c.
Referenced by internal_event_cb().
| void ble_transport_free | ( | void * | buf | ) |
Release a buffer obtained from ble_transport_alloc_evt().
Stub: nothing was ever allocated, so nothing is freed.
| [in] | buf | Buffer to release. May be NULL. |
buf came from ble_transport_alloc_evt() or is NULL. Definition at line 586 of file nimble_npl_threadx.c.
Referenced by ble_transport_to_ll_cmd_impl().
| void ble_transport_ll_init | ( | void | ) |
Bring this port's controller-side transport up.
Upstream transport_impl.h calls this once from the transport core's own init. Implemented by ble_hci_ra8_ble.c.
Bring this port's controller-side transport up.
Idempotent: if the app already called ble_hci_ra8_ble_init we leave the running state alone. Otherwise we attach the inbound callbacks here so the very first HCI command issued by the host has a return path ready.
Definition at line 286 of file ble_hci_ra8_ble.c.
References ble_hci_ra8_ble_init(), k_ble_hci_ra8_ble_state_running, and s_state.
| int ble_transport_to_hs_acl | ( | struct os_mbuf * | om | ) |
Push an ACL packet up to the host stack.
Stub: the mbuf is dropped and success is reported.
| [in] | om | ACL mbuf chain to deliver. |
| 0 | Always, in the stub build. |
om is a valid mbuf chain. om passes to the transport. Definition at line 597 of file nimble_npl_threadx.c.
Referenced by internal_acl_cb().
| int ble_transport_to_hs_evt | ( | void * | buf | ) |
Push an HCI event up to the host stack.
Stub: the event is dropped and success is reported so the controller side does not treat the missing host as an error.
| [in] | buf | Event buffer from ble_transport_alloc_evt(). |
| 0 | Always, in the stub build. |
buf is a valid event buffer. buf passes to the transport. Definition at line 591 of file nimble_npl_threadx.c.
Referenced by internal_event_cb().
| int ble_transport_to_ll_acl | ( | struct os_mbuf * | om | ) |
Host-to-controller ACL entry point.
Stub wrapper: forwards straight to ble_transport_to_ll_acl_impl().
| [in] | om | ACL mbuf chain to send. |
| 0 | Packet accepted by the controller side. |
om is a valid ACL mbuf chain. om passes to the controller side. Definition at line 637 of file nimble_npl_threadx.c.
References ble_transport_to_ll_acl_impl().
| int ble_transport_to_ll_acl_impl | ( | struct os_mbuf * | om | ) |
Controller-side handler for an ACL packet from the host.
Hands the packet to the RA8 BLE transport, reached the same two ways as ble_transport_to_ll_cmd_impl().
| [in] | om | ACL mbuf chain. |
| 0 | Packet handed to the RA8 BLE transport. |
om is a valid ACL mbuf chain. om passes to the RA8 BLE transport. Definition at line 311 of file ble_hci_ra8_ble.c.
References k_ble_hci_acl_header_len, k_ble_hci_acl_off_handle_hi, k_ble_hci_acl_off_handle_lo, k_ble_hci_acl_off_len_hi, k_ble_hci_acl_off_len_lo, k_ble_hci_acl_off_payload, k_ble_hci_ra8_ble_acl_buf_max, k_ble_hci_shift_byte, k_ra8_ok, os_mbuf_copydata(), os_mbuf_free_chain(), os_mbuf_len(), and ra8_ble_hci_send_acl_data().
Referenced by ble_transport_to_ll_acl().
| int ble_transport_to_ll_cmd | ( | void * | buf | ) |
Host-to-controller HCI command entry point.
Stub wrapper: forwards straight to ble_transport_to_ll_cmd_impl() so an app that bypasses the upstream transport core still reaches this port's controller side.
| [in] | buf | HCI command buffer. |
| 0 | Command accepted by the controller side. |
buf holds a well-formed HCI command. buf passes to the controller side. Definition at line 632 of file nimble_npl_threadx.c.
References ble_transport_to_ll_cmd_impl().
| int ble_transport_to_ll_cmd_impl | ( | void * | buf | ) |
Controller-side handler for an HCI command from the host.
Hands the command to the RA8 BLE transport. The upstream transport core reaches this through ble_transport_to_ll_cmd(); the weak stub of that wrapper forwards here too, so an app that skips the core still reaches the controller.
| [in] | buf | HCI command buffer. |
| 0 | Command handed to the RA8 BLE transport. |
buf holds a well-formed HCI command. buf passes to the RA8 BLE transport. Definition at line 294 of file ble_hci_ra8_ble.c.
References ble_transport_free(), k_ble_hci_shift_byte, k_ra8_ok, and ra8_ble_hci_send_command().
Referenced by ble_transport_to_ll_cmd().
| int ble_transport_to_ll_iso_impl | ( | struct os_mbuf * | om | ) |
Controller-side handler for an ISO packet from the host.
The RA8 BLE transport carries no isochronous channels, so this rejects every packet rather than silently dropping it.
| [in] | om | ISO mbuf chain. |
| 0 | Packet accepted. |
om is a valid ISO mbuf chain. om passes to the RA8 BLE transport. Controller-side handler for an ISO packet from the host.
Bluetooth LE Audio (Core 5.2+) ISO data is not exposed through ra8_ble yet. We accept the call to keep the link satisfied, free the mbuf, and return success.
| [in] | om | NimBLE-allocated ISO mbuf chain. |
| 0 | Success or default value. |
Definition at line 370 of file ble_hci_ra8_ble.c.
References os_mbuf_free_chain().
| int os_mbuf_append | ( | struct os_mbuf * | om, |
| const void * | data, | ||
| uint16_t | len ) |
Append bytes to an mbuf chain (upstream os_mbuf.h).
Stub: no mbuf pool exists, so the append is a no-op.
| [in,out] | om | Chain to append to. |
| [in] | data | Bytes to copy in. |
| [in] | len | Number of bytes at data. |
| 0 | Always, in the stub build. |
om and data are valid for len bytes. om is unchanged in the stub build. Definition at line 603 of file nimble_npl_threadx.c.
Referenced by internal_acl_cb().
| int os_mbuf_copydata | ( | const struct os_mbuf * | om, |
| int | off, | ||
| int | len, | ||
| void * | dst ) |
Copy a byte range out of an mbuf chain.
Stub: copies nothing and reports success.
| [in] | om | Chain to read from. |
| [in] | off | Byte offset into the chain payload. |
| [in] | len | Number of bytes to copy. |
| [out] | dst | Destination buffer, at least len bytes. |
| 0 | Always, in the stub build. |
dst is writable for len bytes. off and len lie inside the chain payload. dst is untouched in the stub build. om is not modified.Definition at line 623 of file nimble_npl_threadx.c.
Referenced by ble_transport_to_ll_acl_impl().
| int os_mbuf_free_chain | ( | struct os_mbuf * | om | ) |
Free every mbuf in a chain.
Stub: nothing was allocated, so nothing is freed.
| [in] | om | Head of the chain to release. May be NULL. |
| 0 | Always, in the stub build. |
om is a chain head or NULL. om. Definition at line 611 of file nimble_npl_threadx.c.
Referenced by ble_transport_to_ll_acl_impl(), ble_transport_to_ll_iso_impl(), and internal_acl_cb().
| uint16_t os_mbuf_len | ( | const struct os_mbuf * | om | ) |
Total payload length of an mbuf chain.
Stub: reports an empty chain.
| [in] | om | Chain to measure. May be NULL. |
| 0 | Always, in the stub build. |
om is a chain head or NULL. om is not modified. Definition at line 617 of file nimble_npl_threadx.c.
Referenced by ble_transport_to_ll_acl_impl().