mirror of git://git.sysmocom.de/ofono
isimodem: More cleanup of bad style
This commit is contained in:
parent
48041a0e60
commit
a7d02fbf5c
|
@ -109,8 +109,7 @@ isi_call_req(struct ofono_voicecall *ovc,
|
|||
void const *restrict req,
|
||||
size_t len,
|
||||
GIsiResponse *handler,
|
||||
ofono_voicecall_cb_t cb,
|
||||
void *data)
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
struct isi_voicecall *ivc;
|
||||
struct isi_call_req_context *irc;
|
||||
|
@ -508,9 +507,7 @@ static void isi_call_status_ind_cb(GIsiClient *client,
|
|||
|
||||
static struct isi_call_req_context *
|
||||
isi_call_answer_req(struct ofono_voicecall *ovc,
|
||||
uint8_t call_id,
|
||||
ofono_voicecall_cb_t cb,
|
||||
void *data)
|
||||
uint8_t call_id, ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
uint8_t const req[] = {
|
||||
CALL_ANSWER_REQ, call_id, 0
|
||||
|
@ -546,11 +543,8 @@ static gboolean isi_call_answer_resp(GIsiClient *client,
|
|||
|
||||
static struct isi_call_req_context *
|
||||
isi_call_release_req(struct ofono_voicecall *ovc,
|
||||
uint8_t call_id,
|
||||
enum call_cause_type cause_type,
|
||||
uint8_t cause,
|
||||
ofono_voicecall_cb_t cb,
|
||||
void *data)
|
||||
uint8_t call_id, enum call_cause_type cause_type,
|
||||
uint8_t cause, ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
uint8_t const req[] = {
|
||||
CALL_RELEASE_REQ, call_id, 1,
|
||||
|
@ -600,10 +594,8 @@ static gboolean isi_call_release_resp(GIsiClient *client,
|
|||
|
||||
static struct isi_call_req_context *
|
||||
isi_call_status_req(struct ofono_voicecall *ovc,
|
||||
uint8_t id,
|
||||
uint8_t mode,
|
||||
ofono_voicecall_cb_t cb,
|
||||
void *data)
|
||||
uint8_t id, uint8_t mode,
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
unsigned char req[] = {
|
||||
CALL_STATUS_REQ, id, 1,
|
||||
|
@ -664,11 +656,8 @@ static gboolean isi_call_status_resp(GIsiClient *client,
|
|||
|
||||
static struct isi_call_req_context *
|
||||
isi_call_control_req(struct ofono_voicecall *ovc,
|
||||
uint8_t call_id,
|
||||
enum call_operation op,
|
||||
uint8_t info,
|
||||
ofono_voicecall_cb_t cb,
|
||||
void *data)
|
||||
uint8_t call_id, enum call_operation op, uint8_t info,
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
uint8_t const req[] = {
|
||||
CALL_CONTROL_REQ, call_id, 1,
|
||||
|
@ -681,11 +670,9 @@ isi_call_control_req(struct ofono_voicecall *ovc,
|
|||
|
||||
static struct isi_call_req_context *
|
||||
isi_call_deflect_req(struct ofono_voicecall *ovc,
|
||||
uint8_t call_id,
|
||||
uint8_t address_type,
|
||||
uint8_t call_id, uint8_t address_type,
|
||||
char const address[21],
|
||||
ofono_voicecall_cb_t cb,
|
||||
void *data)
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
size_t addr_len = strlen(address);
|
||||
size_t sub_len = (6 + 2 * addr_len + 3) & ~3;
|
||||
|
@ -748,10 +735,8 @@ static gboolean isi_call_control_resp(GIsiClient *client,
|
|||
|
||||
static struct isi_call_req_context *
|
||||
isi_call_dtmf_send_req(struct ofono_voicecall *ovc,
|
||||
uint8_t call_id,
|
||||
char const *string,
|
||||
ofono_voicecall_cb_t cb,
|
||||
void *data)
|
||||
uint8_t call_id, char const *string,
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
size_t str_len = strlen(string);
|
||||
size_t sub_len = 4 + ((2 * str_len + 3) & ~3);
|
||||
|
@ -892,8 +877,7 @@ static void isi_call_release(struct ofono_voicecall *ovc,
|
|||
isi_call_set_idle(call);
|
||||
}
|
||||
|
||||
static struct ofono_call
|
||||
isi_call_as_ofono_call(struct isi_call const *call)
|
||||
static struct ofono_call isi_call_as_ofono_call(struct isi_call const *call)
|
||||
{
|
||||
struct ofono_call ocall = { call->id };
|
||||
struct ofono_phone_number *number = &ocall.phone_number;
|
||||
|
@ -911,8 +895,7 @@ isi_call_as_ofono_call(struct isi_call const *call)
|
|||
}
|
||||
|
||||
/** Get +CLCC status */
|
||||
static int
|
||||
isi_call_status_to_clcc(struct isi_call const *call)
|
||||
static int isi_call_status_to_clcc(struct isi_call const *call)
|
||||
{
|
||||
switch (call->status) {
|
||||
case CALL_STATUS_CREATE:
|
||||
|
@ -970,8 +953,7 @@ static void isi_dial(struct ofono_voicecall *ovc,
|
|||
const struct ofono_phone_number *restrict number,
|
||||
enum ofono_clir_option clir,
|
||||
enum ofono_cug_option cug,
|
||||
ofono_voicecall_cb_t cb,
|
||||
void *data)
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
unsigned char presentation = CALL_GSM_PRESENTATION_DEFAULT;
|
||||
|
||||
|
@ -996,9 +978,7 @@ static void isi_dial(struct ofono_voicecall *ovc,
|
|||
return;
|
||||
}
|
||||
|
||||
isi_call_create_req(ovc, presentation,
|
||||
number->type,
|
||||
number->number,
|
||||
isi_call_create_req(ovc, presentation, number->type, number->number,
|
||||
cb, data);
|
||||
}
|
||||
|
||||
|
@ -1012,20 +992,16 @@ static void isi_hangup(struct ofono_voicecall *ovc,
|
|||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
/* AT+CHUP */
|
||||
isi_call_release_req(ovc, CALL_ID_ALL,
|
||||
CALL_CAUSE_TYPE_CLIENT,
|
||||
CALL_CAUSE_RELEASE_BY_USER,
|
||||
cb, data);
|
||||
isi_call_release_req(ovc, CALL_ID_ALL, CALL_CAUSE_TYPE_CLIENT,
|
||||
CALL_CAUSE_RELEASE_BY_USER, cb, data);
|
||||
}
|
||||
|
||||
static void isi_release_all_held(struct ofono_voicecall *ovc,
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
/* AT+CHLD=0 (w/out incoming calls) */
|
||||
isi_call_release_req(ovc, CALL_ID_HOLD,
|
||||
CALL_CAUSE_TYPE_CLIENT,
|
||||
CALL_CAUSE_RELEASE_BY_USER,
|
||||
cb, data);
|
||||
isi_call_release_req(ovc, CALL_ID_HOLD, CALL_CAUSE_TYPE_CLIENT,
|
||||
CALL_CAUSE_RELEASE_BY_USER, cb, data);
|
||||
}
|
||||
|
||||
static void isi_set_udub(struct ofono_voicecall *ovc,
|
||||
|
@ -1045,8 +1021,7 @@ static void isi_set_udub(struct ofono_voicecall *ovc,
|
|||
}
|
||||
|
||||
if (id <= 7)
|
||||
isi_call_release_req(ovc, id,
|
||||
CALL_CAUSE_TYPE_CLIENT,
|
||||
isi_call_release_req(ovc, id, CALL_CAUSE_TYPE_CLIENT,
|
||||
CALL_CAUSE_BUSY_USER_REQUEST,
|
||||
cb, data);
|
||||
else
|
||||
|
@ -1056,8 +1031,7 @@ static void isi_set_udub(struct ofono_voicecall *ovc,
|
|||
static void isi_retrieve(struct ofono_voicecall *ovc,
|
||||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
isi_call_control_req(ovc, CALL_ID_HOLD, CALL_OP_RETRIEVE, 0,
|
||||
cb, data);
|
||||
isi_call_control_req(ovc, CALL_ID_HOLD, CALL_OP_RETRIEVE, 0, cb, data);
|
||||
}
|
||||
|
||||
static isi_call_req_step isi_wait_and_answer, isi_wait_and_retrieve;
|
||||
|
@ -1188,8 +1162,7 @@ static void isi_private_chat(struct ofono_voicecall *ovc, int id,
|
|||
{
|
||||
/* AT+CHLD=2X */
|
||||
if (1 <= id && id <= 7)
|
||||
isi_call_control_req(ovc,
|
||||
id, CALL_OP_CONFERENCE_SPLIT, 0,
|
||||
isi_call_control_req(ovc, id, CALL_OP_CONFERENCE_SPLIT, 0,
|
||||
cb, data);
|
||||
else
|
||||
CALLBACK_WITH_FAILURE(cb, data);
|
||||
|
@ -1199,8 +1172,7 @@ static void isi_create_multiparty(struct ofono_voicecall *ovc,
|
|||
ofono_voicecall_cb_t cb, void *data)
|
||||
{
|
||||
/* AT+CHLD=3 */
|
||||
isi_call_control_req(ovc,
|
||||
CALL_ID_ALL, CALL_OP_CONFERENCE_BUILD, 0,
|
||||
isi_call_control_req(ovc, CALL_ID_ALL, CALL_OP_CONFERENCE_BUILD, 0,
|
||||
cb, data);
|
||||
}
|
||||
|
||||
|
@ -1218,9 +1190,7 @@ static void isi_transfer(struct ofono_voicecall *ovc,
|
|||
if (id > 7)
|
||||
id = CALL_ID_ACTIVE;
|
||||
|
||||
isi_call_control_req(ovc,
|
||||
id, CALL_GSM_OP_TRANSFER, 0,
|
||||
cb, data);
|
||||
isi_call_control_req(ovc, id, CALL_GSM_OP_TRANSFER, 0, cb, data);
|
||||
}
|
||||
|
||||
static void isi_deflect(struct ofono_voicecall *ovc,
|
||||
|
@ -1229,8 +1199,7 @@ static void isi_deflect(struct ofono_voicecall *ovc,
|
|||
{
|
||||
/* AT+CTFR=<number>,<type> */
|
||||
int id = CALL_ID_WAITING;
|
||||
isi_call_deflect_req(ovc, id, ph->type, ph->number,
|
||||
cb, data);
|
||||
isi_call_deflect_req(ovc, id, ph->type, ph->number, cb, data);
|
||||
}
|
||||
|
||||
static void isi_swap_without_accept(struct ofono_voicecall *ovc,
|
||||
|
@ -1267,8 +1236,7 @@ static void isi_send_tones(struct ofono_voicecall *ovc, const char *tones,
|
|||
}
|
||||
|
||||
static int isi_voicecall_probe(struct ofono_voicecall *ovc,
|
||||
unsigned int vendor,
|
||||
void *user)
|
||||
unsigned int vendor, void *user)
|
||||
{
|
||||
GIsiModem *idx = user;
|
||||
struct isi_voicecall *ivc = g_try_new0(struct isi_voicecall, 1);
|
||||
|
@ -1295,8 +1263,7 @@ static int isi_voicecall_probe(struct ofono_voicecall *ovc,
|
|||
}
|
||||
|
||||
static void isi_call_verify_cb(GIsiClient *client,
|
||||
gboolean alive, uint16_t object,
|
||||
void *ovc)
|
||||
gboolean alive, uint16_t object, void *ovc)
|
||||
{
|
||||
if (!alive) {
|
||||
DBG("Unable to bootstrap voice call driver");
|
||||
|
@ -1325,8 +1292,7 @@ static gboolean isi_call_register(gpointer _ovc)
|
|||
CALL_STATUS_IND, isi_call_status_ind_cb,
|
||||
ovc);
|
||||
|
||||
if (!isi_call_status_req(ovc,
|
||||
CALL_ID_ALL,
|
||||
if (!isi_call_status_req(ovc, CALL_ID_ALL,
|
||||
CALL_STATUS_MODE_ADDR_AND_ORIGIN,
|
||||
NULL, NULL))
|
||||
DBG("Failed to request call status");
|
||||
|
|
Loading…
Reference in New Issue