Morse Micro IoT SDK  2.9.7

Detailed Description

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...
 

Macro Definition Documentation

◆ MMWLAN_TCP_KEEPALIVE_OFFLOAD_ARGS_INIT

#define MMWLAN_TCP_KEEPALIVE_OFFLOAD_ARGS_INIT   { 0 }

Initializer for mmwlan_tcp_keepalive_offload_args.

See also
mmwlan_tcp_keepalive_offload_args

Definition at line 1666 of file mmwlan.h.

◆ MMWLAN_WHITELIST_FLAGS_CLEAR

#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,.

Definition at line 1700 of file mmwlan.h.

Typedef Documentation

◆ mmwlan_dhcp_lease_update_cb_t

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.

Definition at line 1562 of file mmwlan.h.

Enumeration Type Documentation

◆ mmwlan_tcp_keepalive_offload_cfg

Keep-alive offload configuration options for mmwlan_tcp_keepalive_offload_args::set_cfgs bitmap.

Enumerator
MMWLAN_TCP_KEEPALIVE_SET_CFG_PERIOD 

Bitmap for TCP keep alive period parameter.

MMWLAN_TCP_KEEPALIVE_SET_CFG_RETRY_COUNT 

Bitmap for TCP keep alive retry count parameter.

MMWLAN_TCP_KEEPALIVE_SET_CFG_RETRY_INTERVAL 

Bitmap for TCP keep alive retry interval parameter.

MMWLAN_TCP_KEEPALIVE_SET_CFG_SRC_IP_ADDR 

Bitmap for TCP keep alive source IP parameter.

MMWLAN_TCP_KEEPALIVE_SET_CFG_DEST_IP_ADDR 

Bitmap for TCP keep alive destination IP parameter.

MMWLAN_TCP_KEEPALIVE_SET_CFG_SRC_PORT 

Bitmap for TCP keep alive source port parameter.

MMWLAN_TCP_KEEPALIVE_SET_CFG_DEST_PORT 

Bitmap for TCP keep alive destination port parameter.

MMWLAN_TCP_KEEPALIVE_SET_CFG_TIMING_ONLY 

Bitmap for TCP keep alive timing parameters only.

MMWLAN_TCP_KEEPALIVE_SET_CFG_ALL 

Bitmap for all TCP keep alive parameters.

Definition at line 1590 of file mmwlan.h.

Function Documentation

◆ mmwlan_disable_tcp_keepalive_offload()

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.

Returns
MMWLAN_SUCCESS on success or MMWLAN_ERROR on failure.

◆ mmwlan_enable_arp_refresh_offload()

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.

Note
ARP refresh offload is not supported for IPv6 addresses.
Parameters
interval_sThe interval in seconds to refresh the ARP entries on the AP.
dest_ipThe IP to send the ARP packets to.
send_as_garpIf true, send as gratuitous ARP.
Returns
MMWLAN_SUCCESS on success or MMWLAN_ERROR on failure.

◆ mmwlan_enable_arp_response_offload()

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.

Note
ARP offload can only be enabled for a STA with an active connection.
ARP offload is not supported for IPv6 addresses.
Parameters
arp_addrThe IPv4 address to respond with for ARP requests for this interface.
Returns
MMWLAN_SUCCESS on success, MMWLAN_UNAVAILABLE if the chip does not have a valid connection, or MMWLAN_ERROR on failure.

◆ mmwlan_enable_dhcp_offload()

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.

Note
DHCP offload is not supported for IPv6 addresses.
The DHCP lease update callback (dhcp_lease_update_cb) must not block and MMWLAN API functions may not be invoked from the callback.
Once enabled this feature can only be disabled by a complete system reset or by calling mmwlan_shutdown().
Parameters
dhcp_lease_update_cbThe callback to call whenever the DHCP lease is updated.
argAn opaque argument to pass to dhcp_lease_update_cb.
Returns
MMWLAN_SUCCESS on success or MMWLAN_ERROR on failure.

◆ mmwlan_enable_tcp_keepalive_offload()

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.

Note
TCP keep-alive offload will only be applied to the first TCP connection matching the given configuration that is opened after this function is called.
TCP keep-alive offload is not supported for IPv6 addresses.
Parameters
argsA pointer to arguments of struct mmwlan_tcp_keepalive_offload_args.
Returns
MMWLAN_SUCCESS on success or MMWLAN_ERROR on failure.

◆ mmwlan_set_whitelist_filter()

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.

Note
Address/port level filtering is not supported for IPv6 packets.
Parameters
whitelistThe whitelist filter to set.
Returns
MMWLAN_SUCCESS on success or MMWLAN_ERROR on failure.