Hi Forest,

On 28.12.2012 20:22, Forest Bond wrote:
> From: Forest Bond <[email protected]>
> 
> Previously, the CDMA device was created only after the CDMA
> ConnectionManager interface was added.  This created a chicken-and-egg
> problem because oFono would not add the CM interface until after the
> modem was online, but we would not set the modem online until enabling
> the device (which was not created yet).  As a result, CDMA modems would
> only work if they were set online manually.

So what you are saying is that the comment in ready_to_create_device()
is wrong,

        /*
         * There are three different modem types which behave slightly
         * different:
         * - GSM modems will expose the SIM interface then the
         *   CM interface.
         * - CDMA modems will expose CM first and sometime later
         *   a unique serial number.
         *
         * This functions tests if we have the necessary information gathered
         * before we are able to create a device.
         */

I remember discussing this back and forth with Denis and IIRC the comment
here is correct.

Denis, can you confirm?

> ---
>   plugins/ofono.c |   13 +++++--------
>   1 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/plugins/ofono.c b/plugins/ofono.c
> index 41954e4..fe69495 100644
> --- a/plugins/ofono.c
> +++ b/plugins/ofono.c
> @@ -2031,9 +2031,6 @@ static void modem_update_interfaces(struct modem_data 
> *modem,
>       }
>   
>       if (api_added(old_ifaces, new_ifaces, OFONO_API_CDMA_CM) == TRUE) {
> -             if (ready_to_create_device(modem) == TRUE)
> -                     create_device(modem);
> -
>               if (modem->device != NULL)
>                       cdma_cm_get_properties(modem);
>       }
> @@ -2126,11 +2123,8 @@ static gboolean modem_changed(DBusConnection *conn, 
> DBusMessage *message,
>   
>               DBG("%s Serial %s", modem->path, modem->serial);
>   
> -             if (has_interface(modem->interfaces,
> -                                      OFONO_API_CDMA_CM) == TRUE) {
> -                     if (ready_to_create_device(modem) == TRUE)
> -                             create_device(modem);
> -             }
> +             if (ready_to_create_device(modem) == TRUE)
> +                     create_device(modem);
>       }

At least this change is touching the GSM modem code path, which makes me not
too happy, because that would be the wrong thing to do at this point.

>   
>       return TRUE;
> @@ -2214,6 +2208,9 @@ static void add_modem(const char *path, DBusMessageIter 
> *prop)
>       }
>   
>       modem_update_interfaces(modem, 0, modem->interfaces);
> +
> +     if (ready_to_create_device(modem) == TRUE)
> +             create_device(modem);
>   }

here the same

>   
>   static void modem_power_down(gpointer key, gpointer value, gpointer 
> user_data)
> 

cheers,
daniel
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to