isimodem: use simplified client interface

This commit is contained in:
Pekka Pessi 2011-01-04 17:48:33 +02:00 committed by Aki Niemi
parent 593e74f793
commit e0b6a058a2
14 changed files with 117 additions and 118 deletions

View File

@ -139,8 +139,8 @@ static void isi_set(struct ofono_call_barring *barr, const char *lock,
if (cbd == NULL || bd == NULL) if (cbd == NULL || bd == NULL)
goto error; goto error;
if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT, if (g_isi_client_send(bd->client, msg, sizeof(msg),
set_resp_cb, cbd, g_free) != NULL) set_resp_cb, cbd, g_free))
return; return;
error: error:
@ -258,8 +258,8 @@ static void isi_query(struct ofono_call_barring *barr, const char *lock,
if (cbd == NULL || bd == NULL) if (cbd == NULL || bd == NULL)
goto error; goto error;
if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT, if (g_isi_client_send(bd->client, msg, sizeof(msg),
query_resp_cb, cbd, g_free) != NULL) query_resp_cb, cbd, g_free))
return; return;
error: error:
@ -321,8 +321,8 @@ static void isi_set_passwd(struct ofono_call_barring *barr, const char *lock,
if (cbd == NULL || bd == NULL) if (cbd == NULL || bd == NULL)
goto error; goto error;
if (g_isi_client_send(bd->client, msg, sizeof(msg), SS_TIMEOUT, if (g_isi_client_send(bd->client, msg, sizeof(msg),
set_passwd_resp_cb, cbd, g_free) != NULL) set_passwd_resp_cb, cbd, g_free))
return; return;
error: error:

View File

@ -253,8 +253,8 @@ static void isi_registration(struct ofono_call_forwarding *cf, int type,
memcpy((char *) &msg[13], ucs2, strlen(number->number) * 2); memcpy((char *) &msg[13], ucs2, strlen(number->number) * 2);
g_free(ucs2); g_free(ucs2);
if (g_isi_client_send(fd->client, msg, 7 + msg[8], SS_TIMEOUT, if (g_isi_client_send(fd->client, msg, 7 + msg[8],
registration_resp_cb, cbd, g_free) != NULL) registration_resp_cb, cbd, g_free))
return; return;
error: error:
@ -316,8 +316,8 @@ static void isi_erasure(struct ofono_call_forwarding *cf, int type, int cls,
if (cbd == NULL || fd == NULL || ss_code < 0) if (cbd == NULL || fd == NULL || ss_code < 0)
goto error; goto error;
if (g_isi_client_send(fd->client, msg, sizeof(msg), SS_TIMEOUT, if (g_isi_client_send(fd->client, msg, sizeof(msg),
erasure_resp_cb, cbd, g_free) != NULL) erasure_resp_cb, cbd, g_free))
return; return;
error: error:
@ -411,8 +411,8 @@ static void isi_query(struct ofono_call_forwarding *cf, int type, int cls,
if (cbd == NULL || fd == NULL || cls != 7 || ss_code < 0) if (cbd == NULL || fd == NULL || cls != 7 || ss_code < 0)
goto error; goto error;
if (g_isi_client_send(fd->client, msg, sizeof(msg), SS_TIMEOUT, if (g_isi_client_send(fd->client, msg, sizeof(msg),
query_resp_cb, cbd, g_free) != NULL) query_resp_cb, cbd, g_free))
return; return;
error: error:

View File

@ -172,8 +172,8 @@ static void isi_cw_query(struct ofono_call_settings *cs, int cls,
if (cbd == NULL || sd == NULL) if (cbd == NULL || sd == NULL)
goto error; goto error;
if (g_isi_client_send(sd->client, msg, sizeof(msg), SS_TIMEOUT, if (g_isi_client_send(sd->client, msg, sizeof(msg),
query_resp_cb, cbd, g_free) != NULL) query_resp_cb, cbd, g_free))
return; return;
error: error:
@ -241,8 +241,8 @@ static void isi_cw_set(struct ofono_call_settings *cs, int mode, int cls,
if (cbd == NULL || sd == NULL) if (cbd == NULL || sd == NULL)
goto error; goto error;
if (g_isi_client_send(sd->client, msg, sizeof(msg), SS_TIMEOUT, if (g_isi_client_send(sd->client, msg, sizeof(msg),
set_resp_cb, cbd, g_free) != NULL) set_resp_cb, cbd, g_free))
return; return;
error: error:

View File

@ -173,11 +173,11 @@ static int isi_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
ofono_cbs_set_data(cbs, cd); ofono_cbs_set_data(cbs, cd);
if (g_isi_client_send(cd->client, msg, sizeof(msg), CBS_TIMEOUT, if (g_isi_client_send(cd->client, msg, sizeof(msg),
routing_resp_cb, cbs, NULL) == NULL) routing_resp_cb, cbs, NULL))
return -errno; return 0;
return 0; return -errno;
} }
static void isi_cbs_remove(struct ofono_cbs *cbs) static void isi_cbs_remove(struct ofono_cbs *cbs)
@ -205,8 +205,7 @@ static void isi_cbs_remove(struct ofono_cbs *cbs)
* Send a promiscuous routing release, so as not to hog * Send a promiscuous routing release, so as not to hog
* resources unnecessarily after being removed. * resources unnecessarily after being removed.
*/ */
g_isi_client_send(cd->client, msg, sizeof(msg), CBS_TIMEOUT, NULL, g_isi_client_send(cd->client, msg, sizeof(msg), NULL, NULL, NULL);
NULL, NULL);
g_isi_client_destroy(cd->client); g_isi_client_destroy(cd->client);
g_free(cd); g_free(cd);

View File

@ -115,12 +115,12 @@ static void isi_query_manufacturer(struct ofono_devinfo *info,
INFO_PRODUCT_INFO_READ_REQ, INFO_PRODUCT_INFO_READ_REQ,
INFO_PRODUCT_MANUFACTURER INFO_PRODUCT_MANUFACTURER
}; };
size_t len = sizeof(msg);
if (cbd == NULL || dev == NULL) if (cbd == NULL || dev == NULL)
goto error; goto error;
if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT, if (g_isi_client_send(dev->client, msg, len, info_resp_cb, cbd, g_free))
info_resp_cb, cbd, g_free) != NULL)
return; return;
error: error:
@ -139,12 +139,12 @@ static void isi_query_model(struct ofono_devinfo *info,
INFO_PRODUCT_INFO_READ_REQ, INFO_PRODUCT_INFO_READ_REQ,
INFO_PRODUCT_NAME INFO_PRODUCT_NAME
}; };
size_t len = sizeof(msg);
if (cbd == NULL || dev == NULL) if (cbd == NULL || dev == NULL)
goto error; goto error;
if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT, if (g_isi_client_send(dev->client, msg, len, info_resp_cb, cbd, g_free))
info_resp_cb, cbd, g_free) != NULL)
return; return;
error: error:
@ -164,12 +164,12 @@ static void isi_query_revision(struct ofono_devinfo *info,
0x00, INFO_MCUSW, 0x00, INFO_MCUSW,
0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x00, 0x00
}; };
size_t len = sizeof(msg);
if (cbd == NULL || dev == NULL) if (cbd == NULL || dev == NULL)
goto error; goto error;
if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT, if (g_isi_client_send(dev->client, msg, len, info_resp_cb, cbd, g_free))
info_resp_cb, cbd, g_free) != NULL)
return; return;
error: error:
@ -188,12 +188,12 @@ static void isi_query_serial(struct ofono_devinfo *info,
INFO_SERIAL_NUMBER_READ_REQ, INFO_SERIAL_NUMBER_READ_REQ,
INFO_SN_IMEI_PLAIN INFO_SN_IMEI_PLAIN
}; };
size_t len = sizeof(msg);
if (cbd == NULL || dev == NULL) if (cbd == NULL || dev == NULL)
goto error; goto error;
if (g_isi_client_send(dev->client, msg, sizeof(msg), INFO_TIMEOUT, if (g_isi_client_send(dev->client, msg, len, info_resp_cb, cbd, g_free))
info_resp_cb, cbd, g_free) != NULL)
return; return;
error: error:
@ -228,8 +228,10 @@ static int isi_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
return -ENOMEM; return -ENOMEM;
} }
ofono_devinfo_set_data(info, data); ofono_devinfo_set_data(info, data);
g_isi_client_set_timeout(data->client, INFO_TIMEOUT);
g_isi_client_verify(data->client, reachable_cb, info, NULL); g_isi_client_verify(data->client, reachable_cb, info, NULL);
return 0; return 0;

View File

@ -324,9 +324,9 @@ static void send_context_activate(GIsiClient *client, void *opaque)
g_isi_client_ind_subscribe(client, GPDS_CONTEXT_DEACTIVATE_IND, g_isi_client_ind_subscribe(client, GPDS_CONTEXT_DEACTIVATE_IND,
deactivate_ind_cb, cd); deactivate_ind_cb, cd);
if (g_isi_client_send(client, msg, sizeof(msg), if (g_isi_client_send_with_timeout(client, msg, sizeof(msg),
GPDS_CTX_ACTIVATE_TIMEOUT, GPDS_CTX_ACTIVATE_TIMEOUT,
context_activate_cb, cd, NULL) != NULL) context_activate_cb, cd, NULL))
g_isi_pipe_start(cd->pipe); g_isi_pipe_start(cd->pipe);
else else
gprs_up_fail(cd); gprs_up_fail(cd);
@ -372,8 +372,7 @@ static void send_context_authenticate(GIsiClient *client, void *opaque)
{ cd->password, password_len }, { cd->password, password_len },
}; };
if (g_isi_client_vsend(client, iov, 4, GPDS_TIMEOUT, if (!g_isi_client_vsend(client, iov, 4, context_auth_cb, cd, NULL))
context_auth_cb, cd, NULL) == NULL)
gprs_up_fail(cd); gprs_up_fail(cd);
} }
@ -419,8 +418,8 @@ static void link_conf_cb(const GIsiMessage *msg, void *opaque)
if (!check_resp(msg, GPDS_LL_CONFIGURE_RESP, 2, cd, gprs_up_fail)) if (!check_resp(msg, GPDS_LL_CONFIGURE_RESP, 2, cd, gprs_up_fail))
return; return;
if (g_isi_client_vsend(cd->client, iov, 2, GPDS_TIMEOUT, if (!g_isi_client_vsend(cd->client, iov, 2,
context_conf_cb, cd, NULL) == NULL) context_conf_cb, cd, NULL))
gprs_up_fail(cd); gprs_up_fail(cd);
} }
@ -441,8 +440,8 @@ static void create_context_cb(const GIsiMessage *msg, void *opaque)
cd->handle = req[1] = data[0]; cd->handle = req[1] = data[0];
if (g_isi_client_send(cd->client, req, sizeof(req), GPDS_TIMEOUT, if (!g_isi_client_send(cd->client, req, sizeof(req),
link_conf_cb, cd, NULL) == NULL) link_conf_cb, cd, NULL))
gprs_up_fail(cd); gprs_up_fail(cd);
} }
@ -454,8 +453,8 @@ static void create_pipe_cb(GIsiPipe *pipe)
GPDS_CONTEXT_ID_CREATE_REQ, GPDS_CONTEXT_ID_CREATE_REQ,
}; };
if (g_isi_client_send(cd->client, msg, sizeof(msg), GPDS_TIMEOUT, if (!g_isi_client_send(cd->client, msg, sizeof(msg),
create_context_cb, cd, NULL) == NULL) create_context_cb, cd, NULL))
gprs_up_fail(cd); gprs_up_fail(cd);
} }
@ -551,12 +550,10 @@ static void isi_gprs_deactivate_primary(struct ofono_gprs_context *gc,
msg[1] = cd->handle; msg[1] = cd->handle;
if (g_isi_client_send(cd->client, msg, sizeof(msg), if (!g_isi_client_send_with_timeout(cd->client, msg, sizeof(msg),
GPDS_CTX_DEACTIVATE_TIMEOUT, GPDS_CTX_DEACTIVATE_TIMEOUT,
context_deactivate_cb, cd, NULL) == NULL) { context_deactivate_cb, cd, NULL))
gprs_down_fail(cd); gprs_down_fail(cd);
return;
}
} }
static void gpds_ctx_reachable_cb(const GIsiMessage *msg, void *opaque) static void gpds_ctx_reachable_cb(const GIsiMessage *msg, void *opaque)

View File

@ -93,7 +93,7 @@ static void set_attach_mode(struct ofono_gprs *gprs, int attached)
0x00 0x00
}; };
g_isi_client_send(gd->client, msg, sizeof(msg), GPDS_TIMEOUT, g_isi_client_send(gd->client, msg, sizeof(msg),
configure_resp_cb, gprs, NULL); configure_resp_cb, gprs, NULL);
} }
@ -280,7 +280,7 @@ static void gpds_reachable_cb(const GIsiMessage *msg, void *opaque)
return; return;
} }
g_isi_client_send(gd->info_client, req, sizeof(req), GPDS_TIMEOUT, g_isi_client_send(gd->info_client, req, sizeof(req),
info_pp_read_resp_cb, gprs, NULL); info_pp_read_resp_cb, gprs, NULL);
} }
@ -301,6 +301,7 @@ static int isi_gprs_probe(struct ofono_gprs *gprs,
ofono_gprs_set_data(gprs, gd); ofono_gprs_set_data(gprs, gd);
g_isi_client_set_timeout(gd->client, GPDS_TIMEOUT);
g_isi_client_verify(gd->client, gpds_reachable_cb, gprs, NULL); g_isi_client_verify(gd->client, gpds_reachable_cb, gprs, NULL);
return 0; return 0;
@ -397,9 +398,10 @@ static void isi_gprs_set_attached(struct ofono_gprs *gprs, int attached,
GPDS_FOLLOW_OFF GPDS_FOLLOW_OFF
}; };
if (g_isi_client_send(gd->client, msg, sizeof(msg), if (g_isi_client_send_with_timeout(gd->client,
GPDS_ATTACH_TIMEOUT, attach_resp_cb, msg, sizeof(msg),
cbd, g_free) != NULL) GPDS_ATTACH_TIMEOUT, attach_resp_cb,
cbd, g_free))
return; return;
} else { } else {
const unsigned char msg[] = { const unsigned char msg[] = {
@ -408,9 +410,10 @@ static void isi_gprs_set_attached(struct ofono_gprs *gprs, int attached,
0x00 /* sub-blocks */ 0x00 /* sub-blocks */
}; };
if (g_isi_client_send(gd->client, msg, sizeof(msg), if (g_isi_client_send_with_timeout(gd->client,
GPDS_DETACH_TIMEOUT, detach_resp_cb, msg, sizeof(msg),
cbd, g_free) != NULL) GPDS_DETACH_TIMEOUT, detach_resp_cb,
cbd, g_free))
return; return;
} }
@ -474,8 +477,8 @@ static void isi_gprs_attached_status(struct ofono_gprs *gprs,
if (cbd == NULL || gd == NULL) if (cbd == NULL || gd == NULL)
goto error; goto error;
if (g_isi_client_send(gd->client, msg, sizeof(msg), GPDS_TIMEOUT, if (g_isi_client_send(gd->client, msg, sizeof(msg),
status_resp_cb, cbd, g_free) != NULL) status_resp_cb, cbd, g_free))
return; return;
error: error:

View File

@ -338,8 +338,8 @@ static void rat_resp_cb(const GIsiMessage *msg, void *data)
goto error; goto error;
} }
if (g_isi_client_send(nd->client, req, sizeof(req), NETWORK_TIMEOUT, if (g_isi_client_send(nd->client, req, sizeof(req),
reg_status_resp_cb, cbd, NULL) != NULL) reg_status_resp_cb, cbd, NULL))
return; return;
error: error:
@ -368,8 +368,8 @@ static void isi_registration_status(struct ofono_netreg *netreg,
if (nd == NULL || cbd == NULL) if (nd == NULL || cbd == NULL)
goto error; goto error;
if (g_isi_client_send(nd->client, rat, sizeof(rat), NETWORK_TIMEOUT, if (g_isi_client_send(nd->client, rat, sizeof(rat),
rat_resp_cb, cbd, NULL) != NULL) rat_resp_cb, cbd, NULL))
return; return;
error: error:
@ -449,8 +449,8 @@ static void isi_current_operator(struct ofono_netreg *netreg,
if (cbd == NULL || nd == NULL) if (cbd == NULL || nd == NULL)
goto error; goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_TIMEOUT, if (g_isi_client_send(nd->client, msg, sizeof(msg),
name_get_resp_cb, cbd, g_free) != NULL) name_get_resp_cb, cbd, g_free))
return; return;
error: error:
@ -552,9 +552,9 @@ static void isi_list_operators(struct ofono_netreg *netreg,
if (cbd == NULL || nd == NULL) if (cbd == NULL || nd == NULL)
goto error; goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg), if (g_isi_client_send_with_timeout(nd->client, msg, sizeof(msg),
NETWORK_SCAN_TIMEOUT, available_resp_cb, cbd, NETWORK_SCAN_TIMEOUT, available_resp_cb, cbd,
g_free) != NULL) g_free))
return; return;
error: error:
@ -599,9 +599,9 @@ static void isi_register_auto(struct ofono_netreg *netreg,
if (nd == NULL || cbd == NULL) if (nd == NULL || cbd == NULL)
goto error; goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg), if (g_isi_client_send_with_timeout(nd->client, msg, sizeof(msg),
NETWORK_SET_TIMEOUT, set_auto_resp_cb, cbd, NETWORK_SET_TIMEOUT,
g_free) != NULL) set_auto_resp_cb, cbd, g_free))
return; return;
error: error:
@ -653,8 +653,9 @@ static void isi_register_manual(struct ofono_netreg *netreg,
if (cbd == NULL || nd == NULL) if (cbd == NULL || nd == NULL)
goto error; goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_SET_TIMEOUT, if (g_isi_client_send_with_timeout(nd->client, msg, sizeof(msg),
set_manual_resp_cb, cbd, g_free) != NULL) NETWORK_SET_TIMEOUT,
set_manual_resp_cb, cbd, g_free))
return; return;
error: error:
@ -783,8 +784,8 @@ static void isi_strength(struct ofono_netreg *netreg,
if (nd == NULL || cbd == NULL) if (nd == NULL || cbd == NULL)
goto error; goto error;
if (g_isi_client_send(nd->client, msg, sizeof(msg), NETWORK_TIMEOUT, if (g_isi_client_send(nd->client, msg, sizeof(msg),
rssi_resp_cb, cbd, g_free) != NULL) rssi_resp_cb, cbd, g_free))
return; return;
error: error:

View File

@ -222,8 +222,7 @@ static void read_next_entry(GIsiClient *client, uint16_t location,
if (cbd == NULL) if (cbd == NULL)
goto error; goto error;
if (g_isi_client_send(client, msg, sizeof(msg), SIM_TIMEOUT, if (g_isi_client_send(client, msg, sizeof(msg), notify, cbd, NULL))
notify, cbd, NULL) != NULL)
return; return;
error: error:
@ -278,12 +277,12 @@ static void isi_export_entries(struct ofono_phonebook *pb, const char *storage,
0, SIM_PB_EMAIL, 0, SIM_PB_EMAIL,
0, 0 /* filler */ 0, 0 /* filler */
}; };
size_t len = sizeof(msg);
if (cbd == NULL || pbd == NULL || strcmp(storage, "SM") != 0) if (cbd == NULL || pbd == NULL || strcmp(storage, "SM") != 0)
goto error; goto error;
if (g_isi_client_send(pbd->client, msg, sizeof(msg), SIM_TIMEOUT, if (g_isi_client_send(pbd->client, msg, len, read_resp_cb, cbd, NULL))
read_resp_cb, cbd, NULL) != NULL)
return; return;
error: error:

View File

@ -150,7 +150,7 @@ static void isi_query_rat_mode(struct ofono_radio_settings *rs,
if (cbd == NULL || rd == NULL) if (cbd == NULL || rd == NULL)
goto error; goto error;
if (g_isi_client_send(rd->gss_client, msg, sizeof(msg), GSS_TIMEOUT, if (g_isi_client_send(rd->gss_client, msg, sizeof(msg),
rat_mode_read_resp_cb, cbd, NULL)) rat_mode_read_resp_cb, cbd, NULL))
return; return;
@ -210,7 +210,7 @@ static void isi_set_rat_mode(struct ofono_radio_settings *rs,
if (isi_mode == -1) if (isi_mode == -1)
goto error; goto error;
if (g_isi_client_send(rd->gss_client, msg, sizeof(msg), GSS_TIMEOUT, if (g_isi_client_send(rd->gss_client, msg, sizeof(msg),
mode_write_resp_cb, cbd, NULL)) mode_write_resp_cb, cbd, NULL))
return; return;

View File

@ -194,11 +194,8 @@ static gboolean isi_read_spn(struct ofono_sim *sim, struct isi_cb_data *cbd)
if (sd == NULL) if (sd == NULL)
return FALSE; return FALSE;
if (g_isi_client_send(sd->client, msg, sizeof(msg), SIM_TIMEOUT, return g_isi_client_send(sd->client, msg, sizeof(msg),
spn_resp_cb, cbd, g_free) == NULL) spn_resp_cb, cbd, g_free);
return FALSE;
return TRUE;
} }
static void read_iccid_resp_cb(const GIsiMessage *msg, void *data) static void read_iccid_resp_cb(const GIsiMessage *msg, void *data)
@ -233,11 +230,8 @@ static gboolean isi_read_iccid(struct ofono_sim *sim, struct isi_cb_data *cbd)
if (sd == NULL) if (sd == NULL)
return FALSE; return FALSE;
if (g_isi_client_send(sd->client, req, sizeof(req), SIM_TIMEOUT, return g_isi_client_send(sd->client, req, sizeof(req),
read_iccid_resp_cb, cbd, g_free) == NULL) read_iccid_resp_cb, cbd, g_free);
return FALSE;
return TRUE;
} }
static void isi_read_file_transparent(struct ofono_sim *sim, int fileid, static void isi_read_file_transparent(struct ofono_sim *sim, int fileid,
@ -245,6 +239,7 @@ static void isi_read_file_transparent(struct ofono_sim *sim, int fileid,
ofono_sim_read_cb_t cb, void *data) ofono_sim_read_cb_t cb, void *data)
{ {
struct isi_cb_data *cbd; struct isi_cb_data *cbd;
gboolean done;
cbd = isi_cb_data_new(sim, cb, data); cbd = isi_cb_data_new(sim, cb, data);
if (cbd == NULL) if (cbd == NULL)
@ -252,16 +247,20 @@ static void isi_read_file_transparent(struct ofono_sim *sim, int fileid,
switch (fileid) { switch (fileid) {
case SIM_EFSPN_FILEID: case SIM_EFSPN_FILEID:
done = isi_read_spn(sim, cbd);
if (isi_read_spn(sim, cbd)) break;
return;
case SIM_EF_ICCID_FILEID: case SIM_EF_ICCID_FILEID:
done = isi_read_iccid(sim, cbd);
break;
if (isi_read_iccid(sim, cbd)) default:
return; done = FALSE;
} }
if (done)
return;
DBG("Fileid %04X not implemented", fileid); DBG("Fileid %04X not implemented", fileid);
error: error:
@ -358,12 +357,12 @@ static void isi_read_imsi(struct ofono_sim *sim,
SIM_IMSI_REQ_READ_IMSI, SIM_IMSI_REQ_READ_IMSI,
READ_IMSI READ_IMSI
}; };
size_t len = sizeof(msg);
if (cbd == NULL || sd == NULL) if (cbd == NULL || sd == NULL)
goto error; goto error;
if (g_isi_client_send(sd->client, msg, sizeof(msg), SIM_TIMEOUT, if (g_isi_client_send(sd->client, msg, len, imsi_resp_cb, cbd, g_free))
imsi_resp_cb, cbd, g_free) != NULL)
return; return;
error: error:
@ -401,12 +400,12 @@ static void isi_read_hplmn(struct ofono_sim *sim)
SIM_NETWORK_INFO_REQ, SIM_NETWORK_INFO_REQ,
READ_HPLMN, 0 READ_HPLMN, 0
}; };
size_t len = sizeof(req);
if (sd == NULL) if (sd == NULL)
return; return;
g_isi_client_send(sd->client, req, sizeof(req), SIM_TIMEOUT, g_isi_client_send(sd->client, req, len, read_hplmn_resp_cb, sim, NULL);
read_hplmn_resp_cb, sim, NULL);
} }
static void sim_ind_cb(const GIsiMessage *msg, void *data) static void sim_ind_cb(const GIsiMessage *msg, void *data)

View File

@ -251,8 +251,8 @@ static void isi_sca_query(struct ofono_sms *sms,
if (cbd == NULL || sd == NULL) if (cbd == NULL || sd == NULL)
goto error; goto error;
if (g_isi_client_send(sd->sim, msg, sizeof(msg), SIM_TIMEOUT, if (g_isi_client_send(sd->sim, msg, sizeof(msg),
sca_query_resp_cb, cbd, g_free) != NULL) sca_query_resp_cb, cbd, g_free))
return; return;
error: error:
@ -302,8 +302,7 @@ static void isi_sca_set(struct ofono_sms *sms,
bcd[0] = 1 + (strlen(sca->number) + 1) / 2; bcd[0] = 1 + (strlen(sca->number) + 1) / 2;
bcd[1] = sca->type & 0xFF; bcd[1] = sca->type & 0xFF;
if (g_isi_client_vsend(sd->sim, iov, 2, SIM_TIMEOUT, sca_set_resp_cb, if (g_isi_client_vsend(sd->sim, iov, 2, sca_set_resp_cb, cbd, g_free))
cbd, g_free) != NULL)
return; return;
error: error:
@ -405,8 +404,9 @@ static void isi_submit(struct ofono_sms *sms, unsigned char *pdu,
* Modem seems to time out SMS_MESSAGE_SEND_REQ in 5 seconds. * Modem seems to time out SMS_MESSAGE_SEND_REQ in 5 seconds.
* Wait normal timeout plus the modem timeout. * Wait normal timeout plus the modem timeout.
*/ */
if (g_isi_client_vsend(sd->client, iov, 4, SMS_TIMEOUT + 5, if (g_isi_client_vsend_with_timeout(sd->client, iov, 4,
submit_resp_cb, cbd, g_free) != NULL) SMS_TIMEOUT + 5,
submit_resp_cb, cbd, g_free))
return; return;
error: error:
@ -483,9 +483,9 @@ static gboolean send_deliver_report(GIsiClient *client, gboolean success)
0, 0, 0, /* Filler */ 0, 0, 0, /* Filler */
0, /* Sub blocks */ 0, /* Sub blocks */
}; };
size_t len = sizeof(msg);
return g_isi_client_send(client, msg, sizeof(msg), SMS_TIMEOUT, return g_isi_client_send(client, msg, len, report_resp_cb, NULL, NULL);
report_resp_cb, NULL, NULL) != NULL;
} }
static gboolean parse_sms_address(GIsiSubBlockIter *iter, struct sms_addr *add) static gboolean parse_sms_address(GIsiSubBlockIter *iter, struct sms_addr *add)
@ -627,6 +627,7 @@ static void sim_reachable_cb(const GIsiMessage *msg, void *data)
0x00, 0x00, 0x00, /* Filler */ 0x00, 0x00, 0x00, /* Filler */
0x00 /* Sub-sub-block count */ 0x00 /* Sub-sub-block count */
}; };
size_t len = sizeof(req);
if (g_isi_msg_error(msg) < 0) { if (g_isi_msg_error(msg) < 0) {
DBG("unable to find SIM resource"); DBG("unable to find SIM resource");
@ -636,8 +637,7 @@ static void sim_reachable_cb(const GIsiMessage *msg, void *data)
g_isi_client_ind_subscribe(sd->client, SMS_MESSAGE_SEND_STATUS_IND, g_isi_client_ind_subscribe(sd->client, SMS_MESSAGE_SEND_STATUS_IND,
send_status_ind_cb, sms); send_status_ind_cb, sms);
g_isi_client_send(sd->client, msg, sizeof(msg), SMS_TIMEOUT, g_isi_client_send(sd->client, req, len, routing_resp_cb, sms, NULL);
routing_resp_cb, sms, NULL);
} }
static void sms_reachable_cb(const GIsiMessage *msg, void *data) static void sms_reachable_cb(const GIsiMessage *msg, void *data)
@ -675,6 +675,9 @@ static int isi_sms_probe(struct ofono_sms *sms, unsigned int vendor,
if (sd->sim == NULL) if (sd->sim == NULL)
goto nomem; goto nomem;
g_isi_client_set_timeout(sd->client, SMS_TIMEOUT);
g_isi_client_set_timeout(sd->sim, SIM_TIMEOUT);
ofono_sms_set_data(sms, sd); ofono_sms_set_data(sms, sd);
g_isi_client_verify(sd->client, sms_reachable_cb, sms, NULL); g_isi_client_verify(sd->client, sms_reachable_cb, sms, NULL);
@ -712,8 +715,7 @@ static void isi_sms_remove(struct ofono_sms *sms)
* Send a promiscuous routing release, so as not to * Send a promiscuous routing release, so as not to
* hog resources unnecessarily after being removed * hog resources unnecessarily after being removed
*/ */
g_isi_client_send(sd->client, msg, sizeof(msg), SMS_TIMEOUT, g_isi_client_send(sd->client, msg, sizeof(msg), NULL, NULL, NULL);
NULL, NULL, NULL);
g_isi_client_destroy(sd->client); g_isi_client_destroy(sd->client);
g_isi_client_destroy(sd->sim); g_isi_client_destroy(sd->sim);
g_free(sd); g_free(sd);

View File

@ -81,8 +81,7 @@ static void ussd_notify_ack(struct ussd_data *ud)
0, /* subblock count */ 0, /* subblock count */
}; };
g_isi_client_send(ud->client, msg, sizeof(msg), SS_TIMEOUT, NULL, NULL, g_isi_client_send(ud->client, msg, sizeof(msg), NULL, NULL, NULL);
NULL);
} }
static void ussd_ind_cb(const GIsiMessage *msg, void *data) static void ussd_ind_cb(const GIsiMessage *msg, void *data)
@ -187,8 +186,8 @@ static void isi_request(struct ofono_ussd *ussd, int dcs,
if (cbd == NULL || ud == NULL) if (cbd == NULL || ud == NULL)
goto error; goto error;
if (g_isi_client_vsend(ud->client, iov, 2, SS_TIMEOUT, if (g_isi_client_vsend(ud->client, iov, 2,
ussd_send_resp_cb, cbd, g_free) != NULL) ussd_send_resp_cb, cbd, g_free))
return; return;
error: error:
@ -210,8 +209,8 @@ static void isi_cancel(struct ofono_ussd *ussd,
if (cbd == NULL || ud == NULL) if (cbd == NULL || ud == NULL)
goto error; goto error;
if (g_isi_client_send(ud->client, msg, sizeof(msg), SS_TIMEOUT, if (g_isi_client_send(ud->client, msg, sizeof(msg),
ussd_send_resp_cb, cbd, g_free) != NULL) ussd_send_resp_cb, cbd, g_free))
return; return;
error: error:

View File

@ -119,13 +119,11 @@ static struct isi_call_req_ctx *isi_call_req(struct ofono_voicecall *ovc,
irc->cb = cb; irc->cb = cb;
irc->data = data; irc->data = data;
if (g_isi_client_send(ivc->client, req, len, ISI_CALL_TIMEOUT, if (g_isi_client_send(ivc->client, req, len, handler, irc, NULL))
handler, irc, NULL) == NULL) { return irc;
g_free(irc);
return NULL;
}
return irc; g_free(irc);
return NULL;
} }
static void isi_ctx_queue(struct isi_call_req_ctx *irc, isi_call_req_step *next) static void isi_ctx_queue(struct isi_call_req_ctx *irc, isi_call_req_step *next)