\hypertarget{ar2316_8c_source}{}\doxysection{ar2316.\+c}
\label{ar2316_8c_source}\index{dev/ath/ath\_hal/ar5212/ar2316.c@{dev/ath/ath\_hal/ar5212/ar2316.c}}
\mbox{\hyperlink{ar2316_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: ISC}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2002-\/2009 Sam Leffler, Errno Consulting}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2002-\/2008 Atheros Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00007}00007 \textcolor{comment}{ * Permission to use, copy, modify, and/or distribute this software for any}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00008}00008 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00009}00009 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00011}00011 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00012}00012 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00013}00013 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00014}00014 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00015}00015 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00016}00016 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00017}00017 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00019}00019 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00020}00020 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00021}00021 \textcolor{preprocessor}{\#include "{}opt\_ah.h"{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00022}00022 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00023}00023 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah_8h}{ah.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00024}00024 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__internal_8h}{ah\_internal.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00025}00025 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00026}00026 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5212_8h}{ar5212/ar5212.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00027}00027 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5212reg_8h}{ar5212/ar5212reg.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5212phy_8h}{ar5212/ar5212phy.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00030}00030 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__eeprom__v3_8h}{ah\_eeprom\_v3.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00032}\mbox{\hyperlink{ar2316_8c_a751060c14f421e01a9d1e99aadc6f0e8}{00032}} \textcolor{preprocessor}{\#define AH\_5212\_2316}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00033}00033 \textcolor{preprocessor}{\#include "{}ar5212/ar5212.ini"{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00035}\mbox{\hyperlink{ar2316_8c_af04f8faa08e13b16b70b52a56fbc9c53}{00035}} \textcolor{preprocessor}{\#define N(a)    (sizeof(a)/sizeof(a[0]))}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00037}\mbox{\hyperlink{ar2316_8c_a58b333dce3361818c50e723c13b4165a}{00037}} \textcolor{keyword}{typedef} \mbox{\hyperlink{structRAW__DATA__STRUCT__2413}{RAW\_DATA\_STRUCT\_2413}} \mbox{\hyperlink{ar2316_8c_a58b333dce3361818c50e723c13b4165a}{RAW\_DATA\_STRUCT\_2316}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00038}\mbox{\hyperlink{ar2316_8c_a23b14ea9bb0465f35d51652b7733e5de}{00038}} \textcolor{keyword}{typedef} \mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413}{RAW\_DATA\_PER\_CHANNEL\_2413}} \mbox{\hyperlink{ar2316_8c_a23b14ea9bb0465f35d51652b7733e5de}{RAW\_DATA\_PER\_CHANNEL\_2316}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00039}\mbox{\hyperlink{ar2316_8c_a3f8e7924c8aac9be2ae233770b37878d}{00039}} \textcolor{preprocessor}{\#define PWR\_TABLE\_SIZE\_2316 PWR\_TABLE\_SIZE\_2413}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00041}\mbox{\hyperlink{structar2316State}{00041}} \textcolor{keyword}{struct }\mbox{\hyperlink{structar2316State}{ar2316State}} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00042}\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{00042}}         \mbox{\hyperlink{structRfHalFuncs}{RF\_HAL\_FUNCS}}        \mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}};               \textcolor{comment}{/* public state, must be first */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00043}\mbox{\hyperlink{structar2316State_a0848e631f49acbc33964bf2514c0451d}{00043}}         uint16\_t        \mbox{\hyperlink{structar2316State_a0848e631f49acbc33964bf2514c0451d}{pcdacTable}}[\mbox{\hyperlink{ar2316_8c_a3f8e7924c8aac9be2ae233770b37878d}{PWR\_TABLE\_SIZE\_2316}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00045}\mbox{\hyperlink{structar2316State_ad7893ccd00e713daa98d5c357b5f75a3}{00045}}         uint32\_t        \mbox{\hyperlink{structar2316State_ad7893ccd00e713daa98d5c357b5f75a3}{Bank1Data}}[\mbox{\hyperlink{ar2316_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5212Bank1\_2316)];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00046}\mbox{\hyperlink{structar2316State_acd1dc0df681ba4c3a978448ee9ac20d9}{00046}}         uint32\_t        \mbox{\hyperlink{structar2316State_acd1dc0df681ba4c3a978448ee9ac20d9}{Bank2Data}}[\mbox{\hyperlink{ar2316_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5212Bank2\_2316)];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00047}\mbox{\hyperlink{structar2316State_a5c1f9daa2b8fd7525565741d29addd6b}{00047}}         uint32\_t        \mbox{\hyperlink{structar2316State_a5c1f9daa2b8fd7525565741d29addd6b}{Bank3Data}}[\mbox{\hyperlink{ar2316_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5212Bank3\_2316)];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00048}\mbox{\hyperlink{structar2316State_a77ab69d988dc3b7c6ca4e1ab94cae4d8}{00048}}         uint32\_t        \mbox{\hyperlink{structar2316State_a77ab69d988dc3b7c6ca4e1ab94cae4d8}{Bank6Data}}[\mbox{\hyperlink{ar2316_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5212Bank6\_2316)];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00049}\mbox{\hyperlink{structar2316State_aeaca38cbb151ff40c9235aec0730f8d7}{00049}}         uint32\_t        \mbox{\hyperlink{structar2316State_aeaca38cbb151ff40c9235aec0730f8d7}{Bank7Data}}[\mbox{\hyperlink{ar2316_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5212Bank7\_2316)];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00051}00051         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00052}00052 \textcolor{comment}{         * Private state for reduced stack usage.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00053}00053 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00054}00054         \textcolor{comment}{/* filled out Vpd table for all pdGains (chanL) */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00055}\mbox{\hyperlink{structar2316State_a9506c0204cef1c61bda99ad7b27fb4d6}{00055}}         uint16\_t \mbox{\hyperlink{structar2316State_a9506c0204cef1c61bda99ad7b27fb4d6}{vpdTable\_L}}[\mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}]}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00056}00056                             [\mbox{\hyperlink{ah__eeprom__v3_8h_ac61647b5d6c9457e5111baa78b28a476}{MAX\_PWR\_RANGE\_IN\_HALF\_DB}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00057}00057         \textcolor{comment}{/* filled out Vpd table for all pdGains (chanR) */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00058}\mbox{\hyperlink{structar2316State_af3a925739dcdc1eef30adfeb01460a11}{00058}}         uint16\_t \mbox{\hyperlink{structar2316State_af3a925739dcdc1eef30adfeb01460a11}{vpdTable\_R}}[\mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}]}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00059}00059                             [\mbox{\hyperlink{ah__eeprom__v3_8h_ac61647b5d6c9457e5111baa78b28a476}{MAX\_PWR\_RANGE\_IN\_HALF\_DB}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00060}00060         \textcolor{comment}{/* filled out Vpd table for all pdGains (interpolated) */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00061}\mbox{\hyperlink{structar2316State_a7537fa66c13bbe64d9c8589592169b16}{00061}}         uint16\_t \mbox{\hyperlink{structar2316State_a7537fa66c13bbe64d9c8589592169b16}{vpdTable\_I}}[\mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}]}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00062}00062                             [\mbox{\hyperlink{ah__eeprom__v3_8h_ac61647b5d6c9457e5111baa78b28a476}{MAX\_PWR\_RANGE\_IN\_HALF\_DB}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00063}00063 \};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00064}\mbox{\hyperlink{ar2316_8c_a0a04e152a78faef4fdaaee5f9119bc2f}{00064}} \textcolor{preprocessor}{\#define AR2316(ah)      ((struct ar2316State *) AH5212(ah)-\/>ah\_rfHal)}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00066}00066 \textcolor{keyword}{extern}  \textcolor{keywordtype}{void} \mbox{\hyperlink{ar2316_8c_a396413f51a20b01a7efdc43e5a1bda17}{ar5212ModifyRfBuffer}}(uint32\_t *rfBuf, uint32\_t reg32,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00067}00067                 uint32\_t numBits, uint32\_t firstBit, uint32\_t column);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00069}00069 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00070}\mbox{\hyperlink{ar2316_8c_a95b49691b2efc290b297b64adb77eeaa}{00070}} \mbox{\hyperlink{ar2316_8c_a95b49691b2efc290b297b64adb77eeaa}{ar2316WriteRegs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, u\_int modesIndex, u\_int freqIndex,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00071}00071         \textcolor{keywordtype}{int} regWrites)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00072}00072 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00073}00073         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp = \mbox{\hyperlink{ar5212_8h_ab645c6d1aebbc11b13cd2c76c922fab2}{AH5212}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00075}00075         \mbox{\hyperlink{ah__internal_8h_a7393e1e59fe8ef64d9b0ae774d69dcff}{HAL\_INI\_WRITE\_ARRAY}}(ah, ar5212Modes\_2316, modesIndex, regWrites);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00076}00076         \mbox{\hyperlink{ah__internal_8h_a7393e1e59fe8ef64d9b0ae774d69dcff}{HAL\_INI\_WRITE\_ARRAY}}(ah, ar5212Common\_2316, 1, regWrites);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00077}00077         \mbox{\hyperlink{ah__internal_8h_a7393e1e59fe8ef64d9b0ae774d69dcff}{HAL\_INI\_WRITE\_ARRAY}}(ah, ar5212BB\_RfGain\_2316, freqIndex, regWrites);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00079}00079         \textcolor{comment}{/* For AP51 */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00080}00080         \textcolor{keywordflow}{if} (!ahp-\/>\mbox{\hyperlink{structath__hal__5212_a2bbd3b2ed8f130c6e0c9aa0d9ba3f0d5}{ah\_cwCalRequire}}) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00081}00081                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, 0xa358, (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, 0xa358) \& \string~0x2));}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00082}00082         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00083}00083                 ahp-\/>\mbox{\hyperlink{structath__hal__5212_a2bbd3b2ed8f130c6e0c9aa0d9ba3f0d5}{ah\_cwCalRequire}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00084}00084         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00085}00085 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00087}00087 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00088}00088 \textcolor{comment}{ * Take the MHz channel value and set the Channel value}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00089}00089 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00090}00090 \textcolor{comment}{ * ASSUMES: Writes enabled to analog bus}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00091}00091 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00092}00092 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00093}\mbox{\hyperlink{ar2316_8c_a783071580490461365760f3bb24f28d7}{00093}} \mbox{\hyperlink{ar2316_8c_a783071580490461365760f3bb24f28d7}{ar2316SetChannel}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah,  \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00094}00094 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00095}00095         uint16\_t freq = \mbox{\hyperlink{ah__internal_8h_a8aa798a770b881821a7dcf85e7b26ff5}{ath\_hal\_gethwchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00096}00096         uint32\_t channelSel  = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00097}00097         uint32\_t bModeSynth  = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00098}00098         uint32\_t aModeRefSel = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00099}00099         uint32\_t reg32       = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00101}00101         \mbox{\hyperlink{ah__osdep_8h_ab267e59f6e2341e9565d6b6b04cbd0d3}{OS\_MARK}}(ah, \mbox{\hyperlink{ah__decode_8h_a0411cd49bb5b71852cecd93bcbf0ca2da655ca2fd89a09256aeef35a42282d798}{AH\_MARK\_SETCHANNEL}}, freq);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00103}00103         \textcolor{keywordflow}{if} (freq < 4800) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00104}00104                 uint32\_t txctl;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00106}00106                 \textcolor{keywordflow}{if} (((freq -\/ 2192) \% 5) == 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00107}00107                         channelSel = ((freq -\/ 672) * 2 -\/ 3040)/10;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00108}00108                         bModeSynth = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00109}00109                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (((freq -\/ 2224) \% 5) == 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00110}00110                         channelSel = ((freq -\/ 704) * 2 -\/ 3040) / 10;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00111}00111                         bModeSynth = 1;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00112}00112                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00113}00113                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00114}00114                             \textcolor{stringliteral}{"{}\%s: invalid channel \%u MHz\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00115}00115                             \_\_func\_\_, freq);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00116}00116                         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00117}00117                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00119}00119                 channelSel = (channelSel << 2) \& 0xff;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00120}00120                 channelSel = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(channelSel, 8);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00121}00121 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00122}00122                 txctl = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5212phy_8h_af243f8db8869d6e8a38e46da0f7bc1d4}{AR\_PHY\_CCK\_TX\_CTRL}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00123}00123                 \textcolor{keywordflow}{if} (freq == 2484) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00124}00124                         \textcolor{comment}{/* Enable channel spreading for channel 14 */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00125}00125                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5212phy_8h_af243f8db8869d6e8a38e46da0f7bc1d4}{AR\_PHY\_CCK\_TX\_CTRL}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00126}00126                                 txctl | \mbox{\hyperlink{ar5212phy_8h_a1e427b010925f07de18bc10504dfa9c8}{AR\_PHY\_CCK\_TX\_CTRL\_JAPAN}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00127}00127                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00128}00128                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5212phy_8h_af243f8db8869d6e8a38e46da0f7bc1d4}{AR\_PHY\_CCK\_TX\_CTRL}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00129}00129                                 txctl \&\string~ \mbox{\hyperlink{ar5212phy_8h_a1e427b010925f07de18bc10504dfa9c8}{AR\_PHY\_CCK\_TX\_CTRL\_JAPAN}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00130}00130                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00131}00131         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((freq \% 20) == 0 \&\& freq >= 5120) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00132}00132                 channelSel = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00133}00133                         ((freq -\/ 4800) / 20 << 2), 8);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00134}00134                 aModeRefSel = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(3, 2);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00135}00135         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((freq \% 10) == 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00136}00136                 channelSel = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00137}00137                         ((freq -\/ 4800) / 10 << 1), 8);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00138}00138                 aModeRefSel = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(2, 2);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00139}00139         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((freq \% 5) == 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00140}00140                 channelSel = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00141}00141                         (freq -\/ 4800) / 5, 8);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00142}00142                 aModeRefSel = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(1, 2);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00143}00143         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00144}00144                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: invalid channel \%u MHz\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00145}00145                     \_\_func\_\_, freq);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00146}00146                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00147}00147         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00148}00148 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00149}00149         reg32 = (channelSel << 4) | (aModeRefSel << 2) | (bModeSynth << 1) |}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00150}00150                         (1 << 12) | 0x1;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00151}00151         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(0x27), reg32 \& 0xff);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00153}00153         reg32 >>= 8;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00154}00154         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(0x36), reg32 \& 0x7f);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00156}00156         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_curchan = chan;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00157}00157         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00158}00158 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00159}00159 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00160}00160 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00161}00161 \textcolor{comment}{ * Reads EEPROM header info from device structure and programs}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00162}00162 \textcolor{comment}{ * all rf registers}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00163}00163 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00164}00164 \textcolor{comment}{ * REQUIRES: Access to the analog rf device}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00165}00165 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00166}00166 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00167}\mbox{\hyperlink{ar2316_8c_acc213681cfd2182ccb5a11ed22a788db}{00167}} \mbox{\hyperlink{ar2316_8c_acc213681cfd2182ccb5a11ed22a788db}{ar2316SetRfRegs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00168}00168         uint16\_t modesIndex, uint16\_t *rfXpdGain)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00169}00169 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00170}00170 \textcolor{preprocessor}{\#define RF\_BANK\_SETUP(\_priv, \_ix, \_col) do \{                                \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00171}00171 \textcolor{preprocessor}{        int i;                                                              \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00172}00172 \textcolor{preprocessor}{        for (i = 0; i < N(ar5212Bank\#\#\_ix\#\#\_2316); i++)                     \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00173}00173 \textcolor{preprocessor}{                (\_priv)-\/>Bank\#\#\_ix\#\#Data[i] = ar5212Bank\#\#\_ix\#\#\_2316[i][\_col];\(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00174}00174 \textcolor{preprocessor}{\} while (0)}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00175}00175         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp = \mbox{\hyperlink{ar5212_8h_ab645c6d1aebbc11b13cd2c76c922fab2}{AH5212}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00176}00176         \textcolor{keyword}{const} \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00177}00177         uint16\_t ob2GHz = 0, db2GHz = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00178}00178         \textcolor{keyword}{struct }\mbox{\hyperlink{structar2316State}{ar2316State}} *priv = \mbox{\hyperlink{ar2316_8c_a0a04e152a78faef4fdaaee5f9119bc2f}{AR2316}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00179}00179         \textcolor{keywordtype}{int} regWrites = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00181}00181         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}}, \textcolor{stringliteral}{"{}\%s: chan \%u/0x\%x modesIndex \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00182}00182             \_\_func\_\_, chan-\/>ic\_freq, chan-\/>ic\_flags, modesIndex);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00184}00184         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(priv != \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00186}00186         \textcolor{comment}{/* Setup rf parameters */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00187}00187         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_B(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00188}00188                 ob2GHz = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a7dfbba4a0d790b7bb58a94f64fd972d4}{ee\_obFor24}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00189}00189                 db2GHz = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a6434acc897bbc2238a62c439a9d78b37}{ee\_dbFor24}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00190}00190         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00191}00191                 ob2GHz = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a436123bd9725a787f00c2f17539db0ea}{ee\_obFor24g}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00192}00192                 db2GHz = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aaebaeeb0a6b1923cd5b64f8708cfd0b6}{ee\_dbFor24g}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00193}00193         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00195}00195         \textcolor{comment}{/* Bank 1 Write */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00196}00196         \mbox{\hyperlink{ar2316_8c_abb6bc0a9afcbd2e31dafe303706df5d7}{RF\_BANK\_SETUP}}(priv, 1, 1);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00198}00198         \textcolor{comment}{/* Bank 2 Write */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00199}00199         \mbox{\hyperlink{ar2316_8c_abb6bc0a9afcbd2e31dafe303706df5d7}{RF\_BANK\_SETUP}}(priv, 2, modesIndex);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00200}00200 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00201}00201         \textcolor{comment}{/* Bank 3 Write */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00202}00202         \mbox{\hyperlink{ar2316_8c_abb6bc0a9afcbd2e31dafe303706df5d7}{RF\_BANK\_SETUP}}(priv, 3, modesIndex);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00204}00204         \textcolor{comment}{/* Bank 6 Write */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00205}00205         \mbox{\hyperlink{ar2316_8c_abb6bc0a9afcbd2e31dafe303706df5d7}{RF\_BANK\_SETUP}}(priv, 6, modesIndex);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00207}00207         \mbox{\hyperlink{ar2316_8c_a396413f51a20b01a7efdc43e5a1bda17}{ar5212ModifyRfBuffer}}(priv-\/>\mbox{\hyperlink{structar2316State_a77ab69d988dc3b7c6ca4e1ab94cae4d8}{Bank6Data}}, ob2GHz,   3, 178, 0);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00208}00208         \mbox{\hyperlink{ar2316_8c_a396413f51a20b01a7efdc43e5a1bda17}{ar5212ModifyRfBuffer}}(priv-\/>\mbox{\hyperlink{structar2316State_a77ab69d988dc3b7c6ca4e1ab94cae4d8}{Bank6Data}}, db2GHz,   3, 175, 0);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00210}00210         \textcolor{comment}{/* Bank 7 Setup */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00211}00211         \mbox{\hyperlink{ar2316_8c_abb6bc0a9afcbd2e31dafe303706df5d7}{RF\_BANK\_SETUP}}(priv, 7, modesIndex);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00212}00212 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00213}00213         \textcolor{comment}{/* Write Analog registers */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00214}00214         \mbox{\hyperlink{ah__internal_8h_a3d70138ec20d47306aa934766903342b}{HAL\_INI\_WRITE\_BANK}}(ah, ar5212Bank1\_2316, priv-\/>\mbox{\hyperlink{structar2316State_ad7893ccd00e713daa98d5c357b5f75a3}{Bank1Data}}, regWrites);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00215}00215         \mbox{\hyperlink{ah__internal_8h_a3d70138ec20d47306aa934766903342b}{HAL\_INI\_WRITE\_BANK}}(ah, ar5212Bank2\_2316, priv-\/>\mbox{\hyperlink{structar2316State_acd1dc0df681ba4c3a978448ee9ac20d9}{Bank2Data}}, regWrites);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00216}00216         \mbox{\hyperlink{ah__internal_8h_a3d70138ec20d47306aa934766903342b}{HAL\_INI\_WRITE\_BANK}}(ah, ar5212Bank3\_2316, priv-\/>\mbox{\hyperlink{structar2316State_a5c1f9daa2b8fd7525565741d29addd6b}{Bank3Data}}, regWrites);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00217}00217         \mbox{\hyperlink{ah__internal_8h_a3d70138ec20d47306aa934766903342b}{HAL\_INI\_WRITE\_BANK}}(ah, ar5212Bank6\_2316, priv-\/>\mbox{\hyperlink{structar2316State_a77ab69d988dc3b7c6ca4e1ab94cae4d8}{Bank6Data}}, regWrites);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00218}00218         \mbox{\hyperlink{ah__internal_8h_a3d70138ec20d47306aa934766903342b}{HAL\_INI\_WRITE\_BANK}}(ah, ar5212Bank7\_2316, priv-\/>\mbox{\hyperlink{structar2316State_aeaca38cbb151ff40c9235aec0730f8d7}{Bank7Data}}, regWrites);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00220}00220         \textcolor{comment}{/* Now that we have reprogrammed rfgain value, clear the flag. */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00221}00221         ahp-\/>\mbox{\hyperlink{structath__hal__5212_aba5f7f4630c9af36f6ea2908dd6460e9}{ah\_rfgainState}} = \mbox{\hyperlink{ah_8h_ae556b918a5e9b31dde154d742576a905a30aac39ec9bf5799fd60b7132951e7e4}{HAL\_RFGAIN\_INACTIVE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00222}00222 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00223}00223         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00224}00224 \textcolor{preprocessor}{\#undef  RF\_BANK\_SETUP}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00225}00225 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00227}00227 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00228}00228 \textcolor{comment}{ * Return a reference to the requested RF Bank.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00229}00229 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00230}00230 \textcolor{keyword}{static} uint32\_t *}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00231}\mbox{\hyperlink{ar2316_8c_a935003a771411087233770c6fc5bc327}{00231}} \mbox{\hyperlink{ar2316_8c_a935003a771411087233770c6fc5bc327}{ar2316GetRfBank}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keywordtype}{int} bank)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00232}00232 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00233}00233         \textcolor{keyword}{struct }\mbox{\hyperlink{structar2316State}{ar2316State}} *priv = \mbox{\hyperlink{ar2316_8c_a0a04e152a78faef4fdaaee5f9119bc2f}{AR2316}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00235}00235         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(priv != \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00236}00236         \textcolor{keywordflow}{switch} (bank) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00237}00237         \textcolor{keywordflow}{case} 1: \textcolor{keywordflow}{return} priv-\/>\mbox{\hyperlink{structar2316State_ad7893ccd00e713daa98d5c357b5f75a3}{Bank1Data}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00238}00238         \textcolor{keywordflow}{case} 2: \textcolor{keywordflow}{return} priv-\/>\mbox{\hyperlink{structar2316State_acd1dc0df681ba4c3a978448ee9ac20d9}{Bank2Data}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00239}00239         \textcolor{keywordflow}{case} 3: \textcolor{keywordflow}{return} priv-\/>\mbox{\hyperlink{structar2316State_a5c1f9daa2b8fd7525565741d29addd6b}{Bank3Data}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00240}00240         \textcolor{keywordflow}{case} 6: \textcolor{keywordflow}{return} priv-\/>\mbox{\hyperlink{structar2316State_a77ab69d988dc3b7c6ca4e1ab94cae4d8}{Bank6Data}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00241}00241         \textcolor{keywordflow}{case} 7: \textcolor{keywordflow}{return} priv-\/>\mbox{\hyperlink{structar2316State_aeaca38cbb151ff40c9235aec0730f8d7}{Bank7Data}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00242}00242         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00243}00243         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: unknown RF Bank \%d requested\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00244}00244             \_\_func\_\_, bank);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00245}00245         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00246}00246 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00247}00247 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00248}00248 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00249}00249 \textcolor{comment}{ * Return indices surrounding the value in sorted integer lists.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00250}00250 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00251}00251 \textcolor{comment}{ * NB: the input list is assumed to be sorted in ascending order}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00252}00252 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00253}00253 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00254}\mbox{\hyperlink{ar2316_8c_a98999d491795be8b4b3f4ab57a562850}{00254}} \mbox{\hyperlink{ar2316_8c_a98999d491795be8b4b3f4ab57a562850}{GetLowerUpperIndex}}(int16\_t v, \textcolor{keyword}{const} uint16\_t *lp, uint16\_t listSize,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00255}00255                           uint32\_t *vlo, uint32\_t *vhi)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00256}00256 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00257}00257         int16\_t target = v;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00258}00258         \textcolor{keyword}{const} int16\_t *ep = lp+listSize;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00259}00259         \textcolor{keyword}{const} int16\_t *tp;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00260}00260 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00261}00261         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00262}00262 \textcolor{comment}{         * Check first and last elements for out-\/of-\/bounds conditions.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00263}00263 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00264}00264         \textcolor{keywordflow}{if} (target < lp[0]) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00265}00265                 *vlo = *vhi = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00266}00266                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00267}00267         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00268}00268         \textcolor{keywordflow}{if} (target >= ep[-\/1]) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00269}00269                 *vlo = *vhi = listSize -\/ 1;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00270}00270                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00271}00271         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00273}00273         \textcolor{comment}{/* look for value being near or between 2 values in list */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00274}00274         \textcolor{keywordflow}{for} (tp = lp; tp < ep; tp++) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00275}00275                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00276}00276 \textcolor{comment}{                 * If value is close to the current value of the list}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00277}00277 \textcolor{comment}{                 * then target is not between values, it is one of the values}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00278}00278 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00279}00279                 \textcolor{keywordflow}{if} (*tp == target) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00280}00280                         *vlo = *vhi = tp -\/ (\textcolor{keyword}{const} int16\_t *) lp;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00281}00281                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00282}00282                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00283}00283                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00284}00284 \textcolor{comment}{                 * Look for value being between current value and next value}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00285}00285 \textcolor{comment}{                 * if so return these 2 values}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00286}00286 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00287}00287                 \textcolor{keywordflow}{if} (target < tp[1]) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00288}00288                         *vlo = tp -\/ (\textcolor{keyword}{const} int16\_t *) lp;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00289}00289                         *vhi = *vlo + 1;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00290}00290                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00291}00291                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00292}00292         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00293}00293 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00295}00295 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00296}00296 \textcolor{comment}{ * Fill the Vpdlist for indices Pmax-\/Pmin}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00297}00297 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00298}00298 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00299}\mbox{\hyperlink{ar2316_8c_a854b8b67d1b4078e11ca960ff0103258}{00299}} \mbox{\hyperlink{ar2316_8c_a854b8b67d1b4078e11ca960ff0103258}{ar2316FillVpdTable}}(uint32\_t pdGainIdx, int16\_t Pmin, int16\_t  Pmax,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00300}00300                    \textcolor{keyword}{const} int16\_t *pwrList, \textcolor{keyword}{const} int16\_t *VpdList,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00301}00301                    uint16\_t numIntercepts, uint16\_t retVpdList[][64])}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00302}00302 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00303}00303         uint16\_t ii, jj, kk;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00304}00304         int16\_t currPwr = (int16\_t)(2*Pmin);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00305}00305         \textcolor{comment}{/* since Pmin is pwr*2 and pwrList is 4*pwr */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00306}00306         uint32\_t  idxL, idxR;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00307}00307 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00308}00308         ii = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00309}00309         jj = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00310}00310 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00311}00311         \textcolor{keywordflow}{if} (numIntercepts < 2)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00312}00312                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00313}00313 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00314}00314         \textcolor{keywordflow}{while} (ii <= (uint16\_t)(Pmax -\/ Pmin)) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00315}00315                 \mbox{\hyperlink{ar2316_8c_a98999d491795be8b4b3f4ab57a562850}{GetLowerUpperIndex}}(currPwr, pwrList, numIntercepts, }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00316}00316                                          \&(idxL), \&(idxR));}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00317}00317                 \textcolor{keywordflow}{if} (idxR < 1)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00318}00318                         idxR = 1;                       \textcolor{comment}{/* extrapolate below */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00319}00319                 \textcolor{keywordflow}{if} (idxL == (uint32\_t)(numIntercepts -\/ 1))}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00320}00320                         idxL = numIntercepts -\/ 2;       \textcolor{comment}{/* extrapolate above */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00321}00321                 \textcolor{keywordflow}{if} (pwrList[idxL] == pwrList[idxR])}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00322}00322                         kk = VpdList[idxL];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00323}00323                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00324}00324                         kk = (uint16\_t)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00325}00325                                 (((currPwr -\/ pwrList[idxL])*VpdList[idxR]+ }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00326}00326                                   (pwrList[idxR] -\/ currPwr)*VpdList[idxL])/}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00327}00327                                  (pwrList[idxR] -\/ pwrList[idxL]));}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00328}00328                 retVpdList[pdGainIdx][ii] = kk;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00329}00329                 ii++;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00330}00330                 currPwr += 2;                           \textcolor{comment}{/* half dB steps */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00331}00331         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00333}00333         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00334}00334 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00336}00336 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00337}00337 \textcolor{comment}{ * Returns interpolated or the scaled up interpolated value}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00338}00338 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00339}00339 \textcolor{keyword}{static} int16\_t}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00340}\mbox{\hyperlink{ar2316_8c_aebb262233510ef5604992359bb2c13fa}{00340}} \mbox{\hyperlink{ar2316_8c_aebb262233510ef5604992359bb2c13fa}{interpolate\_signed}}(uint16\_t target, uint16\_t srcLeft, uint16\_t srcRight,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00341}00341         int16\_t targetLeft, int16\_t targetRight)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00342}00342 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00343}00343         int16\_t rv;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00344}00344 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00345}00345         \textcolor{keywordflow}{if} (srcRight != srcLeft) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00346}00346                 rv = ((target -\/ srcLeft)*targetRight +}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00347}00347                       (srcRight -\/ target)*targetLeft) / (srcRight -\/ srcLeft);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00348}00348         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00349}00349                 rv = targetLeft;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00350}00350         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00351}00351         \textcolor{keywordflow}{return} rv;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00352}00352 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00353}00353 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00354}00354 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00355}00355 \textcolor{comment}{ * Uses the data points read from EEPROM to reconstruct the pdadc power table}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00356}00356 \textcolor{comment}{ * Called by ar2316SetPowerTable()}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00357}00357 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00358}00358 \textcolor{keyword}{static} \textcolor{keywordtype}{int} }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00359}\mbox{\hyperlink{ar2316_8c_afa8a89f3dac7567d38d6505cbaf42aa2}{00359}} \mbox{\hyperlink{ar2316_8c_afa8a89f3dac7567d38d6505cbaf42aa2}{ar2316getGainBoundariesAndPdadcsForPowers}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, uint16\_t channel,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00360}00360                 \textcolor{keyword}{const} \mbox{\hyperlink{structRAW__DATA__STRUCT__2413}{RAW\_DATA\_STRUCT\_2316}} *pRawDataset,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00361}00361                 uint16\_t pdGainOverlap\_t2, }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00362}00362                 int16\_t  *pMinCalPower, uint16\_t pPdGainBoundaries[], }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00363}00363                 uint16\_t pPdGainValues[], uint16\_t pPDADCValues[]) }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00364}00364 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00365}00365         \textcolor{keyword}{struct }\mbox{\hyperlink{structar2316State}{ar2316State}} *priv = \mbox{\hyperlink{ar2316_8c_a0a04e152a78faef4fdaaee5f9119bc2f}{AR2316}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00366}00366 \textcolor{preprocessor}{\#define VpdTable\_L      priv-\/>vpdTable\_L}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00367}00367 \textcolor{preprocessor}{\#define VpdTable\_R      priv-\/>vpdTable\_R}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00368}00368 \textcolor{preprocessor}{\#define VpdTable\_I      priv-\/>vpdTable\_I}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00369}00369         uint32\_t ii, jj, kk;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00370}00370         int32\_t ss;\textcolor{comment}{/* potentially -\/ve index for taking care of pdGainOverlap */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00371}00371         uint32\_t idxL, idxR;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00372}00372         uint32\_t numPdGainsUsed = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00373}00373         \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00374}00374 \textcolor{comment}{         * If desired to support -\/ve power levels in future, just}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00375}00375 \textcolor{comment}{         * change pwr\_I\_0 to signed 5-\/bits.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00376}00376 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00377}00377         int16\_t Pmin\_t2[\mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00378}00378         \textcolor{comment}{/* to accommodate -\/ve power levels later on. */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00379}00379         int16\_t Pmax\_t2[\mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00380}00380         \textcolor{comment}{/* to accommodate -\/ve power levels later on */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00381}00381         uint16\_t numVpd = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00382}00382         uint16\_t Vpd\_step;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00383}00383         int16\_t tmpVal ; }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00384}00384         uint32\_t sizeCurrVpdTable, maxIndex, tgtIndex;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00385}00385 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00386}00386         \textcolor{comment}{/* Get upper lower index */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00387}00387         \mbox{\hyperlink{ar2316_8c_a98999d491795be8b4b3f4ab57a562850}{GetLowerUpperIndex}}(channel, pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_a2452fc470bdf4ade3c155069d8ef42b2}{pChannels}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00388}00388                                  pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_a6f7e9d770271e406f6cc440b0bb02f34}{numChannels}}, \&(idxL), \&(idxR));}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00389}00389 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00390}00390         \textcolor{keywordflow}{for} (ii = 0; ii < \mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}; ii++) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00391}00391                 jj = \mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}} -\/ ii -\/ 1;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00392}00392                 \textcolor{comment}{/* work backwards 'cause highest pdGain for lowest power */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00393}00393                 numVpd = pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxL].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a9ab2174b87152d4b5d3f15e30f2fee5d}{numVpd}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00394}00394                 \textcolor{keywordflow}{if} (numVpd > 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00395}00395                         pPdGainValues[numPdGainsUsed] = pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxL].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a2b20113a1884a18e03041bae714639af}{pd\_gain}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00396}00396                         Pmin\_t2[numPdGainsUsed] = pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxL].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[0];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00397}00397                         \textcolor{keywordflow}{if} (Pmin\_t2[numPdGainsUsed] >pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxR].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[0]) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00398}00398                                 Pmin\_t2[numPdGainsUsed] = pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxR].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[0];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00399}00399                         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00400}00400                         Pmin\_t2[numPdGainsUsed] = (int16\_t)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00401}00401                                 (Pmin\_t2[numPdGainsUsed] / 2);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00402}00402                         Pmax\_t2[numPdGainsUsed] = pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxL].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[numVpd-\/1];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00403}00403                         \textcolor{keywordflow}{if} (Pmax\_t2[numPdGainsUsed] > pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxR].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[numVpd-\/1])}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00404}00404                                 Pmax\_t2[numPdGainsUsed] = }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00405}00405                                         pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxR].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[numVpd-\/1];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00406}00406                         Pmax\_t2[numPdGainsUsed] = (int16\_t)(Pmax\_t2[numPdGainsUsed] / 2);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00407}00407                         \mbox{\hyperlink{ar2316_8c_a854b8b67d1b4078e11ca960ff0103258}{ar2316FillVpdTable}}(}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00408}00408                                            numPdGainsUsed, Pmin\_t2[numPdGainsUsed], Pmax\_t2[numPdGainsUsed], }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00409}00409                                            \&(pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxL].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[0]), }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00410}00410                                            \&(pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxL].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a7d8c41c667b28e7da6bc80d2327b4d62}{Vpd}}[0]), numVpd, \mbox{\hyperlink{ar2316_8c_a3784f5a61d1bc2e1ec9bc9040e2ce61b}{VpdTable\_L}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00411}00411                                            );}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00412}00412                         \mbox{\hyperlink{ar2316_8c_a854b8b67d1b4078e11ca960ff0103258}{ar2316FillVpdTable}}(}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00413}00413                                            numPdGainsUsed, Pmin\_t2[numPdGainsUsed], Pmax\_t2[numPdGainsUsed], }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00414}00414                                            \&(pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxR].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[0]),}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00415}00415                                            \&(pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[idxR].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a7d8c41c667b28e7da6bc80d2327b4d62}{Vpd}}[0]), numVpd, \mbox{\hyperlink{ar2316_8c_a5d508b842f09ee3e2b8c840e4db15061}{VpdTable\_R}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00416}00416                                            );}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00417}00417                         \textcolor{keywordflow}{for} (kk = 0; kk < (uint16\_t)(Pmax\_t2[numPdGainsUsed] -\/ Pmin\_t2[numPdGainsUsed]); kk++) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00418}00418                                 \mbox{\hyperlink{ar2316_8c_a4e1263dea1c7c540a996ec7b53b46319}{VpdTable\_I}}[numPdGainsUsed][kk] = }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00419}00419                                         \mbox{\hyperlink{ar2316_8c_aebb262233510ef5604992359bb2c13fa}{interpolate\_signed}}(}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00420}00420                                                            channel, pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_a2452fc470bdf4ade3c155069d8ef42b2}{pChannels}}[idxL], pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_a2452fc470bdf4ade3c155069d8ef42b2}{pChannels}}[idxR],}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00421}00421                                                            (int16\_t)\mbox{\hyperlink{ar2316_8c_a3784f5a61d1bc2e1ec9bc9040e2ce61b}{VpdTable\_L}}[numPdGainsUsed][kk], (int16\_t)\mbox{\hyperlink{ar2316_8c_a5d508b842f09ee3e2b8c840e4db15061}{VpdTable\_R}}[numPdGainsUsed][kk]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00422}00422                         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00423}00423                         \textcolor{comment}{/* fill VpdTable\_I for this pdGain */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00424}00424                         numPdGainsUsed++;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00425}00425                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00426}00426                 \textcolor{comment}{/* if this pdGain is used */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00427}00427         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00428}00428 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00429}00429         *pMinCalPower = Pmin\_t2[0];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00430}00430         kk = 0; \textcolor{comment}{/* index for the final table */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00431}00431         \textcolor{keywordflow}{for} (ii = 0; ii < numPdGainsUsed; ii++) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00432}00432                 \textcolor{keywordflow}{if} (ii == (numPdGainsUsed -\/ 1))}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00433}00433                         pPdGainBoundaries[ii] = Pmax\_t2[ii] +}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00434}00434                                 \mbox{\hyperlink{ah__eeprom__v3_8h_a4e6b30d6a5c2eb3b2ae72fe96752c825}{PD\_GAIN\_BOUNDARY\_STRETCH\_IN\_HALF\_DB}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00435}00435                 \textcolor{keywordflow}{else} }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00436}00436                         pPdGainBoundaries[ii] = (uint16\_t)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00437}00437                                 ((Pmax\_t2[ii] + Pmin\_t2[ii+1]) / 2 );}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00438}00438                 \textcolor{keywordflow}{if} (pPdGainBoundaries[ii] > 63) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00439}00439                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00440}00440                             \textcolor{stringliteral}{"{}\%s: clamp pPdGainBoundaries[\%d] \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00441}00441                             \_\_func\_\_, ii, pPdGainBoundaries[ii]);\textcolor{comment}{/*XXX*/}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00442}00442                         pPdGainBoundaries[ii] = 63;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00443}00443                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00445}00445                 \textcolor{comment}{/* Find starting index for this pdGain */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00446}00446                 \textcolor{keywordflow}{if} (ii == 0) }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00447}00447                         ss = 0; \textcolor{comment}{/* for the first pdGain, start from index 0 */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00448}00448                 \textcolor{keywordflow}{else} }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00449}00449                         ss = (pPdGainBoundaries[ii-\/1] -\/ Pmin\_t2[ii]) -\/ }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00450}00450                                 pdGainOverlap\_t2;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00451}00451                 Vpd\_step = (uint16\_t)(\mbox{\hyperlink{ar2316_8c_a4e1263dea1c7c540a996ec7b53b46319}{VpdTable\_I}}[ii][1] -\/ \mbox{\hyperlink{ar2316_8c_a4e1263dea1c7c540a996ec7b53b46319}{VpdTable\_I}}[ii][0]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00452}00452                 Vpd\_step = (uint16\_t)((Vpd\_step < 1) ? 1 : Vpd\_step);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00453}00453                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00454}00454 \textcolor{comment}{                 *-\/ve ss indicates need to extrapolate data below for this pdGain}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00455}00455 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00456}00456                 \textcolor{keywordflow}{while} (ss < 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00457}00457                         tmpVal = (int16\_t)(\mbox{\hyperlink{ar2316_8c_a4e1263dea1c7c540a996ec7b53b46319}{VpdTable\_I}}[ii][0] + ss*Vpd\_step);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00458}00458                         pPDADCValues[kk++] = (uint16\_t)((tmpVal < 0) ? 0 : tmpVal);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00459}00459                         ss++;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00460}00460                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00461}00461 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00462}00462                 sizeCurrVpdTable = Pmax\_t2[ii] -\/ Pmin\_t2[ii];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00463}00463                 tgtIndex = pPdGainBoundaries[ii] + pdGainOverlap\_t2 -\/ Pmin\_t2[ii];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00464}00464                 maxIndex = (tgtIndex < sizeCurrVpdTable) ? tgtIndex : sizeCurrVpdTable;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00465}00465 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00466}00466                 \textcolor{keywordflow}{while} (ss < (int16\_t)maxIndex)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00467}00467                         pPDADCValues[kk++] = \mbox{\hyperlink{ar2316_8c_a4e1263dea1c7c540a996ec7b53b46319}{VpdTable\_I}}[ii][ss++];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00469}00469                 Vpd\_step = (uint16\_t)(\mbox{\hyperlink{ar2316_8c_a4e1263dea1c7c540a996ec7b53b46319}{VpdTable\_I}}[ii][sizeCurrVpdTable-\/1] -\/}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00470}00470                                        \mbox{\hyperlink{ar2316_8c_a4e1263dea1c7c540a996ec7b53b46319}{VpdTable\_I}}[ii][sizeCurrVpdTable-\/2]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00471}00471                 Vpd\_step = (uint16\_t)((Vpd\_step < 1) ? 1 : Vpd\_step);           }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00472}00472                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00473}00473 \textcolor{comment}{                 * for last gain, pdGainBoundary == Pmax\_t2, so will }}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00474}00474 \textcolor{comment}{                 * have to extrapolate}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00475}00475 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00476}00476                 \textcolor{keywordflow}{if} (tgtIndex > maxIndex) \{      \textcolor{comment}{/* need to extrapolate above */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00477}00477                         \textcolor{keywordflow}{while}(ss < (int16\_t)tgtIndex) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00478}00478                                 tmpVal = (uint16\_t)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00479}00479                                         (\mbox{\hyperlink{ar2316_8c_a4e1263dea1c7c540a996ec7b53b46319}{VpdTable\_I}}[ii][sizeCurrVpdTable-\/1] + }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00480}00480                                          (ss-\/maxIndex)*Vpd\_step);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00481}00481                                 pPDADCValues[kk++] = (tmpVal > 127) ? }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00482}00482                                         127 : tmpVal;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00483}00483                                 ss++;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00484}00484                         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00485}00485                 \}                               \textcolor{comment}{/* extrapolated above */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00486}00486         \}                                       \textcolor{comment}{/* for all pdGainUsed */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00487}00487 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00488}00488         \textcolor{keywordflow}{while} (ii < \mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00489}00489                 pPdGainBoundaries[ii] = pPdGainBoundaries[ii-\/1];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00490}00490                 ii++;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00491}00491         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00492}00492         \textcolor{keywordflow}{while} (kk < 128) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00493}00493                 pPDADCValues[kk] = pPDADCValues[kk-\/1];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00494}00494                 kk++;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00495}00495         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00496}00496 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00497}00497         \textcolor{keywordflow}{return} numPdGainsUsed;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00498}00498 \textcolor{preprocessor}{\#undef VpdTable\_L}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00499}00499 \textcolor{preprocessor}{\#undef VpdTable\_R}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00500}00500 \textcolor{preprocessor}{\#undef VpdTable\_I}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00501}00501 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00502}00502 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00503}00503 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00504}\mbox{\hyperlink{ar2316_8c_a8ff14e85802570285c6afdb5635e0bea}{00504}} \mbox{\hyperlink{ar2316_8c_a8ff14e85802570285c6afdb5635e0bea}{ar2316SetPowerTable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00505}00505         int16\_t *minPower, int16\_t *maxPower,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00506}00506         \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan, }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00507}00507         uint16\_t *rfXpdGain)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00508}00508 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00509}00509         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp = \mbox{\hyperlink{ar5212_8h_ab645c6d1aebbc11b13cd2c76c922fab2}{AH5212}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00510}00510         \textcolor{keyword}{const} \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00511}00511         \textcolor{keyword}{const} \mbox{\hyperlink{structRAW__DATA__STRUCT__2413}{RAW\_DATA\_STRUCT\_2316}} *pRawDataset = \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00512}00512         uint16\_t pdGainOverlap\_t2;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00513}00513         int16\_t minCalPower2316\_t2;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00514}00514         uint16\_t *pdadcValues = ahp-\/>\mbox{\hyperlink{structath__hal__5212_a9b1b03f387c8f0125292e0b916a104e4}{ah\_pcdacTable}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00515}00515         uint16\_t gainBoundaries[4];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00516}00516         uint32\_t reg32, regoffset;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00517}00517         \textcolor{keywordtype}{int} i, numPdGainsUsed;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00518}00518 \textcolor{preprocessor}{\#ifndef AH\_USE\_INIPDGAIN}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00519}00519         uint32\_t tpcrg1;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00520}00520 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00522}00522         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}}, \textcolor{stringliteral}{"{}\%s: chan 0x\%x flag 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00523}00523             \_\_func\_\_, chan-\/>ic\_freq, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00524}00524 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00525}00525         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_G(chan) || IEEE80211\_IS\_CHAN\_108G(chan))}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00526}00526                 pRawDataset = \&ee-\/>ee\_rawDataset2413[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eab1a7f853b8258f4a5ad8b28e0962d139}{headerInfo11G}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00527}00527         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_B(chan))}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00528}00528                 pRawDataset = \&ee-\/>ee\_rawDataset2413[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eaeb6d754fbc141f3c22b8dd6d918b69e2}{headerInfo11B}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00529}00529         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00530}00530                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: illegal mode\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00531}00531                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00532}00532         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00533}00533 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00534}00534         pdGainOverlap\_t2 = (uint16\_t) \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5212phy_8h_a3d252a14bb5a6e463b42d4366fda01e6}{AR\_PHY\_TPCRG5}}),}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00535}00535                                           \mbox{\hyperlink{ar5212phy_8h_a9e2f1a56cefbc5bf551538f7152ca250}{AR\_PHY\_TPCRG5\_PD\_GAIN\_OVERLAP}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00536}00536     }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00537}00537         numPdGainsUsed = \mbox{\hyperlink{ar2316_8c_afa8a89f3dac7567d38d6505cbaf42aa2}{ar2316getGainBoundariesAndPdadcsForPowers}}(ah,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00538}00538                 chan-\/>channel, pRawDataset, pdGainOverlap\_t2,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00539}00539                 \&minCalPower2316\_t2,gainBoundaries, rfXpdGain, pdadcValues);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00540}00540         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(1 <= numPdGainsUsed \&\& numPdGainsUsed <= 3);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00542}00542 \textcolor{preprocessor}{\#ifdef AH\_USE\_INIPDGAIN}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00543}00543         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00544}00544 \textcolor{comment}{         * Use pd\_gains curve from eeprom; Atheros always uses}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00545}00545 \textcolor{comment}{         * the default curve from the ini file but some vendors}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00546}00546 \textcolor{comment}{         * (e.g. Zcomax) want to override this curve and not}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00547}00547 \textcolor{comment}{         * honoring their settings results in tx power 5dBm low.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00548}00548 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00549}00549         \mbox{\hyperlink{ah__internal_8h_ab80ff599cda88f9223505d0ecbb53bcd}{OS\_REG\_RMW\_FIELD}}(ah, \mbox{\hyperlink{ar5212phy_8h_a1560034df4e10cdffe3fda238b8dd57a}{AR\_PHY\_TPCRG1}}, \mbox{\hyperlink{ar5212phy_8h_ab6bbdb1c0a2f5819677255c58ee9def8}{AR\_PHY\_TPCRG1\_NUM\_PD\_GAIN}}, }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00550}00550                          (pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}}[0].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a36307e356e469fdb8536cbcd5af1eeff}{numPdGains}} -\/ 1));}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00551}00551 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00552}00552         tpcrg1 = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5212phy_8h_a1560034df4e10cdffe3fda238b8dd57a}{AR\_PHY\_TPCRG1}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00553}00553         tpcrg1 = (tpcrg1 \&\string~ AR\_PHY\_TPCRG1\_NUM\_PD\_GAIN)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00554}00554                   | \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(numPdGainsUsed-\/1, \mbox{\hyperlink{ar5212phy_8h_ab6bbdb1c0a2f5819677255c58ee9def8}{AR\_PHY\_TPCRG1\_NUM\_PD\_GAIN}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00555}00555         \textcolor{keywordflow}{switch} (numPdGainsUsed) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00556}00556         \textcolor{keywordflow}{case} 3:}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00557}00557                 tpcrg1 \&= \string~AR\_PHY\_TPCRG1\_PDGAIN\_SETTING3;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00558}00558                 tpcrg1 |= \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(rfXpdGain[2], \mbox{\hyperlink{ar5212phy_8h_a63dba6aefec4b7c49dd31c4094b3a923}{AR\_PHY\_TPCRG1\_PDGAIN\_SETTING3}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00559}00559                 \textcolor{comment}{/* fall thru... */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00560}00560         \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00561}00561                 tpcrg1 \&= \string~AR\_PHY\_TPCRG1\_PDGAIN\_SETTING2;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00562}00562                 tpcrg1 |= \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(rfXpdGain[1], \mbox{\hyperlink{ar5212phy_8h_aabfc00af57091418563d353a3d6bc571}{AR\_PHY\_TPCRG1\_PDGAIN\_SETTING2}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00563}00563                 \textcolor{comment}{/* fall thru... */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00564}00564         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00565}00565                 tpcrg1 \&= \string~AR\_PHY\_TPCRG1\_PDGAIN\_SETTING1;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00566}00566                 tpcrg1 |= \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(rfXpdGain[0], \mbox{\hyperlink{ar5212phy_8h_a10508c10381becc92fda4b1423a35fd6}{AR\_PHY\_TPCRG1\_PDGAIN\_SETTING1}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00567}00567                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00568}00568         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00569}00569 \textcolor{preprocessor}{\#ifdef AH\_DEBUG}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00570}00570         \textcolor{keywordflow}{if} (tpcrg1 != \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5212phy_8h_a1560034df4e10cdffe3fda238b8dd57a}{AR\_PHY\_TPCRG1}}))}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00571}00571                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}}, \textcolor{stringliteral}{"{}\%s: using non-\/default "{}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00572}00572                     \textcolor{stringliteral}{"{}pd\_gains (default 0x\%x, calculated 0x\%x)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00573}00573                     \_\_func\_\_, \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5212phy_8h_a1560034df4e10cdffe3fda238b8dd57a}{AR\_PHY\_TPCRG1}}), tpcrg1);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00574}00574 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00575}00575         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5212phy_8h_a1560034df4e10cdffe3fda238b8dd57a}{AR\_PHY\_TPCRG1}}, tpcrg1);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00576}00576 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00577}00577 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00578}00578         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00579}00579 \textcolor{comment}{         * Note the pdadc table may not start at 0 dBm power, could be}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00580}00580 \textcolor{comment}{         * negative or greater than 0.  Need to offset the power}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00581}00581 \textcolor{comment}{         * values by the amount of minPower for griffin}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00582}00582 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00583}00583         \textcolor{keywordflow}{if} (minCalPower2316\_t2 != 0)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00584}00584                 ahp-\/>\mbox{\hyperlink{structath__hal__5212_a2d87383d3ff8190de78e600618863085}{ah\_txPowerIndexOffset}} = (int16\_t)(0 -\/ minCalPower2316\_t2);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00585}00585         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00586}00586                 ahp-\/>\mbox{\hyperlink{structath__hal__5212_a2d87383d3ff8190de78e600618863085}{ah\_txPowerIndexOffset}} = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00588}00588         \textcolor{comment}{/* Finally, write the power values into the baseband power table */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00589}00589         regoffset = 0x9800 + (672 <<2); \textcolor{comment}{/* beginning of pdadc table in griffin */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00590}00590         \textcolor{keywordflow}{for} (i = 0; i < 32; i++) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00591}00591                 reg32 = ((pdadcValues[4*i + 0] \& 0xFF) << 0)  | }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00592}00592                         ((pdadcValues[4*i + 1] \& 0xFF) << 8)  |}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00593}00593                         ((pdadcValues[4*i + 2] \& 0xFF) << 16) |}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00594}00594                         ((pdadcValues[4*i + 3] \& 0xFF) << 24) ;        }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00595}00595                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, regoffset, reg32);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00596}00596                 regoffset += 4;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00597}00597         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00598}00598 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00599}00599         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5212phy_8h_a3d252a14bb5a6e463b42d4366fda01e6}{AR\_PHY\_TPCRG5}}, }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00600}00600                      \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(pdGainOverlap\_t2, \mbox{\hyperlink{ar5212phy_8h_a9e2f1a56cefbc5bf551538f7152ca250}{AR\_PHY\_TPCRG5\_PD\_GAIN\_OVERLAP}}) | }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00601}00601                      \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(gainBoundaries[0], \mbox{\hyperlink{ar5212phy_8h_a79cf6a62ed105221e432c6a5deb83816}{AR\_PHY\_TPCRG5\_PD\_GAIN\_BOUNDARY\_1}}) |}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00602}00602                      \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(gainBoundaries[1], \mbox{\hyperlink{ar5212phy_8h_a4a8e6b39f8876c3c29ffe4b126d848a8}{AR\_PHY\_TPCRG5\_PD\_GAIN\_BOUNDARY\_2}}) |}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00603}00603                      \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(gainBoundaries[2], \mbox{\hyperlink{ar5212phy_8h_ad13d96cb119e50edec2826dec99b7aae}{AR\_PHY\_TPCRG5\_PD\_GAIN\_BOUNDARY\_3}}) |}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00604}00604                      \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(gainBoundaries[3], \mbox{\hyperlink{ar5212phy_8h_a2ea5e6ff52cb320e7cc8cdff922dafe9}{AR\_PHY\_TPCRG5\_PD\_GAIN\_BOUNDARY\_4}}));}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00606}00606         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00607}00607 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00608}00608 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00609}00609 \textcolor{keyword}{static} int16\_t}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00610}\mbox{\hyperlink{ar2316_8c_a3ac4111c0f8a08b411f93fc0bebc3ade}{00610}} \mbox{\hyperlink{ar2316_8c_a3ac4111c0f8a08b411f93fc0bebc3ade}{ar2316GetMinPower}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413}{RAW\_DATA\_PER\_CHANNEL\_2316}} *data)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00611}00611 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00612}00612         uint32\_t ii,jj;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00613}00613         uint16\_t Pmin=0,numVpd;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00614}00614 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00615}00615         \textcolor{keywordflow}{for} (ii = 0; ii < \mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}; ii++) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00616}00616                 jj = \mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}} -\/ ii -\/ 1;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00617}00617                 \textcolor{comment}{/* work backwards 'cause highest pdGain for lowest power */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00618}00618                 numVpd = data-\/>\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a9ab2174b87152d4b5d3f15e30f2fee5d}{numVpd}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00619}00619                 \textcolor{keywordflow}{if} (numVpd > 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00620}00620                         Pmin = data-\/>\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[jj].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[0];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00621}00621                         \textcolor{keywordflow}{return}(Pmin);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00622}00622                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00623}00623         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00624}00624         \textcolor{keywordflow}{return}(Pmin);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00625}00625 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00627}00627 \textcolor{keyword}{static} int16\_t}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00628}\mbox{\hyperlink{ar2316_8c_ae0bc71adbcff42caf15d896c21ba5ffd}{00628}} \mbox{\hyperlink{ar2316_8c_ae0bc71adbcff42caf15d896c21ba5ffd}{ar2316GetMaxPower}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413}{RAW\_DATA\_PER\_CHANNEL\_2316}} *data)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00629}00629 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00630}00630         uint32\_t ii;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00631}00631         uint16\_t Pmax=0,numVpd;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00632}00632 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00633}00633         \textcolor{keywordflow}{for} (ii=0; ii< \mbox{\hyperlink{ah__eeprom__v3_8h_a05da7e9317a4ec48812d51cbd10d6c08}{MAX\_NUM\_PDGAINS\_PER\_CHANNEL}}; ii++) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00634}00634                 \textcolor{comment}{/* work forwards cuase lowest pdGain for highest power */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00635}00635                 numVpd = data-\/>\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[ii].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a9ab2174b87152d4b5d3f15e30f2fee5d}{numVpd}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00636}00636                 \textcolor{keywordflow}{if} (numVpd > 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00637}00637                         Pmax = data-\/>\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a1d4569896fd538ed2ac3e61b30411227}{pDataPerPDGain}}[ii].\mbox{\hyperlink{structRAW__DATA__PER__PDGAIN__2413_a378faae12f5cd061296a7a64a8f1410e}{pwr\_t4}}[numVpd-\/1];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00638}00638                         \textcolor{keywordflow}{return}(Pmax);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00639}00639                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00640}00640         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00641}00641         \textcolor{keywordflow}{return}(Pmax);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00642}00642 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00643}00643 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00644}00644 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00645}\mbox{\hyperlink{ar2316_8c_a5bc2aeeaffadef4f8939bee6ea34a553}{00645}} \mbox{\hyperlink{ar2316_8c_a5bc2aeeaffadef4f8939bee6ea34a553}{ar2316GetChannelMaxMinPower}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00646}00646         \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan,}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00647}00647         int16\_t *maxPow, int16\_t *minPow)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00648}00648 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00649}00649         uint16\_t freq = chan-\/>ic\_freq;          \textcolor{comment}{/* NB: never mapped */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00650}00650         \textcolor{keyword}{const} \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00651}00651         \textcolor{keyword}{const} \mbox{\hyperlink{structRAW__DATA__STRUCT__2413}{RAW\_DATA\_STRUCT\_2316}} *pRawDataset = \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00652}00652         \textcolor{keyword}{const} \mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413}{RAW\_DATA\_PER\_CHANNEL\_2316}} *data=\mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00653}00653         uint16\_t numChannels;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00654}00654         \textcolor{keywordtype}{int} totalD,totalF, totalMin,last, i;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00655}00655 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00656}00656         *maxPow = 0;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00657}00657 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00658}00658         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_G(chan) || IEEE80211\_IS\_CHAN\_108G(chan))}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00659}00659                 pRawDataset = \&ee-\/>ee\_rawDataset2413[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eab1a7f853b8258f4a5ad8b28e0962d139}{headerInfo11G}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00660}00660         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_B(chan))}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00661}00661                 pRawDataset = \&ee-\/>ee\_rawDataset2413[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eaeb6d754fbc141f3c22b8dd6d918b69e2}{headerInfo11B}}];}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00662}00662         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00663}00663                 \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00664}00664 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00665}00665         numChannels = pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_a6f7e9d770271e406f6cc440b0bb02f34}{numChannels}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00666}00666         data = pRawDataset-\/>\mbox{\hyperlink{structRAW__DATA__STRUCT__2413_ad6ad4822b146dde2dff344f17f37ac6d}{pDataPerChannel}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00667}00667 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00668}00668         \textcolor{comment}{/* Make sure the channel is in the range of the TP values }}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00669}00669 \textcolor{comment}{         *  (freq piers)}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00670}00670 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00671}00671         \textcolor{keywordflow}{if} (numChannels < 1)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00672}00672                 \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00673}00673 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00674}00674         \textcolor{keywordflow}{if} ((freq < data[0].channelValue) ||}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00675}00675             (freq > data[numChannels-\/1].channelValue)) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00676}00676                 \textcolor{keywordflow}{if} (freq < data[0].channelValue) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00677}00677                         *maxPow = \mbox{\hyperlink{ar2316_8c_ae0bc71adbcff42caf15d896c21ba5ffd}{ar2316GetMaxPower}}(ah, \&data[0]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00678}00678                         *minPow = \mbox{\hyperlink{ar2316_8c_a3ac4111c0f8a08b411f93fc0bebc3ade}{ar2316GetMinPower}}(ah, \&data[0]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00679}00679                         \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00680}00680                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00681}00681                         *maxPow = \mbox{\hyperlink{ar2316_8c_ae0bc71adbcff42caf15d896c21ba5ffd}{ar2316GetMaxPower}}(ah, \&data[numChannels -\/ 1]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00682}00682                         *minPow = \mbox{\hyperlink{ar2316_8c_a3ac4111c0f8a08b411f93fc0bebc3ade}{ar2316GetMinPower}}(ah, \&data[numChannels -\/ 1]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00683}00683                         \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00684}00684                 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00685}00685         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00686}00686 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00687}00687         \textcolor{comment}{/* Linearly interpolate the power value now */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00688}00688         \textcolor{keywordflow}{for} (last=0,i=0; (i<numChannels) \&\& (freq > data[i].channelValue);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00689}00689              last = i++);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00690}00690         totalD = data[i].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a53ffd248c63382e7459ed49ad6ed1fc3}{channelValue}} -\/ data[last].\mbox{\hyperlink{structRAW__DATA__PER__CHANNEL__2413_a53ffd248c63382e7459ed49ad6ed1fc3}{channelValue}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00691}00691         \textcolor{keywordflow}{if} (totalD > 0) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00692}00692                 totalF = \mbox{\hyperlink{ar2316_8c_ae0bc71adbcff42caf15d896c21ba5ffd}{ar2316GetMaxPower}}(ah, \&data[i]) -\/ \mbox{\hyperlink{ar2316_8c_ae0bc71adbcff42caf15d896c21ba5ffd}{ar2316GetMaxPower}}(ah, \&data[last]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00693}00693                 *maxPow = (int8\_t) ((totalF*(freq-\/data[last].channelValue) + }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00694}00694                                      \mbox{\hyperlink{ar2316_8c_ae0bc71adbcff42caf15d896c21ba5ffd}{ar2316GetMaxPower}}(ah, \&data[last])*totalD)/totalD);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00695}00695                 totalMin = \mbox{\hyperlink{ar2316_8c_a3ac4111c0f8a08b411f93fc0bebc3ade}{ar2316GetMinPower}}(ah, \&data[i]) -\/ \mbox{\hyperlink{ar2316_8c_a3ac4111c0f8a08b411f93fc0bebc3ade}{ar2316GetMinPower}}(ah, \&data[last]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00696}00696                 *minPow = (int8\_t) ((totalMin*(freq-\/data[last].channelValue) +}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00697}00697                                      \mbox{\hyperlink{ar2316_8c_a3ac4111c0f8a08b411f93fc0bebc3ade}{ar2316GetMinPower}}(ah, \&data[last])*totalD)/totalD);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00698}00698                 \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00699}00699         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00700}00700                 \textcolor{keywordflow}{if} (freq == data[i].channelValue) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00701}00701                         *maxPow = \mbox{\hyperlink{ar2316_8c_ae0bc71adbcff42caf15d896c21ba5ffd}{ar2316GetMaxPower}}(ah, \&data[i]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00702}00702                         *minPow = \mbox{\hyperlink{ar2316_8c_a3ac4111c0f8a08b411f93fc0bebc3ade}{ar2316GetMinPower}}(ah, \&data[i]);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00703}00703                         \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00704}00704                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00705}00705                         \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00706}00706         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00707}00707 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00709}00709 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00710}00710 \textcolor{comment}{ * Free memory for analog bank scratch buffers}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00711}00711 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00712}00712 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00713}\mbox{\hyperlink{ar2316_8c_a7ff347bfa84fcec08e1e9ad30eab262d}{00713}} \mbox{\hyperlink{ar2316_8c_a7ff347bfa84fcec08e1e9ad30eab262d}{ar2316RfDetach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00714}00714 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00715}00715         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp = \mbox{\hyperlink{ar5212_8h_ab645c6d1aebbc11b13cd2c76c922fab2}{AH5212}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00716}00716 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00717}00717         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(ahp-\/>\mbox{\hyperlink{structath__hal__5212_ab60ce71dde37f2d3958b4239181aee21}{ah\_rfHal}} != \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00718}00718         \mbox{\hyperlink{ah__osdep_8c_a549b6e20152a3b059711721fab9b9427}{ath\_hal\_free}}(ahp-\/>\mbox{\hyperlink{structath__hal__5212_ab60ce71dde37f2d3958b4239181aee21}{ah\_rfHal}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00719}00719         ahp-\/>\mbox{\hyperlink{structath__hal__5212_ab60ce71dde37f2d3958b4239181aee21}{ah\_rfHal}} = \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00720}00720 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00721}00721 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00722}00722 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00723}00723 \textcolor{comment}{ * Allocate memory for private state.}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00724}00724 \textcolor{comment}{ * Scratch Buffer will be reinitialized every reset so no need to zero now}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00725}00725 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00726}00726 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00727}\mbox{\hyperlink{ar2316_8c_ab57204bc0431a90d172a6dd9b7c0304d}{00727}} \mbox{\hyperlink{ar2316_8c_ab57204bc0431a90d172a6dd9b7c0304d}{ar2316RfAttach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0}{HAL\_STATUS}} *status)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00728}00728 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00729}00729         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp = \mbox{\hyperlink{ar5212_8h_ab645c6d1aebbc11b13cd2c76c922fab2}{AH5212}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00730}00730         \textcolor{keyword}{struct }\mbox{\hyperlink{structar2316State}{ar2316State}} *priv;}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00731}00731 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00732}00732         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(ah-\/>\mbox{\hyperlink{structath__hal_a6760ffd128ce97a5cc891bdb792e0173}{ah\_magic}} == \mbox{\hyperlink{ar5212_8h_ad93bc65899da6c0f2fd644a59eab0da1}{AR5212\_MAGIC}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00734}00734         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(ahp-\/>\mbox{\hyperlink{structath__hal__5212_ab60ce71dde37f2d3958b4239181aee21}{ah\_rfHal}} == \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00735}00735         priv = \mbox{\hyperlink{ah__internal_8h_a7f8ca8d72271b356d041c10bd5598ce1}{ath\_hal\_malloc}}(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structar2316State}{ar2316State}}));}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00736}00736         \textcolor{keywordflow}{if} (priv == \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00737}00737                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00738}00738                     \textcolor{stringliteral}{"{}\%s: cannot allocate private state\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00739}00739                 *status = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0ab19ce53cce6a6d5f053082bebffd7392}{HAL\_ENOMEM}};         \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00740}00740                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00741}00741         \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00742}00742         priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}}.\mbox{\hyperlink{structRfHalFuncs_acbee0c25878650e4c3addb07d06a3ee9}{rfDetach}}         = \mbox{\hyperlink{ar2316_8c_a7ff347bfa84fcec08e1e9ad30eab262d}{ar2316RfDetach}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00743}00743         priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}}.\mbox{\hyperlink{structRfHalFuncs_a79648e9cd31ed5f0bcf38f8c6d915daa}{writeRegs}}               = \mbox{\hyperlink{ar2316_8c_a95b49691b2efc290b297b64adb77eeaa}{ar2316WriteRegs}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00744}00744         priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}}.\mbox{\hyperlink{structRfHalFuncs_a72093ee607f22e28e6e53ca3dbf34ad9}{getRfBank}}               = \mbox{\hyperlink{ar2316_8c_a935003a771411087233770c6fc5bc327}{ar2316GetRfBank}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00745}00745         priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}}.\mbox{\hyperlink{structRfHalFuncs_a689f26e432273638762f517a0d331d02}{setChannel}}             = \mbox{\hyperlink{ar2316_8c_a783071580490461365760f3bb24f28d7}{ar2316SetChannel}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00746}00746         priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}}.\mbox{\hyperlink{structRfHalFuncs_a30babc40da9d497b4c1037d71a797b7f}{setRfRegs}}               = \mbox{\hyperlink{ar2316_8c_acc213681cfd2182ccb5a11ed22a788db}{ar2316SetRfRegs}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00747}00747         priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}}.\mbox{\hyperlink{structRfHalFuncs_a3e920af405d134c4c3b5dc57ac073ac9}{setPowerTable}}       = \mbox{\hyperlink{ar2316_8c_a8ff14e85802570285c6afdb5635e0bea}{ar2316SetPowerTable}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00748}00748         priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}}.\mbox{\hyperlink{structRfHalFuncs_a20c759064c3bb4387b456e5f2b72f6b4}{getChannelMaxMinPower}} = \mbox{\hyperlink{ar2316_8c_a5bc2aeeaffadef4f8939bee6ea34a553}{ar2316GetChannelMaxMinPower}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00749}00749         priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}}.\mbox{\hyperlink{structRfHalFuncs_a9c533207772ea9a66a927c3b29dbab08}{getNfAdjust}}           = \mbox{\hyperlink{ar5212_8h_a883480b3597d581d4a6566eaaee6959b}{ar5212GetNfAdjust}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00750}00750 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00751}00751         ahp-\/>\mbox{\hyperlink{structath__hal__5212_a9b1b03f387c8f0125292e0b916a104e4}{ah\_pcdacTable}} = priv-\/>\mbox{\hyperlink{structar2316State_a0848e631f49acbc33964bf2514c0451d}{pcdacTable}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00752}00752         ahp-\/>\mbox{\hyperlink{structath__hal__5212_a00cd0bdf3d7b1a8039f6c017f0ea8d94}{ah\_pcdacTableSize}} = \textcolor{keyword}{sizeof}(priv-\/>\mbox{\hyperlink{structar2316State_a0848e631f49acbc33964bf2514c0451d}{pcdacTable}});}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00753}00753         ahp-\/>\mbox{\hyperlink{structath__hal__5212_ab60ce71dde37f2d3958b4239181aee21}{ah\_rfHal}} = \&priv-\/>\mbox{\hyperlink{structar2316State_a425b1ad7bb003967311ee6d6714642fd}{base}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00754}00754 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00755}00755         ahp-\/>\mbox{\hyperlink{structath__hal__5212_a2bbd3b2ed8f130c6e0c9aa0d9ba3f0d5}{ah\_cwCalRequire}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};           \textcolor{comment}{/* force initial cal */}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00756}00756 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00757}00757         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00758}00758 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00759}00759 }
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00760}00760 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00761}\mbox{\hyperlink{ar2316_8c_a0c73072ce9f46d36cb141944df07b8bd}{00761}} \mbox{\hyperlink{ar2316_8c_a0c73072ce9f46d36cb141944df07b8bd}{ar2316Probe}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00762}00762 \{}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00763}00763         \textcolor{keywordflow}{return} \mbox{\hyperlink{ar5212_8h_a40e2116d710f7f62b25a434b14f632a6}{IS\_2316}}(ah);}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00764}00764 \}}
\DoxyCodeLine{\Hypertarget{ar2316_8c_source_l00765}\mbox{\hyperlink{ar2316_8c_aa624e9849fa039582afa6ebd9bd335ab}{00765}} \mbox{\hyperlink{ar2316_8c_aa624e9849fa039582afa6ebd9bd335ab}{AH\_RF}}(RF2316, \mbox{\hyperlink{ar2316_8c_a0c73072ce9f46d36cb141944df07b8bd}{ar2316Probe}}, \mbox{\hyperlink{ar2316_8c_ab57204bc0431a90d172a6dd9b7c0304d}{ar2316RfAttach}});}

\end{DoxyCode}
