linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFT] p54: implement rfkill
@ 2009-07-19 21:54 Christian Lamparter
  2009-08-07 15:36 ` John W. Linville
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Lamparter @ 2009-07-19 21:54 UTC (permalink / raw)
  To: wireless

This patch gets rid of the deprecated radio_enabled

fwio.c: In function ‘p54_setup_mac’:
fwio.c:323: warning: ‘radio_enabled’ is deprecated (declared at include/net/mac80211.h:607)
---
diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c
index efe47ec..9f5ebab 100644
--- a/drivers/net/wireless/p54/fwio.c
+++ b/drivers/net/wireless/p54/fwio.c
@@ -320,7 +320,7 @@ int p54_setup_mac(struct p54_common *priv)
 		return -ENOMEM;
 
 	setup = (struct p54_setup_mac *) skb_put(skb, sizeof(*setup));
-	if (priv->hw->conf.radio_enabled) {
+	if (!(priv->hw->conf.flags & IEEE80211_CONF_IDLE)) {
 		switch (priv->mode) {
 		case NL80211_IFTYPE_STATION:
 			mode = P54_FILTER_TYPE_STATION;
@@ -348,8 +348,9 @@ int p54_setup_mac(struct p54_common *priv)
 		     (priv->filter_flags & FIF_OTHER_BSS)) &&
 		    (mode != P54_FILTER_TYPE_PROMISCUOUS))
 			mode |= P54_FILTER_TYPE_TRANSPARENT;
-	} else
+	} else {
 		mode = P54_FILTER_TYPE_HIBERNATE;
+	}
 
 	setup->mac_mode = cpu_to_le16(mode);
 	memcpy(setup->mac_addr, priv->mac_addr, ETH_ALEN);
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 955f6d7..fe36983 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -288,7 +288,11 @@ static int p54_config(struct ieee80211_hw *dev, u32 changed)
 		if (ret)
 			goto out;
 	}
-
+	if (changed & IEEE80211_CONF_CHANGE_IDLE) {
+		ret = p54_setup_mac(priv);
+		if (ret)
+			goto out;
+	}
 out:
 	mutex_unlock(&priv->conf_mutex);
 	return ret;
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 0d589d6..d38f10a 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -552,6 +552,12 @@ static void p54_rx_trap(struct p54_common *priv, struct sk_buff *skb)
 		break;
 	case P54_TRAP_TIMER:
 		break;
+	case P54_TRAP_FAA_RADIO_OFF:
+		wiphy_rfkill_set_hw_state(priv->hw->wiphy, true);
+		break;
+	case P54_TRAP_FAA_RADIO_ON:
+		wiphy_rfkill_set_hw_state(priv->hw->wiphy, false);
+		break;
 	default:
 		printk(KERN_INFO "%s: received event:%x freq:%d\n",
 		       wiphy_name(priv->hw->wiphy), event, freq);

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

* Re: [RFT] p54: implement rfkill
  2009-07-19 21:54 [RFT] p54: implement rfkill Christian Lamparter
@ 2009-08-07 15:36 ` John W. Linville
  2009-08-07 16:39   ` Larry Finger
  0 siblings, 1 reply; 4+ messages in thread
From: John W. Linville @ 2009-08-07 15:36 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: wireless

On Sun, Jul 19, 2009 at 11:54:15PM +0200, Christian Lamparter wrote:
> This patch gets rid of the deprecated radio_enabled
> 
> fwio.c: In function ‘p54_setup_mac’:
> fwio.c:323: warning: ‘radio_enabled’ is deprecated (declared at include/net/mac80211.h:607)

Anyone had a chance to test this?  And report the results to Christian?

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* Re: [RFT] p54: implement rfkill
  2009-08-07 15:36 ` John W. Linville
@ 2009-08-07 16:39   ` Larry Finger
  2009-08-19 14:41     ` John W. Linville
  0 siblings, 1 reply; 4+ messages in thread
From: Larry Finger @ 2009-08-07 16:39 UTC (permalink / raw)
  To: John W. Linville, Christian Lamparter; +Cc: wireless

John W. Linville wrote:
> On Sun, Jul 19, 2009 at 11:54:15PM +0200, Christian Lamparter wrote:
>> This patch gets rid of the deprecated radio_enabled
>>
>> fwio.c: In function ‘p54_setup_mac’:
>> fwio.c:323: warning: ‘radio_enabled’ is deprecated (declared at include/net/mac80211.h:607)
> 
> Anyone had a chance to test this?  And report the results to Christian?

Sorry - I missed this one.

I just tested it. With the patch, the warning is removed. As far as
system operation, the following is observed:

1. If b43 is loaded when using p54usb, then the hardware switch will
kill operation. This behavior is the same with or without this patch.

2. If b43 is unloaded, then p54usb no longer follows the hardware
switch, but operation can be killed with the rfkill user-space
utility. Again, this behavior does not depend on the patch.

Based on the code changes in the patch, it looks as if the radio is
turned off when the device is blocked, but I have no way to test that.

Christian - please add a
Tested-by: Larry Finger <Larry.Finger@lwfinger.net> to the patch and
submit. This change should be in 2.6.32.

Larry



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

* Re: [RFT] p54: implement rfkill
  2009-08-07 16:39   ` Larry Finger
@ 2009-08-19 14:41     ` John W. Linville
  0 siblings, 0 replies; 4+ messages in thread
From: John W. Linville @ 2009-08-19 14:41 UTC (permalink / raw)
  To: Larry Finger; +Cc: Christian Lamparter, wireless

On Fri, Aug 07, 2009 at 11:39:40AM -0500, Larry Finger wrote:
> John W. Linville wrote:
> > On Sun, Jul 19, 2009 at 11:54:15PM +0200, Christian Lamparter wrote:
> >> This patch gets rid of the deprecated radio_enabled
> >>
> >> fwio.c: In function ‘p54_setup_mac’:
> >> fwio.c:323: warning: ‘radio_enabled’ is deprecated (declared at include/net/mac80211.h:607)
> > 
> > Anyone had a chance to test this?  And report the results to Christian?
> 
> Sorry - I missed this one.
> 
> I just tested it. With the patch, the warning is removed. As far as
> system operation, the following is observed:
> 
> 1. If b43 is loaded when using p54usb, then the hardware switch will
> kill operation. This behavior is the same with or without this patch.
> 
> 2. If b43 is unloaded, then p54usb no longer follows the hardware
> switch, but operation can be killed with the rfkill user-space
> utility. Again, this behavior does not depend on the patch.
> 
> Based on the code changes in the patch, it looks as if the radio is
> turned off when the device is blocked, but I have no way to test that.
> 
> Christian - please add a
> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> to the patch and
> submit. This change should be in 2.6.32.
> 
> Larry

Original patch lacks a Signed-off-by...

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

end of thread, other threads:[~2009-08-19 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-19 21:54 [RFT] p54: implement rfkill Christian Lamparter
2009-08-07 15:36 ` John W. Linville
2009-08-07 16:39   ` Larry Finger
2009-08-19 14:41     ` John W. Linville

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