ath5k: added cfg80211 based rfkill support

This patch introduces initial rfkill support for the ath5k driver
based on rfkill support in the cfg80211 framework.
All rfkill related code is separated into newly created rfkill.c.

Changes to existing code are minimal:

* added a new data structure ath5k_rfkill to the ath5k_softc structure
* inserted calls to HW rfkill init/deinit routines
* ath5k_intr() has been extended to handle AR5K_INT_GPIO interrupts

Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Tobias Doerffel
2009-06-09 17:33:27 +02:00
committed by John W. Linville
parent 207ee16217
commit e6a3b61681
7 changed files with 163 additions and 17 deletions

View File

@@ -46,6 +46,7 @@
#include <linux/wireless.h>
#include <linux/if_ether.h>
#include <linux/leds.h>
#include <linux/rfkill.h>
#include "ath5k.h"
#include "debug.h"
@@ -91,6 +92,15 @@ struct ath5k_led
struct led_classdev led_dev; /* led classdev */
};
/* Rfkill */
struct ath5k_rfkill {
/* GPIO PIN for rfkill */
u16 gpio;
/* polarity of rfkill GPIO PIN */
bool polarity;
/* RFKILL toggle tasklet */
struct tasklet_struct toggleq;
};
#if CHAN_DEBUG
#define ATH_CHAN_MAX (26+26+26+200+200)
@@ -167,6 +177,10 @@ struct ath5k_softc {
struct tasklet_struct txtq; /* tx intr tasklet */
struct ath5k_led tx_led; /* tx led */
#ifdef CONFIG_ATH5K_RFKILL
struct ath5k_rfkill rf_kill;
#endif
spinlock_t block; /* protects beacon */
struct tasklet_struct beacontq; /* beacon intr tasklet */
struct ath5k_buf *bbuf; /* beacon buffer */