Fix1 - Pass PS core object in the setup netif callback
authorPhilippe Nunes <philippe.nunes@linux.intel.com>
Sun, 17 Mar 2013 22:29:16 +0000 (23:29 +0100)
committerPhilippe Nunes <philippe.nunes@linux.intel.com>
Sun, 17 Mar 2013 22:32:50 +0000 (23:32 +0100)
Fix2 - Allow PDP disconnection when rawip_enabled is TRUE

Change-Id: If79d42582fda5efe188af3c2239d34f842aaf97b

src/desc_mfld_blackbay.c

index d321af0..a0906c7 100644 (file)
@@ -88,7 +88,7 @@ static struct tcore_hal_operations hops = {
        .setup_netif = hal_setup_netif,
 };
 
-static TReturn prepare_and_send_at_request(TcoreHal *hal,
+static TReturn prepare_and_send_at_request(CoreObject *co, TcoreHal *hal,
                                        const char *at_cmd,
                                        const char *at_cmd_prefix,
                                        enum tcore_at_command_type at_cmd_type,
@@ -99,7 +99,7 @@ static TReturn prepare_and_send_at_request(TcoreHal *hal,
        TcoreATRequest *req;
 
        /* Create Pending Request */
-       pending = tcore_pending_new(NULL, 0);
+       pending = tcore_pending_new(co, 0);
        if (pending == NULL) {
                dbg("Memory failure, pending is NULL");
                return TCORE_RETURN_ENOMEM;
@@ -477,7 +477,7 @@ static void on_response_poweron(TcorePending *p, int data_len,
        }
 
        /* Disable UART for power saving */
-       prepare_and_send_at_request(hal, "AT+XPOW=0,0,0",
+       prepare_and_send_at_request(NULL, hal, "AT+XPOW=0,0,0",
                NULL, TCORE_AT_NO_RESULT, NULL, hal);
 
        dbg("Proceed with mux initialization");
@@ -509,7 +509,7 @@ static TReturn hal_power(TcoreHal *hal, gboolean flag)
        if (flag == TRUE) {
                tcore_server_register_modem(server, cdata->plugin);
 
-               return prepare_and_send_at_request(hal,
+               return prepare_and_send_at_request(NULL, hal,
                                                "AT+CPAS",
                                                "+CPAS", TCORE_AT_SINGLELINE,
                                                on_response_poweron, hal);
@@ -678,7 +678,7 @@ static TReturn hal_setup_netif(CoreObject *co, TcoreHalSetupNetifCallback func,
                return TCORE_RETURN_FAILURE;
        }
 
-       if ((enable == FALSE) && (cdata->rawip_enabled == TRUE)) {
+       if ((enable == FALSE) && (cdata->rawip_enabled == FALSE)) {
                dbg("PDP context %d already disabled", cid);
                return TCORE_RETURN_SUCCESS;
        }
@@ -694,7 +694,7 @@ static TReturn hal_setup_netif(CoreObject *co, TcoreHalSetupNetifCallback func,
 
        cmd_str = g_strdup_printf("AT+CGDATA=\"M-RAW_IP\",%d", cid);
 
-       ret = prepare_and_send_at_request(data_hal, cmd_str, NULL,
+       ret = prepare_and_send_at_request(co, data_hal, cmd_str, NULL,
                                                TCORE_AT_NO_RESULT,
                                                on_response_setup_pdp, data_hal);