This adds support for configuring a gpio in udev to control the modem
power.
To enable gpio control, specify OFONO_QUECTEL_GPIO_CHIP and
OFONO_QUECTEL_GPIO_OFFSET in the udev environment, for example:
KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \
ENV{OFONO_QUECTEL_GPIO_CHIP}="gpiochip2", \
ENV{OFONO_QUECTEL_GPIO_OFFSET}="26"
Setup GSM 07.10 multiplexing using the kernel n_gsm line discpline
driver, and use the virtual tty devices as Aux and Modem channels.
The driver supports rts/cts on the underlying serial device. This is
enabled with OFONO_QUECTED_RTSCTS udev environment, e.g.:
KERNEL=="ttymxc0", ENV{OFONO_DRIVER}="quectel", \
ENV{OFONO_QUECTEL_RTSCTS}="on"
ttyACM0 (USB interface 02) is reportedly unreliable (breaking DHCP setup)
so the recommended approach is to use ttyACM2 (USB interface 06)
exclusively.
In some case linux report 'driver' as valid yet vid and pid as NULL.
Adding NULL check to prevent seg fault.
Log:
ofonod[23829]: plugins/udevng.c:udev_start()
ofonod[23829]: plugins/udevng.c:enumerate_devices()
ofonod[23829]: plugins/udevng.c:check_usb_device() hub [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() usb [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() usbhid [03f0:034a]
ofonod[23829]: plugins/udevng.c:check_usb_device() usbhid [03f0:034a]
ofonod[23829]: plugins/udevng.c:check_usb_device() usb [1d6b:0002]
ofonod[23829]: plugins/udevng.c:check_usb_device() cdc_acm [(null):(null)]
ofonod[23829]: Aborting (signal 11) [./src/ofonod]
Since the merge of udev.c into udevng.c all cleanup function must handle
both usb devices and serial devices. Add this distinction to
check_remove(), so that is doesn't try to iterate the .serial member as
if it were a .devices list.
The return value from ofono_modem_register was not being checked. If this fails
the modem object is not setup and causes a crash. This was specifically seen
when using the mbim driver without having configured with mbim support.
Now the modem object gets destroyed properly if the modem registration fails.
Add support for the SIM7100E modem. We add a new "sim7100" plugin
because there's no other AT-based modem that has support for both GPRS
and voice calls.
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.
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
This patch simplifies and cleans up the check_usb_device function a bit
by doing the two following (slightly intertwined) things:
1) The parent "usb_device" is searched for early in this function and this
device will always have the ID_VENDOR_ID and ID_MODEL_ID properties.
As such, we can get them from this device and thereby be certain that
we _always_ have them available.
2) The logic of iterating the vendor_list table is cleaned up. It's
easier to follow and won't be any less efficient.
Add a new function setup, based on telit, to handle Gemalto P-family
discovery. The setup looks for USB interfaces:
application=/dev/ttyUSB2
gps=/dev/ttyUSB1
modem=/dev/ttyUSB3
When the modes are modified with AT^SETPORT="FF;12,1,16", this modem
and pcui will appear using different ids. Update the interfaces
identifier accordingly.
The huawei E3372 exposes two USB tty at /dev/ttyUSB0 and /dev/ttyUSB1
/dev/ttyUSB1 is properly detected as modem.
/dev/ttyUSB0 is the pcui.
lsusb shows 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
Udevng layer is changed in order to support Sierra QMI modems like
MC73cxx. Identically to Huawei modems, these modems are parsed by
setup_sierra. If QMI interface is detected, the Gobi modem driver is
selected.
Unfortunately, MC73xx chips seem to have a broken QMI UIM interface.
The qmimodem-legacy is so forced in setup function.