mirror of git://git.sysmocom.de/ofono
udevng: add detection logic for Quectel modems
This commit is contained in:
parent
d2f6ffc18d
commit
5cffd8af95
|
@ -791,6 +791,46 @@ static gboolean setup_samsung(struct modem_info *modem)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean setup_quectel(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, "255/255/255") == 0) {
|
||||
if (g_strcmp0(info->number, "02") == 0)
|
||||
aux = info->devnode;
|
||||
else if (g_strcmp0(info->number, "03") == 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);
|
||||
|
@ -815,6 +855,7 @@ static struct {
|
|||
{ "zte", setup_zte },
|
||||
{ "icera", setup_icera },
|
||||
{ "samsung", setup_samsung },
|
||||
{ "quectel", setup_quectel },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -1026,6 +1067,7 @@ static struct {
|
|||
{ "nokia", "option", "0421", "0623" },
|
||||
{ "samsung", "option", "04e8", "6889" },
|
||||
{ "samsung", "kalmia" },
|
||||
{ "quectel", "option", "05c6", "9090" },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue