![]() |
Morse Micro IoT SDK
2.9.7
|
WLAN offload features enable offloading some high level networking features to the WLAN chip.
Features like ARP response, ARP refresh and DHCP lease updates can be offloaded to the chip allowing the host processor to sleep for longer resulting in better power savings.
Modules | |
| WLAN Standby features | |
| The standby mode allows the system to power off or put the host processor in a deep sleep mode while the Morse chip takes over certain functionality to keep the connection alive with the provision to wake up the host processor when certain conditions are met. | |
Data Structures | |
| struct | mmwlan_dhcp_lease_info |
| DHCP lease info structure. More... | |
| struct | mmwlan_tcp_keepalive_offload_args |
| Arguments data structure for TCP keep-alive arguments. More... | |
| struct | mmwlan_config_whitelist |
| Whitelist filter configuration. More... | |
Macros | |
| #define | MMWLAN_TCP_KEEPALIVE_OFFLOAD_ARGS_INIT { 0 } |
| Initializer for mmwlan_tcp_keepalive_offload_args. More... | |
| #define | MMWLAN_WHITELIST_FLAGS_CLEAR 0x01 |
| If this bit is set in the flags parameter of mmwlan_config_whitelist then any active whitelist filters are cleared,. More... | |
Typedefs | |
| typedef void(* | mmwlan_dhcp_lease_update_cb_t) (const struct mmwlan_dhcp_lease_info *lease_info, void *arg) |
| DHCP Lease update callback function prototype - this is called whenever a lease is updated. More... | |
Enumerations | |
| enum | mmwlan_tcp_keepalive_offload_cfg { MMWLAN_TCP_KEEPALIVE_SET_CFG_PERIOD = (0x01) , MMWLAN_TCP_KEEPALIVE_SET_CFG_RETRY_COUNT = (0x02) , MMWLAN_TCP_KEEPALIVE_SET_CFG_RETRY_INTERVAL = (0x04) , MMWLAN_TCP_KEEPALIVE_SET_CFG_SRC_IP_ADDR = (0x08) , MMWLAN_TCP_KEEPALIVE_SET_CFG_DEST_IP_ADDR = (0x10) , MMWLAN_TCP_KEEPALIVE_SET_CFG_SRC_PORT = (0x20) , MMWLAN_TCP_KEEPALIVE_SET_CFG_DEST_PORT = (0x40) , MMWLAN_TCP_KEEPALIVE_SET_CFG_TIMING_ONLY = (0x07) , MMWLAN_TCP_KEEPALIVE_SET_CFG_ALL = (0x7F) } |
| Keep-alive offload configuration options for mmwlan_tcp_keepalive_offload_args::set_cfgs bitmap. More... | |
Functions | |
| enum mmwlan_status | mmwlan_enable_arp_response_offload (uint32_t arp_addr) |
| Enables ARP response offload. More... | |
| enum mmwlan_status | mmwlan_enable_arp_refresh_offload (uint32_t interval_s, uint32_t dest_ip, bool send_as_garp) |
| Enables ARP refresh offload. More... | |
| enum mmwlan_status | mmwlan_enable_dhcp_offload (mmwlan_dhcp_lease_update_cb_t dhcp_lease_update_cb, void *arg) |
| Enables DHCP offload. More... | |
| enum mmwlan_status | mmwlan_enable_tcp_keepalive_offload (const struct mmwlan_tcp_keepalive_offload_args *args) |
| Enables TCP keep-alive offload. More... | |
| enum mmwlan_status | mmwlan_disable_tcp_keepalive_offload (void) |
| Disables the TCP keep-alive offload feature. More... | |
| enum mmwlan_status | mmwlan_set_whitelist_filter (const struct mmwlan_config_whitelist *whitelist) |
| Sets and enables the IP whitelist filter. More... | |
| #define MMWLAN_TCP_KEEPALIVE_OFFLOAD_ARGS_INIT { 0 } |
Initializer for mmwlan_tcp_keepalive_offload_args.
| #define MMWLAN_WHITELIST_FLAGS_CLEAR 0x01 |
If this bit is set in the flags parameter of mmwlan_config_whitelist then any active whitelist filters are cleared,.
| typedef void(* mmwlan_dhcp_lease_update_cb_t) (const struct mmwlan_dhcp_lease_info *lease_info, void *arg) |
Keep-alive offload configuration options for mmwlan_tcp_keepalive_offload_args::set_cfgs bitmap.
| enum mmwlan_status mmwlan_disable_tcp_keepalive_offload | ( | void | ) |
Disables the TCP keep-alive offload feature.
Has no effect if TCP keep-alive offload is not enabled.
| enum mmwlan_status mmwlan_enable_arp_refresh_offload | ( | uint32_t | interval_s, |
| uint32_t | dest_ip, | ||
| bool | send_as_garp | ||
| ) |
Enables ARP refresh offload.
When enabled the Morse chip will periodically send ARP requests to the AP to refresh its ARP table. This keeps this stations ARP entry from expiring. ARP response offload needs to be enabled first for this feature to work.
| interval_s | The interval in seconds to refresh the ARP entries on the AP. |
| dest_ip | The IP to send the ARP packets to. |
| send_as_garp | If true, send as gratuitous ARP. |
| enum mmwlan_status mmwlan_enable_arp_response_offload | ( | uint32_t | arp_addr | ) |
Enables ARP response offload.
When enabled the chip will automatically respond to ARP requests with the specified IPv4 address.
| arp_addr | The IPv4 address to respond with for ARP requests for this interface. |
| enum mmwlan_status mmwlan_enable_dhcp_offload | ( | mmwlan_dhcp_lease_update_cb_t | dhcp_lease_update_cb, |
| void * | arg | ||
| ) |
Enables DHCP offload.
When enabled the Morse chip will handle DHCP discovery and lease updates automatically.
dhcp_lease_update_cb) must not block and MMWLAN API functions may not be invoked from the callback.mmwlan_shutdown().| dhcp_lease_update_cb | The callback to call whenever the DHCP lease is updated. |
| arg | An opaque argument to pass to dhcp_lease_update_cb. |
| enum mmwlan_status mmwlan_enable_tcp_keepalive_offload | ( | const struct mmwlan_tcp_keepalive_offload_args * | args | ) |
Enables TCP keep-alive offload.
When enabled the Morse chip will periodically send TCP keep-alive packets to the destination even when the host processor is in standby mode. This function needs to be called before opening a TCP connection.
| args | A pointer to arguments of struct mmwlan_tcp_keepalive_offload_args. |
| enum mmwlan_status mmwlan_set_whitelist_filter | ( | const struct mmwlan_config_whitelist * | whitelist | ) |
Sets and enables the IP whitelist filter.
The IP whitelist filter specifies which incoming IP packets can wake the host from standby. The filter can be used to specify parameters such as source or destination IP addresses to match on, source or destination ports and even IP layer (Such as TCP, ICMP or UDP) or LLC layer (Such as IPv4 or IPv6) protocols. If any filter parameter is set to 0, then it is excluded from the filtering process.
If the flags parameter is set to MMWLAN_WHITELIST_FLAGS_CLEAR, then all active whitelist filters are cleared.
| whitelist | The whitelist filter to set. |