iPXE
Functions
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().

{
        DBG("ath5k: rfkill disable (gpio:%d polarity:%d)\n",
            sc->rf_kill.gpio, sc->rf_kill.polarity);
        ath5k_hw_set_gpio_output(sc->ah, sc->rf_kill.gpio);
        ath5k_hw_set_gpio(sc->ah, sc->rf_kill.gpio, !sc->rf_kill.polarity);
}
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().

{
        DBG("ath5k: rfkill enable (gpio:%d polarity:%d)\n",
            sc->rf_kill.gpio, sc->rf_kill.polarity);
        ath5k_hw_set_gpio_output(sc->ah, sc->rf_kill.gpio);
        ath5k_hw_set_gpio(sc->ah, sc->rf_kill.gpio, sc->rf_kill.polarity);
}
static void ath5k_rfkill_set_intr ( struct ath5k_softc sc,
int  enable 
) [inline, static]
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.

{
        /* configuring GPIO for input for some reason disables rfkill */
        /*ath5k_hw_set_gpio_input(sc->ah, sc->rf_kill.gpio);*/
        return (ath5k_hw_get_gpio(sc->ah, sc->rf_kill.gpio) ==
                sc->rf_kill.polarity);
}
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().

{
        struct ath5k_softc *sc = ah->ah_sc;

        /* disable interrupt for rfkill switch */
        if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
                ath5k_rfkill_set_intr(sc, 0);

        /* enable RFKILL when stopping HW so Wifi LED is turned off */
        ath5k_rfkill_enable(sc);
}