linktop: new port type hints
Flag ttyACM0 as data port and ttyACM1 as primary port, as per https://bugzilla.gnome.org/show_bug.cgi?id=637140#c10 Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/14
This commit is contained in:
@@ -1002,6 +1002,10 @@ libmm_plugin_linktop_la_CPPFLAGS = \
|
|||||||
libmm_plugin_linktop_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
|
libmm_plugin_linktop_la_LDFLAGS = $(PLUGIN_COMMON_LINKER_FLAGS)
|
||||||
libmm_plugin_linktop_la_LIBADD = $(builddir)/libhelpers-linktop.la
|
libmm_plugin_linktop_la_LIBADD = $(builddir)/libhelpers-linktop.la
|
||||||
|
|
||||||
|
dist_udevrules_DATA += linktop/77-mm-linktop-port-types.rules
|
||||||
|
|
||||||
|
AM_CFLAGS += -DTESTUDEVRULESDIR_LINKTOP=\"${srcdir}/linktop\"
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
16
plugins/linktop/77-mm-linktop-port-types.rules
Normal file
16
plugins/linktop/77-mm-linktop-port-types.rules
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# do not edit this file, it will be overwritten on update
|
||||||
|
|
||||||
|
ACTION!="add|change|move|bind", GOTO="mm_linktop_end"
|
||||||
|
SUBSYSTEMS=="usb", ATTRS{idVendor}=="230d", GOTO="mm_linktop_generic"
|
||||||
|
GOTO="mm_linktop_end"
|
||||||
|
|
||||||
|
LABEL="mm_linktop_generic"
|
||||||
|
SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}"
|
||||||
|
|
||||||
|
# Linktop HSPADataCard
|
||||||
|
# ttyACM0 (if #1): Data port
|
||||||
|
# ttyACM1 (if #3): Primary AT port
|
||||||
|
ATTRS{idVendor}=="230d", ATTRS{idProduct}=="0001", ENV{.MM_USBIFNUM}=="01", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PPP}="1"
|
||||||
|
ATTRS{idVendor}=="230d", ATTRS{idProduct}=="0001", ENV{.MM_USBIFNUM}=="03", SUBSYSTEM=="tty", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1"
|
||||||
|
|
||||||
|
LABEL="mm_linktop_end"
|
@@ -511,19 +511,24 @@ endif
|
|||||||
|
|
||||||
# plugin: linktop
|
# plugin: linktop
|
||||||
if plugins_options['linktop']
|
if plugins_options['linktop']
|
||||||
common_c_args = '-DMM_MODULE_NAME="linktop"'
|
|
||||||
|
|
||||||
sources = files(
|
sources = files(
|
||||||
'linktop/mm-plugin-linktop.c',
|
'linktop/mm-plugin-linktop.c',
|
||||||
'linktop/mm-broadband-modem-linktop.c',
|
'linktop/mm-broadband-modem-linktop.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
c_args = [
|
||||||
|
'-DMM_MODULE_NAME="linktop"',
|
||||||
|
'-DTESTUDEVRULESDIR_LINKTOP="@0@"'.format(plugins_dir / 'linktop'),
|
||||||
|
]
|
||||||
|
|
||||||
plugins += {'plugin-linktop': {
|
plugins += {'plugin-linktop': {
|
||||||
'plugin': true,
|
'plugin': true,
|
||||||
'helper': {'sources': files('linktop/mm-modem-helpers-linktop.c'), 'include_directories': plugins_incs, 'c_args': common_c_args},
|
'helper': {'sources': files('linktop/mm-modem-helpers-linktop.c'), 'include_directories': plugins_incs, 'c_args': c_args},
|
||||||
'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': common_c_args},
|
'module': {'sources': sources, 'include_directories': plugins_incs, 'c_args': c_args},
|
||||||
'test': {'sources': files('linktop/tests/test-modem-helpers-linktop.c'), 'include_directories': include_directories('linktop'), 'dependencies': libhelpers_dep},
|
'test': {'sources': files('linktop/tests/test-modem-helpers-linktop.c'), 'include_directories': include_directories('linktop'), 'dependencies': libhelpers_dep},
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
plugins_udev_rules += files('linktop/77-mm-linktop-port-types.rules')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# plugin: longcheer (and rebranded dongles)
|
# plugin: longcheer (and rebranded dongles)
|
||||||
|
@@ -184,6 +184,14 @@ test_qcom_soc (void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined ENABLE_PLUGIN_LINKTOP
|
||||||
|
static void
|
||||||
|
test_linktop (void)
|
||||||
|
{
|
||||||
|
common_test (TESTUDEVRULESDIR_LINKTOP);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
|
||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
@@ -241,6 +249,9 @@ int main (int argc, char **argv)
|
|||||||
#if defined ENABLE_PLUGIN_QCOM_SOC && defined WITH_QMI
|
#if defined ENABLE_PLUGIN_QCOM_SOC && defined WITH_QMI
|
||||||
g_test_add_func ("/MM/test-udev-rules/qcom-soc", test_qcom_soc);
|
g_test_add_func ("/MM/test-udev-rules/qcom-soc", test_qcom_soc);
|
||||||
#endif
|
#endif
|
||||||
|
#if defined ENABLE_PLUGIN_LINKTOP
|
||||||
|
g_test_add_func ("/MM/test-udev-rules/linktop", test_linktop);
|
||||||
|
#endif
|
||||||
|
|
||||||
return g_test_run ();
|
return g_test_run ();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user