![]() |
Morse Micro IoT SDK
2.9.7
|
API for allocating and freeing packet memory.
Data Structures | |
| struct | mmhal_wlan_pktmem_init_args |
| Initialization arguments passed to mmhal_wlan_pktmem_init(). More... | |
Typedefs | |
| typedef void(* | mmhal_wlan_pktmem_tx_flow_control_cb_t) (void) |
| Flow control callback that can be invoked by the transmit packet memory manager to pause and resume the data path in response to resource availability. More... | |
Enumerations | |
| enum | mmhal_wlan_pkt_class { MMHAL_WLAN_PKT_DATA_TID0 , MMHAL_WLAN_PKT_DATA_TID1 , MMHAL_WLAN_PKT_DATA_TID2 , MMHAL_WLAN_PKT_DATA_TID3 , MMHAL_WLAN_PKT_DATA_TID4 , MMHAL_WLAN_PKT_DATA_TID5 , MMHAL_WLAN_PKT_DATA_TID6 , MMHAL_WLAN_PKT_DATA_TID7 , MMHAL_WLAN_PKT_MANAGEMENT , MMHAL_WLAN_PKT_COMMAND } |
| Enumeration of packet classes used by mmhal_wlan_alloc_mmpkt_for_tx(). More... | |
Functions | |
| void | mmhal_wlan_pktmem_init (struct mmhal_wlan_pktmem_init_args *args) |
| Invoked by the driver to initialize the packet memory in the HAL. More... | |
| void | mmhal_wlan_pktmem_deinit (void) |
| Invoked by the driver to deinitialize the packet memory in the HAL. More... | |
| enum mmwlan_tx_flow_control_state | mmhal_wlan_pktmem_tx_flow_control_state (void) |
| Gets the current TX flow control state. More... | |
| struct mmpkt * | mmhal_wlan_alloc_mmpkt_for_tx (uint8_t pkt_class, uint32_t space_at_start, uint32_t space_at_end, uint32_t metadata_length) |
| Allocates an mmpkt for transmission. More... | |
| struct mmpkt * | mmhal_wlan_alloc_mmpkt_for_rx (uint8_t pkt_class, uint32_t capacity, uint32_t metadata_length) |
| Allocates an mmpkt for reception. More... | |
| typedef void(* mmhal_wlan_pktmem_tx_flow_control_cb_t) (void) |
Flow control callback that can be invoked by the transmit packet memory manager to pause and resume the data path in response to resource availability.
Definition at line 358 of file mmhal_wlan.h.
| enum mmhal_wlan_pkt_class |
Enumeration of packet classes used by mmhal_wlan_alloc_mmpkt_for_tx().
These definitions must match the corresponding values in mmdrv_pkt_class.
Definition at line 392 of file mmhal_wlan.h.
| struct mmpkt * mmhal_wlan_alloc_mmpkt_for_rx | ( | uint8_t | pkt_class, |
| uint32_t | capacity, | ||
| uint32_t | metadata_length | ||
| ) |
Allocates an mmpkt for reception.
| pkt_class | The class of packet (to allow for prioritization). Currently used values are MMHAL_WLAN_PKT_DATA_TID0 for data and management frames, and MMHAL_WLAN_PKT_COMMAND for critical buffers used internally by the driver (e.g., for command responses) where known. |
| capacity | Amount of space to allocate for data. A value of UINT32_MAX should allocate the largest available mmpkt (if supported). |
| metadata_length | Amount of space to allocate for metadata (used internally by the Morse driver). |
NULL on allocation failure. | struct mmpkt * mmhal_wlan_alloc_mmpkt_for_tx | ( | uint8_t | pkt_class, |
| uint32_t | space_at_start, | ||
| uint32_t | space_at_end, | ||
| uint32_t | metadata_length | ||
| ) |
Allocates an mmpkt for transmission.
When the pool of mmpkt buffers available for TX is exhausted, the HAL should pause the TX path using the flow control callback that was registered when mmhal_wlan_pktmem_init() was invoked. Similarly, when the buffers become available again (and assuming the TX path is not otherwise blocked) the driver should unpause the TX path.
| pkt_class | The class of packet (to allow for prioritization). |
| space_at_start | Amount of space to allocate at start of mmpkt (for prepend). |
| space_at_end | Amount of space to allocate at end of mmpkt (for append). |
| metadata_length | Amount of space to allocate for metadata (used internally by the Morse driver). |
NULL on allocation failure. | void mmhal_wlan_pktmem_deinit | ( | void | ) |
Invoked by the driver to deinitialize the packet memory in the HAL.
This can free reserved memory and check for memory leaks.
| void mmhal_wlan_pktmem_init | ( | struct mmhal_wlan_pktmem_init_args * | args | ) |
Invoked by the driver to initialize the packet memory in the HAL.
| args | Initialization arguments. |
| enum mmwlan_tx_flow_control_state mmhal_wlan_pktmem_tx_flow_control_state | ( | void | ) |
Gets the current TX flow control state.