The nokia-gpio plugin should not try to create symlinks to relevant gpio
pins under /dev/cmt, since the location it is looking is no longer
correct on newer kernels and it might change again in the future. This
patch removes code from nokia-gpio that tries to create a symlink.
Users will now need to symlink the modem gpios to /dev/cmt themselves.
On the 4.13 kernel, this can be done by, for example, adding a udev rule
to:
# ln -sf /sys/bus/hsi/devices/n900-modem /dev/cmt
The HUP results in errors in gatio which will deref parts
of the AT channel. This makes it impossible to recover and
send further AT commands after the HUP.
This is needed to find out the maximum fragment size that this device
supports. The minimum length specified in the spec is 64, however 512
bytes is recommended.
We also attempt to parse how many simultaneous commands can be
outstanding at a given time. In theory MBIM supports multiple
outstanding commands through the use of transaction-id matching, but it
seems some devices only support a single outstanding command at a time.
This patch fixes up some fallout from the merging of the udev and udevng
modules.
i) The 'serial' modems in question are not necessarily serial modems at
all; for example, the N900 ISI modems appear as network devices and don't
have a devnode. This patch relaxes the requirement that a devnode exist.
ii) The modem driver was being set to 'legacy', which is a remnant of
an earlier approach to merging these modules. The driver needs to be
properly set to the value of the OFONO_DRIVER property in order for the
setup function to be found.
iii) The serial modem's private data was being added to the modem
structure incorrectly...
In particular point iii) above shows that there is essentially nobody
using these devices which makes modifications in this area tricky.
Gemalto modems have hardware related commands, allowing to monitor voltage
and temperature. These parameters will be accessible on DBus interface:
org.ofono.HardwareMonitor.
- Create the DBus method table with one entry: GetStatistics. This method
would return temperature and voltage values.
- Create a dedicated structure to handle the DBus methods.
- Create enable/disable functions to handle DBus interface registration.
This adds handling for ServicesResolved signal which tells when BlueZ
is done resolving the device services so the code will no longer ignore
devices that got its services resolved after Paired signal.
In case the UUIDs are not updated, as they are still being resolved, when
Paired property changes a modem will never be registered.
In order to fix this problem allow modems to be registered directly
during NewConnection.
This follows the same pattern as the Telit QMI modems, routing the
setup through a QMI driver. I think this can be cleaned up somehow,
but for now this at least provides support for these two modem models
so that others can aid in testing.
...and disable old udev code by shorting it out in it's init() function.
The check_device function is augmented to differentiate between USB
and serial devices:
- if the device sits on a USB bus, the device is handled as before
- if not, an attempt is made to handle the device as a serial device
This adds, but does not hook up, support for simple serial modems. These
modems generally have only a single device node so are simpler than the
USB devices which generally have different device nodes for different
functions. These modems are currently handled by udev.c, but this
functionality will allow to remove that module completely in a later patch.
- A new "device_info" type is created called serial_device_info
- the function add_serial_device sets up a modem_info structure and a
serial_device_info for the device
- A reference to the device's udev node is saved in the device info
- The device driver is retrieved from the OFONO_DRIVER environment variable
which needs to be set up by some udev rule
- Setup functions are added for these types of devices: a common function
setup_serial_modem covers the generic (simple) case, whereas modems
with special requirements are given their own setup functions to handle
the special bits
- Modem destroy needs to know the "device_info" type in order to clean
up properly, so a 'type' value is set on the modem_info structure to
guide selection of the proper cleanup function