From 445591dded5753cf72dcf329a56af732776de97d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Mon, 21 Jun 2010 13:15:01 -0700 Subject: Undo previous merge Change-Id: I74fd5ae2634b0c7909b7ab332d174f98a9c8aee5 --- wifi/wifi.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'wifi/wifi.c') diff --git a/wifi/wifi.c b/wifi/wifi.c index 5fdf99b..3f8708d 100644 --- a/wifi/wifi.c +++ b/wifi/wifi.c @@ -36,6 +36,11 @@ static struct wpa_ctrl *ctrl_conn; static struct wpa_ctrl *monitor_conn; +extern int do_dhcp(); +extern int ifc_init(); +extern void ifc_close(); +extern char *dhcp_lasterror(); +extern void get_dhcp_info(); extern int init_module(void *, unsigned long, const char *); extern int delete_module(const char *, unsigned int); @@ -108,6 +113,28 @@ static int rmmod(const char *modname) return ret; } +int do_dhcp_request(int *ipaddr, int *gateway, int *mask, + int *dns1, int *dns2, int *server, int *lease) { + /* For test driver, always report success */ + if (strcmp(iface, WIFI_TEST_INTERFACE) == 0) + return 0; + + if (ifc_init() < 0) + return -1; + + if (do_dhcp(iface) < 0) { + ifc_close(); + return -1; + } + ifc_close(); + get_dhcp_info(ipaddr, gateway, mask, dns1, dns2, server, lease); + return 0; +} + +const char *get_dhcp_error_string() { + return dhcp_lasterror(); +} + static int check_driver_loaded() { char driver_status[PROPERTY_VALUE_MAX]; FILE *proc; -- cgit v1.1