FreeBSD kernel ATH device code
ar2317.c File Reference
#include "opt_ah.h"
#include "ah.h"
#include "ah_internal.h"
#include "ar5212/ar5212.h"
#include "ar5212/ar5212reg.h"
#include "ar5212/ar5212phy.h"
#include "ah_eeprom_v3.h"
#include "ar5212/ar5212.ini"
Include dependency graph for ar2317.c:

Go to the source code of this file.

Data Structures

struct  ar2317State
 

Macros

#define AH_5212_2317
 
#define N(a)   (sizeof(a)/sizeof(a[0]))
 
#define PWR_TABLE_SIZE_2317   PWR_TABLE_SIZE_2413
 
#define AR2317(ah)   ((struct ar2317State *) AH5212(ah)->ah_rfHal)
 
#define RF_BANK_SETUP(_priv, _ix, _col)
 
#define VpdTable_L   priv->vpdTable_L
 
#define VpdTable_R   priv->vpdTable_R
 
#define VpdTable_I   priv->vpdTable_I
 

Typedefs

typedef RAW_DATA_STRUCT_2413 RAW_DATA_STRUCT_2317
 
typedef RAW_DATA_PER_CHANNEL_2413 RAW_DATA_PER_CHANNEL_2317
 

Functions

void ar5212ModifyRfBuffer (uint32_t *rfBuf, uint32_t reg32, uint32_t numBits, uint32_t firstBit, uint32_t column)
 
static void ar2317WriteRegs (struct ath_hal *ah, u_int modesIndex, u_int freqIndex, int writes)
 
static HAL_BOOL ar2317SetChannel (struct ath_hal *ah, const struct ieee80211_channel *chan)
 
static HAL_BOOL ar2317SetRfRegs (struct ath_hal *ah, const struct ieee80211_channel *chan, uint16_t modesIndex, uint16_t *rfXpdGain)
 
static uint32_t * ar2317GetRfBank (struct ath_hal *ah, int bank)
 
static void GetLowerUpperIndex (int16_t v, const uint16_t *lp, uint16_t listSize, uint32_t *vlo, uint32_t *vhi)
 
static HAL_BOOL ar2317FillVpdTable (uint32_t pdGainIdx, int16_t Pmin, int16_t Pmax, const int16_t *pwrList, const int16_t *VpdList, uint16_t numIntercepts, uint16_t retVpdList[][64])
 
static int16_t interpolate_signed (uint16_t target, uint16_t srcLeft, uint16_t srcRight, int16_t targetLeft, int16_t targetRight)
 
static int ar2317getGainBoundariesAndPdadcsForPowers (struct ath_hal *ah, uint16_t channel, const RAW_DATA_STRUCT_2317 *pRawDataset, uint16_t pdGainOverlap_t2, int16_t *pMinCalPower, uint16_t pPdGainBoundaries[], uint16_t pPdGainValues[], uint16_t pPDADCValues[])
 
static HAL_BOOL ar2317SetPowerTable (struct ath_hal *ah, int16_t *minPower, int16_t *maxPower, const struct ieee80211_channel *chan, uint16_t *rfXpdGain)
 
static int16_t ar2317GetMinPower (struct ath_hal *ah, const RAW_DATA_PER_CHANNEL_2317 *data)
 
static int16_t ar2317GetMaxPower (struct ath_hal *ah, const RAW_DATA_PER_CHANNEL_2317 *data)
 
static HAL_BOOL ar2317GetChannelMaxMinPower (struct ath_hal *ah, const struct ieee80211_channel *chan, int16_t *maxPow, int16_t *minPow)
 
static void ar2317RfDetach (struct ath_hal *ah)
 
static HAL_BOOL ar2317RfAttach (struct ath_hal *ah, HAL_STATUS *status)
 
static HAL_BOOL ar2317Probe (struct ath_hal *ah)
 
 AH_RF (RF2317, ar2317Probe, ar2317RfAttach)
 

Macro Definition Documentation

◆ AH_5212_2317

#define AH_5212_2317

Definition at line 32 of file ar2317.c.

◆ AR2317

#define AR2317 (   ah)    ((struct ar2317State *) AH5212(ah)->ah_rfHal)

Definition at line 64 of file ar2317.c.

◆ N

#define N (   a)    (sizeof(a)/sizeof(a[0]))

Definition at line 35 of file ar2317.c.

◆ PWR_TABLE_SIZE_2317

#define PWR_TABLE_SIZE_2317   PWR_TABLE_SIZE_2413

Definition at line 39 of file ar2317.c.

◆ RF_BANK_SETUP

#define RF_BANK_SETUP (   _priv,
  _ix,
  _col 
)
Value:
do { \
int i; \
for (i = 0; i < N(ar5212Bank##_ix##_2317); i++) \
(_priv)->Bank##_ix##Data[i] = ar5212Bank##_ix##_2317[i][_col];\
} while (0)
#define N(a)
Definition: ar2317.c:35

◆ VpdTable_I

#define VpdTable_I   priv->vpdTable_I

◆ VpdTable_L

#define VpdTable_L   priv->vpdTable_L

◆ VpdTable_R

#define VpdTable_R   priv->vpdTable_R

Typedef Documentation

◆ RAW_DATA_PER_CHANNEL_2317

Definition at line 38 of file ar2317.c.

◆ RAW_DATA_STRUCT_2317

Definition at line 37 of file ar2317.c.

Function Documentation

◆ AH_RF()

AH_RF ( RF2317  ,
ar2317Probe  ,
ar2317RfAttach   
)

◆ ar2317FillVpdTable()

static HAL_BOOL ar2317FillVpdTable ( uint32_t  pdGainIdx,
int16_t  Pmin,
int16_t  Pmax,
const int16_t *  pwrList,
const int16_t *  VpdList,
uint16_t  numIntercepts,
uint16_t  retVpdList[][64] 
)
static

Definition at line 276 of file ar2317.c.

References AH_FALSE, AH_TRUE, and GetLowerUpperIndex().

Referenced by ar2317getGainBoundariesAndPdadcsForPowers().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ar2317GetChannelMaxMinPower()

static HAL_BOOL ar2317GetChannelMaxMinPower ( struct ath_hal ah,
const struct ieee80211_channel *  chan,
int16_t *  maxPow,
int16_t *  minPow 
)
static

Definition at line 625 of file ar2317.c.

References AH_FALSE, AH_NULL, AH_PRIVATE, AH_TRUE, ar2317GetMaxPower(), ar2317GetMinPower(), RAW_DATA_PER_CHANNEL_2413::channelValue, headerInfo11B, headerInfo11G, RAW_DATA_STRUCT_2413::numChannels, and RAW_DATA_STRUCT_2413::pDataPerChannel.

Referenced by ar2317RfAttach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ar2317getGainBoundariesAndPdadcsForPowers()

static int ar2317getGainBoundariesAndPdadcsForPowers ( struct ath_hal ah,
uint16_t  channel,
const RAW_DATA_STRUCT_2317 pRawDataset,
uint16_t  pdGainOverlap_t2,
int16_t *  pMinCalPower,
uint16_t  pPdGainBoundaries[],
uint16_t  pPdGainValues[],
uint16_t  pPDADCValues[] 
)
static

◆ ar2317GetMaxPower()

static int16_t ar2317GetMaxPower ( struct ath_hal ah,
const RAW_DATA_PER_CHANNEL_2317 data 
)
static

◆ ar2317GetMinPower()

static int16_t ar2317GetMinPower ( struct ath_hal ah,
const RAW_DATA_PER_CHANNEL_2317 data 
)
static

◆ ar2317GetRfBank()

static uint32_t * ar2317GetRfBank ( struct ath_hal ah,
int  bank 
)
static

Definition at line 208 of file ar2317.c.

References AH_NULL, AR2317, ar2317State::Bank1Data, ar2317State::Bank2Data, ar2317State::Bank3Data, ar2317State::Bank6Data, ar2317State::Bank7Data, HAL_DEBUG_ANY, HALASSERT, and HALDEBUG.

Referenced by ar2317RfAttach().

Here is the caller graph for this function:

◆ ar2317Probe()

static HAL_BOOL ar2317Probe ( struct ath_hal ah)
static

Definition at line 739 of file ar2317.c.

References IS_2317.

◆ ar2317RfAttach()

◆ ar2317RfDetach()

static void ar2317RfDetach ( struct ath_hal ah)
static

Definition at line 693 of file ar2317.c.

References AH5212, AH_NULL, ath_hal_5212::ah_rfHal, ath_hal_free(), and HALASSERT.

Referenced by ar2317RfAttach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ar2317SetChannel()

static HAL_BOOL ar2317SetChannel ( struct ath_hal ah,
const struct ieee80211_channel *  chan 
)
static

Definition at line 84 of file ar2317.c.

References AH_FALSE, AH_MARK_SETCHANNEL, AH_PRIVATE, AH_TRUE, AR_PHY, AR_PHY_CCK_TX_CTRL, AR_PHY_CCK_TX_CTRL_JAPAN, ath_hal_gethwchannel(), ath_hal_reverseBits(), HAL_DEBUG_ANY, HALDEBUG, OS_MARK, OS_REG_READ, and OS_REG_WRITE.

Referenced by ar2317RfAttach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ar2317SetPowerTable()

◆ ar2317SetRfRegs()

static HAL_BOOL ar2317SetRfRegs ( struct ath_hal ah,
const struct ieee80211_channel *  chan,
uint16_t  modesIndex,
uint16_t *  rfXpdGain 
)
static

◆ ar2317WriteRegs()

static void ar2317WriteRegs ( struct ath_hal ah,
u_int  modesIndex,
u_int  freqIndex,
int  writes 
)
static

Definition at line 70 of file ar2317.c.

References HAL_INI_WRITE_ARRAY.

Referenced by ar2317RfAttach().

Here is the caller graph for this function:

◆ ar5212ModifyRfBuffer()

void ar5212ModifyRfBuffer ( uint32_t *  rfBuf,
uint32_t  reg32,
uint32_t  numBits,
uint32_t  firstBit,
uint32_t  column 
)

Definition at line 2674 of file ar5212_reset.c.

Referenced by ar2317SetRfRegs().

Here is the caller graph for this function:

◆ GetLowerUpperIndex()

static void GetLowerUpperIndex ( int16_t  v,
const uint16_t *  lp,
uint16_t  listSize,
uint32_t *  vlo,
uint32_t *  vhi 
)
static

Definition at line 231 of file ar2317.c.

Referenced by ar2317FillVpdTable(), and ar2317getGainBoundariesAndPdadcsForPowers().

Here is the caller graph for this function:

◆ interpolate_signed()

static int16_t interpolate_signed ( uint16_t  target,
uint16_t  srcLeft,
uint16_t  srcRight,
int16_t  targetLeft,
int16_t  targetRight 
)
static

Definition at line 317 of file ar2317.c.

Referenced by ar2317getGainBoundariesAndPdadcsForPowers().

Here is the caller graph for this function: