[PATCH] ifxmodem: Adding fast dormancy support to Infineon modem
Initial patch to add fast dormancy to Infineon modem. Timeout is not supported yet. Thanks, -- r. --- drivers/ifxmodem/radio-settings.c | 40 - 1 files changed, 39 insertions(+), 1 deletions(-) diff --git a/drivers/ifxmodem/radio-settings.c b/drivers/ifxmodem/radio-settings.c index 89e97e7..68077db 100644 --- a/drivers/ifxmodem/radio-settings.c +++ b/drivers/ifxmodem/radio-settings.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -45,6 +46,7 @@ static const char *xrat_prefix[] = { "+XRAT:", NULL }; struct radio_settings_data { GAtChat *chat; + uint16_t fast_dormancy; }; static void xrat_query_cb(gboolean ok, GAtResult *result, gpointer user_data) @@ -196,12 +198,48 @@ static void ifx_radio_settings_remove(struct ofono_radio_settings *rs) g_free(rsd); } +static void update_fast_dormancy(struct radio_settings_data *rsd) +{ + char buf[20]; + + snprintf(buf, sizeof(buf), "AT+XFDOR=%u", rsd->fast_dormancy); + + if (g_at_chat_send(rsd->chat, buf, NULL, NULL, NULL, NULL) > 0) + DBG("3G fast dormancy %s.", + rsd->fast_dormancy ? "enabled" : "disabled"); + else + DBG("3G fast dormancy unchanged."); +} + +static void ifx_set_fast_dormancy(struct ofono_radio_settings *rs, + int enable, + ofono_radio_settings_fast_dormancy_set_cb_t cb, + void *data) +{ + struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs); + rsd->fast_dormancy = enable ? 1 : 0; + update_fast_dormancy(rsd); + CALLBACK_WITH_SUCCESS(cb, data); +} + +static void ifx_query_fast_dormancy(struct ofono_radio_settings *rs, + ofono_radio_settings_fast_dormancy_query_cb_t cb, + void *data) +{ + struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs); + + /* there is no read AT command */ + CALLBACK_WITH_SUCCESS(cb, rsd->fast_dormancy, data); +} + static struct ofono_radio_settings_driver driver = { .name = "ifxmodem", .probe = ifx_radio_settings_probe, .remove = ifx_radio_settings_remove, .query_rat_mode = ifx_query_rat_mode, - .set_rat_mode = ifx_set_rat_mode + .set_rat_mode = ifx_set_rat_mode, + .query_fast_dormancy= ifx_query_fast_dormancy, + .set_fast_dormancy = ifx_set_fast_dormancy }; void ifx_radio_settings_init() -- 1.7.0.4 ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
Re: [PATCH] ifxmodem: Adding fast dormancy support to Infineon modem
Hi Robertino, > Initial patch to add fast dormancy to Infineon modem. Timeout is not > supported yet. > > Thanks, > -- r. > > --- > drivers/ifxmodem/radio-settings.c | 40 > - > 1 files changed, 39 insertions(+), 1 deletions(-) > > diff --git a/drivers/ifxmodem/radio-settings.c > b/drivers/ifxmodem/radio-settings.c > index 89e97e7..68077db 100644 > --- a/drivers/ifxmodem/radio-settings.c > +++ b/drivers/ifxmodem/radio-settings.c > @@ -27,6 +27,7 @@ > #include > #include > #include > +#include > #include > > #include > @@ -45,6 +46,7 @@ static const char *xrat_prefix[] = { "+XRAT:", NULL }; > > struct radio_settings_data { > GAtChat *chat; > + uint16_t fast_dormancy; > }; > > static void xrat_query_cb(gboolean ok, GAtResult *result, gpointer user_data) > @@ -196,12 +198,48 @@ static void ifx_radio_settings_remove(struct > ofono_radio_settings *rs) > g_free(rsd); > } > > +static void update_fast_dormancy(struct radio_settings_data *rsd) > +{ > + char buf[20]; > + > + snprintf(buf, sizeof(buf), "AT+XFDOR=%u", rsd->fast_dormancy); is this command for fast dormancy really doing exactly what is expected according to doc/radio-settings.txt. In my last documentation from Infineon, that is still not the case. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
RE: [PATCH] ifxmodem: Adding fast dormancy support to Infineon modem
Hi Marcel, >> +snprintf(buf, sizeof(buf), "AT+XFDOR=%u", rsd->fast_dormancy); > is this command for fast dormancy really doing exactly what is expected > according to doc/radio-settings.txt. In my last documentation from > Infineon, that is still not the case. According to the doc I have, modem implementation is quite close: "Trigger Fast Dormancy +XFDOR This command triggers fast dormancy if all conditions are passed successful it will be send towards the network. There will be no confirmation if the request was executed or not as in the last extend the full execution belongs to the network." I tested this (with couple of weeks old FW), and on AT+XFDOR=1 got OK back, which, I understand, doesn't mean much, since there is no other confirmation, and there is no read AT command available yet, but I thought it was a good start. Thanks, -- r. ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
RE: [PATCH] ifxmodem: Adding fast dormancy support to Infineon modem
> According to the doc I have, modem implementation is quite close: > > "Trigger Fast Dormancy +XFDOR > This command triggers fast dormancy if all conditions are passed successful > it will be send > towards the network. There will be no confirmation if the request was > executed or not as in the > last extend the full execution belongs to the network." +XFDOR triggers fast dormancy once iff conditions are suitable. oFono expects a mode where fast dormancy is triggered automatically by the modem _anytime_ conditions have been suitable for the duration of a given timeout period. A command for such mode is not yet available in IFX FW as far as I know. Cheers, Waldo ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono
RE: [PATCH] ifxmodem: Adding fast dormancy support to Infineon modem
Hi Waldo, > > "Trigger Fast Dormancy +XFDOR > > This command triggers fast dormancy if all conditions are passed successful > > it will be send > > towards the network. There will be no confirmation if the request was > > executed or not as in the > > last extend the full execution belongs to the network." > > +XFDOR triggers fast dormancy once iff conditions are suitable. oFono expects > a mode where > fast dormancy is triggered automatically by the modem _anytime_ conditions > have been suitable for the duration of a given timeout period. A command for > such mode is not yet available in IFX FW as far as I know. that is what I remembered. Thanks for the clarification. Regards Marcel ___ ofono mailing list ofono@ofono.org http://lists.ofono.org/listinfo/ofono