[PATCH] iface-modem-3gpp: allow LAC/CID updates reported while registering
Dan Williams
dcbw at redhat.com
Thu Oct 15 07:13:49 PDT 2015
On Thu, 2015-10-15 at 11:39 +0200, Aleksander Morgado wrote:
> When changing from idle to registered we'll load registration info before really
> reporting that we're registered (so that clients can get the new registration
> info directly). During this time, we should also allow LAC/CID updates triggered
> in the location interface.
Works for me.
Dan
> E.g. when receiving this QMI message, we're not processing LAC/CID because when
> they get reported, the registration state was not yet 'registered':
>
> [/dev/cdc-wdm0] Received message (translated)...
> >>>>>> QMUX:
> >>>>>> length = 67
> >>>>>> flags = 0x80
> >>>>>> service = "nas"
> >>>>>> client = 1
> >>>>>> QMI:
> >>>>>> flags = "indication"
> >>>>>> transaction = 0
> >>>>>> tlv_length = 55
> >>>>>> message = "Serving System" (0x0024)
> >>>>>> TLV:
> >>>>>> type = "MNC PCS Digit Include Status" (0x29)
> >>>>>> length = 5
> >>>>>> value = D6:00:01:00:00
> >>>>>> translated = [ mcc = '214' mnc = '1' includes_pcs_digit = 'no' ]
> >>>>>> TLV:
> >>>>>> type = "LTE TAC" (0x25)
> >>>>>> length = 2
> >>>>>> value = 08:01
> >>>>>> translated = 264
> >>>>>> TLV:
> >>>>>> type = "Detailed Service Status" (0x22)
> >>>>>> length = 5
> >>>>>> value = 02:03:00:01:00
> >>>>>> translated = [ status = 'available' capability = 'cs-ps' hdr_status = 'none' hdr_hybrid = 'yes' forbidden = 'no' ]
> >>>>>> TLV:
> >>>>>> type = "CID 3GPP" (0x1e)
> >>>>>> length = 4
> >>>>>> value = 01:A1:4D:04
> >>>>>> translated = 72196353
> >>>>>> TLV:
> >>>>>> type = "LAC 3GPP" (0x1d)
> >>>>>> length = 2
> >>>>>> value = FE:FF
> >>>>>> translated = 65534
> >>>>>> TLV:
> >>>>>> type = "Current PLMN" (0x12)
> >>>>>> length = 5
> >>>>>> value = D6:00:01:00:00
> >>>>>> translated = [ mcc = '214' mnc = '1' description = '' ]
> >>>>>> TLV:
> >>>>>> type = "Data Service Capability" (0x11)
> >>>>>> length = 2
> >>>>>> value = 01:0B
> >>>>>> translated = { [0] = 'lte '}
> >>>>>> TLV:
> >>>>>> type = "Serving System" (0x01)
> >>>>>> length = 6
> >>>>>> value = 01:01:01:02:01:08
> >>>>>> translated = [ registration_state = 'registered' cs_attach_state = 'attached' ps_attach_state = 'attached' selected_network = '3gpp' radio_interfaces = '{ [0] = 'lte '}' ]
> <debug> [1444895382.427216] Processing 3GPP info...
> <info> [1444895382.433423] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP Registration state changed (idle -> registering)
>
> [ Here we tried to update LAC/CID ]
>
> <debug> [1444895382.439668] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP location updated (MCC: '214', MNC: '1', Location area code: '0', Cell ID: '0')
> <info> [1444895382.446788] Modem /org/freedesktop/ModemManager1/Modem/3: 3GPP Registration state changed (registering -> home)
> <info> [1444895382.452383] Modem /org/freedesktop/ModemManager1/Modem/3: state changed (enabled -> registered)
> ---
>
> Hey Dan,
>
> Another one here to fix LAC/CID reporting. This one is trying to allow LAC/CID
> updates once we know we're registered, but before actually reporting it in the
> DBus interface (i.e. while we're reloading the operator name/code).
>
> Let me know what you think.
>
> Cheers!
>
> ---
> src/mm-iface-modem-3gpp.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/src/mm-iface-modem-3gpp.c b/src/mm-iface-modem-3gpp.c
> index c8f3c2e..409c03f 100644
> --- a/src/mm-iface-modem-3gpp.c
> +++ b/src/mm-iface-modem-3gpp.c
> @@ -1052,6 +1052,10 @@ mm_iface_modem_3gpp_update_location (MMIfaceModem3gpp *self,
> gulong cell_id)
> {
> MMModem3gppRegistrationState state;
> + RegistrationStateContext *ctx;
> +
> + ctx = get_registration_state_context (self);
> + g_assert (ctx);
>
> if (!MM_IS_IFACE_MODEM_LOCATION (self))
> return;
> @@ -1061,8 +1065,11 @@ mm_iface_modem_3gpp_update_location (MMIfaceModem3gpp *self,
> NULL);
>
> /* Even if registration state didn't change, report access technology or
> - * location updates, but only if something valid to report */
> - if (state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
> + * location updates, but only if something valid to report. For the case
> + * where we're registering (loading current registration info after a state
> + * change to registered), we also allow LAC/CID updates. */
> + if (ctx->reloading_registration_info ||
> + state == MM_MODEM_3GPP_REGISTRATION_STATE_HOME ||
> state == MM_MODEM_3GPP_REGISTRATION_STATE_ROAMING) {
> if (location_area_code > 0 && cell_id > 0)
> mm_iface_modem_location_3gpp_update_lac_ci (MM_IFACE_MODEM_LOCATION (self),
> --
> 2.6.1
> _______________________________________________
> ModemManager-devel mailing list
> ModemManager-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel
More information about the ModemManager-devel
mailing list