uqmi: add support for MBIM devices with QMI service
authorBjørn Mork <bjorn@mork.no>
Sun, 21 Aug 2016 00:01:09 +0000 (02:01 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 23 Aug 2016 11:38:27 +0000 (13:38 +0200)
commite69bf24b00d8bc15172644e52ead4aae8fdb7257
treeac9ea9d5f0e4c1c6d941b554ba034e70e3d5f234
parentf94b7575aa919e5a090b2e945c62273b72c87ad0
uqmi: add support for MBIM devices with QMI service

Many Qualcomm based devices offer a QMI service when running in MBIM
mode. This is useful for a number of requests which have no MBIM
counterpart.

This implementation is very basic, simply wrapping the QMI requests
in an MBIM command. It is up to the user to make sure that the MBIM
command sequence is valid, using a mix of umbim and uqmi requests.

umbim must be used to send "OPEN" before uqmi can issue any MBIM
requests. Example:

1. use umbim to open the session, using the '-n' option:

$ umbim -d /dev/cdc-wdm0 -n caps
  devicetype: 0003 - remote
  cellularclass: 0001
  voiceclass: 0001 - no-voice
  simclass: 0002
  dataclass: 003C
  smscaps: 0003
  controlcaps: 0001
  maxsessions: 0008
  deviceid: 0145820007xxxxx
  firmwareinfo: SWI9X30C_02.08.02.00
  hardwareinfo: EM7455

2. use uqmi to send an MBIM request, using the '-m' option:

$ uqmi -m -d /dev/cdc-wdm0 --get-serving-system
{
        "registration": "registered",
        "plmn_mcc": 242,
        "plmn_mnc": 1,
        "plmn_description": "TELENOR",
        "roaming": false
}

3. use umbim to close the open session, using the '-t X' option:

$ umbim -d /dev/cdc-wdm0 -t 2 caps
  devicetype: 0003 - remote
  cellularclass: 0001
  voiceclass: 0001 - no-voice
  simclass: 0002
  dataclass: 003C
  smscaps: 0003
  controlcaps: 0001
  maxsessions: 0008
  deviceid: 0145820007xxxxx
  firmwareinfo: SWI9X30C_02.08.02.00
  hardwareinfo: EM7455

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Felix Fietkau <nbd@nbd.name> [cleanup, portability fixes]
CMakeLists.txt
dev.c
main.c
mbim.c [new file with mode: 0644]
mbim.h [new file with mode: 0644]
uqmi.h