longcheer: don't try to use untagged ports on known devices

This commit is contained in:
Dan Williams
2010-01-15 11:45:43 -08:00
parent 471d8a70a9
commit 621d9e8751
2 changed files with 15 additions and 1 deletions

View File

@@ -20,10 +20,12 @@ SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInte
ATTRS{idProduct}=="6060", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1"
ATTRS{idProduct}=="6060", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1"
ATTRS{idProduct}=="6060", ENV{ID_MM_LONGCHEER_TAGGED}="1"
# Alcatel One Touch X020
ATTRS{idProduct}=="6061", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1"
ATTRS{idProduct}=="6061", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1"
ATTRS{idProduct}=="6061", ENV{ID_MM_LONGCHEER_TAGGED}="1"
GOTO="mm_longcheer_port_types_end"
@@ -34,6 +36,7 @@ SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInte
# Alcatel One Touch X060s
ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_LONGCHEER_PORT_TYPE_MODEM}="1"
ATTRS{idProduct}=="0000", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_LONGCHEER_PORT_TYPE_AUX}="1"
ATTRS{idProduct}=="0000", ENV{ID_MM_LONGCHEER_TAGGED}="1"
GOTO="mm_longcheer_port_types_end"

View File

@@ -114,12 +114,23 @@ grab_port (MMPluginBase *base,
port = mm_plugin_base_supports_task_get_port (task);
g_assert (port);
/* Look for port type hints */
/* Look for port type hints; just probing can't distinguish which port should
* be the data/primary port on these devices. We have to tag them based on
* what the Windows .INF files say the port layout should be.
*/
if (g_udev_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_PORT_TYPE_MODEM"))
ptype = MM_PORT_TYPE_PRIMARY;
else if (g_udev_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_PORT_TYPE_AUX"))
ptype = MM_PORT_TYPE_SECONDARY;
/* If the device was tagged by the udev rules, then ignore any other ports
* to guard against race conditions if a device just happens to show up
* with more than two AT-capable ports.
*/
if ( (ptype == MM_PORT_TYPE_UNKNOWN)
&& g_udev_device_get_property_as_boolean (port, "ID_MM_LONGCHEER_TAGGED"))
ptype = MM_PORT_TYPE_IGNORED;
physdev = mm_plugin_base_supports_task_get_physdev (task);
g_assert (physdev);
sysfs_path = g_udev_device_get_sysfs_path (physdev);