Datapath API that is typically hooked up to the network stack.
|
| typedef void(* | mmwlan_link_state_cb_t) (enum mmwlan_link_state link_state, void *arg) |
| | Prototype for link state change callbacks. More...
|
| |
| typedef void(* | mmwlan_vif_state_cb_t) (const struct mmwlan_vif_state *state, void *arg) |
| | Prototype for VIF state change callbacks. More...
|
| |
| typedef void(* | mmwlan_rx_cb_t) (uint8_t *header, unsigned header_len, uint8_t *payload, unsigned payload_len, void *arg) |
| | Receive data packet callback function. More...
|
| |
| typedef void(* | mmwlan_rx_pkt_cb_t) (struct mmpkt *mmpkt, void *arg) |
| | Receive data packet callback function, consuming an mmpkt. More...
|
| |
| typedef void(* | mmwlan_rx_pkt_ext_cb_t) (struct mmpkt *mmpkt, const struct mmwlan_rx_metadata *metadata, void *arg) |
| | Extended receive data packet callback function, consuming an mmpkt. More...
|
| |
| typedef void(* | mmwlan_tx_flow_control_cb_t) (enum mmwlan_tx_flow_control_state state, void *arg) |
| | Transmit flow control callback function type. More...
|
| |
|
| enum mmwlan_status | mmwlan_register_link_state_cb (mmwlan_link_state_cb_t callback, void *arg) |
| | Register a link status callback for use in STA mode. More...
|
| |
| enum mmwlan_status | mmwlan_register_vif_state_cb (enum mmwlan_vif vif, mmwlan_vif_state_cb_t callback, void *arg) |
| | Register a VIF state callback. More...
|
| |
| enum mmwlan_status | mmwlan_register_rx_cb (mmwlan_rx_cb_t callback, void *arg) |
| | Register a receive callback. More...
|
| |
| enum mmwlan_status | mmwlan_register_rx_pkt_cb (mmwlan_rx_pkt_cb_t callback, void *arg) |
| | Register a receive callback which consumes an mmpkt. More...
|
| |
| enum mmwlan_status | mmwlan_register_rx_pkt_ext_cb (enum mmwlan_vif vif, mmwlan_rx_pkt_ext_cb_t callback, void *arg) |
| | Register an extended receive callback which may consume an mmpkt. More...
|
| |
| enum mmwlan_status | mmwlan_tx_wait_until_ready (uint32_t timeout_ms) |
| | Blocks until the transmit path is ready for transmit. More...
|
| |
| struct mmpkt * | mmwlan_alloc_mmpkt_for_tx (uint32_t payload_len, uint8_t tid) |
| | Allocate an mmpkt data structure for transmission with at least enough space for the given payload length. More...
|
| |
| enum mmwlan_status | mmwlan_tx_pkt (struct mmpkt *pkt, const struct mmwlan_tx_metadata *metadata) |
| | Transmit the given packet. More...
|
| |
| static enum mmwlan_status | mmwlan_tx_tid (const uint8_t *data, unsigned len, uint8_t tid) |
| | Transmit the given packet using the given QoS Traffic ID (TID). More...
|
| |
| static enum mmwlan_status | mmwlan_tx (const uint8_t *data, unsigned len) |
| | Transmit the given packet using MMWLAN_TX_DEFAULT_QOS_TID. More...
|
| |
| enum mmwlan_status | mmwlan_register_tx_flow_control_cb (mmwlan_tx_flow_control_cb_t cb, void *arg) |
| | Register a transmit flow control callback. More...
|
| |
◆ MMWLAN_MAX_QOS_TID
| #define MMWLAN_MAX_QOS_TID (7) |
Maximum Traffic ID (TID) supported for QoS traffic.
Definition at line 2790 of file mmwlan.h.
◆ MMWLAN_TX_DEFAULT_QOS_TID
| #define MMWLAN_TX_DEFAULT_QOS_TID (0) |
◆ MMWLAN_TX_DEFAULT_TIMEOUT_MS
| #define MMWLAN_TX_DEFAULT_TIMEOUT_MS (1000) |
◆ MMWLAN_TX_METADATA_INIT
◆ mmwlan_link_state_cb_t
| typedef void(* mmwlan_link_state_cb_t) (enum mmwlan_link_state link_state, void *arg) |
Prototype for link state change callbacks.
- Parameters
-
| link_state | The new link state. |
| arg | Opaque argument that was given when the callback was registered. |
Definition at line 2598 of file mmwlan.h.
◆ mmwlan_rx_cb_t
| typedef void(* mmwlan_rx_cb_t) (uint8_t *header, unsigned header_len, uint8_t *payload, unsigned payload_len, void *arg) |
Receive data packet callback function.
- Parameters
-
| header | Buffer containing the 802.3 header for this packet. |
| header_len | Length of the header. |
| payload | Packet payload (excluding header). |
| payload_len | Length of payload. |
| arg | Opaque argument that was given when the callback was registered. |
Definition at line 2667 of file mmwlan.h.
◆ mmwlan_rx_pkt_cb_t
| typedef void(* mmwlan_rx_pkt_cb_t) (struct mmpkt *mmpkt, void *arg) |
Receive data packet callback function, consuming an mmpkt.
- Parameters
-
| mmpkt | The mmpkt containing the received packet, including an 802.3 header. Ownership of the mmpkt is passed to this callback. |
| arg | Opaque argument that was given when the callback was registered. |
Definition at line 2694 of file mmwlan.h.
◆ mmwlan_rx_pkt_ext_cb_t
| typedef void(* mmwlan_rx_pkt_ext_cb_t) (struct mmpkt *mmpkt, const struct mmwlan_rx_metadata *metadata, void *arg) |
Extended receive data packet callback function, consuming an mmpkt.
This is functionally the same as mmwlan_rx_pkt_cb_t except for the inclusion of additional metadata.
- Parameters
-
| mmpkt | The mmpkt containing the received packet, including an 802.3 header. Ownership of the mmpkt is passed to this callback. |
| metadata | Metadata relating to the received packet. |
| arg | Opaque argument that was given when the callback was registered. |
Definition at line 2734 of file mmwlan.h.
◆ mmwlan_tx_flow_control_cb_t
Transmit flow control callback function type.
When registered, this callback will be invoked when the transmit data path is paused and when unpaused.
- Note
- This function will always be invoked from the Upper MAC thread context. Therefore its invocation may not be synchronous with changes in flow control state.
- Parameters
-
| state | Current transmit flow control state. |
| arg | Opaque argument that was given when the function was registered. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
Definition at line 2972 of file mmwlan.h.
◆ mmwlan_vif_state_cb_t
| typedef void(* mmwlan_vif_state_cb_t) (const struct mmwlan_vif_state *state, void *arg) |
Prototype for VIF state change callbacks.
- Parameters
-
| state | The new VIF state. |
| arg | Opaque argument that was given when the callback was registered. |
Definition at line 2636 of file mmwlan.h.
◆ mmwlan_link_state
Enumeration of link states.
| Enumerator |
|---|
| MMWLAN_LINK_DOWN | The link is down.
|
| MMWLAN_LINK_UP | The link is up.
|
Definition at line 2586 of file mmwlan.h.
◆ mmwlan_tx_flow_control_state
Enumeration of states that can be returned by the transmit flow control callback (as registered by mmwlan_register_tx_flow_control_cb().
| Enumerator |
|---|
| MMWLAN_TX_READY | Transmit data path ready for packets (not paused).
|
| MMWLAN_TX_PAUSED | Transmit data path paused (blocked).
|
Definition at line 2954 of file mmwlan.h.
◆ mmwlan_alloc_mmpkt_for_tx()
| struct mmpkt * mmwlan_alloc_mmpkt_for_tx |
( |
uint32_t |
payload_len, |
|
|
uint8_t |
tid |
|
) |
| |
Allocate an mmpkt data structure for transmission with at least enough space for the given payload length.
The return mmpkt can be passed to mmwlan_tx_pkt().
- Parameters
-
| payload_len | Minimum space required for payload. |
| tid | The TID that this packet will be transmitted at. This may be used by the allocation function to, for example, prioritize allocation of certain classes of traffic. |
- Returns
- the allocated mmpkt on success or
NULL on failure.
◆ mmwlan_register_link_state_cb()
Register a link status callback for use in STA mode.
- Deprecated:
- This function is deprecated and provided for backwards compatibility. mmwlan_register_vif_state_cb should be used for new developments.
- Note
- Only one link status callback may be registered. Further registration will overwrite the previously registered callback.
-
The link status callback must not block and MMWLAN API functions may not be invoked from the callback.
-
This link status callback will not be invoked in AP mode.
- Parameters
-
| callback | The callback to register. |
| arg | Opaque argument to be passed to the callback. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
◆ mmwlan_register_rx_cb()
Register a receive callback.
- Note
- Only one receive callback of any type may be registered. Further registration will overwrite the previously registered callback (see mmwlan_register_rx_pkt_ext_cb for exceptions to this).
- Parameters
-
| callback | The callback to register (NULL to unregister). |
| arg | Opaque argument to be passed to the callback. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
◆ mmwlan_register_rx_pkt_cb()
Register a receive callback which consumes an mmpkt.
- Note
- Only one receive callback of any type may be registered. Further registration will overwrite the previously registered callback (see mmwlan_register_rx_pkt_ext_cb for exceptions to this).
- Parameters
-
| callback | The callback to register (NULL to unregister). |
| arg | Opaque argument to be passed to the callback. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
◆ mmwlan_register_rx_pkt_ext_cb()
Register an extended receive callback which may consume an mmpkt.
- Note
- Only one receive callback of this type may be registered for each VIF. Further registration will overwrite the previously registered callback. Registration of any callback through this function will override any callbacks previously registered by mmwlan_register_rx_cb() or mmwlan_register_rx_pkt_cb().
- Parameters
-
| vif | The VIF to register this callback for. If MMWLAN_VIF_UNSPECIFIED then it will be registered for all VIFs. |
| callback | The callback to register (NULL to unregister). |
| arg | Opaque argument to be passed to the callback. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
◆ mmwlan_register_tx_flow_control_cb()
Register a transmit flow control callback.
This callback will be invoked when the tx data path is paused and when unpaused.
- Note
- This function will always be invoked from the Upper MAC thread context. Therefore its invocation may not be synchronous with changes in flow control state.
- Parameters
-
| cb | The callback to register. |
| arg | Opaque argument to pass to the callback. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
◆ mmwlan_register_vif_state_cb()
Register a VIF state callback.
- Note
- Only one VIF state callback may be registered per VIF. Further registration for a given VIF will overwrite the previously registered callback.
-
The VIF state callback must not block and MMWLAN API functions may not be invoked from the callback.
- Parameters
-
| vif | The VIF that this callback applies to. If MMWLAN_VIF_UNSPECIFIED then the callback will be registered for all interfaces. |
| callback | The callback to register. |
| arg | Opaque argument to be passed to the callback. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
◆ mmwlan_tx()
| static enum mmwlan_status mmwlan_tx |
( |
const uint8_t * |
data, |
|
|
unsigned |
len |
|
) |
| |
|
inlinestatic |
Transmit the given packet using MMWLAN_TX_DEFAULT_QOS_TID.
The packet must start with an 802.3 header that will be translated into an 802.11 header.
+----------+----------+-----------+------------------+
| DST ADDR | SRC ADDR | ETHERTYPE | Payload |
+----------+----------+-----------+------------------+
^ ^ ^
|--------802.3 MAC Header---------| |
| |
| |
| |
|<----------------------len------------------------->|
data
- Parameters
-
| data | Packet data. |
| len | Length of packet. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
Definition at line 2945 of file mmwlan.h.
◆ mmwlan_tx_pkt()
Transmit the given packet.
The packet must start with an 802.3 header, which will be translated into an 802.11 header by this function.
+----------+----------+-----------+------------------+
| DST ADDR | SRC ADDR | ETHERTYPE | Payload |
+----------+----------+-----------+------------------+
^ ^ ^
|--------802.3 MAC Header---------| |
| |
| |
| |
|<----------------------len------------------------->|
data
- Note
- The TID should be set in the tx metadata of
txbuf before invoking this function.
-
This function is non-blocking. It will return immediately if the tx path is blocked. Use the tx flow control callback.
- Warning
- The given
txbuf must be allocated by mmwlan_alloc_mmpkt_for_tx().
- Parameters
-
| pkt | mmpkt containing the packet to transmit. This will be consumed by this function. |
| metadata | Extra information relating to the packet transmission. May be NULL, in which case default values will be used. |
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
◆ mmwlan_tx_tid()
| static enum mmwlan_status mmwlan_tx_tid |
( |
const uint8_t * |
data, |
|
|
unsigned |
len, |
|
|
uint8_t |
tid |
|
) |
| |
|
inlinestatic |
Transmit the given packet using the given QoS Traffic ID (TID).
The packet must start with an 802.3 header that will be translated into an 802.11 header.
+----------+----------+-----------+------------------+
| DST ADDR | SRC ADDR | ETHERTYPE | Payload |
+----------+----------+-----------+------------------+
^ ^ ^
|--------802.3 MAC Header---------| |
| |
| |
| |
|<----------------------len------------------------->|
data
- Parameters
-
- Returns
- MMWLAN_SUCCESS on success, else an appropriate error code.
Definition at line 2894 of file mmwlan.h.
◆ mmwlan_tx_wait_until_ready()
| enum mmwlan_status mmwlan_tx_wait_until_ready |
( |
uint32_t |
timeout_ms | ) |
|
Blocks until the transmit path is ready for transmit.
- Parameters
-
| timeout_ms | The maximum time to wait, in milliseconds. If zero then this function does not block. |
- Returns
- MMWLAN_SUCCESS on success, MMWLAN_TIMED_OUT if the transmit datapath was not ready within the given timeout, or another error code as appropriate.