mirror of git://git.sysmocom.de/ofono
udevng: add detection logic for u-blox modems
This commit is contained in:
parent
1f3e30f1ba
commit
7f29608feb
|
@ -831,6 +831,46 @@ static gboolean setup_quectel(struct modem_info *modem)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean setup_ublox(struct modem_info *modem)
|
||||
{
|
||||
const char *aux = NULL, *mdm = NULL;
|
||||
GSList *list;
|
||||
|
||||
DBG("%s", modem->syspath);
|
||||
|
||||
for (list = modem->devices; list; list = list->next) {
|
||||
struct device_info *info = list->data;
|
||||
|
||||
DBG("%s %s %s %s", info->devnode, info->interface,
|
||||
info->number, info->label);
|
||||
|
||||
if (g_strcmp0(info->label, "aux") == 0) {
|
||||
aux = info->devnode;
|
||||
if (mdm != NULL)
|
||||
break;
|
||||
} else if (g_strcmp0(info->label, "modem") == 0) {
|
||||
mdm = info->devnode;
|
||||
if (aux != NULL)
|
||||
break;
|
||||
} else if (g_strcmp0(info->interface, "2/2/1") == 0) {
|
||||
if (g_strcmp0(info->number, "02") == 0)
|
||||
aux = info->devnode;
|
||||
else if (g_strcmp0(info->number, "00") == 0)
|
||||
mdm = info->devnode;
|
||||
}
|
||||
}
|
||||
|
||||
if (aux == NULL || mdm == NULL)
|
||||
return FALSE;
|
||||
|
||||
DBG("aux=%s modem=%s", aux, mdm);
|
||||
|
||||
ofono_modem_set_string(modem->modem, "Aux", aux);
|
||||
ofono_modem_set_string(modem->modem, "Modem", mdm);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static struct {
|
||||
const char *name;
|
||||
gboolean (*setup)(struct modem_info *modem);
|
||||
|
@ -856,6 +896,7 @@ static struct {
|
|||
{ "icera", setup_icera },
|
||||
{ "samsung", setup_samsung },
|
||||
{ "quectel", setup_quectel },
|
||||
{ "ublox", setup_ublox },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -1068,6 +1109,7 @@ static struct {
|
|||
{ "samsung", "option", "04e8", "6889" },
|
||||
{ "samsung", "kalmia" },
|
||||
{ "quectel", "option", "05c6", "9090" },
|
||||
{ "ublox", "cdc_acm", "1546", "1102" },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue