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

Go to the source code of this file.

Defines

#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)   ((x) * (mul))
#define ATH_RSSI_IN(x)   (ATH_EP_MUL((x), ATH_RSSI_EP_MULTIPLIER))
#define ATH_LPF_RSSI(x, y, len)   ((x != ATH_RSSI_DUMMY_MARKER) ? (((x) * ((len) - 1) + (y)) / (len)) : (y))
#define ATH_RSSI_LPF(x, y)
#define ATH_EP_RND(x, mul)   ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))

Functions

 FILE_LICENCE (BSD2)
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)

Define Documentation

#define WME_NUM_TID   16

Definition at line 29 of file common.h.

#define WME_BA_BMP_SIZE   64

Definition at line 30 of file common.h.

Definition at line 31 of file common.h.

#define ATH_TID_MAX_BUFS   (2 * WME_MAX_BA)

Definition at line 32 of file common.h.

#define WME_AC_BE   2

Definition at line 34 of file common.h.

Referenced by ath_txq_setup().

#define WME_NUM_AC   1

Definition at line 35 of file common.h.

Referenced by ath9k_init_queues().

#define ATH_RSSI_DUMMY_MARKER   0x127

Definition at line 37 of file common.h.

Referenced by ath9k_bss_iter(), and ath9k_init_device().

#define ATH_RSSI_LPF_LEN   10

Definition at line 38 of file common.h.

#define RSSI_LPF_THRESHOLD   -20

Definition at line 39 of file common.h.

#define ATH_RSSI_EP_MULTIPLIER   (1<<7)

Definition at line 40 of file common.h.

#define ATH_EP_MUL (   x,
  mul 
)    ((x) * (mul))

Definition at line 41 of file common.h.

#define ATH_RSSI_IN (   x)    (ATH_EP_MUL((x), ATH_RSSI_EP_MULTIPLIER))

Definition at line 42 of file common.h.

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

Definition at line 43 of file common.h.

#define ATH_RSSI_LPF (   x,
 
)
Value:
do {                                            \
    if ((y) >= RSSI_LPF_THRESHOLD)                                      \
        x = ATH_LPF_RSSI((x), ATH_RSSI_IN((y)), ATH_RSSI_LPF_LEN);      \
} while (0)

Definition at line 45 of file common.h.

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

Definition at line 49 of file common.h.


Function Documentation

FILE_LICENCE ( BSD2  )
void ath9k_cmn_update_ichannel ( struct ath9k_channel ichan,
struct net80211_channel chan 
)
struct ath9k_channel* ath9k_cmn_get_curchannel ( struct net80211_device dev,
struct ath_hw ah 
) [read]

Definition at line 47 of file ath9k_common.c.

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

Referenced by ath9k_start(), and ath_radio_disable().

{
        struct net80211_channel *curchan = dev->channels + dev->channel;
        struct ath9k_channel *channel;
        u8 chan_idx;

        chan_idx = curchan->hw_value;
        channel = &ah->channels[chan_idx];
        ath9k_cmn_update_ichannel(channel, curchan);

        return channel;
}
void ath9k_cmn_update_txpow ( struct ath_hw ah,
u16  cur_txpow,
u16  new_txpow,
u16 txpower 
)

Definition at line 61 of file ath9k_common.c.

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

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

{
        if (cur_txpow != new_txpow) {
                ath9k_hw_set_txpowerlimit(ah, new_txpow, 0);
                /* read back in case value is clamped */
                *txpower = ath9k_hw_regulatory(ah)->power_limit;
        }
}