Skip to contentSkip to conversation

rfkill bug fixed in rfkill_set_sw_state

PATCH In review 정재훈 3 participants 5 messages Feb 26, 2010 – Mar 3, 2010 Rfkill

lore
Share & tools
lore

정재훈

author
#0 lore raw

PATCH 1/1 rfkill bug fixed in rfkill_set_sw_state

Don’t work expected operation in __rfkill_set_sw_state.
when rfkill initialized. Rfkill’s blocked & unblocked is operating on the contrary.

---
 net/rfkill/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/rfkill/core.c +0 -0
index c224cb2..dcc2d38 100644
@@ -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;

Signature · 1 line
1.6.0.4
#1 lore raw

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

Quoted 23 lines · On Fri, 26 Feb 2010 13:55:31 +0900 _________ <[email protected]> wrote:

Don___t work expected operation in __rfkill_set_sw_state.
when rfkill initialized. Rfkill___s blocked & unblocked is operating on the contrary.

---
 net/rfkill/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/rfkill/core.c +1 -1
index c224cb2..dcc2d38 100644
@@ -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
Quoted 1 line

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?

#2 lore raw

Ok Next time, i will add sutatble cc's scripts/get_maintainer.pl. thanks..

Quoted 34 lines

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

Quoted 23 lines · On Fri, 26 Feb 2010 13:55:31 +0900 _________<[email protected]> wrote:

Don___t work expected operation in __rfkill_set_sw_state.
when rfkill initialized. Rfkill___s blocked& unblocked is operating on the contrary.

---
  net/rfkill/core.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
net/rfkill/core.c +1 -1
index c224cb2..dcc2d38 100644
@@ -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
Quoted 2 lines
  		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.

Quoted 3 lines

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.

#3 lore raw
Quoted 42 lines · Jaehoon Chung

Ok Next time, i will add sutatble cc's scripts/get_maintainer.pl. thanks..

Quoted 34 lines

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

Quoted 23 lines · On Fri, 26 Feb 2010 13:55:31 +0900 _________<[email protected]> wrote:

Don___t work expected operation in __rfkill_set_sw_state.
when rfkill initialized. Rfkill___s blocked& unblocked is operating on the contrary.

---
  net/rfkill/core.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
net/rfkill/core.c +1 -1
index c224cb2..dcc2d38 100644
@@ -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
Quoted 2 lines
          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.

Quoted 3 lines

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"

Quoted 5 lines

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

#4 lore raw
Quoted 46 lines · Alan Jenkins
Quoted 39 lines · Jaehoon Chung

Ok Next time, i will add sutatble cc's scripts/get_maintainer.pl. thanks..

Quoted 32 lines

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

Quoted 23 lines · On Fri, 26 Feb 2010 13:55:31 +0900 _________<[email protected]> wrote:

Don___t work expected operation in __rfkill_set_sw_state.
when rfkill initialized. Rfkill___s blocked& unblocked is operating on the contrary.

---
  net/rfkill/core.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
net/rfkill/core.c +1 -1
index c224cb2..dcc2d38 100644
@@ -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
Quoted 1 line
          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.

Quoted 2 lines

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"

Quoted 5 lines

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..

Quoted 9 lines

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