* [PATCH] b43/b43legacy: add RFKILL_STATE_HARD_BLOCKED support
@ 2008-06-29 17:20 drago01
2008-06-29 18:33 ` Henrique de Moraes Holschuh
2008-06-30 21:35 ` John W. Linville
0 siblings, 2 replies; 3+ messages in thread
From: drago01 @ 2008-06-29 17:20 UTC (permalink / raw)
To: Linux Wireless
Cc: Michael Buesch, stefano.brivio, Larry Finger, John W. Linville,
Henrique de Moraes Holschuh, Ivo van Doorn
Hi,
The attached patch adds RFKILL_STATE_HARD_BLOCKED to the b43/b43legacy drivers.
Note: I don't have any hardware to test on, so if you have the
hardware please test.
-----------
This patch sets the rfkill state to RFKILL_STATE_HARD_BLOCKED when the
radio is killed
by the hardware switch.
Signed-off-by: Adel Gadllah <adel.gadllah@gmail.com>
diff --git a/drivers/net/wireless/b43/rfkill.c
b/drivers/net/wireless/b43/rfkill.c
index 4cca203..4c0dd99 100644
--- a/drivers/net/wireless/b43/rfkill.c
+++ b/drivers/net/wireless/b43/rfkill.c
@@ -43,6 +43,23 @@ static bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
return 0;
}
+/* Update the rfkill state */
+static void b43_rfkill_update_state(struct b43_wldev *dev)
+{
+ struct b43_rfkill *rfk = &(dev->wl->rfkill);
+
+ if (!dev->radio_hw_enable) {
+ rfk->rfkill->state = RFKILL_STATE_HARD_BLOCKED;
+ return;
+ }
+
+ if (!dev->phy.radio_on)
+ rfk->rfkill->state = RFKILL_STATE_SOFT_BLOCKED;
+ else
+ rfk->rfkill->state = RFKILL_STATE_UNBLOCKED;
+
+}
+
/* The poll callback for the hardware button. */
static void b43_rfkill_poll(struct input_polled_dev *poll_dev)
{
@@ -60,6 +77,7 @@ static void b43_rfkill_poll(struct input_polled_dev *poll_dev)
if (unlikely(enabled != dev->radio_hw_enable)) {
dev->radio_hw_enable = enabled;
report_change = 1;
+ b43_rfkill_update_state(dev);
b43info(wl, "Radio hardware status changed to %s\n",
enabled ? "ENABLED" : "DISABLED");
}
diff --git a/drivers/net/wireless/b43legacy/rfkill.c
b/drivers/net/wireless/b43legacy/rfkill.c
index 8935a30..19dabb7 100644
--- a/drivers/net/wireless/b43legacy/rfkill.c
+++ b/drivers/net/wireless/b43legacy/rfkill.c
@@ -44,6 +44,23 @@ static bool b43legacy_is_hw_radio_enabled(struct
b43legacy_wldev *dev)
return 0;
}
+/* Update the rfkill state */
+static void b43legacy_rfkill_update_state(struct b43legacy_wldev *dev)
+{
+ struct b43_rfkill *rfk = &(dev->wl->rfkill);
+
+ if (!dev->radio_hw_enable) {
+ rfk->rfkill->state = RFKILL_STATE_HARD_BLOCKED;
+ return;
+ }
+
+ if (!dev->phy.radio_on)
+ rfk->rfkill->state = RFKILL_STATE_SOFT_BLOCKED;
+ else
+ rfk->rfkill->state = RFKILL_STATE_UNBLOCKED;
+
+}
+
/* The poll callback for the hardware button. */
static void b43legacy_rfkill_poll(struct input_polled_dev *poll_dev)
{
@@ -61,6 +78,7 @@ static void b43legacy_rfkill_poll(struct
input_polled_dev *poll_dev)
if (unlikely(enabled != dev->radio_hw_enable)) {
dev->radio_hw_enable = enabled;
report_change = 1;
+ b43legacy_rfkill_update_state(dev);
b43legacyinfo(wl, "Radio hardware status changed to %s\n",
enabled ? "ENABLED" : "DISABLED");
}
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] b43/b43legacy: add RFKILL_STATE_HARD_BLOCKED support
2008-06-29 17:20 [PATCH] b43/b43legacy: add RFKILL_STATE_HARD_BLOCKED support drago01
@ 2008-06-29 18:33 ` Henrique de Moraes Holschuh
2008-06-30 21:35 ` John W. Linville
1 sibling, 0 replies; 3+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-06-29 18:33 UTC (permalink / raw)
To: drago01
Cc: Linux Wireless, Michael Buesch, stefano.brivio, Larry Finger,
John W. Linville, Ivo van Doorn
On Sun, 29 Jun 2008, drago01 wrote:
> The attached patch adds RFKILL_STATE_HARD_BLOCKED to the b43/b43legacy drivers.
While at it, if b43 still has any input layer stuff, especially any input
polldev stuff, please rip that off.
Userspace or a platform driver should listen to the b43 reports on the
rfkill notifier chain (or uevents) and issue the input events.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] b43/b43legacy: add RFKILL_STATE_HARD_BLOCKED support
2008-06-29 17:20 [PATCH] b43/b43legacy: add RFKILL_STATE_HARD_BLOCKED support drago01
2008-06-29 18:33 ` Henrique de Moraes Holschuh
@ 2008-06-30 21:35 ` John W. Linville
1 sibling, 0 replies; 3+ messages in thread
From: John W. Linville @ 2008-06-30 21:35 UTC (permalink / raw)
To: drago01
Cc: Linux Wireless, Michael Buesch, stefano.brivio, Larry Finger,
Henrique de Moraes Holschuh, Ivo van Doorn
On Sun, Jun 29, 2008 at 07:20:21PM +0200, drago01 wrote:
> diff --git a/drivers/net/wireless/b43/rfkill.c
> b/drivers/net/wireless/b43/rfkill.c
> index 4cca203..4c0dd99 100644
> --- a/drivers/net/wireless/b43/rfkill.c
> +++ b/drivers/net/wireless/b43/rfkill.c
> @@ -43,6 +43,23 @@ static bool b43_is_hw_radio_enabled(struct b43_wldev *dev)
> return 0;
> }
>
> +/* Update the rfkill state */
> +static void b43_rfkill_update_state(struct b43_wldev *dev)
> +{
> + struct b43_rfkill *rfk = &(dev->wl->rfkill);
<snip>
> diff --git a/drivers/net/wireless/b43legacy/rfkill.c
> b/drivers/net/wireless/b43legacy/rfkill.c
> index 8935a30..19dabb7 100644
> --- a/drivers/net/wireless/b43legacy/rfkill.c
> +++ b/drivers/net/wireless/b43legacy/rfkill.c
> @@ -44,6 +44,23 @@ static bool b43legacy_is_hw_radio_enabled(struct
> b43legacy_wldev *dev)
> return 0;
> }
>
> +/* Update the rfkill state */
> +static void b43legacy_rfkill_update_state(struct b43legacy_wldev *dev)
> +{
> + struct b43_rfkill *rfk = &(dev->wl->rfkill);
In b43legacy the structure name is 'b43legacy_rfkill'. Please make
sure you compile patches before submitting them.
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-30 21:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-29 17:20 [PATCH] b43/b43legacy: add RFKILL_STATE_HARD_BLOCKED support drago01
2008-06-29 18:33 ` Henrique de Moraes Holschuh
2008-06-30 21:35 ` 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).