summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/hardware_legacy/wifi_hal.h3
-rw-r--r--include/hardware_legacy/wifi_offload.h31
2 files changed, 34 insertions, 0 deletions
diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h
index 6a51db0..fb3316e 100644
--- a/include/hardware_legacy/wifi_hal.h
+++ b/include/hardware_legacy/wifi_hal.h
@@ -110,6 +110,7 @@ void wifi_get_error_info(wifi_error err, const char **msg); // return a pointer
#define WIFI_FEATURE_LOGGER 0x20000 // WiFi Logger
#define WIFI_FEATURE_HAL_EPNO 0x40000 // WiFi PNO enhanced
#define WIFI_FEATURE_RSSI_MONITOR 0x80000 // RSSI Monitor
+#define WIFI_FEATURE_MKEEP_ALIVE 0x100000 // WiFi mkeep_alive
// Add more features here
@@ -163,6 +164,8 @@ wifi_error wifi_set_nodfs_flag(wifi_interface_handle handle, u32 nodfs);
#include "wifi_logger.h"
#include "wifi_config.h"
#include "wifi_nan.h"
+#include "wifi_offload.h"
+
//wifi HAL function pointer table
typedef struct {
wifi_error (* wifi_initialize) (wifi_handle *);
diff --git a/include/hardware_legacy/wifi_offload.h b/include/hardware_legacy/wifi_offload.h
new file mode 100644
index 0000000..f0326f1
--- /dev/null
+++ b/include/hardware_legacy/wifi_offload.h
@@ -0,0 +1,31 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_OFFLOAD_H
+#define __WIFI_HAL_OFFLOAD_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define ETHER_ADDR_LEN 6 // Ethernet frame address length
+#define N_AVAIL_ID 3 // available mkeep_alive IDs from 1 to 3
+#define MKEEP_ALIVE_IP_PKT_MAX 256 // max size of IP packet for keep alive
+
+/**
+ * Send specified keep alive packet periodically.
+ */
+wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface,
+ u8 *ip_packet, u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec);
+
+/**
+ * Stop sending keep alive packet.
+ */
+wifi_error wifi_stop_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_OFFLOAD_H */