diff options
author | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
---|---|---|
committer | Denys Dmytriyenko <denis@denix.org> | 2009-03-17 14:32:59 -0400 |
commit | 709c4d66e0b107ca606941b988bad717c0b45d9b (patch) | |
tree | 37ee08b1eb308f3b2b6426d5793545c38396b838 /recipes/gsm/files/0002-Flush-all-pending-commands-before-restarting-the-mod.patch | |
parent | fa6cd5a3b993f16c27de4ff82b42684516d433ba (diff) |
rename packages/ to recipes/ per earlier agreement
See links below for more details:
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21326
http://thread.gmane.org/gmane.comp.handhelds.openembedded/21816
Signed-off-by: Denys Dmytriyenko <denis@denix.org>
Acked-by: Mike Westerhof <mwester@dls.net>
Acked-by: Philip Balister <philip@balister.org>
Acked-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Marcin Juszkiewicz <hrw@openembedded.org>
Acked-by: Koen Kooi <koen@openembedded.org>
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Diffstat (limited to 'recipes/gsm/files/0002-Flush-all-pending-commands-before-restarting-the-mod.patch')
-rw-r--r-- | recipes/gsm/files/0002-Flush-all-pending-commands-before-restarting-the-mod.patch | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/recipes/gsm/files/0002-Flush-all-pending-commands-before-restarting-the-mod.patch b/recipes/gsm/files/0002-Flush-all-pending-commands-before-restarting-the-mod.patch new file mode 100644 index 0000000000..3683596389 --- /dev/null +++ b/recipes/gsm/files/0002-Flush-all-pending-commands-before-restarting-the-mod.patch @@ -0,0 +1,74 @@ +From 1078f7aced63c6216bffe649930b97c9ccf9a16e Mon Sep 17 00:00:00 2001 +From: Andrzej Zaborowski <balrog@zabor.org> +Date: Wed, 19 Sep 2007 14:04:50 +0200 +Subject: [PATCH] Flush all pending commands before restarting the modem initialisation. + +--- + include/gsmd/gsmd.h | 1 + + src/gsmd/atcmd.c | 21 +++++++++++++++++++++ + src/gsmd/timer.c | 8 ++++++++ + 3 files changed, 30 insertions(+), 0 deletions(-) + +diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h +index 4afdf66..6ac9d8e 100644 +--- a/include/gsmd/gsmd.h ++++ b/include/gsmd/gsmd.h +@@ -131,6 +131,7 @@ struct gsmd_timer { + + int gsmd_timer_init(void); + void gmsd_timer_check_n_run(void); ++void gsmd_timer_reset(void); + + struct gsmd_timer *gsmd_timer_alloc(void); + int gsmd_timer_register(struct gsmd_timer *timer); +diff --git a/src/gsmd/atcmd.c b/src/gsmd/atcmd.c +index 27dfa41..2f6cee2 100644 +--- a/src/gsmd/atcmd.c ++++ b/src/gsmd/atcmd.c +@@ -264,6 +264,27 @@ static int ml_parse(const char *buf, int len, void *ctx) + if (strlen(buf) == 0 || + !strcmp(buf, "AT-Command Interpreter ready")) { + g->interpreter_ready = 1; ++ g->clear_to_send = 1; ++ ++ /* Flush current queue and reinitialise */ ++ while (!llist_empty(&g->busy_atcmds)) { ++ cmd = llist_entry(g->busy_atcmds.next, ++ struct gsmd_atcmd, list); ++ gsmd_log(GSMD_NOTICE, "discarding busy cmd %s\n", ++ cmd->buf); ++ llist_del(&cmd->list); ++ talloc_free(cmd); ++ } ++ while (!llist_empty(&g->pending_atcmds)) { ++ cmd = llist_entry(g->pending_atcmds.next, ++ struct gsmd_atcmd, list); ++ gsmd_log(GSMD_NOTICE, "discarding pending cmd %s\n", ++ cmd->buf); ++ llist_del(&cmd->list); ++ talloc_free(cmd); ++ } ++ ++ gsmd_timer_reset(); + gsmd_initsettings(g); + gmsd_alive_start(g); + atcmd_wake_queue(g); +diff --git a/src/gsmd/timer.c b/src/gsmd/timer.c +index 5200690..8877275 100644 +--- a/src/gsmd/timer.c ++++ b/src/gsmd/timer.c +@@ -215,3 +215,11 @@ void gsmd_timer_unregister(struct gsmd_timer *timer) + /* re-calculate next expiration */ + calc_next_expiration(); + } ++ ++void gsmd_timer_reset(void) ++{ ++ while (!llist_empty(&gsmd_timers)) ++ /* TODO: free associated resources (e.g timer->cancel_cb()) */ ++ llist_del(&llist_entry(gsmd_timers.next, ++ struct gsmd_timer, list)->list); ++} +-- +1.5.2.1 + |