diff --git a/plugins/atgen.c b/plugins/atgen.c index 1ce2467a..413e8a3f 100644 --- a/plugins/atgen.c +++ b/plugins/atgen.c @@ -78,7 +78,9 @@ static void atgen_remove(struct ofono_modem *modem) static void atgen_debug(const char *str, void *user_data) { - ofono_info("%s", str); + const char *prefix = user_data; + + ofono_info("%s%s", prefix, str); } static int atgen_enable(struct ofono_modem *modem) @@ -140,7 +142,7 @@ static int atgen_enable(struct ofono_modem *modem) return -ENOMEM; if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(chat, atgen_debug, NULL); + g_at_chat_set_debug(chat, atgen_debug, ""); ofono_modem_set_data(modem, chat); diff --git a/plugins/calypso.c b/plugins/calypso.c index a2d4ec82..8c54d5ec 100644 --- a/plugins/calypso.c +++ b/plugins/calypso.c @@ -90,21 +90,18 @@ struct calypso_data { static const char *cpin_prefix[] = { "+CPIN:", NULL }; static const char *none_prefix[] = { NULL }; -static void calypso_debug(const char *str, void *data) +static void calypso_dlc_debug(const char *str, void *user_data) { - guint dlc = GPOINTER_TO_UINT(data); + guint dlc = GPOINTER_TO_UINT(user_data); ofono_info("DLC%u: %s", dlc, str); } -static void calypso_mux_debug(const char *str, void *data) +static void calypso_debug(const char *str, void *user_data) { - ofono_info("MUX: %s", str); -} + const char *prefix = user_data; -static void calypso_setup_debug(const char *str, void *data) -{ - ofono_info("Setup: %s", str); + ofono_info("%s%s", prefix, str); } static int calypso_probe(struct ofono_modem *modem) @@ -272,7 +269,7 @@ static void mux_setup(GAtMux *mux, gpointer user_data) data->mux = mux; if (getenv("OFONO_AT_DEBUG")) - g_at_mux_set_debug(data->mux, calypso_mux_debug, NULL); + g_at_mux_set_debug(data->mux, calypso_debug, "MUX: "); g_at_mux_start(mux); @@ -285,7 +282,7 @@ static void mux_setup(GAtMux *mux, gpointer user_data) g_io_channel_unref(io); if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(data->dlcs[i], calypso_debug, + g_at_chat_set_debug(data->dlcs[i], calypso_dlc_debug, GUINT_TO_POINTER(i)); g_at_chat_set_wakeup_command(data->dlcs[i], "AT\r", 500, 5000); @@ -336,7 +333,7 @@ static void modem_initialize(struct ofono_modem *modem) goto error; if (getenv("OFONO_AT_DEBUG") != NULL) - g_at_chat_set_debug(chat, calypso_setup_debug, NULL); + g_at_chat_set_debug(chat, calypso_debug, "Setup: "); g_at_chat_set_wakeup_command(chat, "AT\r", 500, 5000); diff --git a/plugins/g1.c b/plugins/g1.c index fa96eb1e..0cbecef1 100644 --- a/plugins/g1.c +++ b/plugins/g1.c @@ -50,9 +50,11 @@ #include -static void g1_debug(const char *str, void *data) +static void g1_debug(const char *str, void *user_data) { - ofono_info("%s", str); + const char *prefix = user_data; + + ofono_info("%s%s", prefix, str); } /* Detect hardware, and initialize if found */ @@ -111,8 +113,8 @@ static int g1_enable(struct ofono_modem *modem) if (chat == NULL) return -EIO; - if (getenv("OFONO_AT_DEBUG") != NULL) - g_at_chat_set_debug(chat, g1_debug, NULL); + if (getenv("OFONO_AT_DEBUG")) + g_at_chat_set_debug(chat, g1_debug, ""); ofono_modem_set_data(modem, chat); diff --git a/plugins/hfp.c b/plugins/hfp.c index 9a892db7..62d884be 100644 --- a/plugins/hfp.c +++ b/plugins/hfp.c @@ -66,7 +66,9 @@ static GHashTable *modem_hash = NULL; static void hfp_debug(const char *str, void *user_data) { - ofono_info("%s", str); + const char *prefix = user_data; + + ofono_info("%s%s", prefix, str); } static void clear_data(struct ofono_modem *modem) @@ -337,7 +339,7 @@ static int service_level_connection(struct ofono_modem *modem, int fd) g_at_chat_set_disconnect_function(chat, hfp_disconnected_cb, modem); if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(chat, hfp_debug, NULL); + g_at_chat_set_debug(chat, hfp_debug, ""); snprintf(buf, sizeof(buf), "AT+BRSF=%d", data->hf_features); g_at_chat_send(chat, buf, brsf_prefix, diff --git a/plugins/hso.c b/plugins/hso.c index bfc5c471..055c63b3 100644 --- a/plugins/hso.c +++ b/plugins/hso.c @@ -86,6 +86,7 @@ static void hso_remove(struct ofono_modem *modem) static void hso_debug(const char *str, void *user_data) { const char *prefix = user_data; + ofono_info("%s%s", prefix, str); } @@ -157,7 +158,7 @@ static int hso_enable(struct ofono_modem *modem) return -EIO; if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(data->control, hso_debug, "Control:"); + g_at_chat_set_debug(data->control, hso_debug, "Control: "); data->app = create_port(app); @@ -169,7 +170,7 @@ static int hso_enable(struct ofono_modem *modem) } if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(data->app, hso_debug, "App:"); + g_at_chat_set_debug(data->app, hso_debug, "App: "); g_at_chat_send(data->control, "ATE0", none_prefix, NULL, NULL, NULL); g_at_chat_send(data->app, "ATE0", none_prefix, NULL, NULL, NULL); diff --git a/plugins/huawei.c b/plugins/huawei.c index 27473a8d..dd24c3c5 100644 --- a/plugins/huawei.c +++ b/plugins/huawei.c @@ -115,6 +115,7 @@ static void huawei_remove(struct ofono_modem *modem) static void huawei_debug(const char *str, void *user_data) { const char *prefix = user_data; + ofono_info("%s%s", prefix, str); } @@ -528,7 +529,7 @@ static void huawei_disconnect(gpointer user_data) g_at_chat_unref(data->modem); data->modem = NULL; - data->modem = open_device(modem, "Modem", "Modem:"); + data->modem = open_device(modem, "Modem", "Modem: "); if (data->modem == NULL) return; @@ -553,14 +554,14 @@ static int huawei_enable(struct ofono_modem *modem) DBG("%p", modem); - data->modem = open_device(modem, "Modem", "Modem:"); + data->modem = open_device(modem, "Modem", "Modem: "); if (data->modem == NULL) return -EINVAL; g_at_chat_set_disconnect_function(data->modem, huawei_disconnect, modem); - data->pcui = open_device(modem, "Pcui", "Pcui:"); + data->pcui = open_device(modem, "Pcui", "PCUI: "); if (data->pcui == NULL) { g_at_chat_unref(data->modem); data->modem = NULL; diff --git a/plugins/mbm.c b/plugins/mbm.c index a706a34c..41c96384 100644 --- a/plugins/mbm.c +++ b/plugins/mbm.c @@ -103,7 +103,7 @@ static void mbm_debug(const char *str, void *user_data) { const char *prefix = user_data; - ofono_info("%s %s", prefix, str); + ofono_info("%s%s", prefix, str); } static gboolean init_simpin_check(gpointer user_data); @@ -316,7 +316,7 @@ static int mbm_enable(struct ofono_modem *modem) return -EIO; if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(data->modem_port, mbm_debug, "Modem:"); + g_at_chat_set_debug(data->modem_port, mbm_debug, "Modem: "); data->data_port = create_port(data_dev); @@ -328,7 +328,7 @@ static int mbm_enable(struct ofono_modem *modem) } if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(data->data_port, mbm_debug, "Data:"); + g_at_chat_set_debug(data->data_port, mbm_debug, "Data: "); g_at_chat_register(data->modem_port, "*EMRDY:", emrdy_notifier, FALSE, modem, NULL); diff --git a/plugins/nokia.c b/plugins/nokia.c index b7db2cc9..f65617be 100644 --- a/plugins/nokia.c +++ b/plugins/nokia.c @@ -87,6 +87,7 @@ static void nokia_remove(struct ofono_modem *modem) static void nokia_debug(const char *str, void *user_data) { const char *prefix = user_data; + ofono_info("%s%s", prefix, str); } @@ -134,7 +135,7 @@ static void nokia_disconnect(gpointer user_data) g_at_chat_unref(data->modem); data->modem = NULL; - data->modem = open_device(modem, "Modem", "Modem:"); + data->modem = open_device(modem, "Modem", "Modem: "); if (!data->modem) return; @@ -164,14 +165,14 @@ static int nokia_enable(struct ofono_modem *modem) DBG("%p", modem); - data->modem = open_device(modem, "Modem", "Modem:"); + data->modem = open_device(modem, "Modem", "Modem: "); if (data->modem == NULL) return -EINVAL; g_at_chat_set_disconnect_function(data->modem, nokia_disconnect, modem); - data->control = open_device(modem, "Control", "Control:"); + data->control = open_device(modem, "Control", "Control: "); if (data->control == NULL) { g_at_chat_unref(data->modem); data->modem = NULL; diff --git a/plugins/novatel.c b/plugins/novatel.c index 51360abc..4a3802e8 100644 --- a/plugins/novatel.c +++ b/plugins/novatel.c @@ -89,6 +89,7 @@ static void novatel_remove(struct ofono_modem *modem) static void novatel_debug(const char *str, void *user_data) { const char *prefix = user_data; + ofono_info("%s%s", prefix, str); } @@ -144,7 +145,7 @@ static void nwdmat_action(gboolean ok, GAtResult *result, gpointer user_data) data->dmat_mode = 1; - data->secondary = open_device(modem, "SecondaryDevice", "2nd:"); + data->secondary = open_device(modem, "SecondaryDevice", "Control: "); if (!data->secondary) goto done; @@ -206,7 +207,7 @@ static void novatel_disconnect(gpointer user_data) g_at_chat_unref(data->primary); data->primary = NULL; - data->primary = open_device(modem, "PrimaryDevice", "1st:"); + data->primary = open_device(modem, "PrimaryDevice", "Modem: "); if (!data->primary) return; @@ -228,7 +229,7 @@ static int novatel_enable(struct ofono_modem *modem) DBG("%p", modem); - data->primary = open_device(modem, "PrimaryDevice", "1st:"); + data->primary = open_device(modem, "PrimaryDevice", "Modem: "); if (!data->primary) return -EIO; diff --git a/plugins/palmpre.c b/plugins/palmpre.c index 7d2aeb43..17148637 100644 --- a/plugins/palmpre.c +++ b/plugins/palmpre.c @@ -79,7 +79,9 @@ static void palmpre_remove(struct ofono_modem *modem) static void palmpre_debug(const char *str, void *user_data) { - ofono_info("%s", str); + const char *prefix = user_data; + + ofono_info("%s%s", prefix, str); } static void cfun_set_on_cb(gboolean ok, GAtResult *result, gpointer user_data) @@ -126,7 +128,7 @@ static int palmpre_enable(struct ofono_modem *modem) return -ENOMEM; if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(data->chat, palmpre_debug, NULL); + g_at_chat_set_debug(data->chat, palmpre_debug, ""); /* Ensure terminal is in a known state */ g_at_chat_send(data->chat, "ATZ E0 +CMEE=1", NULL, NULL, NULL, NULL); diff --git a/plugins/ste.c b/plugins/ste.c index aab07041..508ad587 100644 --- a/plugins/ste.c +++ b/plugins/ste.c @@ -106,7 +106,9 @@ static void ste_remove(struct ofono_modem *modem) static void ste_debug(const char *str, void *user_data) { - ofono_info("%s", str); + const char *prefix = user_data; + + ofono_info("%s%s", prefix, str); } static gboolean init_simpin_check(gpointer user_data); @@ -235,7 +237,7 @@ static int ste_enable(struct ofono_modem *modem) return -ENOMEM; if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(data->chat, ste_debug, NULL); + g_at_chat_set_debug(data->chat, ste_debug, ""); g_at_chat_send(data->chat, "AT&F E0 V1 X4 &C1 +CMEE=1", NULL, NULL, NULL, NULL); diff --git a/plugins/wavecom.c b/plugins/wavecom.c index 77b7aa16..73fa502c 100644 --- a/plugins/wavecom.c +++ b/plugins/wavecom.c @@ -62,7 +62,9 @@ static void wavecom_remove(struct ofono_modem *modem) static void wavecom_debug(const char *str, void *user_data) { - ofono_info("%s", str); + const char *prefix = user_data; + + ofono_info("%s%s", prefix, str); } static int wavecom_enable(struct ofono_modem *modem) @@ -110,7 +112,7 @@ static int wavecom_enable(struct ofono_modem *modem) return -ENOMEM; if (getenv("OFONO_AT_DEBUG")) - g_at_chat_set_debug(chat, wavecom_debug, NULL); + g_at_chat_set_debug(chat, wavecom_debug, ""); ofono_modem_set_data(modem, chat); diff --git a/plugins/zte.c b/plugins/zte.c index c82b2b51..07f84665 100644 --- a/plugins/zte.c +++ b/plugins/zte.c @@ -89,6 +89,7 @@ static void zte_remove(struct ofono_modem *modem) static void zte_debug(const char *str, void *user_data) { const char *prefix = user_data; + ofono_info("%s%s", prefix, str); } @@ -136,7 +137,7 @@ static void zte_disconnect(gpointer user_data) g_at_chat_unref(data->modem); data->modem = NULL; - data->modem = open_device(modem, "Modem", "Modem:"); + data->modem = open_device(modem, "Modem", "Modem: "); if (!data->modem) return; @@ -166,14 +167,14 @@ static int zte_enable(struct ofono_modem *modem) DBG("%p", modem); - data->modem = open_device(modem, "Modem", "Modem:"); + data->modem = open_device(modem, "Modem", "Modem: "); if (data->modem == NULL) return -EINVAL; g_at_chat_set_disconnect_function(data->modem, zte_disconnect, modem); - data->aux = open_device(modem, "Aux", "Aux:"); + data->aux = open_device(modem, "Aux", "Aux: "); if (data->aux == NULL) { g_at_chat_unref(data->modem); data->modem = NULL;