#include "netsupplicant.h"
#include "wifi-firmware.h"
#include "network-statistics.h"
-#if defined WLAN_CHECK_POWERSAVE
-#include "wifi-powersave.h"
-#endif
#define WLAN_DRIVER_SCRIPT "/usr/bin/wlan.sh"
#define WLAN_IFACE_NAME "wlan0"
-#if defined(TIZEN_TV)
-#define WLAN_P2P_IFACE_NAME "p2p0"
-#else /* defined(TIZEN_TV) */
-#define WLAN_P2P_IFACE_NAME "wlan0"
-#endif /* defined(TIZEN_TV) */
+#define WLAN_P2P_IFACE_NAME_TV "p2p0"
+#define WLAN_P2P_IFACE_NAME_COMMON "wlan0"
+#define WLAN_P2P_IFACE_NAME ((TIZEN_TV) ? (WLAN_P2P_IFACE_NAME_TV) : (WLAN_P2P_IFACE_NAME_COMMON))
static int __netconfig_sta_firmware_start(void)
{
static int __netconfig_wifi_firmware_start(enum netconfig_wifi_firmware type)
{
- if (netconfig_emulator_is_emulated() == TRUE)
+ if (emulator_is_emulated() == TRUE)
return -EIO;
switch (type) {
static int __netconfig_wifi_firmware_stop(enum netconfig_wifi_firmware type)
{
- if (netconfig_emulator_is_emulated() == TRUE)
+ if (emulator_is_emulated() == TRUE)
return -EIO;
switch (type) {
if (current_driver == NETCONFIG_WIFI_OFF) {
return -EALREADY;
} else if (current_driver == alias) {
-#if defined WLAN_CHECK_POWERSAVE
- if (type == NETCONFIG_WIFI_STA &&
- netconfig_wifi_is_powersave_mode() == TRUE) {
- netconfig_interface_down(WIFI_IFNAME);
-
- return -EALREADY;
- }
-#endif
#if defined WLAN_CONCURRENT_MODE
-#if defined TIZEN_TELEPHONY_ENABLE
- vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode);
-#endif
+ netconfig_vconf_get_bool(VCONFKEY_TELEPHONY_FLIGHT_MODE, &flight_mode);
if (flight_mode == 0 && type == NETCONFIG_WIFI_STA &&
netconfig_is_wifi_direct_on() == TRUE) {
netconfig_interface_down(WIFI_IFNAME);
return -EALREADY;
}
- if (type == NETCONFIG_WIFI_P2P &&
- netconfig_wifi_state_get_technology_state() >
- NETCONFIG_WIFI_TECH_OFF) {
+ if (type == NETCONFIG_WIFI_P2P && wifi_state_get_technology_state() > NETCONFIG_WIFI_TECH_OFF) {
netconfig_interface_down(WLAN_P2P_IFACE_NAME);
return -EALREADY;
if (current_driver > NETCONFIG_WIFI_OFF) {
if (current_driver == alias) {
-#if defined WLAN_CHECK_POWERSAVE
- if (type == NETCONFIG_WIFI_STA &&
- netconfig_wifi_is_powersave_mode() == TRUE) {
- netconfig_interface_up(WIFI_IFNAME);
-
- return -EALREADY;
- }
-#endif
#if defined WLAN_CONCURRENT_MODE
if (type == NETCONFIG_WIFI_STA)
if (err < 0) {
if (err == -EALREADY)
netconfig_error_already_exists(context);
- else
+ else if (g_strcmp0("softap", device) == 0 && err == -EIO && netconfig_is_wifi_direct_on() == FALSE) {
+ if (netconfig_wifi_firmware(NETCONFIG_WIFI_P2P, FALSE) == 0 && netconfig_wifi_firmware(NETCONFIG_WIFI_SOFTAP, TRUE) == 0) {
+ wifi_firmware_complete_start(firmware, context);
+ return TRUE;
+ } else
+ netconfig_error_wifi_driver_failed(context);
+ } else
netconfig_error_wifi_driver_failed(context);
- wifi_firmware_complete_start(firmware, context);
return FALSE;
}
else
netconfig_error_wifi_driver_failed(context);
- wifi_firmware_complete_start(firmware, context);
return FALSE;
}
- wifi_firmware_complete_start(firmware, context);
+ wifi_firmware_complete_stop(firmware, context);
return TRUE;
}