On Wed, Sep 19, 2018 at 10:35 AM Slava Monich <[email protected]>
wrote:
> On 19/09/18 08:37, Giacinto Cifelli wrote:
> > ---
> > include/gprs-context.h | 1 +
> > include/lte.h | 11 +++++++++--
> > 2 files changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/gprs-context.h b/include/gprs-context.h
> > index 20ca9ef..8869c12 100644
> > --- a/include/gprs-context.h
> > +++ b/include/gprs-context.h
> > @@ -57,6 +57,7 @@ enum ofono_gprs_context_type {
> > enum ofono_gprs_auth_method {
> > OFONO_GPRS_AUTH_METHOD_CHAP = 0,
> > OFONO_GPRS_AUTH_METHOD_PAP,
> > + OFONO_GPRS_AUTH_METHOD_NONE,
>
> I think there should be OFONO_GPRS_AUTH_METHOD_ANY (or
> OFONO_GPRS_AUTH_METHOD_PAP_CHAP) here as well, for completeness. Many
> modems support that too (and we had to add it in our fork).
>
>
I agree. Let me collect all comments, then I will also add it.
I would favour also renumbering with NONE on top, but I am not sure of the
side effects everywhere, in case the values are used directly in commands.
>
> > };
> >
> > struct ofono_gprs_primary_context {
> > diff --git a/include/lte.h b/include/lte.h
> > index ef84ab9..38587c3 100644
> > --- a/include/lte.h
> > +++ b/include/lte.h
> > @@ -3,6 +3,7 @@
> > * oFono - Open Source Telephony
> > *
> > * Copyright (C) 2016 Endocode AG. All rights reserved.
> > + * Copyright (C) 2018 Gemalto M2M
> > *
> > * This program is free software; you can redistribute it and/or
> modify
> > * it under the terms of the GNU General Public License version 2 as
> > @@ -28,14 +29,18 @@ extern "C" {
> >
> > #include <ofono/types.h>
> >
> > -struct ofono_lte;
> > -
> > struct ofono_lte_default_attach_info {
> > char apn[OFONO_GPRS_MAX_APN_LENGTH + 1];
> > + enum ofono_gprs_proto proto;
> > + enum ofono_gprs_auth_method auth_method;
> > + char username[OFONO_GPRS_MAX_USERNAME_LENGTH + 1];
> > + char password[OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
> > };
>
> This is starting to look suspiciously similar to struct
> ofono_gprs_primary_context (the only thing left is cid). Is it really
> necessary to maintain two copies of essentially the same structure or is
> there some room for unification here?
>
>
There is a lot of duplication between gprs and lte, yes, if you look in the
rest of the patches there is a lot in common.
I havent found a way to do it smoothly. I even had to copy the
gprs_proto_to/from_string, gprs_auth_method_to/from_string in src/gprs.c in
src/lte.c, because I could not export them in common.c (without removing
the enums).
If there is a smart way to do it, I am more than willing to recraft the
code. Like this every change is to be duplicated.
> Cheers,
> -Slava
>
Regards,
Giacinto
_______________________________________________
> ofono mailing list
> [email protected]
> https://lists.ofono.org/mailman/listinfo/ofono
>
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono