Remove modem member from cb_data

This commit is contained in:
Denis Kenzior 2009-08-19 18:15:46 -05:00
parent e8e6d519fe
commit 8c92e3dd18
11 changed files with 42 additions and 45 deletions

View File

@ -32,12 +32,10 @@ void dump_response(const char *func, gboolean ok, GAtResult *result);
struct cb_data {
void *cb;
void *data;
struct ofono_modem *modem;
void *user;
};
static inline struct cb_data *cb_data_new(struct ofono_modem *modem,
void *cb, void *data)
static inline struct cb_data *cb_data_new(void *cb, void *data)
{
struct cb_data *ret;
@ -48,7 +46,6 @@ static inline struct cb_data *cb_data_new(struct ofono_modem *modem,
ret->cb = cb;
ret->data = data;
ret->modem = modem;
return ret;
}

View File

@ -84,7 +84,7 @@ static void at_call_barring_query(struct ofono_call_barring *cb,
void *data)
{
GAtChat *chat = ofono_call_barring_get_data(cb);
struct cb_data *cbd = cb_data_new(NULL, callback, data);
struct cb_data *cbd = cb_data_new(callback, data);
char buf[64];
int len;
@ -124,7 +124,7 @@ static void at_call_barring_set(struct ofono_call_barring *cb, const char *lock,
void *data)
{
GAtChat *chat = ofono_call_barring_get_data(cb);
struct cb_data *cbd = cb_data_new(NULL, callback, data);
struct cb_data *cbd = cb_data_new(callback, data);
char buf[64];
int len;
@ -174,7 +174,7 @@ static void at_call_barring_set_passwd(struct ofono_call_barring *cb,
void *data)
{
GAtChat *chat = ofono_call_barring_get_data(cb);
struct cb_data *cbd = cb_data_new(NULL, callback, data);
struct cb_data *cbd = cb_data_new(callback, data);
char buf[64];
if (!cbd || strlen(lock) != 2)

View File

@ -126,7 +126,7 @@ static void at_ccfc_query(struct ofono_call_forwarding *cf, int type, int cls,
ofono_call_forwarding_query_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_forwarding_get_data(cf);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)
@ -169,7 +169,7 @@ static void at_ccfc_set(struct ofono_call_forwarding *cf, const char *buf,
ofono_call_forwarding_set_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_forwarding_get_data(cf);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;

View File

@ -115,7 +115,7 @@ static void at_caoc_query(struct ofono_call_meter *cm,
void *data)
{
GAtChat *chat = ofono_call_meter_get_data(cm);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -140,7 +140,7 @@ static void at_cacm_query(struct ofono_call_meter *cm,
void *data)
{
GAtChat *chat = ofono_call_meter_get_data(cm);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -176,7 +176,7 @@ static void at_cacm_set(struct ofono_call_meter *cm, const char *passwd,
ofono_call_meter_set_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_meter_get_data(cm);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)
@ -203,7 +203,7 @@ static void at_camm_query(struct ofono_call_meter *cm,
void *data)
{
GAtChat *chat = ofono_call_meter_get_data(cm);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -228,7 +228,7 @@ static void at_camm_set(struct ofono_call_meter *cm,
ofono_call_meter_set_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_meter_get_data(cm);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)
@ -291,7 +291,7 @@ static void at_cpuc_query(struct ofono_call_meter *cm,
ofono_call_meter_puct_query_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_meter_get_data(cm);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -316,7 +316,7 @@ static void at_cpuc_set(struct ofono_call_meter *cm, const char *currency,
ofono_call_meter_set_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_meter_get_data(cm);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)

View File

@ -81,7 +81,7 @@ static void at_ccwa_query(struct ofono_call_settings *cs, int cls,
ofono_call_settings_status_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_settings_get_data(cs);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)
@ -124,7 +124,7 @@ static void at_ccwa_set(struct ofono_call_settings *cs, int mode, int cls,
ofono_call_settings_set_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_settings_get_data(cs);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)
@ -185,7 +185,7 @@ static void at_clip_query(struct ofono_call_settings *cs,
ofono_call_settings_status_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_settings_get_data(cs);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -242,7 +242,7 @@ static void at_colp_query(struct ofono_call_settings *cs,
ofono_call_settings_status_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_settings_get_data(cs);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -299,7 +299,7 @@ static void at_clir_query(struct ofono_call_settings *cs,
ofono_call_settings_clir_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_settings_get_data(cs);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -334,7 +334,7 @@ static void at_clir_set(struct ofono_call_settings *cs, int mode,
ofono_call_settings_set_cb_t cb, void *data)
{
GAtChat *chat = ofono_call_settings_get_data(cs);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)

View File

@ -116,7 +116,7 @@ static void at_registration_status(struct ofono_netreg *netreg,
void *data)
{
struct netreg_data *nd = ofono_netreg_get_data(netreg);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -248,7 +248,7 @@ static void at_current_operator(struct ofono_netreg *netreg,
ofono_netreg_operator_cb_t cb, void *data)
{
struct netreg_data *nd = ofono_netreg_get_data(netreg);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
gboolean ok;
if (!cbd)
@ -391,7 +391,7 @@ static void at_list_operators(struct ofono_netreg *netreg,
ofono_netreg_operator_list_cb_t cb, void *data)
{
struct netreg_data *nd = ofono_netreg_get_data(netreg);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -426,7 +426,7 @@ static void at_register_auto(struct ofono_netreg *netreg,
ofono_netreg_register_cb_t cb, void *data)
{
struct netreg_data *nd = ofono_netreg_get_data(netreg);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -450,7 +450,7 @@ static void at_register_manual(struct ofono_netreg *netreg,
ofono_netreg_register_cb_t cb, void *data)
{
struct netreg_data *nd = ofono_netreg_get_data(netreg);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[128];
if (!cbd)
@ -476,7 +476,7 @@ static void at_deregister(struct ofono_netreg *netreg,
ofono_netreg_register_cb_t cb, void *data)
{
struct netreg_data *nd = ofono_netreg_get_data(netreg);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -562,7 +562,7 @@ static void at_signal_strength(struct ofono_netreg *netreg,
ofono_netreg_strength_cb_t cb, void *data)
{
struct netreg_data *nd = ofono_netreg_get_data(netreg);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;

View File

@ -374,7 +374,7 @@ static void at_export_entries(struct ofono_phonebook *pb, const char *storage,
ofono_phonebook_cb_t cb, void *data)
{
struct pb_data *pbd = ofono_phonebook_get_data(pb);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[32];
if (!cbd)

View File

@ -106,7 +106,7 @@ static void at_sim_read_info(struct ofono_sim *sim, int fileid,
void *data)
{
GAtChat *chat = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)
@ -177,7 +177,7 @@ static void at_sim_read_binary(struct ofono_sim *sim, int fileid,
ofono_sim_read_cb_t cb, void *data)
{
GAtChat *chat = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)
@ -205,7 +205,7 @@ static void at_sim_read_record(struct ofono_sim *sim, int fileid,
ofono_sim_read_cb_t cb, void *data)
{
GAtChat *chat = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
if (!cbd)
@ -276,7 +276,7 @@ static void at_sim_update_binary(struct ofono_sim *sim, int fileid,
ofono_sim_write_cb_t cb, void *data)
{
GAtChat *chat = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char *buf = g_try_new(char, 36 + length * 2);
int len, ret;
@ -313,7 +313,7 @@ static void at_sim_update_record(struct ofono_sim *sim, int fileid,
ofono_sim_write_cb_t cb, void *data)
{
GAtChat *chat = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char *buf = g_try_new(char, 36 + length * 2);
int len, ret;
@ -349,7 +349,7 @@ static void at_sim_update_cyclic(struct ofono_sim *sim, int fileid,
ofono_sim_write_cb_t cb, void *data)
{
GAtChat *chat = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char *buf = g_try_new(char, 36 + length * 2);
int len, ret;
@ -412,7 +412,7 @@ static void at_read_imsi(struct ofono_sim *sim, ofono_sim_imsi_cb_t cb,
void *data)
{
GAtChat *chat = ofono_sim_get_data(sim);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;

View File

@ -98,7 +98,7 @@ static void at_csca_set(struct ofono_sms *sms,
ofono_sms_sca_set_cb_t cb, void *user_data)
{
struct sms_data *data = ofono_sms_get_data(sms);
struct cb_data *cbd = cb_data_new(NULL, cb, user_data);
struct cb_data *cbd = cb_data_new(cb, user_data);
char buf[64];
if (!cbd)
@ -173,7 +173,7 @@ static void at_csca_query(struct ofono_sms *sms, ofono_sms_sca_query_cb_t cb,
void *user_data)
{
struct sms_data *data = ofono_sms_get_data(sms);
struct cb_data *cbd = cb_data_new(NULL, cb, user_data);
struct cb_data *cbd = cb_data_new(cb, user_data);
if (!cbd)
goto error;
@ -233,7 +233,7 @@ static void at_cmgs(struct ofono_sms *sms, unsigned char *pdu, int pdu_len,
void *user_data)
{
struct sms_data *data = ofono_sms_get_data(sms);
struct cb_data *cbd = cb_data_new(NULL, cb, user_data);
struct cb_data *cbd = cb_data_new(cb, user_data);
char buf[512];
int len;

View File

@ -58,7 +58,7 @@ static void at_ussd_request(struct ofono_ussd *ussd, const char *str,
ofono_ussd_cb_t cb, void *data)
{
GAtChat *chat = ofono_ussd_get_data(ussd);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
unsigned char *converted;
int dcs;
int max_len;
@ -115,7 +115,7 @@ static void at_ussd_cancel(struct ofono_ussd *ussd,
ofono_ussd_cb_t cb, void *data)
{
GAtChat *chat = ofono_ussd_get_data(ussd);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;

View File

@ -425,7 +425,7 @@ static void at_dial(struct ofono_voicecall *vc,
ofono_voicecall_cb_t cb, void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[256];
if (!cbd)
@ -565,7 +565,7 @@ static void at_list_calls(struct ofono_voicecall *vc, ofono_call_list_cb_t cb,
void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
if (!cbd)
goto error;
@ -699,7 +699,7 @@ static void at_send_dtmf(struct ofono_voicecall *vc, const char *dtmf,
ofono_voicecall_cb_t cb, void *data)
{
struct voicecall_data *vd = ofono_voicecall_get_data(vc);
struct cb_data *cbd = cb_data_new(NULL, cb, data);
struct cb_data *cbd = cb_data_new(cb, data);
int len = strlen(dtmf);
int s;
int i;