nokia: add port tags for CS-xx Internet Sticks
They appear to always want PPP to happen on interface 0, according to the Windows .INF files.
This commit is contained in:
39
plugins/77-mm-nokia-port-types.rules
Normal file
39
plugins/77-mm-nokia-port-types.rules
Normal file
@@ -0,0 +1,39 @@
|
||||
# do not edit this file, it will be overwritten on update
|
||||
|
||||
ACTION!="add|change", GOTO="mm_nokia_port_types_end"
|
||||
SUBSYSTEM!="tty", GOTO="mm_nokia_port_types_end"
|
||||
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0421", GOTO="mm_nokia_port_types_vendorcheck"
|
||||
GOTO="mm_nokia_port_types_end"
|
||||
|
||||
LABEL="mm_nokia_port_types_vendorcheck"
|
||||
SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}"
|
||||
|
||||
# For Nokia Internet Sticks (CS-xx) the modem/PPP port appears to always be USB interface 0
|
||||
|
||||
ATTRS{idProduct}=="060D", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="0611", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="061A", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="061B", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="061F", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="0620", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="0623", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="0624", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="0625", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="062A", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="062E", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
ATTRS{idProduct}=="062F", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_NOKIA_PORT_TYPE_MODEM}="1"
|
||||
|
||||
LABEL="mm_nokia_port_types_end"
|
||||
|
@@ -442,7 +442,8 @@ udevrules_DATA = \
|
||||
77-mm-zte-port-types.rules \
|
||||
77-mm-longcheer-port-types.rules \
|
||||
77-mm-simtech-port-types.rules \
|
||||
77-mm-x22x-port-types.rules
|
||||
77-mm-x22x-port-types.rules \
|
||||
77-mm-nokia-port-types.rules
|
||||
|
||||
BUILT_SOURCES = \
|
||||
mm-modem-gsm-hso-glue.h
|
||||
|
@@ -135,6 +135,7 @@ grab_port (MMPluginBase *base,
|
||||
const char *name, *subsys, *devfile, *sysfs_path;
|
||||
guint32 caps;
|
||||
guint16 vendor = 0, product = 0;
|
||||
MMPortType ptype = MM_PORT_TYPE_UNKNOWN;
|
||||
|
||||
port = mm_plugin_base_supports_task_get_port (task);
|
||||
g_assert (port);
|
||||
@@ -153,6 +154,12 @@ grab_port (MMPluginBase *base,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Look for port type hints */
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_MODEM"))
|
||||
ptype = MM_PORT_TYPE_PRIMARY;
|
||||
else if (g_udev_device_get_property_as_boolean (port, "ID_MM_NOKIA_PORT_TYPE_AUX"))
|
||||
ptype = MM_PORT_TYPE_SECONDARY;
|
||||
|
||||
caps = mm_plugin_base_supports_task_get_probed_capabilities (task);
|
||||
sysfs_path = mm_plugin_base_supports_task_get_physdev_path (task);
|
||||
if (!existing) {
|
||||
@@ -173,14 +180,14 @@ grab_port (MMPluginBase *base,
|
||||
}
|
||||
|
||||
if (modem) {
|
||||
if (!mm_modem_grab_port (modem, subsys, name, MM_PORT_TYPE_UNKNOWN, NULL, error)) {
|
||||
if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error)) {
|
||||
g_object_unref (modem);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
} else if (get_level_for_capabilities (caps)) {
|
||||
modem = existing;
|
||||
if (!mm_modem_grab_port (modem, subsys, name, MM_PORT_TYPE_UNKNOWN, NULL, error))
|
||||
if (!mm_modem_grab_port (modem, subsys, name, ptype, NULL, error))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user