Dynamic loading of wifi-driver for the wifi tethering 64/12564/2 accepted/tizen_ivi_panda tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.2015.q2_common tizen_ivi_panda accepted/tizen/common/20150204.152905 accepted/tizen/ivi/panda/20140403.015050 accepted/tizen/mobile/20150205.042051 accepted/tizen/tv/20150205.022634 accepted/tizen/wearable/20150205.103113 submit/tizen/20150204.061233 submit/tizen_ivi_panda/20140403.011849
authorpradeep kumar B <b.pradeep@samsung.com>
Tue, 19 Nov 2013 06:45:50 +0000 (12:15 +0530)
committerpradeep kumar B <b.pradeep@samsung.com>
Fri, 22 Nov 2013 08:21:35 +0000 (13:51 +0530)
Change-Id: I3437a19366e9950a7575726a5bd6c0d7d4027dea
Signed-off-by: pradeep kumar B <b.pradeep@samsung.com>
packaging/mobileap-agent.spec
src/mobileap_wifi.c

index e40b777..899893e 100644 (file)
@@ -31,6 +31,9 @@ cp %{SOURCE1001} .
 
 %build
 %cmake .
+%ifarch %arm
+CFLAGS+=" -DTIZEN_ARM"
+%endif
 make %{?jobs:-j%jobs}
 
 %install
index c2c9af2..788b464 100644 (file)
@@ -337,6 +337,22 @@ void _add_wifi_device_to_array(softap_device_info_t *di, GPtrArray *array)
        }
 }
 
+#ifdef TIZEN_ARM
+mobile_ap_error_code_e _wifi_softap_driverloader(gboolean action)
+{
+       char cmd[MAX_BUF_SIZE];
+       int ret_status = MOBILE_AP_ERROR_NONE;
+
+       char *str = action ? "softap":"stop";
+       snprintf(cmd, sizeof(cmd), "%s %s", WLAN_SCRIPT, str);
+       if (_execute_command(cmd)) {
+               ERR("execute script failed : %s\n", cmd);
+               ret_status = MOBILE_AP_ERROR_INTERNAL;
+       }
+       return ret_status;
+}
+#endif
+
 mobile_ap_error_code_e _enable_wifi_tethering(TetheringObject *obj, gchar *ssid)
 {
        mobile_ap_error_code_e ret;
@@ -373,9 +389,21 @@ mobile_ap_error_code_e _enable_wifi_tethering(TetheringObject *obj, gchar *ssid)
        }
 
        /* Upload driver */
+#ifdef TIZEN_ARM
+       ret = _wifi_softap_driverloader(TRUE);
+       if (ret != MOBILE_AP_ERROR_NONE) {
+               _deinit_tethering(obj);
+               _mobileap_clear_state(MOBILE_AP_STATE_WIFI);
+               return ret;
+       }
+#endif
+
        ret = connman_enable_tethering(TECH_TYPE_WIFI, obj->ssid,
                        obj->security_type, obj->key, obj->hide_mode);
        if (ret != MOBILE_AP_ERROR_NONE) {
+#ifdef TIZEN_ARM
+               _wifi_softap_driverloader(FALSE);
+#endif
                _deinit_tethering(obj);
                _mobileap_clear_state(MOBILE_AP_STATE_WIFI);
                return ret;
@@ -414,6 +442,14 @@ mobile_ap_error_code_e _disable_wifi_tethering(TetheringObject *obj)
        _deinit_tethering(obj);
        _mobileap_clear_state(MOBILE_AP_STATE_WIFI);
 
+#ifdef TIZEN_ARM
+       ret = _wifi_softap_driverloader(FALSE);
+       if (ret != MOBILE_AP_ERROR_NONE) {
+               ERR("unload softap driver is failed : %d\n", ret);
+               return ret;
+       }
+#endif
+
        DBG("_disable_wifi_tethering is done\n");
 
        return ret;