linux/drivers/net/wireless/ath/ath9k/ar5008_phy.c

/*
 * Copyright (c) 2008-2011 Atheros Communications Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#include "hw.h"
#include "hw-ops.h"
#include "../regd.h"
#include "ar9002_phy.h"

/* All code below is for AR5008, AR9001, AR9002 */

#define AR5008_OFDM_RATES
#define AR5008_HT_SS_RATES
#define AR5008_HT_DS_RATES

#define AR5008_HT20_SHIFT
#define AR5008_HT40_SHIFT

#define AR5008_11NA_OFDM_SHIFT
#define AR5008_11NA_HT_SS_SHIFT
#define AR5008_11NA_HT_DS_SHIFT

#define AR5008_11NG_OFDM_SHIFT
#define AR5008_11NG_HT_SS_SHIFT
#define AR5008_11NG_HT_DS_SHIFT

/*
 * register values to turn OFDM weak signal detection OFF
 */
static const int m1ThreshLow_off =;
static const int m2ThreshLow_off =;
static const int m1Thresh_off =;
static const int m2Thresh_off =;
static const int m2CountThr_off =;
static const int m2CountThrLow_off =;
static const int m1ThreshLowExt_off =;
static const int m2ThreshLowExt_off =;
static const int m1ThreshExt_off =;
static const int m2ThreshExt_off =;

static const u32 ar5416Bank0[][2] =;

static const u32 ar5416Bank1[][2] =;

static const u32 ar5416Bank2[][2] =;

static const u32 ar5416Bank3[][3] =;

static const u32 ar5416Bank7[][2] =;

static const struct ar5416IniArray bank0 =;
static const struct ar5416IniArray bank1 =;
static const struct ar5416IniArray bank2 =;
static const struct ar5416IniArray bank3 =;
static const struct ar5416IniArray bank7 =;

static void ar5008_write_bank6(struct ath_hw *ah, unsigned int *writecnt)
{}

/*
 * ar5008_hw_phy_modify_rx_buffer() - perform analog swizzling of parameters
 *
 * Performs analog "swizzling" of parameters into their location.
 * Used on external AR2133/AR5133 radios.
 */
static void ar5008_hw_phy_modify_rx_buffer(u32 *rfBuf, u32 reg32,
					   u32 numBits, u32 firstBit,
					   u32 column)
{}

/*
 * Fix on 2.4 GHz band for orientation sensitivity issue by increasing
 * rf_pwd_icsyndiv.
 *
 * Theoretical Rules:
 *   if 2 GHz band
 *      if forceBiasAuto
 *         if synth_freq < 2412
 *            bias = 0
 *         else if 2412 <= synth_freq <= 2422
 *            bias = 1
 *         else // synth_freq > 2422
 *            bias = 2
 *      else if forceBias > 0
 *         bias = forceBias & 7
 *      else
 *         no change, use value from ini file
 *   else
 *      no change, invalid band
 *
 *  1st Mod:
 *    2422 also uses value of 2
 *    <approved>
 *
 *  2nd Mod:
 *    Less than 2412 uses value of 0, 2412 and above uses value of 2
 */
static void ar5008_hw_force_bias(struct ath_hw *ah, u16 synth_freq)
{}

/*
 * ar5008_hw_set_channel - tune to a channel on the external AR2133/AR5133 radios
 *
 * For the external AR2133/AR5133 radios, takes the MHz channel value and set
 * the channel value. Assumes writes enabled to analog bus and bank6 register
 * cache in ah->analogBank6Data.
 */
static int ar5008_hw_set_channel(struct ath_hw *ah, struct ath9k_channel *chan)
{}

void ar5008_hw_cmn_spur_mitigate(struct ath_hw *ah,
			  struct ath9k_channel *chan, int bin)
{}

/*
 * ar5008_hw_spur_mitigate - convert baseband spur frequency for external radios
 *
 * For non single-chip solutions. Converts to baseband spur frequency given the
 * input channel frequency and compute register settings below.
 */
static void ar5008_hw_spur_mitigate(struct ath_hw *ah,
				    struct ath9k_channel *chan)
{}

/**
 * ar5008_hw_rf_alloc_ext_banks - allocates banks for external radio programming
 * @ah: atheros hardware structure
 *
 * Only required for older devices with external AR2133/AR5133 radios.
 */
static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah)
{}


/* *
 * ar5008_hw_set_rf_regs - programs rf registers based on EEPROM
 * @ah: atheros hardware structure
 * @chan:
 * @modesIndex:
 *
 * Used for the external AR2133/AR5133 radios.
 *
 * Reads the EEPROM header info from the device structure and programs
 * all rf registers. This routine requires access to the analog
 * rf device. This is not required for single-chip devices.
 */
static bool ar5008_hw_set_rf_regs(struct ath_hw *ah,
				  struct ath9k_channel *chan,
				  u16 modesIndex)
{}

static void ar5008_hw_init_bb(struct ath_hw *ah,
			      struct ath9k_channel *chan)
{}

static void ar5008_hw_init_chain_masks(struct ath_hw *ah)
{}

static void ar5008_hw_override_ini(struct ath_hw *ah,
				   struct ath9k_channel *chan)
{}

static void ar5008_hw_set_channel_regs(struct ath_hw *ah,
				       struct ath9k_channel *chan)
{}


static int ar5008_hw_process_ini(struct ath_hw *ah,
				 struct ath9k_channel *chan)
{}

static void ar5008_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
{}

static void ar5008_hw_mark_phy_inactive(struct ath_hw *ah)
{}

static void ar5008_hw_set_delta_slope(struct ath_hw *ah,
				      struct ath9k_channel *chan)
{}

static bool ar5008_hw_rfbus_req(struct ath_hw *ah)
{}

static void ar5008_hw_rfbus_done(struct ath_hw *ah)
{}

static void ar5008_restore_chainmask(struct ath_hw *ah)
{}

static u32 ar9160_hw_compute_pll_control(struct ath_hw *ah,
					 struct ath9k_channel *chan)
{}

static u32 ar5008_hw_compute_pll_control(struct ath_hw *ah,
					 struct ath9k_channel *chan)
{}

static bool ar5008_hw_ani_control_new(struct ath_hw *ah,
				      enum ath9k_ani_cmd cmd,
				      int param)
{}

static void ar5008_hw_do_getnf(struct ath_hw *ah,
			      int16_t nfarray[NUM_NF_READINGS])
{}

/*
 * Initialize the ANI register values with default (ini) values.
 * This routine is called during a (full) hardware reset after
 * all the registers are initialised from the INI.
 */
static void ar5008_hw_ani_cache_ini_regs(struct ath_hw *ah)
{}

static void ar5008_hw_set_nf_limits(struct ath_hw *ah)
{}

static void ar5008_hw_set_radar_params(struct ath_hw *ah,
				       struct ath_hw_radar_conf *conf)
{}

static void ar5008_hw_set_radar_conf(struct ath_hw *ah)
{}

static void ar5008_hw_init_txpower_cck(struct ath_hw *ah, int16_t *rate_array)
{}

static void ar5008_hw_init_txpower_ofdm(struct ath_hw *ah, int16_t *rate_array,
					int offset)
{}

static void ar5008_hw_init_txpower_ht(struct ath_hw *ah, int16_t *rate_array,
				      int ss_offset, int ds_offset,
				      bool is_40, int ht40_delta)
{}

void ar5008_hw_init_rate_txpower(struct ath_hw *ah, int16_t *rate_array,
				 struct ath9k_channel *chan, int ht40_delta)
{}

int ar5008_hw_attach_phy_ops(struct ath_hw *ah)
{}