1219393Sadrian/*
2219393Sadrian * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd.
3219393Sadrian *
4219393Sadrian * Redistribution and use in source and binary forms, with or without
5219393Sadrian * modification, are permitted provided that the following conditions
6219393Sadrian * are met:
7219393Sadrian * 1. Redistributions of source code must retain the above copyright
8219393Sadrian *    notice, this list of conditions and the following disclaimer.
9219393Sadrian * 2. Redistributions in binary form must reproduce the above copyright
10219393Sadrian *    notice, this list of conditions and the following disclaimer in the
11219393Sadrian *    documentation and/or other materials provided with the distribution.
12219393Sadrian *
13219393Sadrian * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14219393Sadrian * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15219393Sadrian * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16219393Sadrian * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17219393Sadrian * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18219393Sadrian * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19219393Sadrian * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20219393Sadrian * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21219393Sadrian * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22219393Sadrian * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23219393Sadrian * SUCH DAMAGE.
24219393Sadrian *
25219393Sadrian * $FreeBSD$
26219393Sadrian */
27219393Sadrian
28219393Sadrian#ifndef	__ATH_AR9280_OLC_H__
29219393Sadrian#define	__ATH_AR9280_OLC_H__
30219393Sadrian
31219393Sadrianextern void ar9280olcInit(struct ath_hal *ah);
32219393Sadrian
33219393Sadrian/* OLC TX power control */
34219393Sadrianextern void ar9280olcGetPDADCs(struct ath_hal *ah, uint32_t initTxGain,
35219393Sadrian    int txPower, uint8_t *pPDADCValues);
36219393Sadrianextern void ar9280olcGetTxGainIndex(struct ath_hal *ah,
37219393Sadrian    const struct ieee80211_channel *chan,
38219393Sadrian    struct calDataPerFreqOpLoop *rawDatasetOpLoop,
39219393Sadrian    uint8_t *calChans, uint16_t availPiers, uint8_t *pwr, uint8_t *pcdacIdx);
40219393Sadrianextern void ar9280GetGainBoundariesAndPdadcs(struct ath_hal *ah,
41219393Sadrian        const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet,
42219393Sadrian        uint8_t * bChans, uint16_t availPiers,
43219393Sadrian        uint16_t tPdGainOverlap, int16_t *pMinCalPower,
44219393Sadrian        uint16_t * pPdGainBoundaries, uint8_t * pPDADCValues,
45219393Sadrian        uint16_t numXpdGains);
46219393Sadrianextern HAL_BOOL ar9280SetPowerCalTable(struct ath_hal *ah,
47219393Sadrian	struct ar5416eeprom *pEepData, const struct ieee80211_channel *chan,
48219393Sadrian	int16_t *pTxPowerIndexOffset);
49219393Sadrian
50219393Sadrian/* OLC calibration */
51219393Sadrianextern void ar9280olcTemperatureCompensation(struct ath_hal *ah);
52219393Sadrian
53219393Sadrian#endif
54