aboutsummaryrefslogtreecommitdiff
path: root/src/mm-broadband-modem.c
AgeCommit message (Collapse)Author
2020-01-30broadband-modem: remove unused methodAleksander Morgado
The logic in open_ports_initialization() was included in the generic ports_context_open() method, and the method was not being used anywhere.
2020-01-30broadband-modem: fix warnings with -Wsign-compareAleksander Morgado
mm-broadband-modem.c: In function ‘setup_ports’: mm-broadband-modem.c:9955:23: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare] 9955 | for (j = 0; j < array->len; j++) { | ^ ...
2020-01-30broadband-modem: rework +CIEV URC handlingAleksander Morgado
Switch to use the helper methods to parse strings and numbers from match info results. Also, avoid warnings with -Wsign-compare.
2020-01-30broadband-modem: fix warnings with -Wswitch-defaultAleksander Morgado
mm-broadband-modem.c: In function ‘access_tech_and_mask_new’: mm-broadband-modem.c:2431:9: error: switch missing default case [-Werror=switch-default] 2431 | switch (ctx->sysmode) { | ^~~~~~
2020-01-30broadband-modem: fix warnings with -Wswitch-enumAleksander Morgado
mm-broadband-modem.c: In function ‘cgev_process_detach’: mm-broadband-modem.c:2845:5: error: enumeration value ‘MM_3GPP_CGEV_UNKNOWN’ not handled in switch [-Werror=switch-enum] 2845 | switch (type) { | ^~~~~~ ...
2020-01-30broadband-modem: plug memleak if mm_parse_csim_response() failsAleksander Morgado
The GError would be leaking.
2020-01-30broadband-modem: fix warnings with -Wdiscarded-qualifiersAleksander Morgado
mm-broadband-modem.c: At top level: mm-broadband-modem.c:551:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 551 | { "+CGSM", MM_MODEM_CAPABILITY_GSM_UMTS }, | ^~~~~~~ ...
2020-01-30broadband-modem: fix warnings with -WshadowAleksander Morgado
mm-broadband-modem.c: In function ‘modem_create_bearer’: mm-broadband-modem.c:421:42: error: declaration of ‘properties’ shadows a global declaration [-Werror=shadow] 421 | MMBearerProperties *properties, | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ mm-broadband-modem.c:132:20: note: shadowed declaration is here 132 | static GParamSpec *properties[PROP_LAST]; | ^~~~~~~~~~
2020-01-06broadband-modem: retry +COPS=1,2,<mccmnc> with current charsetAleksander Morgado
If the modem (e.g. u-blox LARA) returns a "Not supported" error when attempting to run +COPS=1,2,<mccmnc> with the MCCMNC encoded in ASCII (and current charset is different, e.g. UCS2), then attempt to re-run the same command with the MCCMNC encoded in the explicit current charset. <debug> (ttyACM0): --> 'AT+COPS=1,2,"21404"<CR>' <debug> (ttyACM0): <-- '<CR><LF>+CME ERROR: 4<CR><LF>' <debug> Got failure code 4: Operation not supported <debug> (ttyACM0): --> 'AT+COPS=1,2,"00320031003400300034"<CR>' <debug> (ttyACM0): <-- '<CR><LF>+CME ERROR: 111<CR><LF>
2020-01-06broadband-modem: +COPS=? response may give strings in UCS2Aleksander Morgado
If the charset selected via CSCS is UCS2, the modem may decide to return all the strings in the +COPS=? response in UCS2: <debug> (ttyACM0): --> 'AT+COPS=?<CR>' <debug> (ttyACM0): <-- '<CR><LF>+COPS: (2,"004D006F007600690073007400610072","004D006F007600690073007400610072","00320031003400300037",7) <debug> Found network '00320031003400300037' ('004D006F007600690073007400610072','004D006F007600690073007400610072'); availability: current, access tech: lte
2019-12-04broadband-modem: trivial fix in logging +CLIP settingAleksander Morgado
2019-10-17broadband-modem: don't cache voice support check AT commandsAleksander Morgado
The result of these commands may be different before and after SIM-PIN unlock, so never cache them.
2019-10-17broadband-modem: ignore SIM-related errors in voice support checkAleksander Morgado
2019-10-17broadband-modem: keep ports context open while in-callAleksander Morgado
This is so that we can receive and process URCs even if the modem is not fully enabled yet.
2019-10-17broadband-modem: reorder generic port context logic in sourcesAleksander Morgado
2019-10-17broadband-modem: new generic ports_context_open()Aleksander Morgado
Used during initialization, enabling and sim hotswap context setup. The secondary AT and QCDM ports will only be open during enabling.
2019-10-17broadband-modem: skip redundant ATE0/AT+CMEE=1 settingsAleksander Morgado
These are already given in the logic behind the "MM_PORT_SERIAL_AT_INIT_SEQUENCE" property: (ttyACM1): --> 'ATE0<CR>' (ttyACM1): <-- '<CR><LF>OK<CR><LF>' (ttyACM1): --> 'ATV1<CR>' (ttyACM1): <-- '<CR><LF>OK<CR><LF>' (ttyACM1): --> 'AT+CMEE=1<CR>' (ttyACM1): <-- '<CR><LF>OK<CR><LF>' (ttyACM1): --> 'ATX4<CR>' (ttyACM1): <-- '<CR><LF>OK<CR><LF>' (ttyACM1): --> 'AT&C1<CR>' (ttyACM1): <-- '<CR><LF>OK<CR><LF>' (ttyACM1): --> 'ATE0<CR>' --> redundant (ttyACM1): <-- '<CR><LF>OK<CR><LF>' (ttyACM1): --> 'AT+CMEE=1<CR>' --> redundant (ttyACM1): <-- '<CR><LF>OK<CR><LF>'
2019-10-17broadband-modem: voice interface available in failed/locked stateAleksander Morgado
2019-10-17broadband-modem: new initialization step when failed/lockedAleksander Morgado
Instead of using the firmware step as fallback when the modem goes into failed or locked state, use an independent step in the initialization state machine, just to make it clearer.
2019-10-11iface-modem: allow plugins to disable access technology pollingAleksander Morgado
Same as with the signal quality polling, we may want to disable explicitly the access technology polling if we can rely on plugin specific URCs for this purpose.
2019-10-11simtech: disable CMER/CIND support explicitlyAleksander Morgado
The logic to setup the generic +CIND indications in the SIM7600E seems to end up breaking connectivity when in TTY+PPP mode. If we issue the AT+CMER=3,0,0,1 command, this will end up in the modem not replying a correct CONNECT response to the ATD command. Let's disable these +CIND indications completely in the simtech plugin, as there is even no AT command reference saying those are supported. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/144
2019-10-11broadband-modem: allow disabling +CIND URC setupAleksander Morgado
Not all modems support correctly +CIND URCs and +CMER settings.
2019-10-11broadband-modem: avoid using MM_CORE_ERROR_CANCELLEDAleksander Morgado
2019-09-23broadband-modem: shutdown firmware interface on dispose()Aleksander Morgado
2019-09-16broadband-modem: do not add +CSQ response to cacheAleksander Morgado
Otherwise, the +CSQ reported signal quality will never change! Fixes edc117406888f489d4ebd29b6d08ea67d60bb99c
2019-09-15iface-modem: report last attempt to load_unlock_required implementationsAleksander Morgado
The load_unlock_required() step will be automatically retried by the generic interface logic unless some specific errors happen (e.g. it won't be retried if a SIM missing error is received). This patch allows telling the implementation of the method whether this time being run is the last one before reporting a hard error or not.
2019-09-13broadband-modem: increase default CPIN? timeoutAleksander Morgado
The Telit LE922 seems to take just a bit more than 3s to reply. Let's increase it up to 10s to be on the safe side. <debug> [1568385270.124866] (ttyUSB3): --> 'AT+CPIN?<CR>' <debug> [1568385273.396659] Couldn't check if unlock required: 'Serial command timed out' <warn> [1568385273.396847] Modem couldn't be initialized: Couldn't check unlock status: Serial command timed out <info> [1568385273.397009] Modem: state changed (unknown -> failed) <debug> [1568385273.397215] (ttyUSB3) device open count is 1 (close) <debug> [1568385273.397268] Creating ports context for SIM hot swap <debug> [1568385273.397289] (ttyUSB3) device open count is 2 (open) <debug> [1568385273.397309] (ttyUSB4) opening serial port... <debug> [1568385273.397676] (ttyUSB4): setting up baudrate: 57600 <debug> [1568385273.397699] (ttyUSB4): no flow control explicitly requested for device <debug> [1568385273.397724] (ttyUSB4): port attributes not fully set <debug> [1568385273.397760] (ttyUSB4) device open count is 1 (open) <debug> [1568385273.397776] (ttyUSB4): running init sequence... <debug> [1568385273.397856] Extended signal information reporting disabled <debug> [1568385273.397927] Couldn't finish initialization in the current state: 'Modem is unusable, cannot fully initialize' <debug> [1568385273.398432] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.1] exported modem at path '/org/freedesktop/ModemManager1/Modem/0' <debug> [1568385273.398464] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.1] plugin: Telit <debug> [1568385273.398484] [device /sys/devices/pci0000:00/0000:00:14.0/usb1/1-11/1-11.4/1-11.4.1] vid:pid: 0x1BC7:0x1040 <debug> [1568385273.398509] (ttyUSB3) device open count is 1 (close) <debug> [1568385273.398546] (ttyUSB4): --> 'ATE0<CR>' <debug> [1568385273.400412] (ttyUSB3): <-- '<CR><LF>+CPIN: READY<CR><LF><CR><LF>OK<CR><LF>' <debug> [1568385273.404870] (ttyUSB4): <-- '<CR><LF>OK<CR><LF>'
2019-08-29broadband-modem: remove unused contacts interface logicAleksander Morgado
2019-07-19broadband-modem,voice: implement call waiting status setup/query with +CCWAAleksander Morgado
2019-07-12voice,call,cinterion: add Purism as copyright holderAleksander Morgado
The GSM supplementary services related changes, as well as the rework done to manage calls per call id, is copyrighted by Purism SPC.
2019-07-11broadband-modem: implement LeaveMultiparty() with +CHLD=2xAleksander Morgado
2019-07-11broadband-modem: implement JoinMultiparty() with +CHLD=3Aleksander Morgado
2019-07-11broadband-modem: setup in-call unsolicited event handlingAleksander Morgado
The in-call handlers will monitor events that report the call being terminated.
2019-07-11iface-modem-voice: allow reporting state updates of any single callAleksander Morgado
Instead of providing a method to exclusively provide incoming call updates, make it more generic so that we allow plugins to provide state updates for any kind of call, not just incoming ones. The logic to match the call info provided by URCs is updated so that it can be reused also by the single call reports, in addition to the full call list reports.
2019-07-11broadband-modem: implement Transfer() with +CHLD=4Aleksander Morgado
2019-07-11broadband-modem: implement HangupAll() with +CHUPAleksander Morgado
2019-07-11broadband-modem: implement HoldAndAccept() with +CHLD=2Aleksander Morgado
2019-07-11broadband-modem: implement HangupAndAccept() with +CHLD=1Aleksander Morgado
2019-07-11broadband-modem: implement call list polling with +CLCCAleksander Morgado
2019-07-11iface-modem-voice: setup full call list polling logicAleksander Morgado
If the modem supports call list polling, we'll setup a timeout to poll for the full call list periodically, in order to get detailed call states. The timeout is setup as soon as a new call is created, and it will be kept enabled as long as there is a call being established (i.e. not unknown, not terminated, not active).
2019-07-11broadband-modem: if +CLCC is supported, call supports detailed eventsAleksander Morgado
2019-07-11broadband-modem: implement +CCWA URC handlingAleksander Morgado
2019-07-11broadband-modem,voice: enable/disable call waiting indicationsAleksander Morgado
2019-07-11broadband-modem,voice: disable unsolicited eventsAleksander Morgado
2019-07-11broadband-modem,voice: rework enabling of unsolicited eventsAleksander Morgado
The previous logic would end up returning an error if either +CLIP or +CRC reported an error, and we should really avoid that, because our setup is able to manage the voice calls even without those settings. So, convert the logic into a small state machine and try to configure the settings both in the primary and secondary ports, instead of just in the primary one.
2019-07-10misc: use g_regex_match() for simplicityBen Chan
This CL converts a few g_regex_match_full() expressions to their equivalent g_regex_match() in order to simplify the code, i.e. g_regex_match_full (regex, str, strlen (str), 0, 0, &match_info, NULL) is equivalent to: g_regex_match_full (regex, str, -1, 0, 0, &match_info, NULL) or simply: g_regex_match (regex, str, 0, &match_info)
2019-06-28broadband-modem: fix logging whether enabling or disabling URCsAleksander Morgado
2019-05-01mm-broadband-modem: fix error propagation in cdma service statusyparitcher
2019-04-09broadband-modem: remove unused CallManagerStateContext defintionBen Chan
2019-04-02shared-qmi: implement QMI PDC based carrier config supportAleksander Morgado
We implement both loading the current configuration in use, as well as automatically switching to a different one if a mapping file is available.