Hi Alok,

>-----Original Message-----
>From: [email protected]
>[mailto:[email protected]] On Behalf Of alok barsode
>Sent: Monday, August 29, 2011 4:11 PM
>To: [email protected]
>Subject: Re: [PATCH 2/3] technology: Remove technology when this type
devices
>are unplugged
>
>Hi,
>
>On Mon, Aug 29, 2011 at 10:48 AM, Yu A Wang <[email protected]> wrote:
>
>> Fix unable to enable/disable 3G service after unplug/plug in again
>>
>> Fix BMC#13547
>> ---
>>  src/technology.c |    5 +++--
>>  1 files changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/technology.c b/src/technology.c
>> index a067d68..187d2f0 100644
>> --- a/src/technology.c
>> +++ b/src/technology.c
>> @@ -750,6 +750,7 @@ int __connman_technology_remove_device(struct
>> connman_device *device)
>>        DBG("device %p", device);
>>
>>        type = __connman_device_get_service_type(device);
>> +       __connman_notifier_disable(type);
>>        __connman_notifier_unregister(type);
>>
>> Why do u need   __connman_notifier_disable here?
The enabled count of technology is stored in notifier.c, if the status of
the technology 
is offline before we unplug the device everything is ok, but if the status
is enabled,
after we plug the device again, the device will be enable again, the count
will increase
again, this will lead to after we disable the device, we can't enable is
again.

>       technology = technology_find(type);
>> @@ -759,8 +760,8 @@ int __connman_technology_remove_device(struct
>> connman_device *device)
>>        technology->device_list = g_slist_remove(technology->device_list,
>>
>device);
>>        if (technology->device_list == NULL) {
>> -               technology->state =
>CONNMAN_TECHNOLOGY_STATE_OFFLINE;
>> -               state_changed(technology);
>> +               technology->refcount = 1;
>> +               technology_put(technology);
>>        }
>>
>>        return 0;
>>
>Why do u need to hardcode the refcount ?  wouldnt technology_put take care
>of it ?
Yes, we should use technology_put to take care of it, but when we unplug a
device,
there may no rfkill event, so there may still have a refcount of technology
we want
to destroy. After we plug the device again, we create a new technology, this
will not
impact the normal use of rfkill functions. 

Thanks
Arron

Attachment: smime.p7s
Description: S/MIME cryptographic signature

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

Reply via email to