Hi Denis,
On 07/03/2018 05:53 PM, Denis Kenzior wrote:
> Hi Christophe,
>
> On 07/03/2018 03:40 AM, Christophe Ronco wrote:
>> Hi,
>> I am doing a test with a 4G SIM card with APN set in provisionning. I
>> 've recently upgraded my Ofono version to 1.23.
>>
>> My card gets LTE attach quickly, before it gets ServiceProviderName from
>> SIM card.
>> So ofono_gprs_cid_activated is called by get_lte_attach_param_cb
>> (drivers/qmimodem/gprs.c) and a context is created with APN discovered
>> in get_lte_attach_param_cb.
>> Then SIM ServiceProviderName is discovered and provision_contexts is
>> called. Another context is created with APN from provisioning file.
>
> It would seem that your gprs atom is being created in the post-online
> state. This means that it doesn't have a chance to run provisioning
> before the network activates a context. This might be a legacy issue
> because all device drivers initially were written with gprs,
> gprs-context and sim atoms in the post_online state. However, these
> really should be in post_sim these days, especially for LTE.
>
>>
>> I end up with 2 contexts using same APN or different APNs, depending on
>> what I wrote in my provisioning file. I attached logs with same APN
>> case.
>> In messages_02.txt:
>> - ofono_gprs_cid_activated is called at line 681
>> - __ofono_gprs_provision_get_settings is called at line 753
>> I end up with two contexts (properties summary in gsmdiag_02.txt).
>>
>> Another strange thing in ofono gprs file for this SIM card:
>> root@klk-lpbs-06029C:~ # cat /etc/network/ofono/208013004789734/gprs
>> [Settings]
>> Powered=true
>> RoamingAllowed=false
>>
>> [context1]
>> Name=orange-mib
>> AccessPointName=
>
> I don't really understand how this can happen. The logic inside
> ofono_gprs_cid_activated should not be setting the context name, only
> the APN.
>
> And I'm pretty sure that provisioning checks that an APN is not empty,
> e.g. is_valid_apn() in provision_context().
>
> So at which point is context1 being created? Because this looks wrong...
I fixed this "APN not written in config file" by patch I sent this
morning on the list.
...
>
>>
>> Here are the "problems" I saw. And I don't know what to do in this case.
>> I mean I don't know what result I should have.
>>
>> What should happen if context information are the same in provisioning
>> and from network discovery? Maybe only one context?
>> What should happen if context information are different in provisioning
>> and from network discovery? Creation of 2 contexts and 1 gets
>> automatically connected? Disconnection of the automatically connected
>> context and creation of context using information from provisionning?
>> Provisionning ignored?
>
> I think the bottom line is that provisioning should happen before you
> go online and encounter these issues. ofono_gprs_cid_activated
> already tries to deal with matching the apn, etc. But it assumes that
> context provisioning has already happened.
>
> What we might need to address is to make the context activated via
> ofono_gprs_cid_activated to be ephemeral. E.g. if it doesn't match an
> actual context loaded from settings / provisioning, it should not be
> synced to storage and forgotten once we leave LTE.
My modem is a MC7430 and I use gobi plugin. Gprs atom is created in
post-online state in this plugin.
I tried to change that and create gprs atom in post-sim state. Traces
are attached. Code used in gobi plugin:
static void gobi_post_sim(struct ofono_modem *modem)
{
struct gobi_data *data = ofono_modem_get_data(modem);
struct ofono_gprs *gprs;
struct ofono_gprs_context *gc;
DBG("%p", modem);
ofono_lte_create(modem, "qmimodem", data->device);
DBG("CRO creating gprs early in gobi_post_sim");
if (data->features & GOBI_WDS) {
gprs = ofono_gprs_create(modem, 0, "qmimodem", data->device);
gc = ofono_gprs_context_create(modem, 0, "qmimodem",
data->device);
if (gprs && gc)
ofono_gprs_add_context(gprs, gc);
}
if (data->features & GOBI_CAT)
ofono_stk_create(modem, 0, "qmimodem", data->device);
else if (data->features & GOBI_CAT_OLD)
ofono_stk_create(modem, 1, "qmimodem", data->device);
if (data->features & GOBI_PBM)
ofono_phonebook_create(modem, 0, "qmimodem", data->device);
if (data->features & GOBI_NAS)
ofono_radio_settings_create(modem, 0, "qmimodem", data->device);
if (data->features & GOBI_WMS)
ofono_sms_create(modem, 0, "qmimodem", data->device);
if ((data->features & GOBI_WMS) && (data->features & GOBI_UIM) &&
!ofono_modem_get_boolean(modem, "ForceSimLegacy")) {
struct ofono_message_waiting *mw =
ofono_message_waiting_create(modem);
if (mw)
ofono_message_waiting_register(mw);
}
}
It does not change the problem, ofono_gprs_cid_activated is called
before provisioning occurs.
I think that's because modem is attached immediately after set_online.
Functions called starting from ofono_gprs_create:
1) calling ofono_gprs_cid_activated
ofono_gprs_create (from plugin)
qmi_gprs_probe
create_nas_cb
create_wds_cb (QMI_NAS_GET_SS_INFO)
ss_info_notify (drivers/qmimodem/gprs.c)
handle_ss_info
get_lte_attach_params (case REGISTERED + techno=LTE)
get_lte_attach_param_cb (WDS, 0x49)
get_default_profile_cb (WDS, 0x85)
get_lte_attach_param_cb
ofono_gprs_cid_activated (line 626 in traces)
2) calling provision_contexts
ofono_gprs_create (from plugin)
qmi_gprs_probe
create_nas_cb
create_wds_cb
ofono_gprs_register
ofono_sim_add_spn_watch
sim_spn_changed
ofono_sim_read(SIM_EFSPN_FILEID)
sim_spn_read_cb (sim.c)
sim_spn_set
spn_watches_notify
spn_read_cb (gprs.c)
provision_contexts
__ofono_gprs_provision_get_settings (line 665 in traces)
I am not sure to understand the change you are suggesting. Is it:
provision_contexts checks for contexts already created (via
ofono_gprs_cid_activated). if context corresponds (same APN? same APN,
Username,...?) it does not create a new context and reuse given context
What to do if another context (let's say with a different APN) exist in
provisioning file? Do we close automatically activated context? Do we
remove it? DO we gave priority to automatically activated context?
What do we do if we don't have provisioning file or don't have
provisioning for this SIM operator? Do we continue connection?
messages_04.tar.gz
Description: application/gzip
_______________________________________________ ofono mailing list [email protected] https://lists.ofono.org/mailman/listinfo/ofono
