Commit Graph

8078 Commits

Author SHA1 Message Date
Lukasz Nowak 4219fcf7bc qmimodem: read ss_info at probe time
LTE modems (observed with Telit LE910 V1) can power on
already registered to a network. In that case, the SS_INFO
change notification will never arrive, and the gprs driver
will never be marked as attached.

To avoid this situation, read SS_INFO at probe time, and if
registered, mark the gprs driver as attached.
2017-03-23 10:25:23 -05:00
Denis Kenzior 8559a29d77 qmimodem: Fix warning
This was introduced by the previous patch:
drivers/qmimodem/devinfo.c: In function ‘get_ids_cb’:
drivers/qmimodem/devinfo.c:129:14: error: implicit declaration of function ‘strcmp’ [-Werror=implicit-function-declaration]
  if (!str || strcmp(str, "0") == 0) {
2017-03-23 10:24:34 -05:00
Lukasz Nowak a2a8e71db2 qmimodem: telit LE910 V1 - fix ESN string
Telit QMI modems report "0", rather than a NULL string,
if ESN is not available.
2017-03-23 10:23:50 -05:00
Christophe Ronco 26aba4612c huawei: reopen modem channel if it disconnects
On E3372 after a GPRS disconnection, modem AT channel (used by PPP) gets
disconnected (G_IO_HUP and G_IO_ERR are detected in received_data
in gatio.c).
After that all connection attempts fail because we are not able to send
any AT commands on modem channel (it is closed).

With this patch, when this behavior is detected, we close gprs context
driver, reopen AT channel and gprs context driver.
2017-02-21 11:13:51 -06:00
Christophe Ronco 94fd4d804d provision: add plugin to provision from config file
This plugin allows to provision gprs-context data based on MCC and MNC.
This is useful when provisioning using mbpi fails (either because you
are using a private APN or because there are multiple internet type context
for your operator in mbpi database).
Config file is STORAGEDIR/provisioning.
Config file should look like that:
[operator:MCC1,MNC1]
internet.AccessPointName=apn1
internet.Username=myUsername
internet.Password=myPassword
internet.AuthenticationMethod=pap
internet.Protocol=ipv6
[operator:MCC2,MNC2]
internet.AccessPointName=apn2

The only mandatory parameter for each operator is internet.AccessPointName.

Parameter description:
internet.AccessPointName: APN
internet.Username: Username
internet.Password: Password
internet.AuthenticationMethod: authentication method.
 Possible values are:
  - pap
  - chap
 Default is chap if unset.
internet.Protocol: protocol
 Possible values are:
  - ip: ipv4
  - ipv6
  - dual
 Default is ip if not set.

All parameters are prefixed with internet to be able to extend this plugin
to other type of contexts (MMS, ...).
2017-02-21 11:08:27 -06:00
Christophe Ronco 89c92e7277 qmimodem: fix sim file reading on MC7304
Command read_file_info on MC7304 always fails.
Using qmicli or AT command, I am able to read file info.
Qmicli command is:
qmicli -d /dev/cdc-wdm0 --uim-get-file-attributes=0x3f00,0x7fff,0x6fad
[(null)] Successfully got file '/dev/cdc-wdm0' attributes from the UIM:
Card result:
        SW1: '0x90'
        SW2: '0x00'
File attributes:
        File size: 4
        File ID: 28589
        File type: transparent
        Record size: 0
        Record count: 0
        Read security attributes: (always) (null)
        Write security attributes: (single) adm
        Increase security attributes: (always) (null)
        Deactivate security attributes: (single) adm
        Activate security attributes: (single) adm
        Raw:    62:17:82:02:41:21:83:02:6F:AD:8A:01:05:8B:...

After a check of parameters sent by qmimodem driver and qmicli,
the only difference is on parameter "Session Information".
Session type sent by qmimodem driver is 'Card on slot 1'.
Session type sent by qmicli command is 'primary-gw-provisioning'.
Changing session type in qmimodem driver fixed problem (on this modem).

Comparing with what is done by qmili command
2017-02-17 11:16:54 -06:00
Christophe Ronco 8e929df4f5 atmodem: use ATD99 to enter data state when needed
Some modems do not support AT+CGDATA="PPP",X to enter data state.
Use AT+CGDATA=? to detect these modems and for them use ATD*99***X#
to enter data state.
2017-02-16 11:52:49 -06:00
Christophe Ronco d43e48ae73 gprs: fix error check of gprs_cid_alloc function
When there is no context id available, idmap_alloc and
gprs_cid_alloc return max + 1.
2017-02-15 14:39:36 -06:00
Piotr Haber 69c67fce7f telit: register SIM if it goes straight to ready
SIM without PIN goes straight to state 3 (INSERTED and READY)
on some modem/firmware versions.
2017-02-08 10:55:09 -06:00
Denis Kenzior 149002c110 rilmodem: Fix warning
drivers/rilmodem/stk.c: In function ‘ril_stk_probe’:
drivers/rilmodem/stk.c:210:18: error: ‘data’ is used uninitialized in
this function [-Werror=uninitialized]
  struct cb_data *cbd = cb_data_new(stk, NULL, data);
2017-02-07 11:05:09 -06:00
Denis Kenzior f48025d841 AUTHORS: mention André's contributions 2017-02-07 10:58:41 -06:00
André Draszik 177e39e44b plugins: telit: send AT&C0 on both channels
At least firmware version 12.00.405 on the UE910-EUR otherwise
closes the AT command port whenever the PPP connection is
dropped, and we'd be left in a funny state.
2017-02-07 10:58:07 -06:00
Antara Borwankar 61453d8688 ril_intel: Add support for stk 2017-02-07 10:56:57 -06:00
Antara Borwankar 058a293de6 rilmodem: Send needed RIL request for stk init
sending RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING after
stk atom is created so that modem will inititialize
sim toolkit by sending terminal profile to sim.
2017-02-07 10:56:46 -06:00
Piotr Haber 3ae33b2dd6 telit: add support for UE866 2017-02-02 11:58:51 -06: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 ccd49f3fe6 plugins: rename xe910 to telit
Unify old telit and xe910 plugins.
Dropping support for Bluetooth SAP.
Add support for UC864 family.
2017-02-02 11:51:19 -06:00
Christophe Ronco cf3835f0f3 qmimodem: change kernel driver data format if needed
During gprs-context driver probe function, check kernel device driver
data format and modem low level data format.
If they are different, align kernel device driver data format on
modem low level data format.
If an error occurs during this process, continue probing without error.
This is inspired by what is done in qmicli and qmi-network (package
libqmi).
2017-02-02 11:48:38 -06:00
Denis Kenzior 0fbc802845 qmi: Fix typo 2017-02-02 11:41:36 -06:00
Christophe Ronco 8dffd365a2 qmimodem: get/set kernel device driver data format
Add a way to get and set data format expected by kernel device driver.
This is inspired by what is done in qmicli (package libqmi).
It does not use QMI protocol but a sysfs exported by kernel driver.
To use this feature, kernel version must be equal or more than 4.5.
2017-02-02 11:41:27 -06:00
Denis Kenzior 7b0671edfb tools: Remove unused qmi tool 2017-02-02 11:41:27 -06:00
Piotr Haber 6e4bf596e9 xe910: support for Telit LE910V2 modem
LE910V2 is next generation Telit LTE modem.
It supports 3GPP Rel. 9 LTE Cat. 4 over multiple bands.
2017-01-27 20:37:05 -06:00
Piotr Haber bf3890a445 telitmodem: support for CDC-NCM network adapter
Network Control Model is a new Communication Device Class
protocol for exchanging Ethernet frames over USB.
NCM is intended to be used with high-speed network
attachments such as HSDPA and LTE data services.
2017-01-27 20:35:50 -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 a88aaaac17 plugins: Handle HE910 and UE910 variants
Telit modems HE910 and UE910 share the same USB
vendor and device IDs (1bc7:0021) but they are
different devices.
HE910 is HSPA Class 14/6 and UE910 is Class 8/6.
Both come in voice-enabled variants.
HE910 also comes in variants with built-in GPS.
2017-01-26 13:29:40 -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
Piotr Haber 50f1dfcb24 qmimodem: send authentication credentials
Pass authentication method, user and password
to QMI WDS service.
2017-01-26 09:21:07 -06:00
Piotr Haber fe24e9a61e doc: description of Telit LE910V2 network setup
NCM network interface on LE910V2 modem needs to be
configured in a specific way after connection is established.
2017-01-25 10:37:54 -06:00
Denis Kenzior f4518701e9 doc: Add 'switch' to item M1 2017-01-25 10:07:18 -06:00
Denis Kenzior 9148525c21 AUTHORS: Mention Piotr's contributions 2017-01-25 10:00:34 -06:00
Piotr Haber c493491c1a atmodem: add LTE to Telit #PSNT status parser
Network type of 4 in Telit #PSNT command response
denotes LTE network
2017-01-25 10:00:07 -06:00
Vincent Cesson 8d330087cf gemalto: Add location reporting support 2017-01-19 13:34:45 -06:00
Vincent Cesson c0c7c92a82 drivers: Add gemaltomodem driver to handle GNSS
Add a new location-reporting driver for Gemalto Cinterion modems based
on telit implementation + use it in gemalto plugin. It supports
activation of GNSS engine (Request) with command AT^SGPSC. This driver
is tested on PHS8. NMEA frames are accessible on /dev/ttyUSB1.
2017-01-19 13:34:36 -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
Christophe Ronco d6866f2f90 qmimodem: query_passwd_state can be retried
Retry command QMI_UIM_GET_CARD_STATUS during query_passwd_state if a
temporary error status has been detected.
This happens with a MC7430 modem when query_passwd_state is called just
after PIN is entered.
2017-01-16 22:25:23 -06:00
Vincent Cesson 92c4b831dc udevng: Add Gemalto P-family detection
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
2017-01-16 22:25:16 -06:00
Vincent Cesson 85c49528d0 plugins: Add Gemalto plugin for Cinterion P-family
Actual cinterion plugin is not compliant with newer Gemalto modems.
Gemalto plugin is based on cinterion with a custom struct to handle the
interfaces Application and Modem.
2017-01-16 22:25:16 -06:00
Denis Kenzior fded53d377 AUTHORS: Mention Vincent's contributions 2017-01-13 09:39:08 -06:00
Vincent Cesson 4edc9fd57f atmodem: Fix CGDCONT result parsing.
CGDCONT result parsing fails if first list contains several ranges. For
example with modem Cinterion PHS8:

 AT+CGDCONT=?
 +CGDCONT: (1-17,101-116),"IP",,,(0),(0-4)

Solution: read first range and jump to second list instead of trying to
close the brackets.
2017-01-13 09:38:43 -06:00
Christophe Ronco b4cbe8d41a qmimodem: add pin_send feature
Add ability to send PIN to a QMI modem using QMI_UIM_VERIFY_PIN command.
This has been tested on MC7304 and MC7430 modems.
2017-01-11 09:57:53 -06:00
Christophe Ronco 6a1d111e21 qmimodem: get password state from modem
Password state and number of retries asked to modem using
QMI_UIM_GET_CARD_STATUS command rather than remembered after initial
QMI_UIM_GET_CARD_STATUS command.
2017-01-11 09:57:06 -06:00
Christophe Ronco 4b38259a6f udevng: Sierra modems use SIM driver 2017-01-10 11:26:23 -06:00
Christophe Ronco 2505d96544 qmimodem: Add read_imsi to qmimodem sim driver
Add read_imsi feature to qmimodem sim driver.
This is based on DMS service.
On MC7430, this is mandatory to be able to use this driver for GPRS
connection because reading IMSI via EF reads fails.
2017-01-09 12:31:35 -06:00
Christophe Ronco c5fbfaa55f sim: backup driver read_imsi by IMSI via EF read
If read_imsi driver function fails, try to obtain IMSI via EF read
2017-01-09 12:25:00 -06:00
Slava Monich aaf70beb06 sim: Stop facility lock query sequence on removal
SIM card can be removed while the query is in progress. There's
still a remote possibility that SIM card is removed and inserted
back while the query is pending, that would start the second query
sequence and end up invoking sim_initialize() twice. But at least
these checks reduce the probability of something like that happening.
2017-01-06 12:25:48 -06:00
Christophe Ronco 567e5ec9fc qmimodem: fix QMI notification messages handling
QMI notification messages handlers are never called on MC7430 without this fix.

- Do not test transaction id before calling notification handler.  On MC7430,
notification messages contain a not null transaction id (starts with 1,
increased at each message for a particular client).
- On MC7304 transaction id in notification messages is always 0.
2016-12-30 18:38:29 -06:00
Denis Kenzior a8f4e23c75 AUTHORS: Mention Christophe's contributions 2016-12-30 18:38:03 -06:00
Christophe Ronco f15c33ed20 qmimodem: fix get signal strength
Get current signal strength (type: 0x01), not list of other signals strength
(0x10)

Without this fix:
- I can't get a signal strength on MC7430 because list does not exist
	(only one signal strength).
- On MC7304, result is wrong
2016-12-30 18:37:30 -06:00
Slava Monich a1df13a3bc smsutil: Prevent invalid access in cbs_decode_text
Valgrind was complaining about it like this:

==18099== Conditional jump or move depends on uninitialised value(s)
==18099==    at 0x4C32281: strspn
==18099==    by 0x41286B: cbs_decode_text (smsutil.c:4140)
==18099==    by 0x40675C: test_cbs_encode_decode (test-sms.c:1417)
2016-12-30 18:19:21 -06:00
Slava Monich a011fea4a4 unit: test-sms: Fix memory leaks in the unit test 2016-12-30 18:13:06 -06:00