All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] speedup: improvement
@ 2011-07-28 14:16 Bertrand Aygon
  2011-07-28 14:16 ` [PATCH 1/2] speedup: remove online/offline mechanism Bertrand Aygon
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bertrand Aygon @ 2011-07-28 14:16 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

Remove online/offline mechanism, since speedup modem have lot of difficulties to exit offline mode.
Delay sending of &C0 to disable data carrier detect.

Bertrand Aygon (2):
  speedup: remove online/offline mechanism.
  speedup: delay &C0.

 plugins/speedup.c |   63 +++++++++++-----------------------------------------
 1 files changed, 14 insertions(+), 49 deletions(-)

-- 
1.7.4.1

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] speedup: remove online/offline mechanism.
  2011-07-28 14:16 [PATCH 0/2] speedup: improvement Bertrand Aygon
@ 2011-07-28 14:16 ` Bertrand Aygon
  2011-07-28 14:16 ` [PATCH 2/2] speedup: delay &C0 Bertrand Aygon
  2011-07-28 20:10 ` [PATCH 0/2] speedup: improvement Marcel Holtmann
  2 siblings, 0 replies; 4+ messages in thread
From: Bertrand Aygon @ 2011-07-28 14:16 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 3866 bytes --]

---
 plugins/speedup.c |   55 +++++++---------------------------------------------
 1 files changed, 8 insertions(+), 47 deletions(-)

diff --git a/plugins/speedup.c b/plugins/speedup.c
index a7aa43c..f959e12 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -47,8 +47,6 @@
 #include <drivers/atmodem/atutil.h>
 #include <drivers/atmodem/vendor.h>
 
-static const char *none_prefix[] = { NULL };
-
 struct speedup_data {
 	GAtChat *modem;
 	GAtChat *aux;
@@ -177,7 +175,7 @@ static int speedup_enable(struct ofono_modem *modem)
 	g_at_chat_send(data->modem, "ATE0 &C0 +CMEE=1", NULL, NULL, NULL, NULL);
 	g_at_chat_send(data->aux, "ATE0 &C0 +CMEE=1", NULL, NULL, NULL, NULL);
 
-	g_at_chat_send(data->aux, "AT+CFUN=4", NULL,
+	g_at_chat_send(data->aux, "AT+CFUN=1", NULL,
 					cfun_enable, modem, NULL);
 
 	return -EINPROGRESS;
@@ -218,34 +216,6 @@ static int speedup_disable(struct ofono_modem *modem)
 	return -EINPROGRESS;
 }
 
-static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data)
-{
-	struct cb_data *cbd = user_data;
-	ofono_modem_online_cb_t cb = cbd->cb;
-	struct ofono_error error;
-
-	decode_at_error(&error, g_at_result_final_response(result));
-	cb(&error, cbd->data);
-}
-
-static void speedup_set_online(struct ofono_modem *modem, ofono_bool_t online,
-				ofono_modem_online_cb_t cb, void *user_data)
-{
-	struct speedup_data *data = ofono_modem_get_data(modem);
-	struct cb_data *cbd = cb_data_new(cb, user_data);
-	char const *command = online ? "AT+CFUN=1" : "AT+CFUN=4";
-
-	DBG("modem %p %s", modem, online ? "online" : "offline");
-
-	if (g_at_chat_send(data->aux, command, none_prefix,
-					set_online_cb, cbd, g_free) > 0)
-		return;
-
-	CALLBACK_WITH_FAILURE(cb, cbd->data);
-
-	g_free(cbd);
-}
-
 static void speedup_pre_sim(struct ofono_modem *modem)
 {
 	struct speedup_data *data = ofono_modem_get_data(modem);
@@ -269,6 +239,13 @@ static void speedup_post_sim(struct ofono_modem *modem)
 
 	DBG("%p", modem);
 
+	ofono_netreg_create(modem, 0, "atmodem", data->aux);
+
+	ofono_cbs_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
+					"atmodem", data->aux);
+	ofono_ussd_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
+					"atmodem", data->aux);
+
 	ofono_phonebook_create(modem, 0, "atmodem", data->aux);
 
 	ofono_sms_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
@@ -281,30 +258,14 @@ static void speedup_post_sim(struct ofono_modem *modem)
 		ofono_gprs_add_context(gprs, gc);
 }
 
-static void speedup_post_online(struct ofono_modem *modem)
-{
-	struct speedup_data *data = ofono_modem_get_data(modem);
-
-	DBG("%p", modem);
-
-	ofono_netreg_create(modem, 0, "atmodem", data->aux);
-
-	ofono_cbs_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
-					"atmodem", data->aux);
-	ofono_ussd_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
-					"atmodem", data->aux);
-}
-
 static struct ofono_modem_driver speedup_driver = {
 	.name		= "speedup",
 	.probe		= speedup_probe,
 	.remove		= speedup_remove,
 	.enable		= speedup_enable,
 	.disable	= speedup_disable,
-	.set_online     = speedup_set_online,
 	.pre_sim	= speedup_pre_sim,
 	.post_sim	= speedup_post_sim,
-	.post_online    = speedup_post_online,
 };
 
 static int speedup_init(void)
-- 
1.7.4.1

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] speedup: delay &C0.
  2011-07-28 14:16 [PATCH 0/2] speedup: improvement Bertrand Aygon
  2011-07-28 14:16 ` [PATCH 1/2] speedup: remove online/offline mechanism Bertrand Aygon
@ 2011-07-28 14:16 ` Bertrand Aygon
  2011-07-28 20:10 ` [PATCH 0/2] speedup: improvement Marcel Holtmann
  2 siblings, 0 replies; 4+ messages in thread
From: Bertrand Aygon @ 2011-07-28 14:16 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

---
 plugins/speedup.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/speedup.c b/plugins/speedup.c
index f959e12..16ae4fa 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -131,6 +131,10 @@ static void sim_state_cb(gboolean present, gpointer user_data)
 	data->have_sim = present;
 
 	ofono_modem_set_powered(modem, TRUE);
+
+	/* AT&C0 needs to be send separate and on both channel */
+	g_at_chat_send(data->modem, "AT&C0", NULL, NULL, NULL, NULL);
+	g_at_chat_send(data->aux, "AT&C0", NULL, NULL, NULL, NULL);
 }
 
 static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
@@ -172,8 +176,8 @@ static int speedup_enable(struct ofono_modem *modem)
 		return -EIO;
 	}
 
-	g_at_chat_send(data->modem, "ATE0 &C0 +CMEE=1", NULL, NULL, NULL, NULL);
-	g_at_chat_send(data->aux, "ATE0 &C0 +CMEE=1", NULL, NULL, NULL, NULL);
+	g_at_chat_send(data->modem, "ATE0 +CMEE=1", NULL, NULL, NULL, NULL);
+	g_at_chat_send(data->aux, "ATE0 +CMEE=1", NULL, NULL, NULL, NULL);
 
 	g_at_chat_send(data->aux, "AT+CFUN=1", NULL,
 					cfun_enable, modem, NULL);
-- 
1.7.4.1

---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] speedup: improvement
  2011-07-28 14:16 [PATCH 0/2] speedup: improvement Bertrand Aygon
  2011-07-28 14:16 ` [PATCH 1/2] speedup: remove online/offline mechanism Bertrand Aygon
  2011-07-28 14:16 ` [PATCH 2/2] speedup: delay &C0 Bertrand Aygon
@ 2011-07-28 20:10 ` Marcel Holtmann
  2 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2011-07-28 20:10 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

Hi Bertrand,

> Remove online/offline mechanism, since speedup modem have lot of difficulties to exit offline mode.
> Delay sending of &C0 to disable data carrier detect.
> 
> Bertrand Aygon (2):
>   speedup: remove online/offline mechanism.
>   speedup: delay &C0.
> 
>  plugins/speedup.c |   63 +++++++++++-----------------------------------------
>  1 files changed, 14 insertions(+), 49 deletions(-)

both patches have been applied. Thanks.

Regards

Marcel




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-28 20:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-28 14:16 [PATCH 0/2] speedup: improvement Bertrand Aygon
2011-07-28 14:16 ` [PATCH 1/2] speedup: remove online/offline mechanism Bertrand Aygon
2011-07-28 14:16 ` [PATCH 2/2] speedup: delay &C0 Bertrand Aygon
2011-07-28 20:10 ` [PATCH 0/2] speedup: improvement Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.