Commit Graph

128 Commits

Author SHA1 Message Date
Lars Poeschel 285fad8f39 quectel: Power on/off with a gpio pulse
Current implementation uses a gpio level of 1 for powering on quectel
modems using a gpio and a level of 0 for powering off.
Normally quectel modems are powered on or off by a gpio pulse on their
PWR_KEY pin. They turn on by the first pulse and turn then off by the
next pulse. The pulse length varies between different modems.
For power on the longest I could in the quectel hardware is "more than
2 seconds" from Quectel M95 Hardware Design Manual.
For Quectel EC21 this is ">= 100 ms".
For Quectel MC60 this is "recommended to be 100 ms".
For Quectel UC15 this is "at least 0.1 s".
For power off the four modems in question vary between a minimum pulse
length of 600-700ms.
This implements a 2100ms pulse for power on and 750ms for power off.

If you have some special circuitry that powers your modem by gpio level
and you need the old behaviour, you can switch to gpio level powering
by setting environment variable OFONO_QUECTEL_GPIO_LEVEL. The gpio goes
to high level for the modem to power on and to low level if it should
power off.
2020-10-06 15:42:46 -05:00
Pavel Machek 07e00b7215 droid 4: Add probing.
Probe Droid 4 modem. This should result in basic support working.
2020-09-15 10:24:37 -05:00
Sergey Matyukevich 71ceaf93fd plugins: udevng: detect gemalto network interfaces
Some gemalto modems, including ELS81x, may provide more than one
USB ethernet interface. Detect and save both network interfaces
rather than only the last one.
2020-08-19 09:50:41 -05:00
Sean Nyekjaer e4d77210ea udevng: Add support for Quectel BG96 modem 2020-07-13 14:05:00 -05:00
Sergey Matyukevich 28d4be1af2 plugins: udevng: detect Centirion ELS81x modem
Enable detection of Centirion ELS81x modem.
2020-06-29 10:20:01 -05:00
Martin Hundebøll ab9cb3b47c udevng: Support quectel MUX settings 2019-10-11 12:19:52 -05:00
Antara Borwankar 26fb0623dc udev: Adding PCIe as a subsystem in udev
Adding support for enumerating PCIe types of modems in ofono
2019-09-30 11:28:34 -05:00
Jonas Bonn 2bb87d88ff udevng: detect LARA R2 series 2019-07-19 02:47:29 -05:00
Martin Hundebøll 2f58421b64 quectel: support gpio to power on/off the modem
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"
2019-07-12 10:50:51 -05:00
Martin Hundebøll 23a09f8559 quectel: add basic support for serial connected modems
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"
2019-07-12 10:47:10 -05:00
Stefan Herbrechtsmeier c3b7756907 udevng: add SIMCom SIM7600 modem support
The SIMCom SIM7100 and SIM7600 modem use the same vendor and product id
but require different drivers (sim7100 vs gobi).
2019-05-08 09:46:39 -05:00
Jonas Bonn 85c64b1784 udevng: detect ublox TOBY L4
ttyACM0 (USB interface 02) is reportedly unreliable (breaking DHCP setup)
so the recommended approach is to use ttyACM2 (USB interface 06)
exclusively.
2019-03-13 16:39:16 -05:00
Jonas Bonn c2f9faef1a udevng: ublox: Model string no longer used 2019-03-13 16:29:09 -05:00
Antara Borwankar fae77b52c6 udevng: Detect multiple network interfaces for xmm7xxx 2019-02-13 08:33:58 -06:00
Nandini Rebello 157258eb2d udevng: enhance udev detection for intel 7xxx modems
Handle newer 7xxx modem enumeration based on ProductId.
Preserving the previous gen support too.
2018-10-31 14:20:00 -05:00
Jonas Bonn ab4460690d mbim: remove unused modem data
Neither the Vendor nor Model strings are used by the mbim plugin.
2018-10-29 13:34:07 -05:00
Pavel Machek 33be5732f1 udevng: Move debug print to more useful place
in setup_gobi()
2018-09-27 17:26:49 -05:00
Anirudh Gargi f2ebcf35d7 udev:fix seg fault in case of vid and pid is NULL
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]
2018-09-10 11:04:11 -05:00
Martin Hundebøll 92a80db13f udevng: fix removal of serial devices
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.
2018-08-24 11:26:42 -05:00
Denis Kenzior 08796aa391 udevng: Fix SIM900 detection 2018-06-19 12:37:15 -05:00
Varun Gargi 0ee376ccab udevng: remove vendor ID to make it generic for intel modem 2018-05-23 08:55:39 -05:00
James Prestwood 34ff57e083 plugins: fixed crash in udevng
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.
2018-05-22 15:39:42 -05:00
Bob Ham 1d63b1d35f plugins: Add support for SIM7100E by SIMCom
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.
2018-04-30 11:17:47 -05:00
Bassem Boubaker 76b5a4044f gemalto: Add more details in setup_gemalto comment
ALS3, PLS8-E and PLS8-X have same vid/pid with same enumeration process
2018-03-16 12:39:56 -05:00
Gabriel Lucas 245d6a8a77 gemalto: add detection of ALS3 modem
The product ID is added to the list of
modems to be detected by Ofono.
The gemalto plugin is used to handle the
ALS3 modem.
2018-03-15 11:54:33 -05:00
Christophe Ronco 1df92289d4 udevng: Add modem string SystemPath 2018-02-20 11:09:25 -06:00
Denis Kenzior 2ce556cb73 udevng: Save off MBIM modem's VID/PID 2017-11-08 21:02:22 -06:00
Denis Kenzior 868ce1536b udevng: Store MBIM descriptors file 2017-10-05 11:08:38 -05:00
Denis Kenzior 4a6007ba2d udevng: Add basic detection for MBIM
Currently only Telit LN930 has been tested to work
2017-10-05 11:08:38 -05:00
Ankit Navik 215a6a1df3 udevng/xmm7xxx: Allow to detect xmm7xxx series modems
The Intel xmm7xxx series modem uses id as 8087:0930
2017-09-13 10:30:08 -05:00
Jonas Bonn dd3a4768b0 udev: isi modems do not use 'Device' property
Neither the n900 nor u8500 drivers use this property so there's currently
no need to set it in the setup function.
2017-09-12 12:28:36 -05:00
Jonas Bonn 29c5cd238b udev: fixes for detection of non-USB modems
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.
2017-09-12 12:28:36 -05:00
Jonas Bonn 1f5aa70b53 udev: fix quectelqmi gps interface
Using location-reporting requires both the 'aux' and 'gps' interfaces;
the GPS interface is interface 1, not 2.
2017-09-08 11:05:45 -05:00
Alexander Couzens 4e495ab7f4 plugins/udevng: use else if instead of if
The same variable is checked in two `if's.
2017-09-07 16:52:43 -05:00
Alexander Couzens 0b10110a87 udevng: use first cdc-wdm interface for sierra qmi
Using the voice firmware on a mc7304 the modem
stopped accepting qmi messages on the second
cdc-wdm interface.
2017-09-07 16:44:40 -05:00
Alexander Couzens fe8fa75691 udevng/gobi: allow to detect ec20 tty devices
The Quectel EC20 uses the same usb id as some gobi 2000 modules (05c6:9215).
2017-05-04 12:38:58 -05:00
Alexander Couzens 3b5aedc8ab udevng/gobi: use subsystem as first identification
Using kernel 4.10 with systemd 232 on archlinux the detection of
a gobi 2000 doesn't detect the qmi/cdc-wdm interface.

The device is detected as follows:

[devnode interface number label sysattr subsystem]
/dev/cdc-wdm1 255/255/255 00 (null) (null) usbmisc
wwan1 255/255/255 00 (null) (null) net
/dev/ttyUSB5 255/255/255 01 (null) (null) tty
/dev/ttyUSB6 255/255/255 02 (null) (null) tty
/dev/ttyUSB7 255/255/255 03 (null) (null) tty
2017-05-04 12:37:51 -05:00
Alexander Couzens cab919d699 udevng/gobi: improve debug output
Add info->sysattr and info->subsystem to the log message.
2017-05-04 12:37:34 -05:00
Jonas Bonn e52d224d9a Add support for Quectel EC21/25 modems
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.
2017-04-20 12:45:11 -05:00
Jonas Bonn 174eddc80d udevng: remove 'option' driver setup
No driver named 'option' exists so this device can never be instantiated.
2017-03-31 18:15:19 -05:00
Jonas Bonn bf20f0df18 udevng: get properties from interface
Device properties are generally on the device, on the USB interface
descriptor, or the on the USB device descriptor.
2017-03-29 09:56:28 -05:00
Jonas Bonn 1b28cb5cc6 udevng: hook up legacy devices
...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
2017-03-29 09:55:51 -05:00
Jonas Bonn 90c8885f4f udevng: match on the hsi subsystem for legacy devices 2017-03-29 09:55:33 -05:00
Jonas Bonn 3ac449e25f udevng: add serial device handling functions
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
2017-03-29 09:53:48 -05:00
Lukasz Nowak e1f42cb68a udevng: add Telit LE910 V1 support
Tested with LE910-SVG and Verizon.
2017-03-26 22:41:50 -05:00
Jonas Bonn 03e1ec2f66 udevng: simplify logic in check_usb_device
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.
2017-03-26 20:42:27 -05:00
Piotr Haber 5c0a8e531e udevng: unify telit and xe910
Unified setup for Telit devices using
usbserial and cdc_acm drivers.
2017-02-02 11:58:13 -06:00
Piotr Haber 0a7e4c0716 udevng: setup of Telit LE910V2
Setup LE910V2 in default USB composition (1bc7:0036)
with 6 CDC-ACM serial ports and 1 CDC-NCM network adapter.
2017-01-27 20:22:59 -06:00
Piotr Haber 36d18310df plugins: rename he910 to xe910
In preparation for more generic support
of Telit xE910 family.
2017-01-26 13:10:18 -06:00
Vincent Cesson e8c80cbe8b udevng: complete gemalto setup
Complete the Gemalto setup with cdc_wdm and qmi,
so all enumerated devices are associated with gemalto.
2017-01-18 20:19:17 -06:00