aboutsummaryrefslogtreecommitdiff
path: root/src/mm-bearer-mbim.c
AgeCommit message (Collapse)Author
2020-09-07bearer-mbim: don't fail IPv4 connection if IPv4v6 was requestedAleksander Morgado
If we ask for IPv4v6 is requested but the network only grants IPv4, we end up receiving the 'Connect Set' response with nw_error set to 'pdp-type-ipv4-only-allowed'. In this case, we should still succeed the connection attempt and only report the IPv4 info. We therefore change the logic to skip processing the nw_error unless the activation state is reported as ACTIVATED or ACTIVATING.
2020-04-08modem-helpers-mbim: port to use object loggingAleksander Morgado
2020-04-08bearer-mbim: port to use object loggingAleksander Morgado
2020-01-30bearer-mbim: fix warnings with -Wimplicit-fallthroughAleksander Morgado
mm-bearer-mbim.c: In function ‘connect_context_step’: mm-bearer-mbim.c:843:18: error: this statement may fall through [-Werror=implicit-fallthrough=] 843 | ctx->step++; | ~~~~~~~~~^~ mm-bearer-mbim.c:845:5: note: here 845 | case CONNECT_STEP_PACKET_SERVICE: { | ^~~~ mm-bearer-mbim.c: In function ‘disconnect_context_step’: mm-bearer-mbim.c:1269:18: error: this statement may fall through [-Werror=implicit-fallthrough=] 1269 | ctx->step++; | ~~~~~~~~~^~ mm-bearer-mbim.c:1271:5: note: here 1271 | case DISCONNECT_STEP_DISCONNECT: { | ^~~~
2020-01-30bearer-mbim: fix warnings with -Wswitch-defaultAleksander Morgado
mm-bearer-mbim.c: In function ‘connect_context_step’: mm-bearer-mbim.c:840:5: error: switch missing default case [-Werror=switch-default] 840 | switch (ctx->step) { | ^~~~~~ mm-bearer-mbim.c: In function ‘disconnect_context_step’: mm-bearer-mbim.c:1266:5: error: switch missing default case [-Werror=switch-default] 1266 | switch (ctx->step) { | ^~~~~~ ...
2019-12-03bearer: avoid reporting disconnection error if already disconnectedAleksander Morgado
When we try to disconnect a bearer and the bearer is already disconnected (e.g. after a cancelled connection attempt), avoid reporting that as an error: <warn> [1575287560.433398] Error disconnecting bearer '/org/freedesktop/ModemManager1/Bearer/0': 'Couldn't disconnect QMI bearer: this bearer is not connected'. Will assume disconnected anyway.
2018-12-07helpers-mbim: new method to convert IP type settings to/from MMAleksander Morgado
2018-12-07helpers-mbim: new method to convert auth settings to/from MMAleksander Morgado
2018-02-02bearer-mbim: check if IP session is activated before deactivating itBen Chan
It may be undesirable to issue a MBIM_CID_CONNECT (MBIMActivationCommandDeactivate) command to deactivate an IP session when the session isn't activated. For instance, it's been observed on Huawei ME936 that it takes more than 30s for the modem to deactivate a not-yet-activated session. This patch modifies MMBearerMbim to query if a session is activated before trying to deactivate the session during a connection attempt.
2018-02-02bearer-mbim: increase timeout for deactivating IP session to 60sBen Chan
Since commit 0c7f3380a ("bearer-mbim: ensure session is disconnected before trying to connect"), MMBearerMbim always issues a MBIM_CID_CONNECT (MBIMActivationCommandDeactivate) command before a MBIM_CID_CONNECT (MBIMActivationCommandActivate) command during a connection attempt. That is to ensure that an IP session is actually deactivated before we try to activate a new IP session. Unfortunately, it's been observed on Huawei ME936 that it takes more than 30s for the modem to respond to a MBIM_CID_CONNECT (MBIMActivationCommandDeactivate) command when trying to deactivate a session that hasn't been activated. When the signal is weak, it's also possible that a modem takes more than 30s to deactivate an IP session during a disconnection attempt. This patch increases the timeout for deactivating an IP session from 30s to 60s in both connection and disconnection attempt.
2018-02-02bearer-mbim: remove a unnecessary MbimMessage variableBen Chan
2017-10-02bearer-mbim: don't crash when modem doesn't send gatewaysDan Williams
When the Ericsson F5321 with firmware R3C11/R4D04 is told to make an IPv6-only connection, it reports that it has IPv4 configuration but then returns no actual addresses. Check both the flags and actual data before trying to use them. ModemManager[25850]: <debug> [1506958721.914717] IPv4 configuration available: 'address, gateway, dns, mtu' ModemManager[25850]: <debug> [1506958721.914731] IP addresses (0) ModemManager[25850]: <debug> [1506958721.914741] DNS addresses (0) ModemManager[25850]: <debug> [1506958721.914748] MTU: '0' ModemManager[25850]: <debug> [1506958721.914758] IPv6 configuration available: 'address, dns, mtu' ModemManager[25850]: <debug> [1506958721.914767] IP addresses (1) ModemManager[25850]: <debug> [1506958721.914852] IP [0]: 'fe80::39:f622:7d01/64' ModemManager[25850]: <debug> [1506958721.914866] DNS addresses (2) ModemManager[25850]: <debug> [1506958721.914883] DNS [0]: 'fd00:976a::9' ModemManager[25850]: <debug> [1506958721.914896] MTU: '1500' ModemManager[25850]: <debug> [1506958721.914947] (wwp0s20u1i6): port now connected
2017-09-12bearer-mbim: ensure session is disconnected before trying to connectAleksander Morgado
If a suspend/resume cycle happens or ModemManager is restarted (e.g. after a crash) the modem may be left with a given session id connected. With this change we're forcing a session disconnection before we attempt a session connection. https://bugs.freedesktop.org/show_bug.cgi?id=102231
2017-08-09bearer-mbim: stop trying to reload stats on OperationNotAllowedAleksander Morgado
The Sierra Wireless EM7345 reports OperationNotAllowed when trying to load stats, just cancel stats reloading if so. ModemManager[8318]: [/dev/cdc-wdm1] Received message (translated)... >>>>>> Header: >>>>>> length = 48 >>>>>> type = command-done (0x80000003) >>>>>> transaction = 24 >>>>>> Fragment header: >>>>>> total = 1 >>>>>> current = 0 >>>>>> Contents: >>>>>> status error = 'OperationNotAllowed' (0x0000001c) >>>>>> service = 'basic-connect' (a289cc33-bcbb-8b4f-b6b0-133ec2aae6df) >>>>>> cid = 'packet-statistics' (0x00000014)
2017-08-06bearer-mbim: refactor disconnect_set_ready()Aleksander Morgado
Try to make it more clear which are the different branches in the logic, and jump out as soon as the branch is finished.
2017-08-04bearer-mbim: minor update in debug log messagesAleksander Morgado
2017-08-04bearer-mbim: avoid accessing invalid session_id and nw_errorBen Chan
This patch fixes an issue in disconnect_set_ready(). If mbim_message_connect_response_parse(), `session_id' and `nw_error' are not set to a valid value, and thus shouldn't be used.
2017-07-27bearer-mbim: avoid calling mbim_message_unref on NULL MbimMessageBen Chan
2017-06-30bearer-mbim: port MMBearerMbim to use GTaskBen Chan
2016-10-12broadband-modem: implement default connection monitoring logicAleksander Morgado
A default implementation to monitor the ongoing connection is provided in the generic MMBroadbandModem, based on AT+CGACT? to check whether the PDP context of the connection (identified by the cached cid) is active or not. This commit also disables the connection monitoring logic in those plugins that have custom connection methods.
2016-07-11bearer-mbim: use the context IP type MM asked to be activated instead of ↵Dan Williams
modem response MM never passes MBIM_CONTEXT_IP_TYPE_DEFAULT which would require paying attention to the ip_type in the reply to figure out what type the modem activated. Instead, MM always specifies the ip_type it wants to activate, and some modems (K5160) return a different type in the response. The modem is required to activate the type MM asks for or return an error, so if the activation was successful we can safely assume the modem activated the ip_type we want, and we can ignore the ip_type in the response.
2016-06-15broadband-bearer-mbim: log context IP type when connectingDan Williams
2016-05-03bearer-mbim: fine-tune bearer IP method reportingDan Williams
v4: modems/providers may not return DNS servers and not all modems support DHCP, so lack of DNS servers should not indicate a bearer IP method of "DHCP". IP config daemon/scripts already have to handle missing DNS anyway. v6: IPv6 requires SLAAC or DHCPv6 as part of the specification, so for now we assume modems will support it. Provide all the info the modem sent, but if there is any missing information use an IP method of "DHCP" to indicate that info should be obtained via SLAAC/DHCPv6. Only use an IP method of "STATIC" when all basic properties are given by the modem.
2015-12-07bearer-mbim: implement stats loadingAleksander Morgado
2014-12-30mbim: use the new response checker helper methodAleksander Morgado
mbim_message_response_get_result() is available in libmbim-glib 1.11.1.
2014-10-29bearer-mbim: Implement report_connection_status() to set the port as ↵Greg Suarez
disconnected When the MBIM modem unexpectedly loses connection the port state never gets set as disconnected thus when trying to reestablish a new connection the bearer cannot find a port in the disconnected state. Signed-off-by: Greg Suarez <gpsuarez2512@gmail.com>
2014-07-17bearer-mbim: increase disconnect timeoutBen Chan
It's been observed that modems may take a long time to disconnect from the network under certain network conditions. This patch increases the timeout for the MBIM_CID_CONNECT set command in the disconnect sequence from 10s to 30s.
2014-07-06bearer: rename 'MMBearer' to 'MMBaseBearer'Aleksander Morgado
Just so that we don't have same header names in src/ and /libmm-glib.
2014-07-01bearer-mbim: ignore empty DNS server addressesDan Williams
2014-06-20bearer-mbim: fix disconnect error handling case splitPrathmesh Prabhu
The first case, with no error, needs to check that there was no original error. Currently, if an error occurs and the resulting NwError is parsed correctly, the case split treats it as a no-error case.
2014-06-18bearer-mbim: disconnect attempt should succeed if bearer is already disconnectedPrathmesh Prabhu
When trying to disconnect bearer, if the modem responds with MBIM_STATUS_ERROR_CONTEXT_NOT_ACTIVATED, take it to mean that the bearer has already been disconnected.
2014-06-13bearer-mbim: use DHCP method when only an IPv6 link-local address is foundDan Williams
When only given a link-local address, then SLAAC must be used to retrieve the real prefix.
2014-06-09bearer-mbim: pass the right GError pointer to response parsersBen Chan
2014-05-20core: minor coding style fixesBen Chan
2014-03-25bearer-mbim: update MTU in bearer IP config propertiesBen Chan
This patch modifies MMBearerMbim to update the MTU value in the bearer IPv4 and IPv6 config property when such information is available in the MBIM_CID_IP_CONFIGURATION response.
2014-03-25bearer-mbim: fix a misleading commentBen Chan
2014-02-13ports: rename 'libserial' to 'libport'Aleksander Morgado
2014-02-13ports: rename 'MMMbimPort' to 'MMPortMbim'Aleksander Morgado
2014-01-24bearer-mbim: fix leaked 'MMBearerIpConfig' objectsAleksander Morgado
2014-01-24bearer-mbim: fix leaked 'MMBearerProperties'Aleksander Morgado
2014-01-24bearer-mbim: fix several leaked 'MbimMessage' objectsAleksander Morgado
mbim_device_command_finish() returns always a new reference to the response.
2013-12-19bearer-mbim: parse replies on failureAleksander Morgado
Based on a patch from: Bjørn Mork <bjorn@mork.no> Some messages provide an additional NwError cause code from the network in case of failure. This means that we need to parse the reply even if the status indicates failure, to be able to return the exact failure cause.
2013-06-17bearer-mbim: make packet service attach operation optionalAleksander Morgado
Some modems do require it, but some others won't (e.g. CDMA based ones), so just make the operation optional, but only if the modem replies NoDeviceSupport. https://bugzilla.gnome.org/show_bug.cgi?id=702419
2013-06-05api: let MMBearerIpFamily be flags instead of a enumerationAleksander Morgado
We want to expose in the Modem interface the list of supported IP families, and the easiest way to do so is to have the IP family as flags, and provide in the interface a single enum. Also, a value of 0 for a MMBearerIpFamily specifies that no flags are set, so just rename it to 'NONE'. And add a new 'ANY' value which sets all flags to 1.
2013-06-05bearers: update connection logic in 3GPP+3GPP2 devicesAleksander Morgado
https://bugzilla.gnome.org/show_bug.cgi?id=701333
2013-04-23bearer: allow specifying default IP family for bearersBen Chan
This patch adds a 'bearer-default-ip-family' property to MMBearer, which specifies the default IP family to use for a bearer when no explicit value is given via the simple connect properties. The default IP family is set to IPv4 in MMBearer but can be overridden by a MMBearer subclass, which allows a modem plugin to specify an appropriate default value.
2013-04-17bearer-mbim: handle static IP configurationAleksander Morgado
2013-04-17bearer-mbim: update connection timeout valuesAleksander Morgado
2013-04-17bearer-mbim: activate packet service during connection requestAleksander Morgado
2013-04-17bearer-mbim: no auth protocol if neither user nor password givenAleksander Morgado