ath5k_rfkill.c File Reference

#include "base.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (MIT)
static void ath5k_rfkill_disable (struct ath5k_softc *sc)
static void ath5k_rfkill_enable (struct ath5k_softc *sc)
static void ath5k_rfkill_set_intr (struct ath5k_softc *sc, int enable)
static int __unused ath5k_is_rfkill_set (struct ath5k_softc *sc)
void ath5k_rfkill_hw_start (struct ath5k_hw *ah)
void ath5k_rfkill_hw_stop (struct ath5k_hw *ah)


Function Documentation

FILE_LICENCE ( MIT   ) 

static void ath5k_rfkill_disable ( struct ath5k_softc sc  )  [inline, static]

Definition at line 42 of file ath5k_rfkill.c.

References ath5k_softc::ah, ath5k_hw_set_gpio(), ath5k_hw_set_gpio_output(), DBG, ath5k_softc::gpio, ath5k_softc::polarity, and ath5k_softc::rf_kill.

Referenced by ath5k_rfkill_hw_start().

00043 {
00044         DBG("ath5k: rfkill disable (gpio:%d polarity:%d)\n",
00045             sc->rf_kill.gpio, sc->rf_kill.polarity);
00046         ath5k_hw_set_gpio_output(sc->ah, sc->rf_kill.gpio);
00047         ath5k_hw_set_gpio(sc->ah, sc->rf_kill.gpio, !sc->rf_kill.polarity);
00048 }

static void ath5k_rfkill_enable ( struct ath5k_softc sc  )  [inline, static]

Definition at line 51 of file ath5k_rfkill.c.

References ath5k_softc::ah, ath5k_hw_set_gpio(), ath5k_hw_set_gpio_output(), DBG, ath5k_softc::gpio, ath5k_softc::polarity, and ath5k_softc::rf_kill.

Referenced by ath5k_rfkill_hw_stop().

00052 {
00053         DBG("ath5k: rfkill enable (gpio:%d polarity:%d)\n",
00054             sc->rf_kill.gpio, sc->rf_kill.polarity);
00055         ath5k_hw_set_gpio_output(sc->ah, sc->rf_kill.gpio);
00056         ath5k_hw_set_gpio(sc->ah, sc->rf_kill.gpio, sc->rf_kill.polarity);
00057 }

static void ath5k_rfkill_set_intr ( struct ath5k_softc sc,
int  enable 
) [inline, static]

Definition at line 59 of file ath5k_rfkill.c.

References ath5k_softc::ah, ath5k_hw_get_gpio(), ath5k_hw_set_gpio_input(), ath5k_hw_set_gpio_intr(), ath5k_softc::gpio, ath5k_softc::rf_kill, and u32.

Referenced by ath5k_rfkill_hw_start(), and ath5k_rfkill_hw_stop().

00060 {
00061         struct ath5k_hw *ah = sc->ah;
00062         u32 curval;
00063 
00064         ath5k_hw_set_gpio_input(ah, sc->rf_kill.gpio);
00065         curval = ath5k_hw_get_gpio(ah, sc->rf_kill.gpio);
00066         ath5k_hw_set_gpio_intr(ah, sc->rf_kill.gpio, enable ?
00067                                !!curval : !curval);
00068 }

static int __unused ath5k_is_rfkill_set ( struct ath5k_softc sc  )  [static]

Definition at line 71 of file ath5k_rfkill.c.

References ath5k_softc::ah, ath5k_hw_get_gpio(), ath5k_softc::gpio, ath5k_softc::polarity, and ath5k_softc::rf_kill.

00072 {
00073         /* configuring GPIO for input for some reason disables rfkill */
00074         /*ath5k_hw_set_gpio_input(sc->ah, sc->rf_kill.gpio);*/
00075         return (ath5k_hw_get_gpio(sc->ah, sc->rf_kill.gpio) ==
00076                 sc->rf_kill.polarity);
00077 }

void ath5k_rfkill_hw_start ( struct ath5k_hw ah  ) 

void ath5k_rfkill_hw_stop ( struct ath5k_hw ah  ) 

Definition at line 97 of file ath5k_rfkill.c.

References ath5k_hw::ah_capabilities, ath5k_hw::ah_sc, AR5K_EEPROM_HDR_RFKILL, ath5k_rfkill_enable(), ath5k_rfkill_set_intr(), ath5k_capabilities::cap_eeprom, and ath5k_eeprom_info::ee_header.

Referenced by ath5k_stop_hw().

00098 {
00099         struct ath5k_softc *sc = ah->ah_sc;
00100 
00101         /* disable interrupt for rfkill switch */
00102         if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
00103                 ath5k_rfkill_set_intr(sc, 0);
00104 
00105         /* enable RFKILL when stopping HW so Wifi LED is turned off */
00106         ath5k_rfkill_enable(sc);
00107 }


Generated on Tue Apr 6 20:01:20 2010 for gPXE by  doxygen 1.5.7.1