huawei: add port type rules for modems
This commit is contained in:
committed by
Aleksander Morgado
parent
d56a87a3bd
commit
01400024cd
@@ -3,6 +3,12 @@ ACTION!="add|change", GOTO="mm_huawei_port_types_end"
|
||||
|
||||
ENV{ID_VENDOR_ID}!="12d1", GOTO="mm_huawei_port_types_end"
|
||||
|
||||
# Mark the modem and at port flags for ModemManager
|
||||
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_HUAWEI_MODEM_PORT}="1"
|
||||
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_HUAWEI_AT_PORT}="1"
|
||||
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_HUAWEI_MODEM_PORT}="1"
|
||||
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_HUAWEI_AT_PORT}="1"
|
||||
|
||||
# Only the standard ECM or NCM port can support dial-up with AT NDISDUP through AT port
|
||||
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="02", ATTRS{bInterfaceSubClass}=="06",ATTRS{bInterfaceProtocol}=="00", ENV{ID_MM_HUAWEI_NDISDUP_SUPPORTED}="1"
|
||||
SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="02", ATTRS{bInterfaceSubClass}=="0d",ATTRS{bInterfaceProtocol}=="00", ENV{ID_MM_HUAWEI_NDISDUP_SUPPORTED}="1"
|
||||
|
||||
@@ -465,16 +465,31 @@ grab_port (MMPlugin *self,
|
||||
MMPortProbe *probe,
|
||||
GError **error)
|
||||
{
|
||||
gchar *str;
|
||||
MMAtPortFlag pflags;
|
||||
GUdevDevice *port;
|
||||
|
||||
pflags = (MMAtPortFlag) GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (probe), TAG_AT_PORT_FLAGS));
|
||||
str = mm_at_port_flag_build_string_from_mask (pflags);
|
||||
mm_dbg ("(%s/%s) Port will have AT flags '%s'",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe),
|
||||
str);
|
||||
g_free (str);
|
||||
port = mm_port_probe_peek_port (probe);
|
||||
if (g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_AT_PORT")) {
|
||||
mm_dbg ("(%s/%s)' Port flagged as primary",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_AT_PORT_FLAG_PRIMARY;
|
||||
} else if (g_udev_device_get_property_as_boolean (port, "ID_MM_HUAWEI_MODEM_PORT")) {
|
||||
mm_dbg ("(%s/%s) Port flagged as PPP",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe));
|
||||
pflags = MM_AT_PORT_FLAG_PPP;
|
||||
} else {
|
||||
gchar *str;
|
||||
|
||||
pflags = (MMAtPortFlag) GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (probe), TAG_AT_PORT_FLAGS));
|
||||
str = mm_at_port_flag_build_string_from_mask (pflags);
|
||||
mm_dbg ("(%s/%s) Port will have AT flags '%s'",
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
mm_port_probe_get_port_name (probe),
|
||||
str);
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
return mm_base_modem_grab_port (modem,
|
||||
mm_port_probe_get_port_subsys (probe),
|
||||
|
||||
Reference in New Issue
Block a user