\hypertarget{ar9280_8c_source}{}\doxysection{ar9280.\+c}
\label{ar9280_8c_source}\index{dev/ath/ath\_hal/ar9002/ar9280.c@{dev/ath/ath\_hal/ar9002/ar9280.c}}
\mbox{\hyperlink{ar9280_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: ISC}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2008-\/2009 Sam Leffler, Errno Consulting}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2008 Atheros Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00007}00007 \textcolor{comment}{ * Permission to use, copy, modify, and/or distribute this software for any}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00008}00008 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00009}00009 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00011}00011 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00012}00012 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00013}00013 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00014}00014 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00015}00015 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00016}00016 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00017}00017 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00019}00019 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00020}00020 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00021}00021 \textcolor{preprocessor}{\#include "{}opt\_ah.h"{}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00022}00022 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00023}00023 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00024}00024 \textcolor{comment}{ * NB: Merlin and later have a simpler RF backend.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00025}00025 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00026}00026 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah_8h}{ah.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00027}00027 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__internal_8h}{ah\_internal.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__eeprom__v14_8h}{ah\_eeprom\_v14.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00031}00031 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar9280_8h}{ar9002/ar9280.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00032}00032 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5416reg_8h}{ar5416/ar5416reg.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00033}00033 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5416phy_8h}{ar5416/ar5416phy.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00035}\mbox{\hyperlink{ar9280_8c_af04f8faa08e13b16b70b52a56fbc9c53}{00035}} \textcolor{preprocessor}{\#define N(a)    (sizeof(a)/sizeof(a[0]))}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00037}\mbox{\hyperlink{structar9280State}{00037}} \textcolor{keyword}{struct }\mbox{\hyperlink{structar9280State}{ar9280State}} \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00038}\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{00038}}         \mbox{\hyperlink{structRfHalFuncs}{RF\_HAL\_FUNCS}}        \mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}};               \textcolor{comment}{/* public state, must be first */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00039}\mbox{\hyperlink{structar9280State_a79477ab68ce73ed1f55c4a3f8d78dbce}{00039}}         uint16\_t        \mbox{\hyperlink{structar9280State_a79477ab68ce73ed1f55c4a3f8d78dbce}{pcdacTable}}[1];        \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00040}00040 \};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00041}\mbox{\hyperlink{ar9280_8c_a2469a0e425be6a21b178c884b533badd}{00041}} \textcolor{preprocessor}{\#define AR9280(ah)      ((struct ar9280State *) AH5212(ah)-\/>ah\_rfHal)}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00042}00042 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00043}00043 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar9280_8c_a6dbfc19fdfb2a5f7a5bb6d19e857a83f}{ar9280GetChannelMaxMinPower}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00044}00044         \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *, int16\_t *maxPow,int16\_t *minPow);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00045}00045 int16\_t \mbox{\hyperlink{ar9280_8c_afb24851916aaed780aba99f68b4283e8}{ar9280GetNfAdjust}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \mbox{\hyperlink{structHAL__CHANNEL__INTERNAL}{HAL\_CHANNEL\_INTERNAL}} *c);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00047}00047 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00048}\mbox{\hyperlink{ar9280_8c_a13210d02451a350efa3fa28047bf6b9d}{00048}} \mbox{\hyperlink{ar9280_8c_a13210d02451a350efa3fa28047bf6b9d}{ar9280WriteRegs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, u\_int modesIndex, u\_int freqIndex,}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00049}00049         \textcolor{keywordtype}{int} writes)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00050}00050 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00051}00051         (void) \mbox{\hyperlink{ah_8c_ab52bbbccdbd322c7927486ad5c8543b9}{ath\_hal\_ini\_write}}(ah, \&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_bb\_rfgain,}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00052}00052                 freqIndex, writes);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00053}00053 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00055}00055 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00056}00056 \textcolor{comment}{ * Take the MHz channel value and set the Channel value}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00057}00057 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00058}00058 \textcolor{comment}{ * ASSUMES: Writes enabled to analog bus}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00059}00059 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00060}00060 \textcolor{comment}{ * Actual Expression,}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00061}00061 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00062}00062 \textcolor{comment}{ * For 2GHz channel, }}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00063}00063 \textcolor{comment}{ * Channel Frequency = (3/4) * freq\_ref * (chansel[8:0] + chanfrac[16:0]/2\string^17) }}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00064}00064 \textcolor{comment}{ * (freq\_ref = 40MHz)}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00065}00065 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00066}00066 \textcolor{comment}{ * For 5GHz channel,}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00067}00067 \textcolor{comment}{ * Channel Frequency = (3/2) * freq\_ref * (chansel[8:0] + chanfrac[16:0]/2\string^10)}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00068}00068 \textcolor{comment}{ * (freq\_ref = 40MHz/(24>>amodeRefSel))}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00069}00069 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00070}00070 \textcolor{comment}{ * For 5GHz channels which are 5MHz spaced,}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00071}00071 \textcolor{comment}{ * Channel Frequency = (3/2) * freq\_ref * (chansel[8:0] + chanfrac[16:0]/2\string^17)}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00072}00072 \textcolor{comment}{ * (freq\_ref = 40MHz)}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00073}00073 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00074}00074 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00075}\mbox{\hyperlink{ar9280_8c_a3d217088855c6594ebe8f22a44c05e8a}{00075}} \mbox{\hyperlink{ar9280_8c_a3d217088855c6594ebe8f22a44c05e8a}{ar9280SetChannel}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00076}00076 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00077}00077         uint16\_t bMode, fracMode, aModeRefSel = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00078}00078         uint32\_t freq, ndiv, channelSel = 0, channelFrac = 0, reg32 = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00079}00079         \mbox{\hyperlink{structCHAN__CENTERS}{CHAN\_CENTERS}} centers;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00080}00080         uint32\_t refDivA = 24;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00081}00081         uint8\_t frac\_n\_5g;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00083}00083         \mbox{\hyperlink{ah__osdep_8h_ab267e59f6e2341e9565d6b6b04cbd0d3}{OS\_MARK}}(ah, \mbox{\hyperlink{ah__decode_8h_a0411cd49bb5b71852cecd93bcbf0ca2da655ca2fd89a09256aeef35a42282d798}{AH\_MARK\_SETCHANNEL}}, chan-\/>ic\_freq);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00085}00085         \mbox{\hyperlink{ar5416_8h_a044274773df09faab06e4a3bc809dbec}{ar5416GetChannelCenters}}(ah, chan, \&centers);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00086}00086         freq = centers.\mbox{\hyperlink{structCHAN__CENTERS_a87cac942715760a189fa25344b970370}{synth\_center}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00087}00087 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00088}00088         reg32 = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_a4a9b9486d932e5218eab70eb7a5d0bfc}{AR\_PHY\_SYNTH\_CONTROL}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00089}00089         reg32 \&= 0xc0000000;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00091}00091         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7176b52a6180c0ebb56fa0eae8146024}{ath\_hal\_eepromGet}}(ah, \mbox{\hyperlink{ah__eeprom_8h_ac36f475ca5b446f4fde4c9b90bec77c8aac22f69fd0a8486c527ea89a3db6d1be}{AR\_EEP\_FRAC\_N\_5G}}, \&frac\_n\_5g) != \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a6eb724a07061d89a4a2052744e5a3632}{HAL\_OK}})}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00092}00092                 frac\_n\_5g = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00094}00094         \textcolor{keywordflow}{if} (freq < 4800) \{     \textcolor{comment}{/* 2 GHz, fractional mode */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00095}00095                 uint32\_t txctl;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00097}00097                 bMode = 1;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00098}00098                 fracMode = 1;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00099}00099                 aModeRefSel = 0;       }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00100}00100                 channelSel = (freq * 0x10000)/15;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00101}00101 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00102}00102                 txctl = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5212phy_8h_af243f8db8869d6e8a38e46da0f7bc1d4}{AR\_PHY\_CCK\_TX\_CTRL}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00103}00103                 \textcolor{keywordflow}{if} (freq == 2484) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00104}00104                         \textcolor{comment}{/* Enable channel spreading for channel 14 */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00105}00105                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5212phy_8h_af243f8db8869d6e8a38e46da0f7bc1d4}{AR\_PHY\_CCK\_TX\_CTRL}},}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00106}00106                             txctl | \mbox{\hyperlink{ar5212phy_8h_a1e427b010925f07de18bc10504dfa9c8}{AR\_PHY\_CCK\_TX\_CTRL\_JAPAN}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00107}00107                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00108}00108                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5212phy_8h_af243f8db8869d6e8a38e46da0f7bc1d4}{AR\_PHY\_CCK\_TX\_CTRL}},}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00109}00109                             txctl \&\string~ \mbox{\hyperlink{ar5212phy_8h_a1e427b010925f07de18bc10504dfa9c8}{AR\_PHY\_CCK\_TX\_CTRL\_JAPAN}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00110}00110                 \}     }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00111}00111         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00112}00112                 bMode = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00113}00113                 fracMode = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00114}00114 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00115}00115                 \textcolor{keywordflow}{switch} (frac\_n\_5g) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00116}00116                 \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00117}00117                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00118}00118 \textcolor{comment}{                         * Enable fractional mode for half/quarter rate}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00119}00119 \textcolor{comment}{                         * channels.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00120}00120 \textcolor{comment}{                         *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00121}00121 \textcolor{comment}{                         * This is from the Linux ath9k code, rather than}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00122}00122 \textcolor{comment}{                         * the Atheros HAL code.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00123}00123 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00124}00124                         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_QUARTER(chan) ||}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00125}00125                             IEEE80211\_IS\_CHAN\_HALF(chan))}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00126}00126                                 aModeRefSel = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00127}00127                         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((freq \% 20) == 0) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00128}00128                                 aModeRefSel = 3;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00129}00129                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((freq \% 10) == 0) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00130}00130                                 aModeRefSel = 2;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00131}00131                         \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00132}00132                         \textcolor{keywordflow}{if} (aModeRefSel) \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00133}00133                 \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00134}00134                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00135}00135                         aModeRefSel = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00136}00136                         \textcolor{comment}{/* Enable 2G (fractional) mode for channels which are 5MHz spaced */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00138}00138                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00139}00139 \textcolor{comment}{                         * Workaround for talking on PSB non-\/5MHz channels;}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00140}00140 \textcolor{comment}{                         * the pre-\/Merlin chips only had a 2.5MHz channel}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00141}00141 \textcolor{comment}{                         * spacing so some channels aren't reachable.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00142}00142 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00143}00143 \textcolor{comment}{                         *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00144}00144 \textcolor{comment}{                         * This interoperates on the quarter rate channels}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00145}00145 \textcolor{comment}{                         * with the AR5112 and later RF synths.  Please note}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00146}00146 \textcolor{comment}{                         * that the synthesiser isn't able to completely}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00147}00147 \textcolor{comment}{                         * accurately represent these frequencies (as the}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00148}00148 \textcolor{comment}{                         * resolution in this reference is 2.5MHz) and thus}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00149}00149 \textcolor{comment}{                         * it will be slightly "{}off centre."{}  This matches}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00150}00150 \textcolor{comment}{                         * the same slightly incorrect centre frequency}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00151}00151 \textcolor{comment}{                         * behaviour that the AR5112 and later channel}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00152}00152 \textcolor{comment}{                         * selection code has.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00153}00153 \textcolor{comment}{                         *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00154}00154 \textcolor{comment}{                         * This also interoperates with the AR5416}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00155}00155 \textcolor{comment}{                         * synthesiser modification for programming}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00156}00156 \textcolor{comment}{                         * fractional frequencies in 5GHz mode.  However}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00157}00157 \textcolor{comment}{                         * that modification is also disabled by default.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00158}00158 \textcolor{comment}{                         *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00159}00159 \textcolor{comment}{                         * This is disabled because it hasn't been tested for}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00160}00160 \textcolor{comment}{                         * regulatory compliance and neither have the NICs}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00161}00161 \textcolor{comment}{                         * which would use it.  So if you enable this code,}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00162}00162 \textcolor{comment}{                         * you must first ensure that you've re-\/certified the}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00163}00163 \textcolor{comment}{                         * NICs in question beforehand or you will be}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00164}00164 \textcolor{comment}{                         * violating your local regulatory rules and breaking}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00165}00165 \textcolor{comment}{                         * the law.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00166}00166 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00167}00167 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00168}00168                         \textcolor{keywordflow}{if} (freq \% 5 == 0) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00169}00169 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00170}00170                                 \textcolor{comment}{/* Normal */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00171}00171                                 fracMode = 1;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00172}00172                                 refDivA = 1;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00173}00173                                 channelSel = (freq * 0x8000)/15;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00174}00174 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00175}00175                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00176}00176                                 \textcolor{comment}{/* Offset by 500KHz */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00177}00177                                 uint32\_t f, ch, ch2;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00179}00179                                 fracMode = 1;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00180}00180                                 refDivA = 1;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00181}00181 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00182}00182                                 \textcolor{comment}{/* Calculate the "{}adjusted"{} frequency */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00183}00183                                 f = freq -\/ 2;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00184}00184                                 ch = (((f -\/ 4800) * 10) / 25) + 1;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00186}00186                                 ch2 = ((ch * 25) / 5) + 9600;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00187}00187                                 channelSel = (ch2 * 0x4000) / 15;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00188}00188                                 \textcolor{comment}{//ath\_hal\_printf(ah,}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00189}00189                                 \textcolor{comment}{//    "{}\%s: freq=\%d, ch=\%d, ch2=\%d, "{}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00190}00190                                 \textcolor{comment}{//    "{}channelSel=\%d\(\backslash\)n"{},}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00191}00191                                 \textcolor{comment}{//    \_\_func\_\_, freq, ch, ch2, channelSel);}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00192}00192                         \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00193}00193 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00195}00195                         \textcolor{comment}{/* RefDivA setting */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00196}00196                         \mbox{\hyperlink{ah__internal_8h_ae101d8b01c2ecfb69205fdbe761b84aa}{OS\_A\_REG\_RMW\_FIELD}}(ah, \mbox{\hyperlink{ar5416reg_8h_a73138e3ec28fd2f2128e4bf0f300cf8f}{AR\_AN\_SYNTH9}},}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00197}00197                             \mbox{\hyperlink{ar5416reg_8h_a109212cfb450f046ce21d2ad80644838}{AR\_AN\_SYNTH9\_REFDIVA}}, refDivA);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00198}00198                 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00200}00200                 \textcolor{keywordflow}{if} (!fracMode) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00201}00201                         ndiv = (freq * (refDivA >> aModeRefSel))/60;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00202}00202                         channelSel =  ndiv \& 0x1ff;         }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00203}00203                         channelFrac = (ndiv \& 0xfffffe00) * 2;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00204}00204                         channelSel = (channelSel << 17) | channelFrac;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00205}00205                 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00206}00206         \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00208}00208         reg32 = reg32 | (bMode << 29) | (fracMode << 28) |}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00209}00209             (aModeRefSel << 26) | (channelSel);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00211}00211         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5416phy_8h_a4a9b9486d932e5218eab70eb7a5d0bfc}{AR\_PHY\_SYNTH\_CONTROL}}, reg32);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00212}00212 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00213}00213         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_curchan = chan;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00215}00215         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00216}00216 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00218}00218 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00219}00219 \textcolor{comment}{ * Return a reference to the requested RF Bank.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00220}00220 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00221}00221 \textcolor{keyword}{static} uint32\_t *}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00222}\mbox{\hyperlink{ar9280_8c_a0144bdbe2703fe7d69a331b16df9d563}{00222}} \mbox{\hyperlink{ar9280_8c_a0144bdbe2703fe7d69a331b16df9d563}{ar9280GetRfBank}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keywordtype}{int} bank)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00223}00223 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00224}00224         \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{ar9280_8c_source_l00225}00225             \_\_func\_\_, bank);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00226}00226         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00227}00227 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00229}00229 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00230}00230 \textcolor{comment}{ * Reads EEPROM header info from device structure and programs}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00231}00231 \textcolor{comment}{ * all rf registers}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00232}00232 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00233}00233 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00234}\mbox{\hyperlink{ar9280_8c_a13cc7c78d079d9fd6cd1811bbcb6be94}{00234}} \mbox{\hyperlink{ar9280_8c_a13cc7c78d079d9fd6cd1811bbcb6be94}{ar9280SetRfRegs}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan,}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00235}00235                 uint16\_t modesIndex, uint16\_t *rfXpdGain)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00236}00236 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00237}00237         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};          \textcolor{comment}{/* nothing to do */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00238}00238 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00239}00239 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00240}00240 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00241}00241 \textcolor{comment}{ * Read the transmit power levels from the structures taken from EEPROM}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00242}00242 \textcolor{comment}{ * Interpolate read transmit power values for this channel}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00243}00243 \textcolor{comment}{ * Organize the transmit power values into a table for writing into the hardware}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00244}00244 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00246}00246 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00247}\mbox{\hyperlink{ar9280_8c_aa5320b31712789ef066b3b70373cd178}{00247}} \mbox{\hyperlink{ar9280_8c_aa5320b31712789ef066b3b70373cd178}{ar9280SetPowerTable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, int16\_t *pPowerMin, int16\_t *pPowerMax, }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00248}00248         \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan, uint16\_t *rfXpdGain)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00249}00249 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00250}00250         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00251}00251 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00253}00253 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00254}00254 \textcolor{keyword}{static} int16\_t}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00255}00255 ar9280GetMinPower(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112}{EXPN\_DATA\_PER\_CHANNEL\_5112}} *data)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00256}00256 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00257}00257     \textcolor{keywordtype}{int} i, minIndex;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00258}00258     int16\_t minGain,minPwr,minPcdac,retVal;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00260}00260     \textcolor{comment}{/* Assume NUM\_POINTS\_XPD0 > 0 */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00261}00261     minGain = data-\/>\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_af197b312195fecbb8ae04b2d187d9f00}{pDataPerXPD}}[0].\mbox{\hyperlink{structEXPN__DATA__PER__XPD__5112_a7a4f6266e0906e73058bc56c794d0775}{xpd\_gain}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00262}00262     \textcolor{keywordflow}{for} (minIndex=0,i=1; i<\mbox{\hyperlink{ah__eeprom__v3_8h_a068a8727a7200dfd935363c87389afe6}{NUM\_XPD\_PER\_CHANNEL}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00263}00263         \textcolor{keywordflow}{if} (data-\/>\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_af197b312195fecbb8ae04b2d187d9f00}{pDataPerXPD}}[i].\mbox{\hyperlink{structEXPN__DATA__PER__XPD__5112_a7a4f6266e0906e73058bc56c794d0775}{xpd\_gain}} < minGain) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00264}00264             minIndex = i;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00265}00265             minGain = data-\/>\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_af197b312195fecbb8ae04b2d187d9f00}{pDataPerXPD}}[i].\mbox{\hyperlink{structEXPN__DATA__PER__XPD__5112_a7a4f6266e0906e73058bc56c794d0775}{xpd\_gain}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00266}00266         \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00267}00267     \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00268}00268     minPwr = data-\/>\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_af197b312195fecbb8ae04b2d187d9f00}{pDataPerXPD}}[minIndex].\mbox{\hyperlink{structEXPN__DATA__PER__XPD__5112_a353eeb14f8997ddc0f6bdf568911695f}{pwr\_t4}}[0];}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00269}00269     minPcdac = data-\/>\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_af197b312195fecbb8ae04b2d187d9f00}{pDataPerXPD}}[minIndex].\mbox{\hyperlink{structEXPN__DATA__PER__XPD__5112_ad224ff8cd6282176f94425b249cab194}{pcdac}}[0];}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00270}00270     \textcolor{keywordflow}{for} (i=1; i<\mbox{\hyperlink{ah__eeprom__v3_8h_a808214afbf1a6d31974594c114517f54}{NUM\_POINTS\_XPD0}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00271}00271         \textcolor{keywordflow}{if} (data-\/>\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_af197b312195fecbb8ae04b2d187d9f00}{pDataPerXPD}}[minIndex].\mbox{\hyperlink{structEXPN__DATA__PER__XPD__5112_a353eeb14f8997ddc0f6bdf568911695f}{pwr\_t4}}[i] < minPwr) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00272}00272             minPwr = data-\/>\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_af197b312195fecbb8ae04b2d187d9f00}{pDataPerXPD}}[minIndex].\mbox{\hyperlink{structEXPN__DATA__PER__XPD__5112_a353eeb14f8997ddc0f6bdf568911695f}{pwr\_t4}}[i];}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00273}00273             minPcdac = data-\/>\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_af197b312195fecbb8ae04b2d187d9f00}{pDataPerXPD}}[minIndex].\mbox{\hyperlink{structEXPN__DATA__PER__XPD__5112_ad224ff8cd6282176f94425b249cab194}{pcdac}}[i];}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00274}00274         \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00275}00275     \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00276}00276     retVal = minPwr -\/ (minPcdac*2);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00277}00277     \textcolor{keywordflow}{return}(retVal);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00278}00278 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00279}00279 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00280}00280 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00281}00281 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00282}\mbox{\hyperlink{ar9280_8c_a6dbfc19fdfb2a5f7a5bb6d19e857a83f}{00282}} \mbox{\hyperlink{ar9280_8c_a6dbfc19fdfb2a5f7a5bb6d19e857a83f}{ar9280GetChannelMaxMinPower}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah,}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00283}00283         \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan,}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00284}00284         int16\_t *maxPow, int16\_t *minPow)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00285}00285 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00286}00286 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00287}00287     \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp = \mbox{\hyperlink{ar5212_8h_ab645c6d1aebbc11b13cd2c76c922fab2}{AH5212}}(ah);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00288}00288     \textcolor{keywordtype}{int} numChannels=0,i,last;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00289}00289     \textcolor{keywordtype}{int} totalD, totalF,totalMin;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00290}00290     \mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112}{EXPN\_DATA\_PER\_CHANNEL\_5112}} *data=\mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00291}00291     \mbox{\hyperlink{structEEPROM__POWER__EXPN__5112}{EEPROM\_POWER\_EXPN\_5112}} *powerArray=\mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00292}00292 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00293}00293     *maxPow = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00294}00294     \textcolor{keywordflow}{if} (IS\_CHAN\_A(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00295}00295         powerArray = ahp-\/>ah\_modePowerArray5112;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00296}00296         data = powerArray[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eac21cb619724bb52a51578b92561f3362}{headerInfo11A}}].\mbox{\hyperlink{structEEPROM__POWER__EXPN__5112_a2c528146159afecb61b67f27279a4b82}{pDataPerChannel}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00297}00297         numChannels = powerArray[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eac21cb619724bb52a51578b92561f3362}{headerInfo11A}}].\mbox{\hyperlink{structEEPROM__POWER__EXPN__5112_a62e22f4302cdee86b5573ee754a6a098}{numChannels}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00298}00298     \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (IS\_CHAN\_G(chan) || IS\_CHAN\_108G(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00299}00299         \textcolor{comment}{/* XXX -\/ is this correct? Should we also use the same power for turbo G? */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00300}00300         powerArray = ahp-\/>ah\_modePowerArray5112;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00301}00301         data = powerArray[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eab1a7f853b8258f4a5ad8b28e0962d139}{headerInfo11G}}].\mbox{\hyperlink{structEEPROM__POWER__EXPN__5112_a2c528146159afecb61b67f27279a4b82}{pDataPerChannel}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00302}00302         numChannels = powerArray[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eab1a7f853b8258f4a5ad8b28e0962d139}{headerInfo11G}}].\mbox{\hyperlink{structEEPROM__POWER__EXPN__5112_a62e22f4302cdee86b5573ee754a6a098}{numChannels}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00303}00303     \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (IS\_CHAN\_B(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00304}00304         powerArray = ahp-\/>ah\_modePowerArray5112;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00305}00305         data = powerArray[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eaeb6d754fbc141f3c22b8dd6d918b69e2}{headerInfo11B}}].\mbox{\hyperlink{structEEPROM__POWER__EXPN__5112_a2c528146159afecb61b67f27279a4b82}{pDataPerChannel}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00306}00306         numChannels = powerArray[\mbox{\hyperlink{ah__eeprom__v3_8h_a05589fbab0657f08285ebdfe93f5ec9eaeb6d754fbc141f3c22b8dd6d918b69e2}{headerInfo11B}}].\mbox{\hyperlink{structEEPROM__POWER__EXPN__5112_a62e22f4302cdee86b5573ee754a6a098}{numChannels}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00307}00307     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00308}00308         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00309}00309     \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00310}00310     \textcolor{comment}{/* Make sure the channel is in the range of the TP values}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00311}00311 \textcolor{comment}{     *  (freq piers)}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00312}00312 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00313}00313     \textcolor{keywordflow}{if} ((numChannels < 1) ||}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00314}00314         (chan-\/>channel < data[0].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a2e4fbadd8b965f4c8c5c4bbd4bdcd666}{channelValue}}) ||}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00315}00315         (chan-\/>channel > data[numChannels-\/1].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a2e4fbadd8b965f4c8c5c4bbd4bdcd666}{channelValue}}))}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00316}00316         \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00318}00318     \textcolor{comment}{/* Linearly interpolate the power value now */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00319}00319     \textcolor{keywordflow}{for} (last=0,i=0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00320}00320          (i<numChannels) \&\& (chan-\/>channel > data[i].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a2e4fbadd8b965f4c8c5c4bbd4bdcd666}{channelValue}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00321}00321          last=i++);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00322}00322     totalD = data[i].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a2e4fbadd8b965f4c8c5c4bbd4bdcd666}{channelValue}} -\/ data[last].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a2e4fbadd8b965f4c8c5c4bbd4bdcd666}{channelValue}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00323}00323     \textcolor{keywordflow}{if} (totalD > 0) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00324}00324         totalF = data[i].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a7cf310642439287147e5c29ceebdd2c9}{maxPower\_t4}} -\/ data[last].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a7cf310642439287147e5c29ceebdd2c9}{maxPower\_t4}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00325}00325         *maxPow = (int8\_t) ((totalF*(chan-\/>channel-\/data[last].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a2e4fbadd8b965f4c8c5c4bbd4bdcd666}{channelValue}}) + data[last].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a7cf310642439287147e5c29ceebdd2c9}{maxPower\_t4}}*totalD)/totalD);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00327}00327         totalMin = ar9280GetMinPower(ah,\&data[i]) -\/ ar9280GetMinPower(ah, \&data[last]);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00328}00328         *minPow = (int8\_t) ((totalMin*(chan-\/>channel-\/data[last].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a2e4fbadd8b965f4c8c5c4bbd4bdcd666}{channelValue}}) + ar9280GetMinPower(ah, \&data[last])*totalD)/totalD);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00329}00329         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00330}00330     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00331}00331         \textcolor{keywordflow}{if} (chan-\/>channel == data[i].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a2e4fbadd8b965f4c8c5c4bbd4bdcd666}{channelValue}}) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00332}00332             *maxPow = data[i].\mbox{\hyperlink{structEXPN__DATA__PER__CHANNEL__5112_a7cf310642439287147e5c29ceebdd2c9}{maxPower\_t4}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00333}00333             *minPow = ar9280GetMinPower(ah, \&data[i]);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00334}00334             \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00335}00335         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00336}00336             \textcolor{keywordflow}{return}(\mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00337}00337     \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00338}00338 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00339}00339         *maxPow = *minPow = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00340}00340         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00341}00341 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00342}00342 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00344}00344 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00345}00345 \textcolor{comment}{ * The ordering of nfarray is thus:}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00346}00346 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00347}00347 \textcolor{comment}{ * nfarray[0]: Chain 0 ctl}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00348}00348 \textcolor{comment}{ * nfarray[1]: Chain 1 ctl}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00349}00349 \textcolor{comment}{ * nfarray[2]: Chain 2 ctl}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00350}00350 \textcolor{comment}{ * nfarray[3]: Chain 0 ext}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00351}00351 \textcolor{comment}{ * nfarray[4]: Chain 1 ext}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00352}00352 \textcolor{comment}{ * nfarray[5]: Chain 2 ext}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00353}00353 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00354}00354 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00355}\mbox{\hyperlink{ar9280_8c_a34b5928ab84aaea834f4c8960c413904}{00355}} \mbox{\hyperlink{ar9280_8c_a34b5928ab84aaea834f4c8960c413904}{ar9280GetNoiseFloor}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, int16\_t nfarray[])}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00356}00356 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00357}00357         int16\_t nf;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00358}00358 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00359}00359         nf = \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_aacad34afc5d591c3c8d68c1bd0a4237d}{AR\_PHY\_CCA}}), \mbox{\hyperlink{ar5416phy_8h_aeca83e06076d21590ce1698416a2cd90}{AR9280\_PHY\_MINCCA\_PWR}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00360}00360         \textcolor{keywordflow}{if} (nf \& 0x100)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00361}00361                 nf = 0 -\/ ((nf \string^ 0x1ff) + 1);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00362}00362         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea1c869e006c3f735c9931040bd2082f02}{HAL\_DEBUG\_NFCAL}},}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00363}00363             \textcolor{stringliteral}{"{}NF calibrated [ctl] [chain 0] is \%d\(\backslash\)n"{}}, nf);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00364}00364         nfarray[0] = nf;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00365}00365 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00366}00366         nf = \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_a6c0d4dc08921f69cd907e0cbe90b5f98}{AR\_PHY\_CH1\_CCA}}), \mbox{\hyperlink{ar5416phy_8h_a3d492cb6527d11806bcd1780b702a4e3}{AR9280\_PHY\_CH1\_MINCCA\_PWR}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00367}00367         \textcolor{keywordflow}{if} (nf \& 0x100)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00368}00368                 nf = 0 -\/ ((nf \string^ 0x1ff) + 1);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00369}00369         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea1c869e006c3f735c9931040bd2082f02}{HAL\_DEBUG\_NFCAL}},}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00370}00370             \textcolor{stringliteral}{"{}NF calibrated [ctl] [chain 1] is \%d\(\backslash\)n"{}}, nf);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00371}00371         nfarray[1] = nf;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00372}00372 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00373}00373         nf = \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_a3c9af442753b454074cda0b71c36840d}{AR\_PHY\_EXT\_CCA}}), \mbox{\hyperlink{ar5416phy_8h_a89882f8d906e56e4b31d4b25c6c850a6}{AR9280\_PHY\_EXT\_MINCCA\_PWR}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00374}00374         \textcolor{keywordflow}{if} (nf \& 0x100)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00375}00375                 nf = 0 -\/ ((nf \string^ 0x1ff) + 1);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00376}00376         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea1c869e006c3f735c9931040bd2082f02}{HAL\_DEBUG\_NFCAL}},}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00377}00377             \textcolor{stringliteral}{"{}NF calibrated [ext] [chain 0] is \%d\(\backslash\)n"{}}, nf);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00378}00378         nfarray[3] = nf;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00380}00380         nf = \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5416phy_8h_a422e08f07e1132dfbf607c4b6fca429d}{AR\_PHY\_CH1\_EXT\_CCA}}), \mbox{\hyperlink{ar5416phy_8h_a2e4e06c9502ff7d7aab7647460aa6b1b}{AR9280\_PHY\_CH1\_EXT\_MINCCA\_PWR}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00381}00381         \textcolor{keywordflow}{if} (nf \& 0x100)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00382}00382                 nf = 0 -\/ ((nf \string^ 0x1ff) + 1);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00383}00383         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea1c869e006c3f735c9931040bd2082f02}{HAL\_DEBUG\_NFCAL}},}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00384}00384             \textcolor{stringliteral}{"{}NF calibrated [ext] [chain 1] is \%d\(\backslash\)n"{}}, nf);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00385}00385         nfarray[4] = nf;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00386}00386 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00387}00387         \textcolor{comment}{/* Chain 2 -\/ invalid */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00388}00388         nfarray[2] = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00389}00389         nfarray[5] = 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00390}00390 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00391}00391 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00393}00393 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00394}00394 \textcolor{comment}{ * Adjust NF based on statistical values for 5GHz frequencies.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00395}00395 \textcolor{comment}{ * Stubbed:Not used by Fowl}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00396}00396 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00397}00397 int16\_t}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00398}\mbox{\hyperlink{ar9280_8c_afb24851916aaed780aba99f68b4283e8}{00398}} \mbox{\hyperlink{ar9280_8c_afb24851916aaed780aba99f68b4283e8}{ar9280GetNfAdjust}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \mbox{\hyperlink{structHAL__CHANNEL__INTERNAL}{HAL\_CHANNEL\_INTERNAL}} *c)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00399}00399 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00400}00400         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00401}00401 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00403}00403 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00404}00404 \textcolor{comment}{ * Free memory for analog bank scratch buffers}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00405}00405 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00406}00406 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00407}\mbox{\hyperlink{ar9280_8c_ae0b12f14358ee8f96e7544e04b7a3036}{00407}} \mbox{\hyperlink{ar9280_8c_ae0b12f14358ee8f96e7544e04b7a3036}{ar9280RfDetach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00408}00408 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00409}00409         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp = \mbox{\hyperlink{ar5212_8h_ab645c6d1aebbc11b13cd2c76c922fab2}{AH5212}}(ah);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00410}00410 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00411}00411         \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{ar9280_8c_source_l00412}00412         \mbox{\hyperlink{ah__osdep_8c_a549b6e20152a3b059711721fab9b9427}{ath\_hal\_free}}(ahp-\/>\mbox{\hyperlink{structath__hal__5212_ab60ce71dde37f2d3958b4239181aee21}{ah\_rfHal}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00413}00413         ahp-\/>\mbox{\hyperlink{structath__hal__5212_ab60ce71dde37f2d3958b4239181aee21}{ah\_rfHal}} = \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00414}00414 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00416}00416 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00417}\mbox{\hyperlink{ar9280_8c_a8986146a12077d99809b3626cee4e82f}{00417}} \mbox{\hyperlink{ar9280_8c_a8986146a12077d99809b3626cee4e82f}{ar9280RfAttach}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0}{HAL\_STATUS}} *status)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00418}00418 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00419}00419         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp = \mbox{\hyperlink{ar5212_8h_ab645c6d1aebbc11b13cd2c76c922fab2}{AH5212}}(ah);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00420}00420         \textcolor{keyword}{struct }\mbox{\hyperlink{structar9280State}{ar9280State}} *priv;}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00421}00421 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00422}00422         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eae6b6ecc851ab8e4b694d5a0b8dcb429c}{HAL\_DEBUG\_ATTACH}}, \textcolor{stringliteral}{"{}\%s: attach AR9280 radio\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00424}00424         \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{ar9280_8c_source_l00425}00425         priv = \mbox{\hyperlink{ah__internal_8h_a7f8ca8d72271b356d041c10bd5598ce1}{ath\_hal\_malloc}}(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structar9280State}{ar9280State}}));}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00426}00426         \textcolor{keywordflow}{if} (priv == \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00427}00427                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00428}00428                     \textcolor{stringliteral}{"{}\%s: cannot allocate private state\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00429}00429                 *status = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0ab19ce53cce6a6d5f053082bebffd7392}{HAL\_ENOMEM}};         \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00430}00430                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00431}00431         \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00432}00432         priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_acbee0c25878650e4c3addb07d06a3ee9}{rfDetach}}         = \mbox{\hyperlink{ar9280_8c_ae0b12f14358ee8f96e7544e04b7a3036}{ar9280RfDetach}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00433}00433         priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_a79648e9cd31ed5f0bcf38f8c6d915daa}{writeRegs}}               = \mbox{\hyperlink{ar9280_8c_a13210d02451a350efa3fa28047bf6b9d}{ar9280WriteRegs}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00434}00434         priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_a72093ee607f22e28e6e53ca3dbf34ad9}{getRfBank}}               = \mbox{\hyperlink{ar9280_8c_a0144bdbe2703fe7d69a331b16df9d563}{ar9280GetRfBank}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00435}00435         priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_a689f26e432273638762f517a0d331d02}{setChannel}}             = \mbox{\hyperlink{ar9280_8c_a3d217088855c6594ebe8f22a44c05e8a}{ar9280SetChannel}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00436}00436         priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_a30babc40da9d497b4c1037d71a797b7f}{setRfRegs}}               = \mbox{\hyperlink{ar9280_8c_a13cc7c78d079d9fd6cd1811bbcb6be94}{ar9280SetRfRegs}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00437}00437         priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_a3e920af405d134c4c3b5dc57ac073ac9}{setPowerTable}}       = \mbox{\hyperlink{ar9280_8c_aa5320b31712789ef066b3b70373cd178}{ar9280SetPowerTable}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00438}00438         priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_a20c759064c3bb4387b456e5f2b72f6b4}{getChannelMaxMinPower}} = \mbox{\hyperlink{ar9280_8c_a6dbfc19fdfb2a5f7a5bb6d19e857a83f}{ar9280GetChannelMaxMinPower}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00439}00439         priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_a9c533207772ea9a66a927c3b29dbab08}{getNfAdjust}}           = \mbox{\hyperlink{ar9280_8c_afb24851916aaed780aba99f68b4283e8}{ar9280GetNfAdjust}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00440}00440 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00441}00441         ahp-\/>\mbox{\hyperlink{structath__hal__5212_a9b1b03f387c8f0125292e0b916a104e4}{ah\_pcdacTable}} = priv-\/>\mbox{\hyperlink{structar9280State_a79477ab68ce73ed1f55c4a3f8d78dbce}{pcdacTable}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00442}00442         ahp-\/>\mbox{\hyperlink{structath__hal__5212_a00cd0bdf3d7b1a8039f6c017f0ea8d94}{ah\_pcdacTableSize}} = \textcolor{keyword}{sizeof}(priv-\/>\mbox{\hyperlink{structar9280State_a79477ab68ce73ed1f55c4a3f8d78dbce}{pcdacTable}});}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00443}00443         ahp-\/>\mbox{\hyperlink{structath__hal__5212_ab60ce71dde37f2d3958b4239181aee21}{ah\_rfHal}} = \&priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00444}00444         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00445}00445 \textcolor{comment}{         * Set noise floor adjust method; we arrange a}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00446}00446 \textcolor{comment}{         * direct call instead of thunking.}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00447}00447 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00448}00448         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_getNfAdjust = priv-\/>\mbox{\hyperlink{structar9280State_ae868def6883c0a3b426a05649c832468}{base}}.\mbox{\hyperlink{structRfHalFuncs_a9c533207772ea9a66a927c3b29dbab08}{getNfAdjust}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00449}00449         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_getNoiseFloor = \mbox{\hyperlink{ar9280_8c_a34b5928ab84aaea834f4c8960c413904}{ar9280GetNoiseFloor}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00450}00450 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00451}00451         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00452}00452 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00453}00453 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00454}00454 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00455}\mbox{\hyperlink{ar9280_8c_a731836754d54d80f40391dba20dbe686}{00455}} \mbox{\hyperlink{ar9280_8c_a731836754d54d80f40391dba20dbe686}{ar9280RfProbe}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00456}00456 \{}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00457}00457         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ar5416reg_8h_af24951f5914a8c46befb9f1e685f13f8}{AR\_SREV\_MERLIN}}(ah));}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00458}00458 \}}
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00459}00459 }
\DoxyCodeLine{\Hypertarget{ar9280_8c_source_l00460}\mbox{\hyperlink{ar9280_8c_a557e845c51d4a01a67fe91048161963b}{00460}} \mbox{\hyperlink{ar9280_8c_a557e845c51d4a01a67fe91048161963b}{AH\_RF}}(RF9280, \mbox{\hyperlink{ar9280_8c_a731836754d54d80f40391dba20dbe686}{ar9280RfProbe}}, \mbox{\hyperlink{ar9280_8c_a8986146a12077d99809b3626cee4e82f}{ar9280RfAttach}});}

\end{DoxyCode}
