summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerryLee <jerrylee@broadcom.com>2015-06-18 17:05:29 -0700
committerVinit Deshpande <vinitd@google.com>2015-06-24 14:15:49 -0700
commitc96943046060b3aa1e0cd2fb3974dfa3aeacb7cc (patch)
tree76fca0d14454ee9312f817256d82b73cd367fa0c
parent1de429dcaa9136ae7bbc57e7cccc10a5893fa7a3 (diff)
downloadhardware_libhardware_legacy-c96943046060b3aa1e0cd2fb3974dfa3aeacb7cc.zip
hardware_libhardware_legacy-c96943046060b3aa1e0cd2fb3974dfa3aeacb7cc.tar.gz
hardware_libhardware_legacy-c96943046060b3aa1e0cd2fb3974dfa3aeacb7cc.tar.bz2
Add wifi offload feature: mkeep_alive
b/21405946 Change-Id: Id8651f56d36d142772218defc9f9521dac82624a Signed-off-by: JerryLee <jerrylee@broadcom.com>
-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 */