debug logs

This commit is contained in:
2025-10-23 23:34:21 +08:00
parent 71742217ad
commit ded0ec01b9
3 changed files with 60 additions and 0 deletions

View File

@@ -157,6 +157,7 @@ void ofono_audio_settings_driver_unregister(const struct ofono_audio_settings_dr
static void audio_settings_unregister(struct ofono_atom *atom)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_audio_settings *as = __ofono_atom_get_data(atom);
const char *path = __ofono_atom_get_path(as->atom);
DBusConnection *conn = ofono_dbus_get_connection();
@@ -168,6 +169,7 @@ static void audio_settings_unregister(struct ofono_atom *atom)
static void audio_settings_remove(struct ofono_atom *atom)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_audio_settings *as = __ofono_atom_get_data(atom);
DBG("atom: %p", atom);
@@ -187,6 +189,7 @@ struct ofono_audio_settings *ofono_audio_settings_create(struct ofono_modem *mod
const char *driver,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_audio_settings *as;
GSList *l;
@@ -218,6 +221,7 @@ struct ofono_audio_settings *ofono_audio_settings_create(struct ofono_modem *mod
void ofono_audio_settings_register(struct ofono_audio_settings *as)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
DBusConnection *conn = ofono_dbus_get_connection();
struct ofono_modem *modem = __ofono_atom_get_modem(as->atom);
const char *path = __ofono_atom_get_path(as->atom);
@@ -238,20 +242,24 @@ void ofono_audio_settings_register(struct ofono_audio_settings *as)
void ofono_audio_settings_remove(struct ofono_audio_settings *as)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
__ofono_atom_free(as->atom);
}
void ofono_audio_settings_set_data(struct ofono_audio_settings *as, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
as->driver_data = data;
}
void *ofono_audio_settings_get_data(struct ofono_audio_settings *as)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
return as->driver_data;
}
struct ofono_modem *ofono_audio_settings_get_modem(struct ofono_audio_settings *as)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
return __ofono_atom_get_modem(as->atom);
}

View File

@@ -95,6 +95,7 @@ static inline void emit_barring_changed(struct ofono_call_barring *cb,
int start, int end,
const char *type, int cls)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
DBusConnection *conn = ofono_dbus_get_connection();
const char *path = __ofono_atom_get_path(cb->atom);
char property_name[64];
@@ -129,6 +130,7 @@ static inline void emit_barring_changed(struct ofono_call_barring *cb,
static void update_barrings(struct ofono_call_barring *cb, int mask)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
int cls;
int i;
@@ -151,6 +153,7 @@ static void cb_ss_property_append(struct ofono_call_barring *cb,
DBusMessageIter *dict, int lock,
int mask)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
int i;
char property_name[64];
const char *strvalue;
@@ -173,6 +176,7 @@ static void cb_ss_property_append(struct ofono_call_barring *cb,
static void cb_set_query_bounds(struct ofono_call_barring *cb,
const char *fac, gboolean fac_only)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
int i;
if (!strcmp("AB", fac)) {
@@ -225,6 +229,7 @@ incoming:
static void generate_ss_query_reply(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
const char *context = "CallBarring";
const char *sig = "(ssa{sv})";
const char *ss_type = ss_control_type_to_string(cb->ss_req_type);
@@ -281,6 +286,7 @@ static void generate_ss_query_reply(struct ofono_call_barring *cb)
static void cb_ss_query_next_lock_callback(const struct ofono_error *error,
int status, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
@@ -308,6 +314,7 @@ static void cb_ss_query_next_lock_callback(const struct ofono_error *error,
static void cb_ss_query_next_lock(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
int cls;
cls = (cb->ss_req_type == SS_CONTROL_TYPE_QUERY) ?
@@ -320,6 +327,7 @@ static void cb_ss_query_next_lock(struct ofono_call_barring *cb)
static void cb_ss_set_lock_callback(const struct ofono_error *error,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
@@ -336,6 +344,7 @@ static void cb_ss_set_lock_callback(const struct ofono_error *error,
static const char *cb_ss_service_to_fac(const char *svc)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
if (!strcmp(svc, "33"))
return "AO";
else if (!strcmp(svc, "331"))
@@ -361,6 +370,7 @@ static gboolean cb_ss_control(int type, const char *sc,
const char *sic, const char *dn,
DBusMessage *msg, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
DBusConnection *conn = ofono_dbus_get_connection();
int cls = BEARER_CLASS_DEFAULT;
@@ -480,6 +490,7 @@ bad_format:
static void cb_set_passwd_callback(const struct ofono_error *error, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
DBusMessage *reply;
@@ -498,6 +509,7 @@ static gboolean cb_ss_passwd(const char *sc,
const char *old, const char *new,
DBusMessage *msg, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
DBusConnection *conn = ofono_dbus_get_connection();
DBusMessage *reply;
@@ -537,6 +549,7 @@ bad_format:
static void cb_register_ss_controls(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
__ofono_ussd_ssc_register(cb->ussd, "33", cb_ss_control, cb, NULL);
__ofono_ussd_ssc_register(cb->ussd, "331", cb_ss_control, cb, NULL);
__ofono_ussd_ssc_register(cb->ussd, "332", cb_ss_control, cb, NULL);
@@ -559,6 +572,7 @@ static void cb_register_ss_controls(struct ofono_call_barring *cb)
static void cb_unregister_ss_controls(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
__ofono_ussd_ssc_unregister(cb->ussd, "33");
__ofono_ussd_ssc_unregister(cb->ussd, "331");
__ofono_ussd_ssc_unregister(cb->ussd, "332");
@@ -581,6 +595,7 @@ static void cb_unregister_ss_controls(struct ofono_call_barring *cb)
gboolean __ofono_call_barring_is_busy(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
return cb->pending ? TRUE : FALSE;
}
@@ -588,6 +603,7 @@ static inline void cb_append_property(struct ofono_call_barring *cb,
DBusMessageIter *dict, int start,
int end, int cls, const char *property)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
char property_name[64];
const char *value = "disabled";
int i;
@@ -608,6 +624,7 @@ static inline void cb_append_property(struct ofono_call_barring *cb,
static void cb_get_properties_reply(struct ofono_call_barring *cb, int mask)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
DBusMessage *reply;
DBusMessageIter iter, dict;
int j;
@@ -643,6 +660,7 @@ static void cb_get_properties_reply(struct ofono_call_barring *cb, int mask)
static void get_query_lock_callback(const struct ofono_error *error,
int status, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
if (error->type == OFONO_ERROR_TYPE_NO_ERROR) {
@@ -664,6 +682,7 @@ static void get_query_lock_callback(const struct ofono_error *error,
static void get_query_next_lock(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
cb->driver->query(cb, cb_locks[cb->query_next].fac,
BEARER_CLASS_DEFAULT, get_query_lock_callback, cb);
}
@@ -671,6 +690,7 @@ static void get_query_next_lock(struct ofono_call_barring *cb)
static DBusMessage *cb_get_properties(DBusConnection *conn, DBusMessage *msg,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
if (__ofono_call_barring_is_busy(cb) || __ofono_ussd_is_busy(cb->ussd))
@@ -694,6 +714,7 @@ static DBusMessage *cb_get_properties(DBusConnection *conn, DBusMessage *msg,
static void set_query_lock_callback(const struct ofono_error *error,
int status, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
@@ -722,12 +743,14 @@ static void set_query_lock_callback(const struct ofono_error *error,
static void set_query_next_lock(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
cb->driver->query(cb, cb_locks[cb->query_next].fac,
BEARER_CLASS_DEFAULT, set_query_lock_callback, cb);
}
static void set_lock_callback(const struct ofono_error *error, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
@@ -754,6 +777,7 @@ static gboolean cb_lock_property_lookup(const char *property, const char *value,
int mask, int *out_which, int *out_cls,
int *out_mode)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
int i, j;
const char *prefix;
size_t len;
@@ -819,6 +843,7 @@ static gboolean cb_lock_property_lookup(const char *property, const char *value,
static DBusMessage *cb_set_property(DBusConnection *conn, DBusMessage *msg,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
DBusMessageIter iter;
DBusMessageIter var;
@@ -878,6 +903,7 @@ static DBusMessage *cb_set_property(DBusConnection *conn, DBusMessage *msg,
static void disable_all_callback(const struct ofono_error *error, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
@@ -894,6 +920,7 @@ static void disable_all_callback(const struct ofono_error *error, void *data)
static DBusMessage *cb_disable_all(DBusConnection *conn, DBusMessage *msg,
void *data, const char *fac)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
const char *passwd;
@@ -922,24 +949,28 @@ static DBusMessage *cb_disable_all(DBusConnection *conn, DBusMessage *msg,
static DBusMessage *cb_disable_ab(DBusConnection *conn, DBusMessage *msg,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
return cb_disable_all(conn, msg, data, "AB");
}
static DBusMessage *cb_disable_ac(DBusConnection *conn, DBusMessage *msg,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
return cb_disable_all(conn, msg, data, "AC");
}
static DBusMessage *cb_disable_ag(DBusConnection *conn, DBusMessage *msg,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
return cb_disable_all(conn, msg, data, "AG");
}
static DBusMessage *cb_set_passwd(DBusConnection *conn, DBusMessage *msg,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
const char *old_passwd;
const char *new_passwd;
@@ -998,6 +1029,7 @@ static const GDBusSignalTable cb_signals[] = {
int ofono_call_barring_driver_register(const struct ofono_call_barring_driver *d)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
DBG("driver: %p, name: %s", d, d->name);
if (d->probe == NULL)
@@ -1010,6 +1042,7 @@ int ofono_call_barring_driver_register(const struct ofono_call_barring_driver *d
void ofono_call_barring_driver_unregister(const struct ofono_call_barring_driver *d)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
DBG("driver: %p, name: %s", d, d->name);
g_drivers = g_slist_remove(g_drivers, (void *) d);
@@ -1017,6 +1050,7 @@ void ofono_call_barring_driver_unregister(const struct ofono_call_barring_driver
static void call_barring_unregister(struct ofono_atom *atom)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = __ofono_atom_get_data(atom);
const char *path = __ofono_atom_get_path(cb->atom);
DBusConnection *conn = ofono_dbus_get_connection();
@@ -1034,6 +1068,7 @@ static void call_barring_unregister(struct ofono_atom *atom)
static void call_barring_remove(struct ofono_atom *atom)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = __ofono_atom_get_data(atom);
DBG("atom: %p", atom);
@@ -1052,6 +1087,7 @@ struct ofono_call_barring *ofono_call_barring_create(struct ofono_modem *modem,
const char *driver,
void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb;
GSList *l;
@@ -1085,6 +1121,7 @@ struct ofono_call_barring *ofono_call_barring_create(struct ofono_modem *modem,
static void ussd_watch(struct ofono_atom *atom,
enum ofono_atom_watch_condition cond, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_barring *cb = data;
if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) {
@@ -1098,6 +1135,7 @@ static void ussd_watch(struct ofono_atom *atom,
void ofono_call_barring_register(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
DBusConnection *conn = ofono_dbus_get_connection();
const char *path = __ofono_atom_get_path(cb->atom);
struct ofono_modem *modem = __ofono_atom_get_modem(cb->atom);
@@ -1123,15 +1161,18 @@ void ofono_call_barring_register(struct ofono_call_barring *cb)
void ofono_call_barring_remove(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
__ofono_atom_free(cb->atom);
}
void ofono_call_barring_set_data(struct ofono_call_barring *cb, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
cb->driver_data = data;
}
void *ofono_call_barring_get_data(struct ofono_call_barring *cb)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
return cb->driver_data;
}

View File

@@ -89,6 +89,7 @@ static void ss_set_query_next_cf_cond(struct ofono_call_forwarding *cf);
static gint cf_cond_compare(gconstpointer a, gconstpointer b)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
const struct ofono_call_forwarding_condition *ca = a;
const struct ofono_call_forwarding_condition *cb = b;
@@ -97,6 +98,7 @@ static gint cf_cond_compare(gconstpointer a, gconstpointer b)
static struct ofono_call_forwarding_condition *cf_cond_find(GSList *l, int cls)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_forwarding_condition *c;
for (; l; l = l->next) {
@@ -111,6 +113,7 @@ static struct ofono_call_forwarding_condition *cf_cond_find(GSList *l, int cls)
static int cf_cond_find_timeout(GSList *l, int cls)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_forwarding_condition *cond = cf_cond_find(l, cls);
return cond ? cond->time : DEFAULT_NO_REPLY_TIMEOUT;
@@ -118,6 +121,7 @@ static int cf_cond_find_timeout(GSList *l, int cls)
static void cf_cond_list_print(GSList *l)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_forwarding_condition *cond;
for (; l ; l = l->next) {
@@ -133,6 +137,7 @@ static void cf_cond_list_print(GSList *l)
static GSList *cf_cond_list_create(int total,
const struct ofono_call_forwarding_condition *list)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
GSList *l = NULL;
int i;
int j;
@@ -169,6 +174,7 @@ static GSList *cf_cond_list_create(int total,
static inline void cf_clear_all(struct ofono_call_forwarding *cf)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
int i;
for (i = 0; i < 4; i++) {
@@ -188,12 +194,14 @@ static const char *cf_type_lut[] = {
static void sim_cfis_update_cb(int ok, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
if (!ok)
ofono_info("Failed to update EFcfis");
}
static void sim_cphs_cff_update_cb(int ok, void *data)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
if (!ok)
ofono_info("Failed to update EFcphs-cff");
}
@@ -201,6 +209,7 @@ static void sim_cphs_cff_update_cb(int ok, void *data)
static inline struct ofono_call_forwarding_condition *cf_find_unconditional(
struct ofono_call_forwarding *cf)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
return cf_cond_find(
cf->cf_conditions[CALL_FORWARDING_TYPE_UNCONDITIONAL],
BEARER_CLASS_VOICE);
@@ -208,6 +217,7 @@ static inline struct ofono_call_forwarding_condition *cf_find_unconditional(
static void sim_set_cf_indicator(struct ofono_call_forwarding *cf)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
struct ofono_call_forwarding_condition *cfu_voice =
cf_find_unconditional(cf);
@@ -258,6 +268,7 @@ static void sim_set_cf_indicator(struct ofono_call_forwarding *cf)
static void set_new_cond_list(struct ofono_call_forwarding *cf,
int type, GSList *list)
{
DBG("func:%s,line:%d,file:%s", __func__, __LINE__, __FILE__);
GSList *old = cf->cf_conditions[type];
DBusConnection *conn = ofono_dbus_get_connection();
const char *path = __ofono_atom_get_path(cf->atom);