Commit Graph

34 Commits

Author SHA1 Message Date
Freedom Liu
039ac40aab foxconn: delete the carrier mapping table of T99W175
For T99W175, Qualcomm realized mcfg switching mechanism
in FW side. It can work indepently without MM's help.
Therefore, delete mcfg switching mechanism in MM.
2021-10-28 08:40:18 +08:00
Freedom Liu
f720467016 foxconn: add T99W175 carrier mapping table 2021-08-09 17:47:27 +08:00
Freedom Liu
33e2b023ef foxconn: Rename carrier-mapping to t77w968-carrier-mapping 2021-08-09 15:37:22 +08:00
Freedom Liu
c31488608a foxconn: change modem-foxconn-t77w968 to modem-mbim-foxconn
Named the object in a more generic way.
2021-04-29 00:58:35 +00:00
Aleksander Morgado
8fc60754dd qcom-soc: new plugin for Qualcomm SoCs
This plugin implements support for old Qualcomm SoCs like the MSM8916
or the MSM8974, where:
 * control ports are available via RPMSG channels exported as devices
   e.g. with rpmsgexport:
   https://github.com/andersson/rpmsgexport
 * network ports are exposed by the bam-dmux kernel driver:
   https://github.com/msm8916-mainline/linux/commits/bam-dmux

Adding support for newer Qualcomm SoCs (e.g. QRTR+IPA) could be done
in a similar way on this very same plugin.

This plugin is the first and only one that implements support for a
modem device that is "built in" the system, as opposed to external
modems that may be available via USB or PCI.

The ID_MM_PHYSDEV_UID based udev tags provided by the plugin provide
the logic to bind all the SoC ports together in the same modem object,
and therefore ID_MM_PHYSDEV_UID should not be used by users to
override the ones set by the plugin.

All "rpmsg[0-9]*" ports that are considered part of the modem are
flagged as candidate, ignoring the parent "rpmsg_ctrl[0-9]*" ports on
purpose. This setup therefore assumes that the channels have been
exported already as devices (e.g. using rpmsgexport).

libqmi 1.27.2 is required to support the "WDS Bind Data Port" message.
2020-11-20 09:24:51 +00:00
Aleksander Morgado
9397ed420d gosuncn: new plugin
For now, just with port type hints for the GM800 in MBIM mode.
2020-09-28 08:22:35 +00:00
Aleksander Morgado
55ae47a3bb quectel: add udev rules unit tester 2020-08-16 14:17:41 +02:00
Aleksander Morgado
301b6f0a64 plugins,tests: avoid cast-align errors
We can safely cast the data in a GArray to gpointer first, and then
to the pointer type we require.

  tests/test-helpers.c: In function 'mm_test_helpers_compare_bands':
  tests/test-helpers.c:41:47: error: cast increases required alignment of target type [-Werror=cast-align]
       bands_str = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len);
                                                 ^
  tests/test-helpers.c:46:56: error: cast increases required alignment of target type [-Werror=cast-align]
       expected_bands_str = mm_common_build_bands_string ((MMModemBand *)(expected_bands_array->data), expected_bands_array->len);
                                                          ^
2020-05-19 13:44:23 +02:00
Aleksander Morgado
e956bac47b log: common logging method definition for all testers and helpers 2020-04-08 17:53:42 +02:00
Aleksander Morgado
9bcadea172 log: new object logging support
So that we can provide the specific object id in every log associated
to a given object.
2020-04-08 16:35:08 +02:00
Aleksander Morgado
bdd1874f17 tests,keyfiles: add dummy test to avoid -Wunused-function warnings
If none of the plugins enabled in the build has custom keyfiles, the
common_test() method would be unused. Avoid this just by adding a new
dummy test which is always available in the keyfiles tester.
2020-02-03 16:08:40 +01:00
Aleksander Morgado
55d344ab96 tests,udev-rules: add dummy test to avoid -Wunused-function warnings
If none of the plugins enabled in the build has custom udev rules, the
common_test() method would be unused. Avoid this just by adding a new
dummy test which is always available in the udev rules tester.
2020-02-02 11:33:13 +01:00
Aleksander Morgado
53784f95aa tests,fixture: fix warnings with -Wsign-compare
tests/test-fixture.c:130:28: error: comparison of integer expressions of different signedness: ‘gboolean’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
    130 |         if (modem_expected == n_modems) {
        |                            ^~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
09080073ff build: setup plugin selection logic 2019-11-27 10:11:43 +00:00
Aleksander Morgado
d7d2b9108e foxconn: new plugin to support the T77W968
The Dell DW5821e is really a re-branded Foxconn T77W968.
2019-11-13 12:31:58 +01:00
Aleksander Morgado
b99597b594 tests,helpers: minor alignment fix 2019-10-14 15:30:29 +02:00
Aleksander Morgado
d5d0ed0b24 tests: print MM logs only on verbose test mode
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
2019-10-14 15:30:27 +02:00
Aleksander Morgado
87224e083c tests,helpers: minor indentation fix 2019-09-10 12:24:38 +02:00
Aleksander Morgado
141e69bc00 plugins,tests: setup new helper utilities for tests
For now, including a handy method from the ublox tests that allows
comparing arrays of bands that may not be sorted.
2019-09-09 12:24:43 +02:00
Aleksander Morgado
147facd2ec plugins,test: setup new simple keyfile tester 2019-04-02 12:14:03 +02:00
Aleksander Morgado
36e09ef441 fibocom: include udev rules tests 2018-08-21 17:02:39 +00:00
Ben Chan
254f2e3412 plugins: remove explicit GDestroyNotify cast on g_free / g_object_unref
g_free and g_object_unref are in form of  `void (*)(gpointer)`, which
matches the GDestroyNotify signature. An explicit GDestroyNotify cast on
g_free and g_object_unref is thus not needed.
2017-03-29 10:22:18 +02:00
Ben Chan
31655bb5a5 glib: remove invocations of g_type_init()
g_type_init() has been deprecated (and also marked with the attribute
'deprecated') since glib 2.36 as the type system is automatically
initialized. Since the minimum version of glib required by ModemManager
is 2.36, calling g_type_init() isn't necessarily in the ModemManager
code.
2017-02-03 10:05:14 +01:00
Aleksander Morgado
20074c5574 tests,dbus: check if we're asked to use an abstract socket 2016-11-23 11:02:18 +01:00
Aleksander Morgado
58c955f5f2 core: allow building and running without udev
Instead of relying on the udev daemon and GUDev to manage the devices reported
by the kernel, we can now run ModemManager relying solely on the kernel events
reported via the new ReportKernelEvent() API. Therefore, the '--no-auto-scan'
option is implicit for the ModemManager daemon when udev is disabled in the
build.

Additionally, a new custom implementation of the kernel device object is
provided, which uses sysfs to load the properties and attributes required in
each kernel device, instead of using a GUdevDevice.

The udev rule files are kept in place, and a simple custom parser is provided
which preloads all rules in memory once and then applies them to the different
kernel objects reported via ReportKernelEvent(), e.g. to set port type hints.
A simple unit test setup is prepared to validate the udev rules during the
`check' Makefile target.
2016-09-29 15:43:05 +02:00
Aleksander Morgado
7136c0b321 tests,port-context: explicitly close the socket that is added to the listener
Since GLib 2.42, the sockets that are added to socket listeners may no longer
be closed automatically when the listener is finalized. In order to avoid that,
we will keep our own socket reference and close/unref it ourselves.

This issue was preventing adding new test cases with the same port names.

    $ ./test-service-generic --verbose
    GTest: random seed: R02S889153ee0f2e59c570f4edff9caa4176
    GTest: run: /MM/Service/Generic/enable-disable
    Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'
    (MSG: DEBUG: client connection closed)
    (MSG: MESSAGE: Found modem at '/org/freedesktop/ModemManager1/Modem/0')
    ** Message: Found modem at '/org/freedesktop/ModemManager1/Modem/0'
    (MSG: DEBUG: client connection closed)
    GTest: result: OK
    GTest: run: /MM/Service/Generic/cme-error-detected
    Activating service name='org.freedesktop.ModemManager1'
    Successfully activated service 'org.freedesktop.ModemManager1'
    (MSG: FATAL-ERROR: Cannot bind socket: Error binding to address: Address already in use)

    ** (/home/aleksander/Development/foss/ModemManager/plugins/.libs/lt-test-service-generic:32043): ERROR **: Cannot bind socket: Error binding to address: Address already in use
2016-01-16 17:59:49 +01:00
Aleksander Morgado
dfd111f291 tests,test-fixture: don't rely on other threads to update dbus properties
We were wrongly using a main loop in the port context thread to manage the
global main context. That was silently making the DBus property notifications
kind of work, as they were being updated via another thread, so here we could
just sleep() and recheck the property values.

Given that having that unrelated thread updating the dbus properties of our
MMManager object is not a good thing, we'll instead totally ignore that and
fully re-create the MMManager in each iteration with the sync() method, which
has its own internal thread.
2016-01-16 17:59:49 +01:00
Aleksander Morgado
87bafa33dc tests,port-context: properly setup per-thread main context
Instead of creating a new main context to be used in the thread, we were using
the global context. So, fix that, and create a totally new pair of main context
and main loop to be used within the thread.
2016-01-16 17:59:49 +01:00
Aleksander Morgado
692e6d344a tests,port-context: joining thread takes the reference already 2014-11-14 12:13:10 +01:00
Aleksander Morgado
a72b120798 tests,fixture: fix comment 2014-10-17 15:55:12 +02:00
Ben Chan
1e5ec7e1b1 tests: increase timeout for starting ModemManager on test bus
The timeout for starting ModemManager on the test bus was 3s, which is
sufficient under normal conditions. However, when running ModemManager
tests on a build infrastructure under a heavy load, we've observed that
the timeout isn't always sufficient and that becomes the source of false
test failures. This patch increases the timeout to 30s, which shouldn't
introduce any unexpected behavior under normnal conditions while
addressing the timeout issue on heavily loaded systems.
2014-10-05 15:37:47 -05:00
Ben Chan
3d378bef5d tests: consistently use spaces for indentation 2014-05-21 11:58:03 +02:00
Ben Chan
d278f381d2 tests: fix array bound checks in process_next_command
This patch fixes the out-of-bounds array accesses in test-port-context.c,
which is detected by AddressSanitizer, by checking the index against the
array length before accessing the array.
2014-02-14 09:03:13 +01:00
Aleksander Morgado
bff2a8d2f2 tests: added support for DBus service tests
We can now run 'simulated' modems against a ModemManager running in its own
session bus.
2014-02-13 13:41:58 +01:00