Skip to contentSkip to conversation

modemconf: default to grabbing the "Device" entry from the config file

PATCH In review Andres Salomon 2 participants 2 messages Oct 2, 2009 – Oct 3, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 modemconf: default to grabbing the "Device" entry from the config file

Previously, we manually listed every driver entry that needed Device; this meant that we needed to edit modemconf.c every time we added a new modem plugin. Sjoerd Simons discovered that mbm doesn't work because it wasn't listed in modemconf, therefore Device was being ignored. This patch makes modemconf default to setting Device, with exceptions made for certain plugin drivers.

A better way to fix this that I started working on would be to have each driver plugin have a table of desired/required strings, and to keep any knowledge of drivers out of udev.c and modemconf.c. This may be a bit of a challenge for udev.c, though. Is this something that people would like to see?

---
 plugins/modemconf.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
plugins/modemconf.c +1 -3
index 4795749..dce31e2 100644
@@ -98,9 +98,7 @@ static struct ofono_modem *create_modem(GKeyFile *keyfile, const char *group)
 
 	if (!g_strcmp0(driver, "phonesim"))
 		set_address(modem, keyfile, group);
-
-	if (!g_strcmp0(driver, "atgen") || !g_strcmp0(driver, "g1") ||
-						!g_strcmp0(driver, "calypso"))
+	else
 		set_device(modem, keyfile, group);
 
 	g_free(driver);
Signature · 1 line
1.6.4.3
#1 lore raw

Hi Andres,

Quoted 7 lines

Previously, we manually listed every driver entry that needed Device; this meant that we needed to edit modemconf.c every time we added a new modem plugin. Sjoerd Simons discovered that mbm doesn't work because it wasn't listed in modemconf, therefore Device was being ignored. This patch makes modemconf default to setting Device, with exceptions made for certain plugin drivers.

Quoted 5 lines

A better way to fix this that I started working on would be to have each driver plugin have a table of desired/required strings, and to keep any knowledge of drivers out of udev.c and modemconf.c. This may be a bit of a challenge for udev.c, though. Is this something that people would like to see?

actually modemconf is only for static devices inside embedded systems like a mobile phone. The desktop should auto-discover modems via udev and MBM is one of them that get auto-discovered nicely when having a proper libudev in place.

Regards

Marcel