iPXE
common.h File Reference
#include "../ath.h"
#include "hw.h"
#include "hw-ops.h"

Go to the source code of this file.

Macros

#define WME_NUM_TID   16
#define WME_BA_BMP_SIZE   64
#define WME_MAX_BA   WME_BA_BMP_SIZE
#define ATH_TID_MAX_BUFS   (2 * WME_MAX_BA)
#define WME_AC_BE   2
#define WME_NUM_AC   1
#define ATH_RSSI_DUMMY_MARKER   0x127
#define ATH_RSSI_LPF_LEN   10
#define RSSI_LPF_THRESHOLD   -20
#define ATH_RSSI_EP_MULTIPLIER   (1<<7)
#define ATH_EP_MUL(x, mul)
#define ATH_RSSI_IN(x)
#define ATH_LPF_RSSI(x, y, len)
#define ATH_RSSI_LPF(x, y)
#define ATH_EP_RND(x, mul)

Functions

 FILE_LICENCE (BSD2)
 FILE_SECBOOT (FORBIDDEN)
void ath9k_cmn_update_ichannel (struct ath9k_channel *ichan, struct net80211_channel *chan)
struct ath9k_channelath9k_cmn_get_curchannel (struct net80211_device *dev, struct ath_hw *ah)
void ath9k_cmn_update_txpow (struct ath_hw *ah, u16 cur_txpow, u16 new_txpow, u16 *txpower)

Macro Definition Documentation

◆ WME_NUM_TID

#define WME_NUM_TID   16

Definition at line 30 of file common.h.

◆ WME_BA_BMP_SIZE

#define WME_BA_BMP_SIZE   64

Definition at line 31 of file common.h.

◆ WME_MAX_BA

#define WME_MAX_BA   WME_BA_BMP_SIZE

Definition at line 32 of file common.h.

◆ ATH_TID_MAX_BUFS

#define ATH_TID_MAX_BUFS   (2 * WME_MAX_BA)

Definition at line 33 of file common.h.

◆ WME_AC_BE

#define WME_AC_BE   2

Definition at line 35 of file common.h.

Referenced by ath_txq_setup().

◆ WME_NUM_AC

#define WME_NUM_AC   1

Definition at line 36 of file common.h.

Referenced by ath9k_init_queues().

◆ ATH_RSSI_DUMMY_MARKER

#define ATH_RSSI_DUMMY_MARKER   0x127

Definition at line 38 of file common.h.

Referenced by ath9k_bss_iter(), and ath9k_init_device().

◆ ATH_RSSI_LPF_LEN

#define ATH_RSSI_LPF_LEN   10

Definition at line 39 of file common.h.

◆ RSSI_LPF_THRESHOLD

#define RSSI_LPF_THRESHOLD   -20

Definition at line 40 of file common.h.

◆ ATH_RSSI_EP_MULTIPLIER

#define ATH_RSSI_EP_MULTIPLIER   (1<<7)

Definition at line 41 of file common.h.

◆ ATH_EP_MUL

#define ATH_EP_MUL ( x,
mul )
Value:
((x) * (mul))
static unsigned int x
Definition pixbuf.h:63

Definition at line 42 of file common.h.

◆ ATH_RSSI_IN

#define ATH_RSSI_IN ( x)
Value:
#define ATH_RSSI_EP_MULTIPLIER
Definition common.h:41
#define ATH_EP_MUL(x, mul)
Definition common.h:42

Definition at line 43 of file common.h.

◆ ATH_LPF_RSSI

#define ATH_LPF_RSSI ( x,
y,
len )
Value:
((x != ATH_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))
#define ATH_RSSI_DUMMY_MARKER
Definition common.h:38
ring len
Length.
Definition dwmac.h:226
static unsigned int unsigned int y
Definition pixbuf.h:63

Definition at line 44 of file common.h.

44#define ATH_LPF_RSSI(x, y, len) \
45 ((x != ATH_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))

◆ ATH_RSSI_LPF

#define ATH_RSSI_LPF ( x,
y )
Value:
do { \
if ((y) >= RSSI_LPF_THRESHOLD) \
} while (0)
#define ATH_RSSI_IN(x)
Definition common.h:43
#define ATH_RSSI_LPF_LEN
Definition common.h:39
#define ATH_LPF_RSSI(x, y, len)
Definition common.h:44
#define RSSI_LPF_THRESHOLD
Definition common.h:40

Definition at line 46 of file common.h.

46#define ATH_RSSI_LPF(x, y) do { \
47 if ((y) >= RSSI_LPF_THRESHOLD) \
48 x = ATH_LPF_RSSI((x), ATH_RSSI_IN((y)), ATH_RSSI_LPF_LEN); \
49} while (0)

◆ ATH_EP_RND

#define ATH_EP_RND ( x,
mul )
Value:
((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))

Definition at line 50 of file common.h.

50#define ATH_EP_RND(x, mul) \
51 ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( BSD2 )

◆ FILE_SECBOOT()

FILE_SECBOOT ( FORBIDDEN )

◆ ath9k_cmn_update_ichannel()

void ath9k_cmn_update_ichannel ( struct ath9k_channel * ichan,
struct net80211_channel * chan )

Definition at line 31 of file ath9k_common.c.

33{
34 ichan->channel = chan->center_freq;
35 ichan->chan = chan;
36
37 if (chan->band == NET80211_BAND_2GHZ) {
38 ichan->chanmode = CHANNEL_G;
40 } else {
41 ichan->chanmode = CHANNEL_A;
43 }
44}
#define CHANNEL_5GHZ
Definition ath5k.h:635
#define CHANNEL_OFDM
Definition ath5k.h:633
#define CHANNEL_G
Definition ath5k.h:642
#define CHANNEL_A
Definition ath5k.h:640
#define CHANNEL_2GHZ
Definition ath5k.h:634
#define NET80211_BAND_2GHZ
The 2.4 GHz ISM band, unlicensed in most countries.
Definition net80211.h:45
u16 channel
Definition hw.h:350
u32 chanmode
Definition hw.h:352
struct net80211_channel * chan
Definition hw.h:348
u32 channelFlags
Definition hw.h:351
u16 center_freq
The center frequency for this channel.
Definition net80211.h:411
u8 band
The band with which this channel is associated.
Definition net80211.h:388

References net80211_channel::band, net80211_channel::center_freq, ath9k_channel::chan, ath9k_channel::chanmode, ath9k_channel::channel, CHANNEL_2GHZ, CHANNEL_5GHZ, CHANNEL_A, CHANNEL_G, CHANNEL_OFDM, ath9k_channel::channelFlags, and NET80211_BAND_2GHZ.

Referenced by ath9k_cmn_get_curchannel(), and ath9k_config().

◆ ath9k_cmn_get_curchannel()

struct ath9k_channel * ath9k_cmn_get_curchannel ( struct net80211_device * dev,
struct ath_hw * ah )

Definition at line 49 of file ath9k_common.c.

51{
52 struct net80211_channel *curchan = dev->channels + dev->channel;
53 struct ath9k_channel *channel;
54 u8 chan_idx;
55
56 chan_idx = curchan->hw_value;
57 channel = &ah->channels[chan_idx];
59
60 return channel;
61}
void ath9k_cmn_update_ichannel(struct ath9k_channel *ichan, struct net80211_channel *chan)
#define u8
Definition igbvf_osdep.h:40
uint32_t channel
RNDIS channel.
Definition netvsc.h:3
uint8_t ah
Definition registers.h:1
An 802.11 RF channel.
Definition net80211.h:386
u16 hw_value
Hardware channel value.
Definition net80211.h:414
struct net80211_channel channels[NET80211_MAX_CHANNELS]
A list of all possible channels we might use.
Definition net80211.h:806
u8 channel
The channel currently in use, as an index into the channels array.
Definition net80211.h:812

References ah, ath9k_cmn_update_ichannel(), channel, net80211_device::channel, net80211_device::channels, net80211_channel::hw_value, and u8.

Referenced by ath9k_start(), and ath_radio_disable().

◆ ath9k_cmn_update_txpow()

void ath9k_cmn_update_txpow ( struct ath_hw * ah,
u16 cur_txpow,
u16 new_txpow,
u16 * txpower )

Definition at line 63 of file ath9k_common.c.

65{
66 if (cur_txpow != new_txpow) {
67 ath9k_hw_set_txpowerlimit(ah, new_txpow, 0);
68 /* read back in case value is clamped */
70 }
71}
void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, int test)
Definition ath9k_hw.c:1939
static struct ath_regulatory * ath9k_hw_regulatory(struct ath_hw *ah)
Definition hw.h:875
int16_t power_limit
Definition ath.h:145

References ah, ath9k_hw_regulatory(), ath9k_hw_set_txpowerlimit(), ath_regulatory::power_limit, and u16.

Referenced by ath9k_config(), ath9k_start(), ath_reset(), and ath_set_channel().