mirror of git://git.sysmocom.de/ofono
Fix style issues in isimodem
This commit is contained in:
parent
c5023690b7
commit
a03d11fec7
|
@ -112,16 +112,16 @@ static void isi_set(struct ofono_call_barring *barr, const char *lock,
|
|||
SS_SERVICE_REQ,
|
||||
enable ? SS_ACTIVATION : SS_DEACTIVATION,
|
||||
SS_ALL_TELE_AND_BEARER,
|
||||
ss_code >> 8, ss_code & 0xFF, /* Supplementary services code */
|
||||
SS_SEND_ADDITIONAL_INFO, /* ? */
|
||||
1, /* Subblock count */
|
||||
ss_code >> 8, ss_code & 0xFF, /* Service code */
|
||||
SS_SEND_ADDITIONAL_INFO,
|
||||
1, /* Subblock count */
|
||||
SS_GSM_PASSWORD,
|
||||
28, /* Subblock length */
|
||||
0, passwd[0], 0, passwd[1], /* Password */
|
||||
28, /* Subblock length */
|
||||
0, passwd[0], 0, passwd[1],
|
||||
0, passwd[2], 0, passwd[3],
|
||||
0, 0, 0, 0, 0, 0, 0, 0, /* Filler */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, /* Filler */
|
||||
0, 0 /* Filler */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, /* Filler */
|
||||
0, 0, 0, 0, 0, 0, 0, 0, /* Filler */
|
||||
0, 0 /* Filler */
|
||||
};
|
||||
|
||||
DBG("lock code %s enable %d class %d password %s\n",
|
||||
|
@ -251,8 +251,8 @@ out:
|
|||
|
||||
}
|
||||
|
||||
static void isi_query(struct ofono_call_barring *barr, const char *lock, int cls,
|
||||
ofono_call_barring_query_cb_t cb, void *data)
|
||||
static void isi_query(struct ofono_call_barring *barr, const char *lock,
|
||||
int cls, ofono_call_barring_query_cb_t cb, void *data)
|
||||
{
|
||||
struct barr_data *bd = ofono_call_barring_get_data(barr);
|
||||
struct isi_cb_data *cbd = isi_cb_data_new(barr, cb, data);
|
||||
|
@ -262,8 +262,8 @@ static void isi_query(struct ofono_call_barring *barr, const char *lock, int cls
|
|||
SS_SERVICE_REQ,
|
||||
SS_INTERROGATION,
|
||||
SS_ALL_TELE_AND_BEARER,
|
||||
ss_code >> 8, ss_code & 0xFF, /* Supplementary services code */
|
||||
SS_SEND_ADDITIONAL_INFO, /* Get BER-encoded result, too */
|
||||
ss_code >> 8, ss_code & 0xFF, /* services code */
|
||||
SS_SEND_ADDITIONAL_INFO, /* Get BER-encoded result */
|
||||
0 /* Subblock count */
|
||||
};
|
||||
|
||||
|
@ -318,7 +318,7 @@ static void isi_set_passwd(struct ofono_call_barring *barr, const char *lock,
|
|||
SS_SERVICE_REQ,
|
||||
SS_GSM_PASSWORD_REGISTRATION,
|
||||
SS_ALL_TELE_AND_BEARER,
|
||||
ss_code >> 8, ss_code & 0xFF, /* Supplementary services code */
|
||||
ss_code >> 8, ss_code & 0xFF, /* Service code */
|
||||
SS_SEND_ADDITIONAL_INFO,
|
||||
1, /* Subblock count */
|
||||
SS_GSM_PASSWORD,
|
||||
|
|
|
@ -422,7 +422,8 @@ static bool query_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
&ton, &norply, &number))
|
||||
goto error;
|
||||
|
||||
list.status = status & (SS_GSM_ACTIVE | SS_GSM_REGISTERED
|
||||
list.status = status & (SS_GSM_ACTIVE
|
||||
| SS_GSM_REGISTERED
|
||||
| SS_GSM_PROVISIONED);
|
||||
list.time = norply;
|
||||
list.phone_number.type = ton | 128;
|
||||
|
|
|
@ -133,7 +133,7 @@ static bool query_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
for (i = 0; i < count; i++) {
|
||||
if (!g_isi_sb_iter_get_byte(&iter, &bsc, 3 + i))
|
||||
goto error;
|
||||
update_status_mask(&mask, bsc);
|
||||
update_status_mask(&mask, bsc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -311,8 +311,8 @@ static void reachable_cb(GIsiClient *client, bool alive, uint16_t object,
|
|||
}
|
||||
|
||||
|
||||
static int isi_call_settings_probe(struct ofono_call_settings *cs, unsigned int vendor,
|
||||
void *user)
|
||||
static int isi_call_settings_probe(struct ofono_call_settings *cs,
|
||||
unsigned int vendor, void *user)
|
||||
{
|
||||
GIsiModem *idx = user;
|
||||
struct settings_data *data;
|
||||
|
|
|
@ -138,7 +138,8 @@ static int isi_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
|
|||
routing_resp_cb, cbs))
|
||||
DBG("Failed to set CBS routing.");
|
||||
|
||||
g_isi_subscribe(cd->client, SMS_GSM_CB_ROUTING_NTF, routing_ntf_cb, cbs);
|
||||
g_isi_subscribe(cd->client, SMS_GSM_CB_ROUTING_NTF, routing_ntf_cb,
|
||||
cbs);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -991,9 +991,8 @@ static void hex_dump(const char *name, const uint8_t m[], size_t len)
|
|||
}
|
||||
}
|
||||
|
||||
if (j) {
|
||||
if (j)
|
||||
ofono_debug(" *%-48s : %.*s", hex, (int)k, ascii);
|
||||
}
|
||||
}
|
||||
|
||||
void ss_debug(const void *restrict buf, size_t len, void *data)
|
||||
|
|
|
@ -279,7 +279,8 @@ error:
|
|||
}
|
||||
|
||||
static void activate_fail_ind_cb(GIsiClient *client, const void *restrict data,
|
||||
size_t len, uint16_t object, void *opaque)
|
||||
size_t len, uint16_t object,
|
||||
void *opaque)
|
||||
{
|
||||
const unsigned char *msg = data;
|
||||
struct gprs_context_data *gcd = opaque;
|
||||
|
@ -443,7 +444,7 @@ static bool create_context_cb(GIsiClient *client, const void *restrict data,
|
|||
GPDS_LL_PLAIN, /* link type */
|
||||
};
|
||||
|
||||
if(!check_resp(client, data, len, GPDS_CONTEXT_ID_CREATE_RESP, cd))
|
||||
if (!check_resp(client, data, len, GPDS_CONTEXT_ID_CREATE_RESP, cd))
|
||||
return gprs_up_fail(cd);
|
||||
|
||||
cd->handle = msg[1] = resp[1];
|
||||
|
@ -545,8 +546,9 @@ static void isi_gprs_activate_primary(struct ofono_gprs_context *gc,
|
|||
goto error;
|
||||
|
||||
cd->pipe = g_isi_pipe_create(gcd->idx, create_pipe_cb,
|
||||
g_isi_pep_get_object(cd->pep), gcd->gpds,
|
||||
PN_PEP_TYPE_GPRS, PN_PEP_TYPE_GPRS);
|
||||
g_isi_pep_get_object(cd->pep),
|
||||
gcd->gpds, PN_PEP_TYPE_GPRS,
|
||||
PN_PEP_TYPE_GPRS);
|
||||
if (cd->pipe == NULL)
|
||||
goto error;
|
||||
|
||||
|
@ -558,7 +560,8 @@ error:
|
|||
}
|
||||
|
||||
static bool context_deactivate_cb(GIsiClient *client, const void *restrict data,
|
||||
size_t len, uint16_t object, void *opaque)
|
||||
size_t len, uint16_t object,
|
||||
void *opaque)
|
||||
{
|
||||
struct context_data *cd = opaque;
|
||||
struct ofono_gprs_context *gc = cd->driver;
|
||||
|
|
|
@ -139,7 +139,7 @@ static bool attach_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
struct isi_cb_data *cbd = opaque;
|
||||
ofono_gprs_cb_t cb = cbd->cb;
|
||||
|
||||
if(!msg) {
|
||||
if (!msg) {
|
||||
DBG("ISI client error: %d", g_isi_client_error(client));
|
||||
goto error;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ static bool detach_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
struct isi_cb_data *cbd = opaque;
|
||||
ofono_gprs_cb_t cb = cbd->cb;
|
||||
|
||||
if(!msg) {
|
||||
if (!msg) {
|
||||
DBG("ISI client error: %d", g_isi_client_error(client));
|
||||
goto error;
|
||||
}
|
||||
|
@ -242,13 +242,13 @@ error:
|
|||
}
|
||||
|
||||
static bool status_resp_cb(GIsiClient *client, const void *restrict data,
|
||||
size_t len, uint16_t object, void *opaque)
|
||||
size_t len, uint16_t object, void *opaque)
|
||||
{
|
||||
const unsigned char *msg = data;
|
||||
struct isi_cb_data *cbd = opaque;
|
||||
ofono_gprs_status_cb_t cb = cbd->cb;
|
||||
|
||||
if(!msg) {
|
||||
if (!msg) {
|
||||
DBG("ISI client error: %d", g_isi_client_error(client));
|
||||
goto error;
|
||||
}
|
||||
|
@ -286,9 +286,9 @@ static void isi_gprs_attached_status(struct ofono_gprs *gprs,
|
|||
if (!cbd)
|
||||
goto error;
|
||||
|
||||
if (g_isi_request_make(gd->client, msg, sizeof(msg), GPDS_TIMEOUT,
|
||||
status_resp_cb, cbd))
|
||||
return;
|
||||
if (!g_isi_request_make(gd->client, msg, sizeof(msg), GPDS_TIMEOUT,
|
||||
status_resp_cb, cbd))
|
||||
return;
|
||||
|
||||
error:
|
||||
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||
|
|
|
@ -38,10 +38,9 @@
|
|||
#include "info.h"
|
||||
#include "infoserver.h"
|
||||
|
||||
struct isi_infoserver
|
||||
{
|
||||
struct isi_infoserver {
|
||||
GIsiServer *server;
|
||||
unsigned sv; /* Software version in 0..98 */
|
||||
unsigned sv; /* Software version in 0..98 */
|
||||
};
|
||||
|
||||
static bool serial_number_read_req(GIsiServer *server, void const *data,
|
||||
|
|
|
@ -78,8 +78,7 @@ static void report_powered(struct isi_data *isi, ofono_bool_t powered)
|
|||
|
||||
static void set_power_by_mtc_state(struct isi_data *isi, int state)
|
||||
{
|
||||
switch (isi->mtc_state = state)
|
||||
{
|
||||
switch (isi->mtc_state = state) {
|
||||
case MTC_STATE_NONE:
|
||||
case MTC_POWER_OFF:
|
||||
case MTC_CHARGING:
|
||||
|
@ -132,7 +131,7 @@ static bool mtc_poll_query_cb(GIsiClient *client, const void *restrict data,
|
|||
MTC_STATE_QUERY_REQ, 0x00, 0x00
|
||||
};
|
||||
|
||||
if (!isi-> iface_up)
|
||||
if (!isi->iface_up)
|
||||
return true;
|
||||
|
||||
isi->interval *= 2;
|
||||
|
|
|
@ -49,7 +49,7 @@ static inline struct isi_cb_data *isi_cb_data_new(void *user, void *cb,
|
|||
e.type = OFONO_ERROR_TYPE_FAILURE; \
|
||||
e.error = 0; \
|
||||
f(&e, ##args); \
|
||||
} while(0)
|
||||
} while (0)
|
||||
|
||||
#define CALLBACK_WITH_SUCCESS(f, args...) \
|
||||
do { \
|
||||
|
@ -57,6 +57,6 @@ static inline struct isi_cb_data *isi_cb_data_new(void *user, void *cb,
|
|||
e.type = OFONO_ERROR_TYPE_NO_ERROR; \
|
||||
e.error = 0; \
|
||||
f(&e, ##args); \
|
||||
} while(0)
|
||||
} while (0)
|
||||
|
||||
#endif /* !__ISIMODEM_UTIL_H */
|
||||
|
|
|
@ -302,7 +302,8 @@ static bool name_get_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
switch (g_isi_sb_iter_get_id(&iter)) {
|
||||
|
||||
case NET_GSM_OPERATOR_INFO:
|
||||
if (!g_isi_sb_iter_get_oper_code(&iter, op.mcc, op.mnc, 2))
|
||||
if (!g_isi_sb_iter_get_oper_code(&iter, op.mcc,
|
||||
op.mnc, 2))
|
||||
goto error;
|
||||
break;
|
||||
|
||||
|
@ -569,7 +570,7 @@ static bool set_manual_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
struct netreg_data *nd = ofono_netreg_get_data(netreg);
|
||||
ofono_netreg_register_cb_t cb = cbd->cb;
|
||||
|
||||
if(!msg) {
|
||||
if (!msg) {
|
||||
DBG("ISI client error: %d", g_isi_client_error(client));
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ static int decode_read_response(const unsigned char *msg, size_t len,
|
|||
|
||||
char *name = NULL;
|
||||
char *number = NULL;
|
||||
char *sne= NULL;
|
||||
char *sne = NULL;
|
||||
char *anr = NULL;
|
||||
char *email = NULL;
|
||||
|
||||
|
@ -135,7 +135,7 @@ static int decode_read_response(const unsigned char *msg, size_t len,
|
|||
case SIM_PB_STATUS:
|
||||
|
||||
if (!g_isi_sb_iter_get_byte(&iter, &status, 4))
|
||||
goto error;
|
||||
goto error;
|
||||
|
||||
break;
|
||||
|
||||
|
@ -166,7 +166,9 @@ error:
|
|||
return location;
|
||||
}
|
||||
|
||||
static void read_next_entry(GIsiClient *client, int location, GIsiResponseFunc read_cb, struct isi_cb_data *cbd)
|
||||
static void read_next_entry(GIsiClient *client, int location,
|
||||
GIsiResponseFunc read_cb,
|
||||
struct isi_cb_data *cbd)
|
||||
{
|
||||
ofono_phonebook_cb_t cb = cbd->cb;
|
||||
const unsigned char msg[] = {
|
||||
|
@ -176,7 +178,8 @@ static void read_next_entry(GIsiClient *client, int location, GIsiResponseFunc r
|
|||
0, SIM_PB_LOCATION_SEARCH, /* subblock id */
|
||||
0, 8, /* subblock size */
|
||||
0, SIM_PB_ADN,
|
||||
location >> 8, location & 0xFF, /* read next entry after specified by location */
|
||||
location >> 8, location & 0xFF, /* read next entry after
|
||||
* specified by location */
|
||||
0, SIM_PB_INFO_REQUEST, /* subblock id */
|
||||
0, 16, /* subblock size */
|
||||
4, /* number of tags */
|
||||
|
@ -211,7 +214,7 @@ static bool read_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
ofono_phonebook_cb_t cb = cbd->cb;
|
||||
int location;
|
||||
|
||||
if(!msg) {
|
||||
if (!msg) {
|
||||
DBG("ISI client error: %d", g_isi_client_error(client));
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -77,7 +77,8 @@ static int ofono_mode_to_isi_mode(enum ofono_radio_access_mode mode)
|
|||
}
|
||||
|
||||
static bool rat_mode_read_resp_cb(GIsiClient *client, const void *restrict data,
|
||||
size_t len, uint16_t object, void *opaque)
|
||||
size_t len, uint16_t object,
|
||||
void *opaque)
|
||||
{
|
||||
const unsigned char *msg = data;
|
||||
struct isi_cb_data *cbd = opaque;
|
||||
|
@ -118,7 +119,8 @@ static bool rat_mode_read_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
}
|
||||
default:
|
||||
DBG("Skipping sub-block: %s (%zu bytes)",
|
||||
gss_subblock_name(g_isi_sb_iter_get_id(&iter)),
|
||||
gss_subblock_name(
|
||||
g_isi_sb_iter_get_id(&iter)),
|
||||
g_isi_sb_iter_get_len(&iter));
|
||||
break;
|
||||
}
|
||||
|
@ -163,8 +165,8 @@ error:
|
|||
g_free(cbd);
|
||||
}
|
||||
|
||||
static bool rat_mode_write_resp_cb(GIsiClient *client, const void *restrict data,
|
||||
size_t len, uint16_t object, void *opaque)
|
||||
static bool mode_write_resp_cb(GIsiClient *client, const void *restrict data,
|
||||
size_t len, uint16_t object, void *opaque)
|
||||
{
|
||||
const unsigned char *msg = data;
|
||||
struct isi_cb_data *cbd = opaque;
|
||||
|
@ -224,7 +226,7 @@ static void isi_set_rat_mode(struct ofono_radio_settings *rs,
|
|||
goto error;
|
||||
|
||||
if (g_isi_request_make(rd->client, msg, sizeof(msg), GSS_TIMEOUT,
|
||||
rat_mode_write_resp_cb, cbd))
|
||||
mode_write_resp_cb, cbd))
|
||||
return;
|
||||
|
||||
error:
|
||||
|
|
|
@ -85,7 +85,7 @@ static bool routing_resp_cb(GIsiClient *client, const void *restrict data,
|
|||
|
||||
DBG("");
|
||||
|
||||
if(!msg) {
|
||||
if (!msg) {
|
||||
DBG("ISI client error: %d", g_isi_client_error(client));
|
||||
goto error;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue