linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] rfkill bug fixed in rfkill_set_sw_state
       [not found] <000301cab69f$ec61ad00$c5250700$%chung@samsung.com>
@ 2010-03-02 20:50 ` Andrew Morton
  2010-03-03  0:47   ` Jaehoon Chung
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2010-03-02 20:50 UTC (permalink / raw)
  To: 정재훈
  Cc: linux-kernel, linux-wireless, John W. Linville, Johannes Berg,
	Alan Jenkins

Suitable cc's (from scripts/get_maintainer.pl) added.

On Fri, 26 Feb 2010 13:55:31 +0900
_________ <jh80.chung@samsung.com> wrote:

> Don___t work expected operation in __rfkill_set_sw_state. 
> when rfkill initialized. Rfkill___s blocked & unblocked is operating on the
> contrary.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> 
> ---
>  net/rfkill/core.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
> index c224cb2..dcc2d38 100644
> --- a/net/rfkill/core.c
> +++ b/net/rfkill/core.c
> @@ -488,7 +488,7 @@ static void __rfkill_set_sw_state(struct rfkill
> *rfkill, bool blocked)
>  	if (rfkill->state & RFKILL_BLOCK_SW_SETCALL)
>  		bit = RFKILL_BLOCK_SW_PREV;
>  
> -	if (blocked)
> +	if (!blocked)
>  		rfkill->state |= bit;
>  	else
>  		rfkill->state &= ~bit;

Are you sure?  What problems were you observing with the existing code?
Please fully describe your hardware and the driver's behaviour.

The current code _looks_ OK to me.  If bool `blocked' is true, we set
the RFKILL_BLOCK_SW bit?


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rfkill bug fixed in rfkill_set_sw_state
  2010-03-02 20:50 ` [PATCH] rfkill bug fixed in rfkill_set_sw_state Andrew Morton
@ 2010-03-03  0:47   ` Jaehoon Chung
  2010-03-03  9:37     ` Alan Jenkins
  0 siblings, 1 reply; 4+ messages in thread
From: Jaehoon Chung @ 2010-03-03  0:47 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, linux-wireless, John W. Linville, Johannes Berg,
	Alan Jenkins

Ok Next time, i will add sutatble cc's scripts/get_maintainer.pl. thanks..
> Suitable cc's (from scripts/get_maintainer.pl) added.
>
> On Fri, 26 Feb 2010 13:55:31 +0900
> _________<jh80.chung@samsung.com>  wrote:
>
>    
>> Don___t work expected operation in __rfkill_set_sw_state.
>> when rfkill initialized. Rfkill___s blocked&  unblocked is operating on the
>> contrary.
>>
>> Signed-off-by: Jaehoon Chung<jh80.chung@samsung.com>
>>
>> ---
>>   net/rfkill/core.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
>> index c224cb2..dcc2d38 100644
>> --- a/net/rfkill/core.c
>> +++ b/net/rfkill/core.c
>> @@ -488,7 +488,7 @@ static void __rfkill_set_sw_state(struct rfkill
>> *rfkill, bool blocked)
>>   	if (rfkill->state&  RFKILL_BLOCK_SW_SETCALL)
>>   		bit = RFKILL_BLOCK_SW_PREV;
>>
>> -	if (blocked)
>> +	if (!blocked)
>>   		rfkill->state |= bit;
>>   	else
>>   		rfkill->state&= ~bit;
>>      
> Are you sure?  What problems were you observing with the existing code?
> Please fully describe your hardware and the driver's behaviour.
>
> The current code _looks_ OK to me.  If bool `blocked' is true, we set
> the RFKILL_BLOCK_SW bit?
>    
I implemented the wlan driver using rfkill.
In my source code, the wlan driver initalized to 
RFKLL_USESR_STATE_UNBLOCKED..
if that is correct, maybe do working the unblocked...but not work 
"unblocked"

below code is unblock's operation..right?
rfkill_init_sw_state(wlan, RFKILL_USER_STATE_UNBLOCKED);

but, do not operate unblocked.
please check that source code..

thanks for your comment, Andrew.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rfkill bug fixed in rfkill_set_sw_state
  2010-03-03  0:47   ` Jaehoon Chung
@ 2010-03-03  9:37     ` Alan Jenkins
  2010-03-03 10:14       ` Jaehoon Chung
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Jenkins @ 2010-03-03  9:37 UTC (permalink / raw)
  To: jh80.chung
  Cc: Andrew Morton, linux-kernel, linux-wireless, John W. Linville,
	Johannes Berg

Jaehoon Chung wrote:
> Ok Next time, i will add sutatble cc's scripts/get_maintainer.pl. 
> thanks..
>> Suitable cc's (from scripts/get_maintainer.pl) added.
>>
>> On Fri, 26 Feb 2010 13:55:31 +0900
>> _________<jh80.chung@samsung.com>  wrote:
>>
>>   
>>> Don___t work expected operation in __rfkill_set_sw_state.
>>> when rfkill initialized. Rfkill___s blocked&  unblocked is operating 
>>> on the
>>> contrary.
>>>
>>> Signed-off-by: Jaehoon Chung<jh80.chung@samsung.com>
>>>
>>> ---
>>>   net/rfkill/core.c |    2 +-
>>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
>>> index c224cb2..dcc2d38 100644
>>> --- a/net/rfkill/core.c
>>> +++ b/net/rfkill/core.c
>>> @@ -488,7 +488,7 @@ static void __rfkill_set_sw_state(struct rfkill
>>> *rfkill, bool blocked)
>>>       if (rfkill->state&  RFKILL_BLOCK_SW_SETCALL)
>>>           bit = RFKILL_BLOCK_SW_PREV;
>>>
>>> -    if (blocked)
>>> +    if (!blocked)
>>>           rfkill->state |= bit;
>>>       else
>>>           rfkill->state&= ~bit;
>>>      
>> Are you sure?  What problems were you observing with the existing code?
>> Please fully describe your hardware and the driver's behaviour.
>>
>> The current code _looks_ OK to me.  If bool `blocked' is true, we set
>> the RFKILL_BLOCK_SW bit?
>>    
> I implemented the wlan driver using rfkill.
> In my source code, the wlan driver initalized to 
> RFKLL_USESR_STATE_UNBLOCKED..
> if that is correct, maybe do working the unblocked...but not work 
> "unblocked"
>
> below code is unblock's operation..right?
> rfkill_init_sw_state(wlan, RFKILL_USER_STATE_UNBLOCKED);
>
> but, do not operate unblocked.
> please check that source code..

I see the problem :).  The hint is in the _USER_ - those constants are 
not for use by drivers.  You want this instead:

rfkill_init_sw_state(wlan, false);

(assuming you really want init_sw_state().  Please do check that your 
device state is persistent, as described by the comment in rfkill.h).

Regards
Alan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] rfkill bug fixed in rfkill_set_sw_state
  2010-03-03  9:37     ` Alan Jenkins
@ 2010-03-03 10:14       ` Jaehoon Chung
  0 siblings, 0 replies; 4+ messages in thread
From: Jaehoon Chung @ 2010-03-03 10:14 UTC (permalink / raw)
  To: Alan Jenkins
  Cc: Andrew Morton, linux-kernel, linux-wireless, John W. Linville,
	Johannes Berg

Alan Jenkins wrote:
> Jaehoon Chung wrote:
>> Ok Next time, i will add sutatble cc's scripts/get_maintainer.pl. 
>> thanks..
>>> Suitable cc's (from scripts/get_maintainer.pl) added.
>>>
>>> On Fri, 26 Feb 2010 13:55:31 +0900
>>> _________<jh80.chung@samsung.com>  wrote:
>>>
>>>> Don___t work expected operation in __rfkill_set_sw_state.
>>>> when rfkill initialized. Rfkill___s blocked&  unblocked is 
>>>> operating on the
>>>> contrary.
>>>>
>>>> Signed-off-by: Jaehoon Chung<jh80.chung@samsung.com>
>>>>
>>>> ---
>>>>   net/rfkill/core.c |    2 +-
>>>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/net/rfkill/core.c b/net/rfkill/core.c
>>>> index c224cb2..dcc2d38 100644
>>>> --- a/net/rfkill/core.c
>>>> +++ b/net/rfkill/core.c
>>>> @@ -488,7 +488,7 @@ static void __rfkill_set_sw_state(struct rfkill
>>>> *rfkill, bool blocked)
>>>>       if (rfkill->state&  RFKILL_BLOCK_SW_SETCALL)
>>>>           bit = RFKILL_BLOCK_SW_PREV;
>>>>
>>>> -    if (blocked)
>>>> +    if (!blocked)
>>>>           rfkill->state |= bit;
>>>>       else
>>>>           rfkill->state&= ~bit;
>>> Are you sure?  What problems were you observing with the existing code?
>>> Please fully describe your hardware and the driver's behaviour.
>>>
>>> The current code _looks_ OK to me.  If bool `blocked' is true, we set
>>> the RFKILL_BLOCK_SW bit?
>> I implemented the wlan driver using rfkill.
>> In my source code, the wlan driver initalized to 
>> RFKLL_USESR_STATE_UNBLOCKED..
>> if that is correct, maybe do working the unblocked...but not work 
>> "unblocked"
>>
>> below code is unblock's operation..right?
>> rfkill_init_sw_state(wlan, RFKILL_USER_STATE_UNBLOCKED);
>>
>> but, do not operate unblocked.
>> please check that source code..
>
> I see the problem :).  The hint is in the _USER_ - those constants are 
> not for use by drivers.  You want this instead:
>
> rfkill_init_sw_state(wlan, false);
>
> (assuming you really want init_sw_state().  Please do check that your 
> device state is persistent, as described by the comment in rfkill.h).
>
> Regards
> Alan
>

Oh...i checked the comment in rfkill.h. i didn't see that comment.
thanks for your opinion..:)

Regards
Jaehoon Chung

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-03 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <000301cab69f$ec61ad00$c5250700$%chung@samsung.com>
2010-03-02 20:50 ` [PATCH] rfkill bug fixed in rfkill_set_sw_state Andrew Morton
2010-03-03  0:47   ` Jaehoon Chung
2010-03-03  9:37     ` Alan Jenkins
2010-03-03 10:14       ` Jaehoon Chung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).