Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/3] Gobi: Enable SIM driver forcing
@ 2016-05-03  8:44 Martin Chaplet
  2016-05-03  8:44 ` [PATCH 2/3] Udevng: Improve modem properties detection Martin Chaplet
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Martin Chaplet @ 2016-05-03  8:44 UTC (permalink / raw)
  To: ofono

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

Let modem detect part overload default SIM driver by using an additional
property named "ForceSimLegacy" (boolean).
---
 plugins/gobi.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/plugins/gobi.c b/plugins/gobi.c
index 061ee04..8850904 100644
--- a/plugins/gobi.c
+++ b/plugins/gobi.c
@@ -414,15 +414,21 @@ error:
 static void gobi_pre_sim(struct ofono_modem *modem)
 {
 	struct gobi_data *data = ofono_modem_get_data(modem);
+	const char *sim_driver;
 
 	DBG("%p", modem);
 
 	ofono_devinfo_create(modem, 0, "qmimodem", data->device);
 
 	if (data->features & GOBI_UIM)
-		ofono_sim_create(modem, 0, "qmimodem", data->device);
+		sim_driver = "qmimodem";
 	else if (data->features & GOBI_DMS)
-		ofono_sim_create(modem, 0, "qmimodem-legacy", data->device);
+		sim_driver = "qmimodem-legacy";
+
+	if (ofono_modem_get_boolean(modem, "ForceSimLegacy"))
+		sim_driver = "qmimodem-legacy";
+
+	ofono_sim_create(modem, 0, sim_driver, data->device);
 
 	if (data->features & GOBI_VOICE)
 		ofono_voicecall_create(modem, 0, "qmimodem", data->device);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* Re: [PATCH 3/3] Add support for Sierra MC73xx QMI modems
@ 2016-05-02 15:20 Denis Kenzior
  2016-05-02 16:33 ` [PATCH 1/3] Gobi: Enable SIM driver forcing Martin Chaplet
  0 siblings, 1 reply; 6+ messages in thread
From: Denis Kenzior @ 2016-05-02 15:20 UTC (permalink / raw)
  To: ofono

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

Hi Martin,

On 05/02/2016 09:42 AM, Martin Chaplet wrote:
> Udevng layer is changed in order to support Sierra QMI modems like MC73cxx.
> Identically to Huawei modems, these modems are parsed by setup_sierra.
> If QMI interface is detected, the Gobi modem driver is selected.
> In order to keep setup function as light as possible, real interface
> matching is done by udev rule.

This is a bit unusual.  ofono.rules is now only used with the old 
plugins/udev.c detection logic.  udev.c is only really used for 
serial-based devices, not USB.

Can we add the logic directly to udevng.c and not depend on ofono.rules?

>
> Unfortunately, MC73xx chips seem to have a broken QMI UIM interface.
> The qmimodem-legacy is so forced in setup function.
> ---
>   plugins/ofono.rules | 10 ++++++++++
>   plugins/udevng.c    | 25 ++++++++++++++++++++++---
>   2 files changed, 32 insertions(+), 3 deletions(-)
>
> diff --git a/plugins/ofono.rules b/plugins/ofono.rules
> index 3ed9f16..4c5e0e3 100644
> --- a/plugins/ofono.rules
> +++ b/plugins/ofono.rules
> @@ -16,6 +16,16 @@ KERNEL=="shrm0", ENV{OFONO_DRIVER}="u8500"
>
>   LABEL="ofono_isi_end"
>
> +# Tag QMI devices
> +SUBSYSTEM=="usbmisc", KERNEL=="cdc-wdm*", ENV{OFONO_LABEL}="qmi"
> +
> +# Sierra MC73xx (wwan0 is buggy, AT interface is ttyUSB2)
> +ENV{ID_MODEL}!="MC73*", GOTO="sierra_end"
> +SUBSYSTEM=="net", ENV{ID_USB_INTERFACE_NUM}=="0a", ENV{OFONO_LABEL}="net"
> +SUBSYSTEM=="tty", ENV{ID_USB_INTERFACE_NUM}=="00", ENV{OFONO_LABEL}="diag"
> +SUBSYSTEM=="tty", ENV{ID_USB_INTERFACE_NUM}=="03", ENV{OFONO_LABEL}="modem"
> +LABEL="sierra_end"
> +
>   SUBSYSTEM!="usb", GOTO="ofono_end"
>   ENV{DEVTYPE}!="usb_device", GOTO="ofono_end"
>
> diff --git a/plugins/udevng.c b/plugins/udevng.c
> index 9643b0a..409ff22 100644
> --- a/plugins/udevng.c
> +++ b/plugins/udevng.c
> @@ -219,7 +219,7 @@ static gboolean setup_gobi(struct modem_info *modem)
>
>   static gboolean setup_sierra(struct modem_info *modem)
>   {
> -	const char *mdm = NULL, *app = NULL, *net = NULL, *diag = NULL;
> +	const char *mdm = NULL, *app = NULL, *net = NULL, *diag = NULL, *qmi = NULL;
>   	GSList *list;
>
>   	DBG("%s", modem->syspath);
> @@ -230,7 +230,15 @@ static gboolean setup_sierra(struct modem_info *modem)
>   		DBG("%s %s %s %s", info->devnode, info->interface,
>   						info->number, info->label);
>
> -		if (g_strcmp0(info->interface, "255/255/255") == 0) {
> +		if (g_strcmp0(info->label, "modem") == 0)
> +			mdm = info->devnode;
> +		else if (g_strcmp0(info->label, "net") == 0)
> +			net = info->devnode;
> +		else if (g_strcmp0(info->label, "diag") == 0)
> +			diag = info->devnode;
> +		else if (g_strcmp0(info->label, "qmi") == 0)
> +			qmi = info->devnode;
> +		else if (g_strcmp0(info->interface, "255/255/255") == 0) {
>   			if (g_strcmp0(info->number, "01") == 0)
>   				diag = info->devnode;
>   			if (g_strcmp0(info->number, "03") == 0)
> @@ -242,11 +250,20 @@ static gboolean setup_sierra(struct modem_info *modem)
>   		}
>   	}
>
> +	if (qmi != NULL && net != NULL) {
> +		ofono_modem_set_driver(modem->modem, "gobi");
> +		/* Fixup SIM interface for Sierra QMI devices */
> +		ofono_modem_set_string(modem->modem, "Simdriver", "qmimodem-legacy");

Lets do something like:

ofono_modem_set_boolean(modem->modem, "ForceSimLegacy", TRUE);

> +		goto done;
> +	}
> +
>   	if (mdm == NULL || net == NULL)
>   		return FALSE;
>
> -	DBG("modem=%s app=%s net=%s diag=%s", mdm, app, net, diag);
> +done:
> +	DBG("modem=%s app=%s net=%s diag=%s qmi=%s", mdm, app, net, diag, qmi);
>
> +	ofono_modem_set_string(modem->modem, "Device", qmi);
>   	ofono_modem_set_string(modem->modem, "Modem", mdm);
>   	ofono_modem_set_string(modem->modem, "App", app);
>   	ofono_modem_set_string(modem->modem, "Diag", diag);
> @@ -1096,6 +1113,8 @@ static struct {
>   	{ "hso",	"hso"				},
>   	{ "gobi",	"qmi_wwan"			},
>   	{ "gobi",	"qcserial"			},
> +	{ "sierra",	"qmi_wwan",	"1199"		},
> +	{ "sierra",	"qcserial",	"1199"		},
>   	{ "sierra",	"sierra"			},
>   	{ "sierra",	"sierra_net"			},
>   	{ "option",	"option",	"0af0"		},
>

Regards,
-Denis

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

end of thread, other threads:[~2016-05-03 16:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-03  8:44 [PATCH 1/3] Gobi: Enable SIM driver forcing Martin Chaplet
2016-05-03  8:44 ` [PATCH 2/3] Udevng: Improve modem properties detection Martin Chaplet
2016-05-03  8:44 ` [PATCH 3/3] Add support for Sierra MC73xx QMI modems Martin Chaplet
2016-05-03 16:12 ` [PATCH 1/3] Gobi: Enable SIM driver forcing Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2016-05-02 15:20 [PATCH 3/3] Add support for Sierra MC73xx QMI modems Denis Kenzior
2016-05-02 16:33 ` [PATCH 1/3] Gobi: Enable SIM driver forcing Martin Chaplet
2016-05-03  3:21   ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox