Commit 4b7ffa08 authored by Dmitry Shmidt's avatar Dmitry Shmidt
Browse files

wifi: Add wifi_get_fw_path() call


Change-Id: Ib9dc8ce84febb2fba045ee527838653d0d1ad11b
Signed-off-by: default avatarDmitry Shmidt <dimitrysh@google.com>
parent d301cb7a
...@@ -172,6 +172,14 @@ int do_dhcp_request(int *ipaddr, int *gateway, int *mask, ...@@ -172,6 +172,14 @@ int do_dhcp_request(int *ipaddr, int *gateway, int *mask,
*/ */
const char *get_dhcp_error_string(); const char *get_dhcp_error_string();
/**
* Return the path to requested firmware
*/
#define WIFI_GET_FW_PATH_STA 0
#define WIFI_GET_FW_PATH_AP 1
#define WIFI_GET_FW_PATH_P2P 2
const char *wifi_get_fw_path(int fw_type);
#if __cplusplus #if __cplusplus
}; // extern "C" }; // extern "C"
#endif #endif
......
...@@ -15,6 +15,15 @@ endif ...@@ -15,6 +15,15 @@ endif
ifdef WIFI_FIRMWARE_LOADER ifdef WIFI_FIRMWARE_LOADER
LOCAL_CFLAGS += -DWIFI_FIRMWARE_LOADER=\"$(WIFI_FIRMWARE_LOADER)\" LOCAL_CFLAGS += -DWIFI_FIRMWARE_LOADER=\"$(WIFI_FIRMWARE_LOADER)\"
endif endif
ifdef WIFI_DRIVER_FW_PATH_STA
LOCAL_CFLAGS += -DWIFI_DRIVER_FW_PATH_STA=\"$(WIFI_DRIVER_FW_PATH_STA)\"
endif
ifdef WIFI_DRIVER_FW_PATH_AP
LOCAL_CFLAGS += -DWIFI_DRIVER_FW_PATH_AP=\"$(WIFI_DRIVER_FW_PATH_AP)\"
endif
ifdef WIFI_DRIVER_FW_PATH_P2P
LOCAL_CFLAGS += -DWIFI_DRIVER_FW_PATH_P2P=\"$(WIFI_DRIVER_FW_PATH_P2P)\"
endif
LOCAL_SRC_FILES += wifi/wifi.c LOCAL_SRC_FILES += wifi/wifi.c
......
...@@ -57,6 +57,16 @@ static char iface[PROPERTY_VALUE_MAX]; ...@@ -57,6 +57,16 @@ static char iface[PROPERTY_VALUE_MAX];
#endif #endif
#define WIFI_TEST_INTERFACE "sta" #define WIFI_TEST_INTERFACE "sta"
#ifndef WIFI_DRIVER_FW_PATH_STA
#define WIFI_DRIVER_FW_PATH_STA NULL
#endif
#ifndef WIFI_DRIVER_FW_PATH_AP
#define WIFI_DRIVER_FW_PATH_AP NULL
#endif
#ifndef WIFI_DRIVER_FW_PATH_P2P
#define WIFI_DRIVER_FW_PATH_P2P NULL
#endif
#define WIFI_DRIVER_LOADER_DELAY 1000000 #define WIFI_DRIVER_LOADER_DELAY 1000000
static const char IFACE_DIR[] = "/data/system/wpa_supplicant"; static const char IFACE_DIR[] = "/data/system/wpa_supplicant";
...@@ -604,3 +614,16 @@ int wifi_command(const char *command, char *reply, size_t *reply_len) ...@@ -604,3 +614,16 @@ int wifi_command(const char *command, char *reply, size_t *reply_len)
{ {
return wifi_send_command(ctrl_conn, command, reply, reply_len); return wifi_send_command(ctrl_conn, command, reply, reply_len);
} }
const char *wifi_get_fw_path(int fw_type)
{
switch (fw_type) {
case WIFI_GET_FW_PATH_STA:
return WIFI_DRIVER_FW_PATH_STA;
case WIFI_GET_FW_PATH_AP:
return WIFI_DRIVER_FW_PATH_AP;
case WIFI_GET_FW_PATH_P2P:
return WIFI_DRIVER_FW_PATH_P2P;
}
return NULL;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment