iPXE
ath5k_rfkill.c File Reference
#include "base.h"

Go to the source code of this file.

Functions

 FILE_LICENCE (MIT)
 FILE_SECBOOT (FORBIDDEN)
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()

FILE_LICENCE ( MIT )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN )

◆ ath5k_rfkill_disable()

void ath5k_rfkill_disable ( struct ath5k_softc * sc)
inlinestatic

Definition at line 43 of file ath5k_rfkill.c.

44{
45 DBG("ath5k: rfkill disable (gpio:%d polarity:%d)\n",
46 sc->rf_kill.gpio, sc->rf_kill.polarity);
49}
int ath5k_hw_set_gpio(struct ath5k_hw *ah, u32 gpio, u32 val)
Definition ath5k_gpio.c:78
int ath5k_hw_set_gpio_output(struct ath5k_hw *ah, u32 gpio)
Definition ath5k_gpio.c:50
#define DBG(...)
Print a debugging message.
Definition compiler.h:498
struct ath5k_hw * ah
Definition base.h:93
u16 gpio
Definition base.h:128
struct ath5k_softc::@344164377243325166301233055376377150275233304000 rf_kill
unsigned polarity
Definition base.h:129

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

◆ ath5k_rfkill_enable()

void ath5k_rfkill_enable ( struct ath5k_softc * sc)
inlinestatic

Definition at line 52 of file ath5k_rfkill.c.

53{
54 DBG("ath5k: rfkill enable (gpio:%d polarity:%d)\n",
55 sc->rf_kill.gpio, sc->rf_kill.polarity);
58}

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

◆ ath5k_rfkill_set_intr()

void ath5k_rfkill_set_intr ( struct ath5k_softc * sc,
int enable )
inlinestatic

Definition at line 60 of file ath5k_rfkill.c.

61{
62 struct ath5k_hw *ah = sc->ah;
63 u32 curval;
64
66 curval = ath5k_hw_get_gpio(ah, sc->rf_kill.gpio);
68 !!curval : !curval);
69}
u32 ath5k_hw_get_gpio(struct ath5k_hw *ah, u32 gpio)
Definition ath5k_gpio.c:65
int ath5k_hw_set_gpio_input(struct ath5k_hw *ah, u32 gpio)
Definition ath5k_gpio.c:35
void ath5k_hw_set_gpio_intr(struct ath5k_hw *ah, unsigned int gpio, u32 interrupt_level)
Definition ath5k_gpio.c:99
uint8_t ah
Definition registers.h:1
ath5k_hw_get_isr - Get interrupt status
Definition ath5k.h:955
#define u32
Definition vga.h:21

References ah, 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().

◆ ath5k_is_rfkill_set()

int __unused ath5k_is_rfkill_set ( struct ath5k_softc * sc)
static

Definition at line 72 of file ath5k_rfkill.c.

73{
74 /* configuring GPIO for input for some reason disables rfkill */
75 /*ath5k_hw_set_gpio_input(sc->ah, sc->rf_kill.gpio);*/
76 return (ath5k_hw_get_gpio(sc->ah, sc->rf_kill.gpio) ==
77 sc->rf_kill.polarity);
78}

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

◆ ath5k_rfkill_hw_start()

void ath5k_rfkill_hw_start ( struct ath5k_hw * ah)

Definition at line 81 of file ath5k_rfkill.c.

82{
83 struct ath5k_softc *sc = ah->ah_sc;
84
85 /* read rfkill GPIO configuration from EEPROM header */
86 sc->rf_kill.gpio = ah->ah_capabilities.cap_eeprom.ee_rfkill_pin;
87 sc->rf_kill.polarity = ah->ah_capabilities.cap_eeprom.ee_rfkill_pol;
88
90
91 /* enable interrupt for rfkill switch */
92 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
94}
#define AR5K_EEPROM_HDR_RFKILL(_v)
Definition eeprom.h:75
static void ath5k_rfkill_disable(struct ath5k_softc *sc)
static void ath5k_rfkill_set_intr(struct ath5k_softc *sc, int enable)

References ah, AR5K_EEPROM_HDR_RFKILL, ath5k_rfkill_disable(), ath5k_rfkill_set_intr(), ath5k_softc::gpio, ath5k_softc::polarity, and ath5k_softc::rf_kill.

Referenced by ath5k_init().

◆ ath5k_rfkill_hw_stop()

void ath5k_rfkill_hw_stop ( struct ath5k_hw * ah)

Definition at line 98 of file ath5k_rfkill.c.

99{
100 struct ath5k_softc *sc = ah->ah_sc;
101
102 /* disable interrupt for rfkill switch */
103 if (AR5K_EEPROM_HDR_RFKILL(ah->ah_capabilities.cap_eeprom.ee_header))
105
106 /* enable RFKILL when stopping HW so Wifi LED is turned off */
108}
static void ath5k_rfkill_enable(struct ath5k_softc *sc)

References ah, AR5K_EEPROM_HDR_RFKILL, ath5k_rfkill_enable(), and ath5k_rfkill_set_intr().

Referenced by ath5k_stop_hw().