mirror of git://git.sysmocom.de/ofono
udev: Add detection support for SIM COM modems
This commit is contained in:
parent
3029e73c16
commit
f2bfaed174
|
@ -521,6 +521,51 @@ static gboolean setup_telit(struct modem_info *modem)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean setup_simcom(struct modem_info *modem)
|
||||
{
|
||||
const char *mdm = NULL, *aux = NULL, *gps = NULL, *diag = 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, "00") == 0)
|
||||
diag = info->devnode;
|
||||
else if (g_strcmp0(info->number, "01") == 0)
|
||||
gps = info->devnode;
|
||||
else 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("modem=%s aux=%s gps=%s diag=%s", mdm, aux, gps, diag);
|
||||
|
||||
ofono_modem_set_string(modem->modem, "Modem", mdm);
|
||||
ofono_modem_set_string(modem->modem, "Data", aux);
|
||||
ofono_modem_set_string(modem->modem, "GPS", gps);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean setup_zte(struct modem_info *modem)
|
||||
{
|
||||
const char *aux = NULL, *mdm = NULL, *qcdm = NULL;
|
||||
|
@ -613,6 +658,7 @@ static struct {
|
|||
{ "novatel", setup_novatel },
|
||||
{ "nokia", setup_nokia },
|
||||
{ "telit", setup_telit },
|
||||
{ "simcom", setup_simcom },
|
||||
{ "zte", setup_zte },
|
||||
{ "samsung", setup_samsung },
|
||||
{ }
|
||||
|
@ -801,6 +847,7 @@ static struct {
|
|||
{ "alcatel", "option", "1bbb", "0017" },
|
||||
{ "novatel", "option", "1410" },
|
||||
{ "zte", "option", "19d2" },
|
||||
{ "simcom", "option", "05c6", "9000" },
|
||||
{ "telit", "usbserial", "1bc7" },
|
||||
{ "telit", "option", "1bc7" },
|
||||
{ "nokia", "option", "0421", "060e" },
|
||||
|
|
Loading…
Reference in New Issue