diff options
author | Christian Lamparter <chunkeey@web.de> | 2009-08-07 13:39:05 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:13:45 -0400 |
commit | 6208f8b22cb24e446f24eb9f4aa9f4c3a9a1d52e (patch) | |
tree | 054637baf5739ed552a53ee5662b2317789eb487 /drivers/net/wireless/p54 | |
parent | 718126a75e5fd4c6df6ee0567f00c7345b2370f4 (diff) |
p54: implement rfkill
This patch implements a basic rfkill support for p54 hardware and
removes a rfkill related WARNING:
fwio.c: In function ‘p54_setup_mac’:
fwio.c:323: warning: ‘radio_enabled’ is deprecated.
by abandoning radio_enable in flavour for IEEE80211_CONF_CHANGE_IDLE.
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/p54')
-rw-r--r-- | drivers/net/wireless/p54/fwio.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/p54/main.c | 5 | ||||
-rw-r--r-- | drivers/net/wireless/p54/txrx.c | 6 |
3 files changed, 14 insertions, 2 deletions
diff --git a/drivers/net/wireless/p54/fwio.c b/drivers/net/wireless/p54/fwio.c index 21f19018fab5..e7b9e9cb39f5 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) | |||
320 | return -ENOMEM; | 320 | return -ENOMEM; |
321 | 321 | ||
322 | setup = (struct p54_setup_mac *) skb_put(skb, sizeof(*setup)); | 322 | setup = (struct p54_setup_mac *) skb_put(skb, sizeof(*setup)); |
323 | if (priv->hw->conf.radio_enabled) { | 323 | if (!(priv->hw->conf.flags & IEEE80211_CONF_IDLE)) { |
324 | switch (priv->mode) { | 324 | switch (priv->mode) { |
325 | case NL80211_IFTYPE_STATION: | 325 | case NL80211_IFTYPE_STATION: |
326 | mode = P54_FILTER_TYPE_STATION; | 326 | mode = P54_FILTER_TYPE_STATION; |
@@ -348,8 +348,9 @@ int p54_setup_mac(struct p54_common *priv) | |||
348 | (priv->filter_flags & FIF_OTHER_BSS)) && | 348 | (priv->filter_flags & FIF_OTHER_BSS)) && |
349 | (mode != P54_FILTER_TYPE_PROMISCUOUS)) | 349 | (mode != P54_FILTER_TYPE_PROMISCUOUS)) |
350 | mode |= P54_FILTER_TYPE_TRANSPARENT; | 350 | mode |= P54_FILTER_TYPE_TRANSPARENT; |
351 | } else | 351 | } else { |
352 | mode = P54_FILTER_TYPE_HIBERNATE; | 352 | mode = P54_FILTER_TYPE_HIBERNATE; |
353 | } | ||
353 | 354 | ||
354 | setup->mac_mode = cpu_to_le16(mode); | 355 | setup->mac_mode = cpu_to_le16(mode); |
355 | memcpy(setup->mac_addr, priv->mac_addr, ETH_ALEN); | 356 | 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 b99ee9b472b6..4a741df9c081 100644 --- a/drivers/net/wireless/p54/main.c +++ b/drivers/net/wireless/p54/main.c | |||
@@ -288,6 +288,11 @@ static int p54_config(struct ieee80211_hw *dev, u32 changed) | |||
288 | if (ret) | 288 | if (ret) |
289 | goto out; | 289 | goto out; |
290 | } | 290 | } |
291 | if (changed & IEEE80211_CONF_CHANGE_IDLE) { | ||
292 | ret = p54_setup_mac(priv); | ||
293 | if (ret) | ||
294 | goto out; | ||
295 | } | ||
291 | 296 | ||
292 | out: | 297 | out: |
293 | mutex_unlock(&priv->conf_mutex); | 298 | mutex_unlock(&priv->conf_mutex); |
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c index 704685fab177..6fc0b6148c8a 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) | |||
552 | break; | 552 | break; |
553 | case P54_TRAP_TIMER: | 553 | case P54_TRAP_TIMER: |
554 | break; | 554 | break; |
555 | case P54_TRAP_FAA_RADIO_OFF: | ||
556 | wiphy_rfkill_set_hw_state(priv->hw->wiphy, true); | ||
557 | break; | ||
558 | case P54_TRAP_FAA_RADIO_ON: | ||
559 | wiphy_rfkill_set_hw_state(priv->hw->wiphy, false); | ||
560 | break; | ||
555 | default: | 561 | default: |
556 | printk(KERN_INFO "%s: received event:%x freq:%d\n", | 562 | printk(KERN_INFO "%s: received event:%x freq:%d\n", |
557 | wiphy_name(priv->hw->wiphy), event, freq); | 563 | wiphy_name(priv->hw->wiphy), event, freq); |