193
if (mm_port_probe_list_has_qmi_port (probes)) {
194
mm_dbg ("QMI-powered X22X modem found...");
195
return MM_BASE_MODEM (mm_broadband_modem_qmi_new (sysfs_path,
197
mm_plugin_get_name (self),
188
203
return MM_BASE_MODEM (mm_broadband_modem_x22x_new (sysfs_path,
190
205
mm_plugin_get_name (self),
205
220
port = mm_port_probe_peek_port (probe);
206
221
ptype = mm_port_probe_get_port_type (probe);
208
/* Look for port type hints; just probing can't distinguish which port should
209
* be the data/primary port on these devices. We have to tag them based on
210
* what the Windows .INF files say the port layout should be.
212
if (g_udev_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_MODEM")) {
213
mm_dbg ("x22x: AT port '%s/%s' flagged as primary",
214
mm_port_probe_get_port_subsys (probe),
215
mm_port_probe_get_port_name (probe));
216
pflags = MM_AT_PORT_FLAG_PRIMARY;
217
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_AUX")) {
218
mm_dbg ("x22x: AT port '%s/%s' flagged as secondary",
219
mm_port_probe_get_port_subsys (probe),
220
mm_port_probe_get_port_name (probe));
221
pflags = MM_AT_PORT_FLAG_SECONDARY;
223
/* If the port was tagged by the udev rules but isn't a primary or secondary,
224
* then ignore it to guard against race conditions if a device just happens
225
* to show up with more than two AT-capable ports.
223
if (ptype == MM_PORT_TYPE_AT) {
224
/* Look for port type hints; just probing can't distinguish which port should
225
* be the data/primary port on these devices. We have to tag them based on
226
* what the Windows .INF files say the port layout should be.
227
ptype = MM_PORT_TYPE_IGNORED;
228
if (g_udev_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_MODEM")) {
229
mm_dbg ("x22x: AT port '%s/%s' flagged as primary",
230
mm_port_probe_get_port_subsys (probe),
231
mm_port_probe_get_port_name (probe));
232
pflags = MM_AT_PORT_FLAG_PRIMARY;
233
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_X22X_PORT_TYPE_AUX")) {
234
mm_dbg ("x22x: AT port '%s/%s' flagged as secondary",
235
mm_port_probe_get_port_subsys (probe),
236
mm_port_probe_get_port_name (probe));
237
pflags = MM_AT_PORT_FLAG_SECONDARY;
239
/* If the port was tagged by the udev rules but isn't a primary or secondary,
240
* then ignore it to guard against race conditions if a device just happens
241
* to show up with more than two AT-capable ports.
243
ptype = MM_PORT_TYPE_IGNORED;
230
247
return mm_base_modem_grab_port (modem,
240
257
G_MODULE_EXPORT MMPlugin *
241
258
mm_plugin_create (void)
243
static const gchar *subsystems[] = { "tty", NULL };
260
static const gchar *subsystems[] = { "tty", "net", "usb", NULL };
244
261
/* Vendors: TAMobile and Olivetti */
245
262
static const guint16 vendor_ids[] = { 0x1bbb, 0x0b3c, 0 };
246
263
/* Only handle X22X tagged devices here. */
259
276
MM_PLUGIN_ALLOWED_SUBSYSTEMS, subsystems,
260
277
MM_PLUGIN_ALLOWED_VENDOR_IDS, vendor_ids,
261
278
MM_PLUGIN_ALLOWED_AT, TRUE,
279
MM_PLUGIN_ALLOWED_QMI, TRUE,
262
280
MM_PLUGIN_ALLOWED_UDEV_TAGS, udev_tags,
263
281
MM_PLUGIN_CUSTOM_INIT, &custom_init,