linux/drivers/net/wireless/ath/carl9170/phy.c

/*
 * Atheros CARL9170 driver
 *
 * PHY and RF code
 *
 * Copyright 2008, Johannes Berg <[email protected]>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; see the file COPYING.  If not, see
 * http://www.gnu.org/licenses/.
 *
 * This file incorporates work covered by the following copyright and
 * permission notice:
 *    Copyright (c) 2007-2008 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 <linux/bitrev.h>
#include "carl9170.h"
#include "cmd.h"
#include "phy.h"

static int carl9170_init_power_cal(struct ar9170 *ar)
{}

struct carl9170_phy_init {};

static struct carl9170_phy_init ar5416_phy_init[] =;

/*
 * look up a certain register in ar5416_phy_init[] and return the init. value
 * for the band and bandwidth given. Return 0 if register address not found.
 */
static u32 carl9170_def_val(u32 reg, bool is_2ghz, bool is_40mhz)
{}

/*
 * initialize some phy regs from eeprom values in modal_header[]
 * acc. to band and bandwidth
 */
static int carl9170_init_phy_from_eeprom(struct ar9170 *ar,
				bool is_2ghz, bool is_40mhz)
{}

static int carl9170_init_phy(struct ar9170 *ar, enum nl80211_band band)
{}

struct carl9170_rf_initvals {};

static struct carl9170_rf_initvals carl9170_rf_initval[] =;

static int carl9170_init_rf_banks_0_7(struct ar9170 *ar, bool band5ghz)
{}

struct carl9170_phy_freq_params {};

enum carl9170_bw {};

struct carl9170_phy_freq_entry {};

/* NB: must be in sync with channel tables in main! */
static const struct carl9170_phy_freq_entry carl9170_phy_freq_params[] =;

static int carl9170_init_rf_bank4_pwr(struct ar9170 *ar, bool band5ghz,
				      u32 freq, enum carl9170_bw bw)
{}

static const struct carl9170_phy_freq_params *
carl9170_get_hw_dyn_params(struct ieee80211_channel *channel,
			   enum carl9170_bw bw)
{}

static int carl9170_find_freq_idx(int nfreqs, u8 *freqs, u8 f)
{}

static s32 carl9170_interpolate_s32(s32 x, s32 x1, s32 y1, s32 x2, s32 y2)
{}

static u8 carl9170_interpolate_u8(u8 x, u8 x1, u8 y1, u8 x2, u8 y2)
{}

static u8 carl9170_interpolate_val(u8 x, u8 *x_array, u8 *y_array)
{}

static int carl9170_set_freq_cal_data(struct ar9170 *ar,
	struct ieee80211_channel *channel)
{}

static u8 carl9170_get_max_edge_power(struct ar9170 *ar,
	u32 freq, struct ar9170_calctl_edges edges[])
{}

static u8 carl9170_get_heavy_clip(struct ar9170 *ar, u32 freq,
	enum carl9170_bw bw, struct ar9170_calctl_edges edges[])
{}

/*
 * calculate the conformance test limits and the heavy clip parameter
 * and apply them to ar->power* (derived from otus hal/hpmain.c, line 3706)
 */
static void carl9170_calc_ctl(struct ar9170 *ar, u32 freq, enum carl9170_bw bw)
{}

static void carl9170_set_power_cal(struct ar9170 *ar, u32 freq,
				   enum carl9170_bw bw)
{}

int carl9170_get_noisefloor(struct ar9170 *ar)
{}

static enum carl9170_bw nl80211_to_carl(enum nl80211_channel_type type)
{}

int carl9170_set_channel(struct ar9170 *ar, struct ieee80211_channel *channel,
			 enum nl80211_channel_type _bw)
{}