mirror of git://git.sysmocom.de/ofono
isimodem: fix style issues
This commit is contained in:
parent
a3f491a82b
commit
e130d21be9
|
@ -135,7 +135,7 @@ static gboolean decode_gsm_forwarding_info(GIsiSubBlockIter *parent,
|
||||||
if (g_isi_sb_iter_get_id(&iter) != SS_GSM_FORWARDING_FEATURE)
|
if (g_isi_sb_iter_get_id(&iter) != SS_GSM_FORWARDING_FEATURE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!g_isi_sb_iter_get_struct(&iter, (void *)&info, len, 2))
|
if (!g_isi_sb_iter_get_struct(&iter, (void *) &info, len, 2))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if (info->numlen != 0) {
|
if (info->numlen != 0) {
|
||||||
|
@ -250,7 +250,7 @@ static void isi_registration(struct ofono_call_forwarding *cf, int type,
|
||||||
if (ucs2 == NULL)
|
if (ucs2 == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
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], SS_TIMEOUT,
|
||||||
|
|
|
@ -111,7 +111,7 @@ static gboolean decode_gsm_bsc_info(GIsiSubBlockIter *iter, uint32_t *mask)
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
|
|
||||||
if (!g_isi_sb_iter_get_byte(iter, &num, 2) ||
|
if (!g_isi_sb_iter_get_byte(iter, &num, 2) ||
|
||||||
!g_isi_sb_iter_get_struct(iter, (void **)&bsc, num, 3))
|
!g_isi_sb_iter_get_struct(iter, (void **) &bsc, num, 3))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
|
|
|
@ -120,7 +120,7 @@ static void routing_ntf_cb(const GIsiMessage *msg, void *data)
|
||||||
if (g_isi_sb_iter_get_id(&iter) != SMS_GSM_CB_MESSAGE)
|
if (g_isi_sb_iter_get_id(&iter) != SMS_GSM_CB_MESSAGE)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!g_isi_sb_iter_get_struct(&iter, (void *)&info, len, 2))
|
if (!g_isi_sb_iter_get_struct(&iter, (void *) &info, len, 2))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ofono_cbs_notify(cbs, info->pdu, len);
|
ofono_cbs_notify(cbs, info->pdu, len);
|
||||||
|
|
|
@ -1042,13 +1042,13 @@ static void hex_dump(const char *resname, uint8_t res, const char *name,
|
||||||
ascii[k++] = g_ascii_isgraph(m[i]) ? m[i] : '.';
|
ascii[k++] = g_ascii_isgraph(m[i]) ? m[i] : '.';
|
||||||
|
|
||||||
if ((j & 48) == 48) {
|
if ((j & 48) == 48) {
|
||||||
ofono_debug(" *%-48s : %.*s", hex, (int)k, ascii);
|
ofono_debug(" *%-48s : %.*s", hex, (int) k, ascii);
|
||||||
j = 0, k = 0;
|
j = 0, k = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j)
|
if (j)
|
||||||
ofono_debug(" *%-48s : %.*s", hex, (int)k, ascii);
|
ofono_debug(" *%-48s : %.*s", hex, (int) k, ascii);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char *res_to_name(uint8_t res, uint8_t id)
|
static const char *res_to_name(uint8_t res, uint8_t id)
|
||||||
|
|
|
@ -366,9 +366,9 @@ static void send_context_authenticate(GIsiClient *client, void *opaque)
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct iovec iov[4] = {
|
const struct iovec iov[4] = {
|
||||||
{ (uint8_t *)top, sizeof(top) },
|
{ (uint8_t *) top, sizeof(top) },
|
||||||
{ cd->username, username_len },
|
{ cd->username, username_len },
|
||||||
{ (uint8_t *)bottom, sizeof(bottom) },
|
{ (uint8_t *) bottom, sizeof(bottom) },
|
||||||
{ cd->password, password_len },
|
{ cd->password, password_len },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ static void link_conf_cb(const GIsiMessage *msg, void *opaque)
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct iovec iov[2] = {
|
const struct iovec iov[2] = {
|
||||||
{ (uint8_t *)req, sizeof(req) },
|
{ (uint8_t *) req, sizeof(req) },
|
||||||
{ cd->apn, apn_len },
|
{ cd->apn, apn_len },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ static void isi_read_file_info(struct ofono_sim *sim, int fileid,
|
||||||
|
|
||||||
for (i = 0; i < N; i++) {
|
for (i = 0; i < N; i++) {
|
||||||
if (fileid == info[i].fileid) {
|
if (fileid == info[i].fileid) {
|
||||||
cbd = isi_cb_data_new((void *)&info[i], cb, data);
|
cbd = isi_cb_data_new((void *) &info[i], cb, data);
|
||||||
g_idle_add(fake_file_info, cbd);
|
g_idle_add(fake_file_info, cbd);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,6 +137,7 @@ static gboolean check_sim_status(const GIsiMessage *msg, uint8_t msgid,
|
||||||
DBG("Request failed: %s", sim_isi_cause_name(cause));
|
DBG("Request failed: %s", sim_isi_cause_name(cause));
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -221,6 +222,7 @@ static void sca_query_resp_cb(const GIsiMessage *msg, void *data)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
bcd_len = info->sca[0];
|
bcd_len = info->sca[0];
|
||||||
|
|
||||||
if (bcd_len == 0 || bcd_len > 12)
|
if (bcd_len == 0 || bcd_len > 12)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -327,7 +329,7 @@ static void submit_resp_cb(const GIsiMessage *msg, void *data)
|
||||||
if (g_isi_sb_iter_get_id(&iter) != SMS_GSM_REPORT)
|
if (g_isi_sb_iter_get_id(&iter) != SMS_GSM_REPORT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!g_isi_sb_iter_get_struct(&iter, (void **)&report, len, 2))
|
if (!g_isi_sb_iter_get_struct(&iter, (void **) &report, len, 2))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (report->cause != SMS_OK)
|
if (report->cause != SMS_OK)
|
||||||
|
@ -436,7 +438,7 @@ static void send_status_ind_cb(const GIsiMessage *msg, void *data)
|
||||||
if (g_isi_msg_id(msg) != SMS_MESSAGE_SEND_STATUS_IND)
|
if (g_isi_msg_id(msg) != SMS_MESSAGE_SEND_STATUS_IND)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!g_isi_msg_data_get_struct(msg, 0, (const void **)&info, len))
|
if (!g_isi_msg_data_get_struct(msg, 0, (const void **) &info, len))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DBG("status=0x%"PRIx8", ref=0x%"PRIx8", route=0x%"PRIx8
|
DBG("status=0x%"PRIx8", ref=0x%"PRIx8", route=0x%"PRIx8
|
||||||
|
@ -538,15 +540,18 @@ static gboolean parse_gsm_tpdu(GIsiSubBlockIter *parent, struct sms_addr *add,
|
||||||
|
|
||||||
if (add->type != SMS_GSM_0411_ADDRESS)
|
if (add->type != SMS_GSM_0411_ADDRESS)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SMS_COMMON_DATA:
|
case SMS_COMMON_DATA:
|
||||||
|
|
||||||
if (!parse_sms_tpdu(&iter, com))
|
if (!parse_sms_tpdu(&iter, com))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,10 +97,10 @@ static void ussd_ind_cb(const GIsiMessage *msg, void *data)
|
||||||
if (g_isi_msg_id(msg) != SS_GSM_USSD_RECEIVE_IND)
|
if (g_isi_msg_id(msg) != SS_GSM_USSD_RECEIVE_IND)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!g_isi_msg_data_get_struct(msg, 0, (const void **)&info, len))
|
if (!g_isi_msg_data_get_struct(msg, 0, (const void **) &info, len))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!g_isi_msg_data_get_struct(msg, len, (const void **)&string,
|
if (!g_isi_msg_data_get_struct(msg, len, (const void **) &string,
|
||||||
info->len))
|
info->len))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -180,8 +180,8 @@ static void isi_request(struct ofono_ussd *ussd, int dcs,
|
||||||
/* USSD string goes here */
|
/* USSD string goes here */
|
||||||
};
|
};
|
||||||
const struct iovec iov[2] = {
|
const struct iovec iov[2] = {
|
||||||
{ (uint8_t *)msg, sizeof(msg) },
|
{ (uint8_t *) msg, sizeof(msg) },
|
||||||
{ (uint8_t *)pdu, len }
|
{ (uint8_t *) pdu, len }
|
||||||
};
|
};
|
||||||
|
|
||||||
if (cbd == NULL || ud == NULL)
|
if (cbd == NULL || ud == NULL)
|
||||||
|
|
|
@ -291,7 +291,7 @@ static struct isi_call *isi_call_status_info_sb_proc(struct isi_voicecall *ivc,
|
||||||
struct call_info *ci;
|
struct call_info *ci;
|
||||||
size_t len = sizeof(struct call_info);
|
size_t len = sizeof(struct call_info);
|
||||||
|
|
||||||
if (!g_isi_sb_iter_get_struct(sb, (void *)&ci, len, 2))
|
if (!g_isi_sb_iter_get_struct(sb, (void *) &ci, len, 2))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
i = ci->call_id & 7;
|
i = ci->call_id & 7;
|
||||||
|
@ -317,7 +317,7 @@ static struct isi_call *isi_call_addr_and_status_info_sb_proc(
|
||||||
size_t len = sizeof(struct call_addr_info);
|
size_t len = sizeof(struct call_addr_info);
|
||||||
char *addr;
|
char *addr;
|
||||||
|
|
||||||
if (!g_isi_sb_iter_get_struct(sb, (void *)&ci, len, 2))
|
if (!g_isi_sb_iter_get_struct(sb, (void *) &ci, len, 2))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!g_isi_sb_iter_get_alpha_tag(sb, &addr, 2 * ci->addr_len, 12))
|
if (!g_isi_sb_iter_get_alpha_tag(sb, &addr, 2 * ci->addr_len, 12))
|
||||||
|
@ -1024,7 +1024,7 @@ static void isi_retrieve(struct ofono_voicecall *ovc,
|
||||||
|
|
||||||
static void isi_wait_and_answer(struct isi_call_req_ctx *irc, int event)
|
static void isi_wait_and_answer(struct isi_call_req_ctx *irc, int event)
|
||||||
{
|
{
|
||||||
DBG("irc=%p event=%u", (void *)irc, event);
|
DBG("irc=%p event=%u", (void *) irc, event);
|
||||||
|
|
||||||
if (event != CALL_STATUS_TERMINATED)
|
if (event != CALL_STATUS_TERMINATED)
|
||||||
return;
|
return;
|
||||||
|
@ -1035,7 +1035,7 @@ static void isi_wait_and_answer(struct isi_call_req_ctx *irc, int event)
|
||||||
|
|
||||||
static void isi_wait_and_retrieve(struct isi_call_req_ctx *irc, int event)
|
static void isi_wait_and_retrieve(struct isi_call_req_ctx *irc, int event)
|
||||||
{
|
{
|
||||||
DBG("irc=%p event=%u", (void *)irc, event);
|
DBG("irc=%p event=%u", (void *) irc, event);
|
||||||
|
|
||||||
if (event != CALL_STATUS_TERMINATED)
|
if (event != CALL_STATUS_TERMINATED)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue