\hypertarget{ar5211__reset_8c_source}{}\doxysection{ar5211\+\_\+reset.\+c}
\label{ar5211__reset_8c_source}\index{dev/ath/ath\_hal/ar5211/ar5211\_reset.c@{dev/ath/ath\_hal/ar5211/ar5211\_reset.c}}
\mbox{\hyperlink{ar5211__reset_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: ISC}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2002-\/2009 Sam Leffler, Errno Consulting}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2002-\/2006 Atheros Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00007}00007 \textcolor{comment}{ * Permission to use, copy, modify, and/or distribute this software for any}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00008}00008 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00009}00009 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00011}00011 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00012}00012 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00013}00013 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00014}00014 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00015}00015 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00016}00016 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00017}00017 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00019}00019 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00020}00020 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00021}00021 \textcolor{preprocessor}{\#include "{}opt\_ah.h"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00022}00022 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00023}00023 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00024}00024 \textcolor{comment}{ * Chips specific device attachment and device info collection}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00025}00025 \textcolor{comment}{ * Connects Init Reg Vectors, EEPROM Data, and device Functions.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00026}00026 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00027}00027 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah_8h}{ah.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__internal_8h}{ah\_internal.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__devid_8h}{ah\_devid.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00031}00031 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5211_8h}{ar5211/ar5211.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00032}00032 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5211reg_8h}{ar5211/ar5211reg.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00033}00033 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5211phy_8h}{ar5211/ar5211phy.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00035}00035 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__eeprom__v3_8h}{ah\_eeprom\_v3.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00036}00036 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00037}00037 \textcolor{comment}{/* Add static register initialization vectors */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00038}00038 \textcolor{preprocessor}{\#include "{}ar5211/boss.ini"{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00040}00040 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00041}00041 \textcolor{comment}{ * Structure to hold 11b tuning information for Beanie/Sombrero}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00042}00042 \textcolor{comment}{ * 16 MHz mode, divider ratio = 198 = NP+S. N=16, S=4 or 6, P=12}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00043}00043 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00044}\mbox{\hyperlink{structCHAN__INFO__2GHZ}{00044}} \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00045}\mbox{\hyperlink{structCHAN__INFO__2GHZ_a928918064992dec2559fb711c7835aae}{00045}}         uint32\_t        \mbox{\hyperlink{structCHAN__INFO__2GHZ_a928918064992dec2559fb711c7835aae}{refClkSel}};     \textcolor{comment}{/* reference clock, 1 for 16 MHz */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00046}\mbox{\hyperlink{structCHAN__INFO__2GHZ_a939578519805260791e9465fef98c7ed}{00046}}         uint32\_t        \mbox{\hyperlink{structCHAN__INFO__2GHZ_a939578519805260791e9465fef98c7ed}{channelSelect}};     \textcolor{comment}{/* P[7:4]S[3:0] bits */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00047}\mbox{\hyperlink{structCHAN__INFO__2GHZ_af62eebe2b052e23d21ca9fb97ec4425f}{00047}}         uint16\_t        \mbox{\hyperlink{structCHAN__INFO__2GHZ_af62eebe2b052e23d21ca9fb97ec4425f}{channel5111}}; \textcolor{comment}{/* 11a channel for 5111 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00048}00048 \} \mbox{\hyperlink{structCHAN__INFO__2GHZ}{CHAN\_INFO\_2GHZ}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00050}\mbox{\hyperlink{ar5211__reset_8c_af6130a9d3f26baa7a3d681c8d5fa7571}{00050}} \textcolor{preprocessor}{\#define CI\_2GHZ\_INDEX\_CORRECTION 19}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00051}\mbox{\hyperlink{ar5211__reset_8c_ae6e627f782bef358642c8aeed43ea2db}{00051}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{structCHAN__INFO__2GHZ}{CHAN\_INFO\_2GHZ}} \mbox{\hyperlink{ar5211__reset_8c_ae6e627f782bef358642c8aeed43ea2db}{chan2GHzData}}[] = \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00052}00052         \{ 1, 0x46, 96  \},       \textcolor{comment}{/* 2312 -\/19 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00053}00053         \{ 1, 0x46, 97  \},       \textcolor{comment}{/* 2317 -\/18 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00054}00054         \{ 1, 0x46, 98  \},       \textcolor{comment}{/* 2322 -\/17 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00055}00055         \{ 1, 0x46, 99  \},       \textcolor{comment}{/* 2327 -\/16 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00056}00056         \{ 1, 0x46, 100 \},       \textcolor{comment}{/* 2332 -\/15 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00057}00057         \{ 1, 0x46, 101 \},       \textcolor{comment}{/* 2337 -\/14 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00058}00058         \{ 1, 0x46, 102 \},       \textcolor{comment}{/* 2342 -\/13 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00059}00059         \{ 1, 0x46, 103 \},       \textcolor{comment}{/* 2347 -\/12 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00060}00060         \{ 1, 0x46, 104 \},       \textcolor{comment}{/* 2352 -\/11 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00061}00061         \{ 1, 0x46, 105 \},       \textcolor{comment}{/* 2357 -\/10 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00062}00062         \{ 1, 0x46, 106 \},       \textcolor{comment}{/* 2362  -\/9 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00063}00063         \{ 1, 0x46, 107 \},       \textcolor{comment}{/* 2367  -\/8 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00064}00064         \{ 1, 0x46, 108 \},       \textcolor{comment}{/* 2372  -\/7 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00065}00065         \textcolor{comment}{/* index -\/6 to 0 are pad to make this a nolookup table */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00066}00066         \{ 1, 0x46, 116 \},       \textcolor{comment}{/*       -\/6 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00067}00067         \{ 1, 0x46, 116 \},       \textcolor{comment}{/*       -\/5 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00068}00068         \{ 1, 0x46, 116 \},       \textcolor{comment}{/*       -\/4 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00069}00069         \{ 1, 0x46, 116 \},       \textcolor{comment}{/*       -\/3 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00070}00070         \{ 1, 0x46, 116 \},       \textcolor{comment}{/*       -\/2 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00071}00071         \{ 1, 0x46, 116 \},       \textcolor{comment}{/*       -\/1 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00072}00072         \{ 1, 0x46, 116 \},       \textcolor{comment}{/*        0 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00073}00073         \{ 1, 0x46, 116 \},       \textcolor{comment}{/* 2412   1 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00074}00074         \{ 1, 0x46, 117 \},       \textcolor{comment}{/* 2417   2 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00075}00075         \{ 1, 0x46, 118 \},       \textcolor{comment}{/* 2422   3 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00076}00076         \{ 1, 0x46, 119 \},       \textcolor{comment}{/* 2427   4 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00077}00077         \{ 1, 0x46, 120 \},       \textcolor{comment}{/* 2432   5 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00078}00078         \{ 1, 0x46, 121 \},       \textcolor{comment}{/* 2437   6 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00079}00079         \{ 1, 0x46, 122 \},       \textcolor{comment}{/* 2442   7 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00080}00080         \{ 1, 0x46, 123 \},       \textcolor{comment}{/* 2447   8 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00081}00081         \{ 1, 0x46, 124 \},       \textcolor{comment}{/* 2452   9 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00082}00082         \{ 1, 0x46, 125 \},       \textcolor{comment}{/* 2457  10 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00083}00083         \{ 1, 0x46, 126 \},       \textcolor{comment}{/* 2462  11 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00084}00084         \{ 1, 0x46, 127 \},       \textcolor{comment}{/* 2467  12 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00085}00085         \{ 1, 0x46, 128 \},       \textcolor{comment}{/* 2472  13 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00086}00086         \{ 1, 0x44, 124 \},       \textcolor{comment}{/* 2484  14 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00087}00087         \{ 1, 0x46, 136 \},       \textcolor{comment}{/* 2512  15 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00088}00088         \{ 1, 0x46, 140 \},       \textcolor{comment}{/* 2532  16 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00089}00089         \{ 1, 0x46, 144 \},       \textcolor{comment}{/* 2552  17 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00090}00090         \{ 1, 0x46, 148 \},       \textcolor{comment}{/* 2572  18 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00091}00091         \{ 1, 0x46, 152 \},       \textcolor{comment}{/* 2592  19 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00092}00092         \{ 1, 0x46, 156 \},       \textcolor{comment}{/* 2612  20 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00093}00093         \{ 1, 0x46, 160 \},       \textcolor{comment}{/* 2632  21 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00094}00094         \{ 1, 0x46, 164 \},       \textcolor{comment}{/* 2652  22 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00095}00095         \{ 1, 0x46, 168 \},       \textcolor{comment}{/* 2672  23 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00096}00096         \{ 1, 0x46, 172 \},       \textcolor{comment}{/* 2692  24 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00097}00097         \{ 1, 0x46, 176 \},       \textcolor{comment}{/* 2712  25 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00098}00098         \{ 1, 0x46, 180 \}        \textcolor{comment}{/* 2732  26 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00099}00099 \};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00101}00101 \textcolor{comment}{/* Power timeouts in usec to wait for chip to wake-\/up. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00102}\mbox{\hyperlink{ar5211__reset_8c_aa60a4e4fa86c0453150732d7898bfbdf}{00102}} \textcolor{preprocessor}{\#define POWER\_UP\_TIME   2000}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00103}00103 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00104}\mbox{\hyperlink{ar5211__reset_8c_ab69cf54552ef955d040b0161f3058793}{00104}} \textcolor{preprocessor}{\#define DELAY\_PLL\_SETTLE        300             }\textcolor{comment}{/* 300 us */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00105}\mbox{\hyperlink{ar5211__reset_8c_a10c74cfaa1f3673f50208a4f22efccf4}{00105}} \textcolor{preprocessor}{\#define DELAY\_BASE\_ACTIVATE     100             }\textcolor{comment}{/* 100 us */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00107}\mbox{\hyperlink{ar5211__reset_8c_a645e6e4b2b86edabb8055e43055b1b02}{00107}} \textcolor{preprocessor}{\#define NUM\_RATES       8}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00109}00109 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_a0daae57c1669bf29282c74dc75ca641b}{ar5211SetResetReg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, uint32\_t resetMask);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00110}00110 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_ad1f9223fd8b95c01ce7603a1d4f40db8}{ar5211SetChannel}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00111}00111                 \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00112}00112 \textcolor{keyword}{static} int16\_t \mbox{\hyperlink{ar5211__reset_8c_ab644efdb414e7ffcd95b2f2ef3cede1c}{ar5211RunNoiseFloor}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00113}00113                 uint8\_t runTime, int16\_t startingNF);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00114}00114 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_ade820d57f34b131fd18d2fa9fef5e5e6}{ar5211IsNfGood}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00115}00115                 \textcolor{keyword}{struct} ieee80211\_channel *chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00116}00116 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_ae266d696ac06bbf296b284fd78e07658}{ar5211SetRf6and7}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00117}00117                 \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00118}00118 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_a7d8bdf217b5f2ac849e63aed002b6e7f}{ar5211SetBoardValues}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00119}00119                 \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00120}00120 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ar5211__reset_8c_a665bb511b45cdd65287d4781a08f89a8}{ar5211SetPowerTable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00121}00121                 \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} *pSrcStruct, uint16\_t channel);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00122}00122 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_aedab42df3abd366fa213b4d4c6eb9f96}{ar5211SetTransmitPower}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00123}00123                 \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00124}00124 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ar5211__reset_8c_acb60fa8b312cd28560b5373576f4c29d}{ar5211SetRateTable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00125}00125                 \mbox{\hyperlink{structRD__EDGES__POWER}{RD\_EDGES\_POWER}} *pRdEdgesPower, \mbox{\hyperlink{structtrgtPowerInfo}{TRGT\_POWER\_INFO}} *pPowerInfo,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00126}00126                 uint16\_t numChannels, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00127}00127 \textcolor{keyword}{static} uint16\_t \mbox{\hyperlink{ar5211__reset_8c_ae493ba2c1980b5c8654009ade758e45a}{ar5211GetScaledPower}}(uint16\_t channel, uint16\_t pcdacValue,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00128}00128                 \textcolor{keyword}{const} \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} *pSrcStruct);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00129}00129 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_a1568bea89384cef35cd0345c97b2cd8f}{ar5211FindValueInList}}(uint16\_t channel, uint16\_t pcdacValue,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00130}00130                 \textcolor{keyword}{const} \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} *pSrcStruct, uint16\_t *powerValue);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00131}00131 \textcolor{keyword}{static} uint16\_t \mbox{\hyperlink{ar5211__reset_8c_af7c8bbd712238de0779ffe911fb6bd1a}{ar5211GetInterpolatedValue}}(uint16\_t target,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00132}00132                 uint16\_t srcLeft, uint16\_t srcRight,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00133}00133                 uint16\_t targetLeft, uint16\_t targetRight, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} scaleUp);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00134}00134 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ar5211__reset_8c_a0525b0fa3ecd4d2e55c6067548f2ce53}{ar5211GetLowerUpperValues}}(uint16\_t value,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00135}00135                 \textcolor{keyword}{const} uint16\_t *pList, uint16\_t listSize,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00136}00136                 uint16\_t *pLowerValue, uint16\_t *pUpperValue);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00137}00137 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ar5211__reset_8c_a9c1a6d8cbb60fd9c8cde2d02e6a7737c}{ar5211GetLowerUpperPcdacs}}(uint16\_t pcdac,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00138}00138                 uint16\_t channel, \textcolor{keyword}{const} \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} *pSrcStruct,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00139}00139                 uint16\_t *pLowerPcdac, uint16\_t *pUpperPcdac);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00141}00141 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ar5211__reset_8c_a2f24a06af637ac702d4870a05d78cc66}{ar5211SetRfgain}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *, \textcolor{keyword}{const} \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00142}00142 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ar5211__reset_8c_a2e22eca717c93e7d9e684527ab7fb3f0}{ar5211RequestRfgain}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00143}00143 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_a6a8ed9524913cafe8bd1b1a272a4702c}{ar5211InvalidGainReadback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *, \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00144}00144 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar5211__reset_8c_aac4c9f9ca911cdbd92eeb38ccb0cb5e7}{ar5211IsGainAdjustNeeded}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *, \textcolor{keyword}{const} \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00145}00145 \textcolor{keyword}{static} int32\_t \mbox{\hyperlink{ar5211__reset_8c_a420cbe76f65b9d7ef969b40c4a737eba}{ar5211AdjustGain}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *, \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00146}00146 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ar5211__reset_8c_a7602af326b5930af3c6f60d4360d98cf}{ar5211SetOperatingMode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *, \textcolor{keywordtype}{int} opmode);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00148}00148 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00149}00149 \textcolor{comment}{ * Places the device in and out of reset and then places sane}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00150}00150 \textcolor{comment}{ * values in the registers based on EEPROM config, initialization}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00151}00151 \textcolor{comment}{ * vectors (as determined by the mode), and station configuration}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00152}00152 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00153}00153 \textcolor{comment}{ * bChannelChange is used to preserve DMA/PCU registers across}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00154}00154 \textcolor{comment}{ * a HW Reset during channel change.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00155}00155 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00156}00156 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00157}\mbox{\hyperlink{ar5211_8h_adf0ae2a25bfdf6909f8b3cba66a04dcc}{00157}} \mbox{\hyperlink{ar5211__reset_8c_a5d483c5f3a5831a56eb101d8ccac863b}{ar5211Reset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3}{HAL\_OPMODE}} opmode,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00158}00158         \textcolor{keyword}{struct} ieee80211\_channel *chan, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} bChannelChange,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00159}00159         \mbox{\hyperlink{ah_8h_a5d39e0ba467d3f62f525498655ccb497}{HAL\_RESET\_TYPE}} resetType,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00160}00160         \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0}{HAL\_STATUS}} *status)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00161}00161 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00162}00162 uint32\_t softLedCfg, softLedState;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00163}00163 \textcolor{preprocessor}{\#define N(a)    (sizeof (a) /sizeof (a[0]))}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00164}00164 \textcolor{preprocessor}{\#define FAIL(\_code)     do \{ ecode = \_code; goto bad; \} while (0)}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00165}00165         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00166}00166         \mbox{\hyperlink{structHAL__CHANNEL__INTERNAL}{HAL\_CHANNEL\_INTERNAL}} *ichan;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00167}00167         uint32\_t i, ledstate;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00168}00168         \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0}{HAL\_STATUS}} ecode;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00169}00169         \textcolor{keywordtype}{int} q;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00171}00171         uint32\_t                data, synthDelay;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00172}00172         uint32\_t                macStaId1;    }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00173}00173         uint16\_t                modesIndex = 0, freqIndex = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00174}00174         uint32\_t                saveFrameSeqCount[\mbox{\hyperlink{ar5211reg_8h_a393ec388edc5772b8256f8ffce2589aa}{AR\_NUM\_DCU}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00175}00175         uint32\_t                saveTsfLow = 0, saveTsfHigh = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00176}00176         uint32\_t                saveDefAntenna;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00178}00178         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea3476c6e4fcd910454cfdda4f7f0f25e6}{HAL\_DEBUG\_RESET}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00179}00179              \textcolor{stringliteral}{"{}\%s: opmode \%u channel \%u/0x\%x \%s channel\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00180}00180              \_\_func\_\_, opmode, chan-\/>ic\_freq, chan-\/>ic\_flags,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00181}00181              bChannelChange ? \textcolor{stringliteral}{"{}change"{}} : \textcolor{stringliteral}{"{}same"{}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00182}00182 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00183}00183         \mbox{\hyperlink{ah__osdep_8h_ab267e59f6e2341e9565d6b6b04cbd0d3}{OS\_MARK}}(ah, \mbox{\hyperlink{ah__decode_8h_a0411cd49bb5b71852cecd93bcbf0ca2dace2a2869ad0d1c8de2918162e605f0d3}{AH\_MARK\_RESET}}, bChannelChange);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00184}00184         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00185}00185 \textcolor{comment}{         * Map public channel to private.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00186}00186 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00187}00187         ichan = \mbox{\hyperlink{ah__internal_8h_a43ec3662d6186b79cd289c466ed900fe}{ath\_hal\_checkchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00188}00188         \textcolor{keywordflow}{if} (ichan == \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}})}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00189}00189                 \mbox{\hyperlink{ar5211__reset_8c_a57e372ff9ed08ebabb8e269f1a105a5d}{FAIL}}(\mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a925d3be7c5ded1ced35f00a48560e01f}{HAL\_EINVAL}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00190}00190         \textcolor{keywordflow}{switch} (opmode) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00191}00191         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3ab5bcbfc7b87ac33ac0da97127bbd6138}{HAL\_M\_STA}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00192}00192         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3a0944a9d007b1d97b31eefcde3ff6e92a}{HAL\_M\_IBSS}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00193}00193         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3ae7ab5162a6e449287d9e8c63a4c4e628}{HAL\_M\_HOSTAP}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00194}00194         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3a9182c471b73c905660273a4b428ac753}{HAL\_M\_MONITOR}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00195}00195                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00196}00196         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00197}00197                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00198}00198                     \textcolor{stringliteral}{"{}\%s: invalid operating mode \%u\(\backslash\)n"{}}, \_\_func\_\_, opmode);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00199}00199                 \mbox{\hyperlink{ar5211__reset_8c_a57e372ff9ed08ebabb8e269f1a105a5d}{FAIL}}(\mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a925d3be7c5ded1ced35f00a48560e01f}{HAL\_EINVAL}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00200}00200                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00201}00201         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00202}00202         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeversion >= \mbox{\hyperlink{ah__eeprom_8h_a70f8a9779f9a995dad518d63bd479225}{AR\_EEPROM\_VER3}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00204}00204         \textcolor{comment}{/* Preserve certain DMA hardware registers on a channel change */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00205}00205         \textcolor{keywordflow}{if} (bChannelChange) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00206}00206                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00207}00207 \textcolor{comment}{                 * Need to save/restore the TSF because of an issue}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00208}00208 \textcolor{comment}{                 * that accelerates the TSF during a chip reset.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00209}00209 \textcolor{comment}{                 *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00210}00210 \textcolor{comment}{                 * We could use system timer routines to more}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00211}00211 \textcolor{comment}{                 * accurately restore the TSF, but}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00212}00212 \textcolor{comment}{                 * 1. Timer routines on certain platforms are}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00213}00213 \textcolor{comment}{                 *      not accurate enough (e.g. 1 ms resolution).}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00214}00214 \textcolor{comment}{                 * 2. It would still not be accurate.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00215}00215 \textcolor{comment}{                 *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00216}00216 \textcolor{comment}{                 * The most important aspect of this workaround,}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00217}00217 \textcolor{comment}{                 * is that, after reset, the TSF is behind}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00218}00218 \textcolor{comment}{                 * other STAs TSFs.  This will allow the STA to}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00219}00219 \textcolor{comment}{                 * properly resynchronize its TSF in adhoc mode.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00220}00220 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00221}00221                 saveTsfLow  = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_ac9219f86e27e5067ee61ae3b9be36bb0}{AR\_TSF\_L32}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00222}00222                 saveTsfHigh = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a45c3514a9216cf659adfae165b267ac6}{AR\_TSF\_U32}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00224}00224                 \textcolor{comment}{/* Read frame sequence count */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00225}00225                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion >= \mbox{\hyperlink{ar5211reg_8h_aa68f39a7b4367b67addf2e0bf33c2727}{AR\_SREV\_VERSION\_OAHU}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00226}00226                         saveFrameSeqCount[0] = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211reg_8h_afb808d755c1df8dfe71a1becb495ab25}{AR\_D0\_SEQNUM}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00227}00227                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00228}00228                         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211reg_8h_a393ec388edc5772b8256f8ffce2589aa}{AR\_NUM\_DCU}}; i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00229}00229                                 saveFrameSeqCount[i] = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211reg_8h_af1d3a419ac2d2363b7c8470815ec257b}{AR\_DSEQNUM}}(i));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00230}00230                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00231}00231                 \textcolor{keywordflow}{if} (!IEEE80211\_IS\_CHAN\_DFS(chan)) }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00232}00232                         chan-\/>ic\_state \&= \string~IEEE80211\_CHANSTATE\_CWINT;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00233}00233         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00234}00234 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00235}00235         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00236}00236 \textcolor{comment}{         * Preserve the antenna on a channel change}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00237}00237 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00238}00238         saveDefAntenna = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211reg_8h_aaacc96cdfb07a2341a3305bbe2d69081}{AR\_DEF\_ANTENNA}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00239}00239         \textcolor{keywordflow}{if} (saveDefAntenna == 0)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00240}00240                 saveDefAntenna = 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00242}00242         \textcolor{comment}{/* Save hardware flag before chip reset clears the register */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00243}00243         macStaId1 = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a3449425878b8a4ad684aa58673c97f9e}{AR\_STA\_ID1}}) \& \mbox{\hyperlink{ar5211reg_8h_af3d9850739c75b3e905a904c99f05a09}{AR\_STA\_ID1\_BASE\_RATE\_11B}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00245}00245         \textcolor{comment}{/* Save led state from pci config register */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00246}00246         ledstate = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a663173df4480365bf66e01b63c9f1714}{AR\_PCICFG}}) \&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00247}00247                 (\mbox{\hyperlink{ar5211reg_8h_a7f5317ba5667763d3c94be6553dcf4df}{AR\_PCICFG\_LEDCTL}} | \mbox{\hyperlink{ar5211reg_8h_a5ffa0d4eb4c3bd0fdfa7cdda3a082f80}{AR\_PCICFG\_LEDMODE}} | \mbox{\hyperlink{ar5211reg_8h_aa482adb1f81b53a7fe66a30de2837b38}{AR\_PCICFG\_LEDBLINK}} |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00248}00248                  \mbox{\hyperlink{ar5211reg_8h_a519c4471095e8ecea47f3a3f1644df38}{AR\_PCICFG\_LEDSLOW}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00249}00249         softLedCfg = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_ab77487e529cc58e6fddd0617879f7e40}{AR\_GPIOCR}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00250}00250         softLedState = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a806ffa33c8b0116fd9cc938ee449901d}{AR\_GPIODO}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00252}00252         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a93bce73e4c71516a805115acba518071}{ar5211ChipReset}}(ah, chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00253}00253                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: chip reset failed\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00254}00254                 \mbox{\hyperlink{ar5211__reset_8c_a57e372ff9ed08ebabb8e269f1a105a5d}{FAIL}}(\mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a163bd2fc79bfcdd646cf57ed3d46542a}{HAL\_EIO}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00255}00255         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00256}00256 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00257}00257         \textcolor{comment}{/* Setup the indices for the next set of register array writes */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00258}00258         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_5GHZ(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00259}00259                 freqIndex = 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00260}00260                 \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_TURBO(chan))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00261}00261                         modesIndex = 2;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00262}00262                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_A(chan))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00263}00263                         modesIndex = 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00264}00264                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00265}00265                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00266}00266                             \textcolor{stringliteral}{"{}\%s: invalid channel \%u/0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00267}00267                             \_\_func\_\_, chan-\/>ic\_freq, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00268}00268                         \mbox{\hyperlink{ar5211__reset_8c_a57e372ff9ed08ebabb8e269f1a105a5d}{FAIL}}(\mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a925d3be7c5ded1ced35f00a48560e01f}{HAL\_EINVAL}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00269}00269                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00270}00270         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00271}00271                 freqIndex = 2;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00272}00272                 \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_B(chan))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00273}00273                         modesIndex = 3;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00274}00274                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_PUREG(chan))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00275}00275                         modesIndex = 4;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00276}00276                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00277}00277                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00278}00278                             \textcolor{stringliteral}{"{}\%s: invalid channel \%u/0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00279}00279                             \_\_func\_\_, chan-\/>ic\_freq, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00280}00280                         \mbox{\hyperlink{ar5211__reset_8c_a57e372ff9ed08ebabb8e269f1a105a5d}{FAIL}}(\mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a925d3be7c5ded1ced35f00a48560e01f}{HAL\_EINVAL}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00281}00281                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00282}00282         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00284}00284         \textcolor{comment}{/* Set correct Baseband to analog shift setting to access analog chips. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00285}00285         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion >= \mbox{\hyperlink{ar5211reg_8h_aa68f39a7b4367b67addf2e0bf33c2727}{AR\_SREV\_VERSION\_OAHU}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00286}00286                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}}, 0x00000007);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00287}00287         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00288}00288                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}}, 0x00000047);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00289}00289         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00290}00290 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00291}00291         \textcolor{comment}{/* Write parameters specific to AR5211 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00292}00292         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion >= \mbox{\hyperlink{ar5211reg_8h_aa68f39a7b4367b67addf2e0bf33c2727}{AR\_SREV\_VERSION\_OAHU}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00293}00293                 \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_2GHZ(chan) \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00294}00294                     \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeversion >= \mbox{\hyperlink{ah__eeprom_8h_a290d6128e664a89fbfef32fddf72f599}{AR\_EEPROM\_VER3\_1}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00295}00295                         \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00296}00296                         uint32\_t ob2GHz, db2GHz;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00297}00297 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00298}00298                         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_CCK(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00299}00299                                 ob2GHz = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_ab007a793965d43b251f1b36327724a1d}{ee\_ob2GHz}}[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00300}00300                                 db2GHz = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a8cf051ceb73431136b2bcd96f20b9752}{ee\_db2GHz}}[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00301}00301                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00302}00302                                 ob2GHz = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_ab007a793965d43b251f1b36327724a1d}{ee\_ob2GHz}}[1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00303}00303                                 db2GHz = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a8cf051ceb73431136b2bcd96f20b9752}{ee\_db2GHz}}[1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00304}00304                         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00305}00305                         ob2GHz = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(ob2GHz, 3);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00306}00306                         db2GHz = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(db2GHz, 3);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00307}00307                         ar5211Mode2\_4[25][freqIndex] =}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00308}00308                                 (ar5211Mode2\_4[25][freqIndex] \& \string~0xC0) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00309}00309                                         ((ob2GHz << 6) \& 0xC0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00310}00310                         ar5211Mode2\_4[26][freqIndex] =}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00311}00311                                 (ar5211Mode2\_4[26][freqIndex] \& \string~0x0F) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00312}00312                                         (((ob2GHz >> 2) \& 0x1) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00313}00313                                          ((db2GHz << 1) \& 0x0E));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00314}00314                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00315}00315                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211__reset_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5211Mode2\_4); i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00316}00316                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, ar5211Mode2\_4[i][0],}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00317}00317                                 ar5211Mode2\_4[i][freqIndex]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00318}00318         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00320}00320         \textcolor{comment}{/* Write the analog registers 6 and 7 before other config */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00321}00321         \mbox{\hyperlink{ar5211__reset_8c_ae266d696ac06bbf296b284fd78e07658}{ar5211SetRf6and7}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00323}00323         \textcolor{comment}{/* Write registers that vary across all modes */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00324}00324         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211__reset_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5211Modes); i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00325}00325                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, ar5211Modes[i][0], ar5211Modes[i][modesIndex]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00327}00327         \textcolor{comment}{/* Write RFGain Parameters that differ between 2.4 and 5 GHz */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00328}00328         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211__reset_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5211BB\_RfGain); i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00329}00329                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, ar5211BB\_RfGain[i][0], ar5211BB\_RfGain[i][freqIndex]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00331}00331         \textcolor{comment}{/* Write Common Array Parameters */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00332}00332         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211__reset_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5211Common); i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00333}00333                 uint32\_t reg = ar5211Common[i][0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00334}00334                 \textcolor{comment}{/* On channel change, don't reset the PCU registers */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00335}00335                 \textcolor{keywordflow}{if} (!(bChannelChange \&\& (0x8000 <= reg \&\& reg < 0x9000)))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00336}00336                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, reg, ar5211Common[i][1]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00337}00337         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00338}00338 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00339}00339         \textcolor{comment}{/* Fix pre-\/AR5211 register values, this includes AR5311s. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00340}00340         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion < \mbox{\hyperlink{ar5211reg_8h_aa68f39a7b4367b67addf2e0bf33c2727}{AR\_SREV\_VERSION\_OAHU}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00341}00341                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00342}00342 \textcolor{comment}{                 * The TX and RX latency values have changed locations}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00343}00343 \textcolor{comment}{                 * within the USEC register in AR5211.  Since they're}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00344}00344 \textcolor{comment}{                 * set via the .ini, for both AR5211 and AR5311, they}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00345}00345 \textcolor{comment}{                 * are written properly here for AR5311.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00346}00346 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00347}00347                 data = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_af7f522a2143a1207d9b6316b7ee4ceb7}{AR\_USEC}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00348}00348                 \textcolor{comment}{/* Must be 0 for proper write in AR5311 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00349}00349                 \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}((data \& 0x00700000) == 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00350}00350                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_af7f522a2143a1207d9b6316b7ee4ceb7}{AR\_USEC}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00351}00351                         (data \& (\mbox{\hyperlink{ar5211reg_8h_a2561327c8101b5590f7eee24b2bed214}{AR\_USEC\_M}} | \mbox{\hyperlink{ar5211reg_8h_a7e8838f4d3825257d81d3cd9b6370074}{AR\_USEC\_32\_M}} | \mbox{\hyperlink{ar5211reg_8h_a0161756f9693c6a3cd6bacdb742b7180}{AR5311\_USEC\_TX\_LAT\_M}})) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00352}00352                         ((29 << \mbox{\hyperlink{ar5211reg_8h_a92b4397ea6c94d68c1bdfa2406633f6e}{AR5311\_USEC\_RX\_LAT\_S}}) \& \mbox{\hyperlink{ar5211reg_8h_ae64d9e2f5901f63f16833136d0d8775d}{AR5311\_USEC\_RX\_LAT\_M}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00353}00353                 \textcolor{comment}{/* The following registers exist only on AR5311. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00354}00354                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_ae508b236b4c60c043675cfbe38517173}{AR5311\_QDCLKGATE}}, 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00355}00355 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00356}00356                 \textcolor{comment}{/* Set proper ADC \& DAC delays for AR5311. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00357}00357                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, 0x00009878, 0x00000008);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00358}00358 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00359}00359                 \textcolor{comment}{/* Enable the PCU FIFO corruption ECO on AR5311. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00360}00360                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_aef907b410f065ff5672fc24bfe844d3e}{AR\_DIAG\_SW}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00361}00361                         \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_aef907b410f065ff5672fc24bfe844d3e}{AR\_DIAG\_SW}}) | \mbox{\hyperlink{ar5211reg_8h_a26e207abd386483300cb4ce958737e1a}{AR5311\_DIAG\_SW\_USE\_ECO}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00362}00362         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00363}00363 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00364}00364         \textcolor{comment}{/* Restore certain DMA hardware registers on a channel change */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00365}00365         \textcolor{keywordflow}{if} (bChannelChange) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00366}00366                 \textcolor{comment}{/* Restore TSF */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00367}00367                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_ac9219f86e27e5067ee61ae3b9be36bb0}{AR\_TSF\_L32}}, saveTsfLow);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00368}00368                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a45c3514a9216cf659adfae165b267ac6}{AR\_TSF\_U32}}, saveTsfHigh);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00370}00370                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion >= \mbox{\hyperlink{ar5211reg_8h_aa68f39a7b4367b67addf2e0bf33c2727}{AR\_SREV\_VERSION\_OAHU}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00371}00371                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_afb808d755c1df8dfe71a1becb495ab25}{AR\_D0\_SEQNUM}}, saveFrameSeqCount[0]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00372}00372                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00373}00373                         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211reg_8h_a393ec388edc5772b8256f8ffce2589aa}{AR\_NUM\_DCU}}; i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00374}00374                                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_af1d3a419ac2d2363b7c8470815ec257b}{AR\_DSEQNUM}}(i), saveFrameSeqCount[i]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00375}00375                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00376}00376         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00377}00377 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00378}00378         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a103941b39e75da2ba24e1247f3faa428}{AR\_STA\_ID0}}, \mbox{\hyperlink{ah__internal_8h_a110f2217661b4b5b0ab0ba8a6b62aac4}{LE\_READ\_4}}(ahp-\/>\mbox{\hyperlink{structath__hal__5211_ac338f111d4a596f5906dd5dc3eeba0a7}{ah\_macaddr}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00379}00379         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a3449425878b8a4ad684aa58673c97f9e}{AR\_STA\_ID1}}, \mbox{\hyperlink{ah__internal_8h_a232f5ccb3fe93ddacc4dda5aac2ff4a3}{LE\_READ\_2}}(ahp-\/>\mbox{\hyperlink{structath__hal__5211_ac338f111d4a596f5906dd5dc3eeba0a7}{ah\_macaddr}} + 4)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00380}00380                 | macStaId1}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00381}00381         );}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00382}00382         \mbox{\hyperlink{ar5211__reset_8c_a7602af326b5930af3c6f60d4360d98cf}{ar5211SetOperatingMode}}(ah, opmode);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00383}00383 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00384}00384         \textcolor{comment}{/* Restore previous led state */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00385}00385         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a663173df4480365bf66e01b63c9f1714}{AR\_PCICFG}}, \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a663173df4480365bf66e01b63c9f1714}{AR\_PCICFG}}) | ledstate);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00386}00386         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_ab77487e529cc58e6fddd0617879f7e40}{AR\_GPIOCR}}, softLedCfg);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00387}00387         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a806ffa33c8b0116fd9cc938ee449901d}{AR\_GPIODO}}, softLedState);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00388}00388 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00389}00389         \textcolor{comment}{/* Restore previous antenna */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00390}00390         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_aaacc96cdfb07a2341a3305bbe2d69081}{AR\_DEF\_ANTENNA}}, saveDefAntenna);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00391}00391 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00392}00392         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a56b695fd4d87860b05b098abee41a3c0}{AR\_BSS\_ID0}}, \mbox{\hyperlink{ah__internal_8h_a110f2217661b4b5b0ab0ba8a6b62aac4}{LE\_READ\_4}}(ahp-\/>\mbox{\hyperlink{structath__hal__5211_a719a128719a5c0985dd6d3ce5831c51b}{ah\_bssid}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00393}00393         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_abd978d574d90e81d06679dc752827a31}{AR\_BSS\_ID1}}, \mbox{\hyperlink{ah__internal_8h_a232f5ccb3fe93ddacc4dda5aac2ff4a3}{LE\_READ\_2}}(ahp-\/>\mbox{\hyperlink{structath__hal__5211_a719a128719a5c0985dd6d3ce5831c51b}{ah\_bssid}} + 4));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00395}00395         \textcolor{comment}{/* Restore bmiss rssi \& count thresholds */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00396}00396         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_adc0111d531ffdb2bec209f7baa1b66c4}{AR\_RSSI\_THR}}, ahp-\/>\mbox{\hyperlink{structath__hal__5211_a11a0da430343e897c3f500e6771d5a23}{ah\_rssiThr}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00397}00397 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00398}00398         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a3bf709edde279783ef3650f18f0d2230}{AR\_ISR}}, \string~0);         \textcolor{comment}{/* cleared on write */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00399}00399 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00400}00400         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00401}00401 \textcolor{comment}{         * for pre-\/Production Oahu only.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00402}00402 \textcolor{comment}{         * Disable clock gating in all DMA blocks. Helps when using}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00403}00403 \textcolor{comment}{         * 11B and AES but results in higher power consumption.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00404}00404 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00405}00405         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion == \mbox{\hyperlink{ar5211reg_8h_aa68f39a7b4367b67addf2e0bf33c2727}{AR\_SREV\_VERSION\_OAHU}} \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00406}00406             \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macRev < \mbox{\hyperlink{ar5211reg_8h_ab81b931165395d8650ed8ef03e122b51}{AR\_SREV\_OAHU\_PROD}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00407}00407                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_aabe6a889defde22905387f48c41b34b4}{AR\_CFG}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00408}00408                         \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_aabe6a889defde22905387f48c41b34b4}{AR\_CFG}}) | \mbox{\hyperlink{ar5211reg_8h_a1cee64755cf8e2baf7937b58c080928c}{AR\_CFG\_CLK\_GATE\_DIS}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00409}00409         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00410}00410 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00411}00411         \textcolor{comment}{/* Setup the transmit power values. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00412}00412         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_aedab42df3abd366fa213b4d4c6eb9f96}{ar5211SetTransmitPower}}(ah, chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00413}00413                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00414}00414                     \textcolor{stringliteral}{"{}\%s: error init'ing transmit power\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00415}00415                 \mbox{\hyperlink{ar5211__reset_8c_a57e372ff9ed08ebabb8e269f1a105a5d}{FAIL}}(\mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a163bd2fc79bfcdd646cf57ed3d46542a}{HAL\_EIO}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00416}00416         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00417}00417 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00418}00418         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00419}00419 \textcolor{comment}{         * Configurable OFDM spoofing for 11n compatibility; used}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00420}00420 \textcolor{comment}{         * only when operating in station mode.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00421}00421 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00422}00422         \textcolor{keywordflow}{if} (opmode != \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3ae7ab5162a6e449287d9e8c63a4c4e628}{HAL\_M\_HOSTAP}} \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00423}00423             (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_11nCompat \& \mbox{\hyperlink{ah__internal_8h_a834f8c3f622014560e6de04f5c137a4a}{HAL\_DIAG\_11N\_SERVICES}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00424}00424                 \textcolor{comment}{/* NB: override the .ini setting */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00425}00425                 \mbox{\hyperlink{ah__internal_8h_ab80ff599cda88f9223505d0ecbb53bcd}{OS\_REG\_RMW\_FIELD}}(ah, \mbox{\hyperlink{ar5211phy_8h_af544c44a8a68c588d2fc768ec4c010ac}{AR\_PHY\_FRAME\_CTL}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00426}00426                         \mbox{\hyperlink{ar5211phy_8h_a523a9740cfb4fd87235b6feab8b3925e}{AR\_PHY\_FRAME\_CTL\_ERR\_SERV}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00427}00427                         \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_11nCompat, \mbox{\hyperlink{ah__internal_8h_a834f8c3f622014560e6de04f5c137a4a}{HAL\_DIAG\_11N\_SERVICES}})\&1);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00428}00428         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00429}00429 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00430}00430         \textcolor{comment}{/* Setup board specific options for EEPROM version 3 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00431}00431         \mbox{\hyperlink{ar5211__reset_8c_a7d8bdf217b5f2ac849e63aed002b6e7f}{ar5211SetBoardValues}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00432}00432 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00433}00433         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_ad1f9223fd8b95c01ce7603a1d4f40db8}{ar5211SetChannel}}(ah, chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00434}00434                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: unable to set channel\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00435}00435                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00436}00436                 \mbox{\hyperlink{ar5211__reset_8c_a57e372ff9ed08ebabb8e269f1a105a5d}{FAIL}}(\mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a163bd2fc79bfcdd646cf57ed3d46542a}{HAL\_EIO}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00437}00437         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00438}00438 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00439}00439         \textcolor{comment}{/* Activate the PHY */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00440}00440         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_devid == \mbox{\hyperlink{ah__devid_8h_aa29bf40eb6b1e6489a82313fb3d06ffc}{AR5211\_FPGA11B}} \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00441}00441             IEEE80211\_IS\_CHAN\_2GHZ(chan))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00442}00442                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, 0xd808, 0x502); \textcolor{comment}{/* required for FPGA */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00443}00443         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_ad7f16a59bcea7d2df60b7f3b0a5d29d8}{AR\_PHY\_ACTIVE}}, \mbox{\hyperlink{ar5211phy_8h_a049cd9742fbac792703c37a86f592cc8}{AR\_PHY\_ACTIVE\_EN}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00445}00445         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00446}00446 \textcolor{comment}{         * Wait for the frequency synth to settle (synth goes on}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00447}00447 \textcolor{comment}{         * via AR\_PHY\_ACTIVE\_EN).  Read the phy active delay register.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00448}00448 \textcolor{comment}{         * Value is in 100ns increments.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00449}00449 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00450}00450         data = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_a3a106683248fb1b98267342ab48f34be}{AR\_PHY\_RX\_DELAY}}) \& \mbox{\hyperlink{ar5211phy_8h_aefb64f442ab9ff3b644e7588e16c7e0e}{AR\_PHY\_RX\_DELAY\_M}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00451}00451         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_CCK(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00452}00452                 synthDelay = (4 * data) / 22;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00453}00453         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00454}00454                 synthDelay = data / 10;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00455}00455         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00456}00456         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00457}00457 \textcolor{comment}{         * There is an issue if the AP starts the calibration before}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00458}00458 \textcolor{comment}{         * the baseband timeout completes.  This could result in the}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00459}00459 \textcolor{comment}{         * rxclear false triggering.  Add an extra delay to ensure this}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00460}00460 \textcolor{comment}{         * this does not happen.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00461}00461 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00462}00462         \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(synthDelay + \mbox{\hyperlink{ar5211__reset_8c_a10c74cfaa1f3673f50208a4f22efccf4}{DELAY\_BASE\_ACTIVATE}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00463}00463 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00464}00464         \textcolor{comment}{/* Calibrate the AGC and wait for completion. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00465}00465         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00466}00466                  \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}}) | \mbox{\hyperlink{ar5211phy_8h_a1af96ebb45ea99b299667ddd89b025c5}{AR\_PHY\_AGC\_CONTROL\_CAL}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00467}00467         (void) \mbox{\hyperlink{ah_8c_ae13dc040798ba80daf9dc3da9e571146}{ath\_hal\_wait}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}}, \mbox{\hyperlink{ar5211phy_8h_a1af96ebb45ea99b299667ddd89b025c5}{AR\_PHY\_AGC\_CONTROL\_CAL}}, 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00468}00468 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00469}00469         \textcolor{comment}{/* Perform noise floor and set status */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00470}00470         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a88273773545507a651ec19940946b42d}{ar5211CalNoiseFloor}}(ah, chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00471}00471                 \textcolor{keywordflow}{if} (!IEEE80211\_IS\_CHAN\_CCK(chan))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00472}00472                         chan-\/>ic\_state |= IEEE80211\_CHANSTATE\_CWINT;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00473}00473                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00474}00474                     \textcolor{stringliteral}{"{}\%s: noise floor calibration failed\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00475}00475                 \mbox{\hyperlink{ar5211__reset_8c_a57e372ff9ed08ebabb8e269f1a105a5d}{FAIL}}(\mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a163bd2fc79bfcdd646cf57ed3d46542a}{HAL\_EIO}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00476}00476         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00477}00477 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00478}00478         \textcolor{comment}{/* Start IQ calibration w/ 2\string^(INIT\_IQCAL\_LOG\_COUNT\_MAX+1) samples */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00479}00479         \textcolor{keywordflow}{if} (ahp-\/>\mbox{\hyperlink{structath__hal__5211_af127a054cac2559d254b8114ee1a08bf}{ah\_calibrationTime}} != 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00480}00480                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_ac5a185c33c643ef9f935af17e62c0c40}{AR\_PHY\_TIMING\_CTRL4}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00481}00481                         \mbox{\hyperlink{ar5211phy_8h_a276a3296dc4a95181e28da73f2d77307}{AR\_PHY\_TIMING\_CTRL4\_DO\_IQCAL}} | (\mbox{\hyperlink{ar5211_8h_a1ec24a6229e90728d35813ba0e46fa7d}{INIT\_IQCAL\_LOG\_COUNT\_MAX}} << \mbox{\hyperlink{ar5211phy_8h_ae9df991e5d4b497ac87e4a4856fd7f25}{AR\_PHY\_TIMING\_CTRL4\_IQCAL\_LOG\_COUNT\_MAX\_S}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00482}00482                 ahp-\/>\mbox{\hyperlink{structath__hal__5211_ab87d33d39a2e3acba8f1d64180062604}{ah\_bIQCalibration}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00483}00483         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00484}00484 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00485}00485         \textcolor{comment}{/* set 1:1 QCU to DCU mapping for all queues */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00486}00486         \textcolor{keywordflow}{for} (q = 0; q < \mbox{\hyperlink{ar5211reg_8h_a393ec388edc5772b8256f8ffce2589aa}{AR\_NUM\_DCU}}; q++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00487}00487                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_abe119a0b5d90598d8c84767fb3866856}{AR\_DQCUMASK}}(q), 1<<q);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00489}00489         \textcolor{keywordflow}{for} (q = 0; q < \mbox{\hyperlink{ah_8h_a363b3fe07ea76336166c13de41fdfefb}{HAL\_NUM\_TX\_QUEUES}}; q++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00490}00490                 \mbox{\hyperlink{ar5211_8h_a065c8ba5e3a3dcc5de7bbd9ed62c1e9d}{ar5211ResetTxQueue}}(ah, q);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00491}00491 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00492}00492         \textcolor{comment}{/* Setup QCU0 transmit interrupt masks (TX\_ERR, TX\_OK, TX\_DESC, TX\_URN) */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00493}00493         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_aa0ff3ff61981edbcc5ba4d10ced07d14}{AR\_IMR\_S0}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00494}00494                  (\mbox{\hyperlink{ar5211reg_8h_a8c6ba55f228d19324cc02f3bfcd01316}{AR\_IMR\_S0\_QCU\_TXOK}} \& \mbox{\hyperlink{ar5211reg_8h_a2d2efaec72931f84b33a3ad076381f8b}{AR\_QCU\_0}}) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00495}00495                  (\mbox{\hyperlink{ar5211reg_8h_a714669f6c9733242a4b56fd898ed33c3}{AR\_IMR\_S0\_QCU\_TXDESC}} \& (\mbox{\hyperlink{ar5211reg_8h_a2d2efaec72931f84b33a3ad076381f8b}{AR\_QCU\_0}}<<\mbox{\hyperlink{ar5211reg_8h_ae5214db406dd3b0c811f6e5c84c14117}{AR\_IMR\_S0\_QCU\_TXDESC\_S}})));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00496}00496         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_a668e3c98fad9993bc268bbbafceeada7}{AR\_IMR\_S1}}, (\mbox{\hyperlink{ar5211reg_8h_ac90f160f29a02f66ef2e6af3b46130e6}{AR\_IMR\_S1\_QCU\_TXERR}} \& \mbox{\hyperlink{ar5211reg_8h_a2d2efaec72931f84b33a3ad076381f8b}{AR\_QCU\_0}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00497}00497         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_a5432445835791619b0311984d0e342f9}{AR\_IMR\_S2}}, (\mbox{\hyperlink{ar5211reg_8h_aed59cc85c7dd40aaaa2c7bc9f997e060}{AR\_IMR\_S2\_QCU\_TXURN}} \& \mbox{\hyperlink{ar5211reg_8h_a2d2efaec72931f84b33a3ad076381f8b}{AR\_QCU\_0}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00498}00498 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00499}00499         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00500}00500 \textcolor{comment}{         * GBL\_EIFS must always be written after writing}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00501}00501 \textcolor{comment}{         *              to any QCUMASK register.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00502}00502 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00503}00503         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_afff2f977862212ec2dc6f43cd42b5991}{AR\_D\_GBL\_IFS\_EIFS}}, \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211reg_8h_afff2f977862212ec2dc6f43cd42b5991}{AR\_D\_GBL\_IFS\_EIFS}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00505}00505         \textcolor{comment}{/* Now set up the Interrupt Mask Register and save it for future use */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00506}00506         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a904d277c98b9f08a1aba1240dddfe135}{AR\_IMR}}, \mbox{\hyperlink{ar5211_8h_a34b7738c4cd5b8dae25c13f88a2e082c}{INIT\_INTERRUPT\_MASK}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00507}00507         ahp-\/>\mbox{\hyperlink{structath__hal__5211_a4dcc41e9178cc6fabfa0be48cdfb9b58}{ah\_maskReg}} = \mbox{\hyperlink{ar5211_8h_a34b7738c4cd5b8dae25c13f88a2e082c}{INIT\_INTERRUPT\_MASK}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00509}00509         \textcolor{comment}{/* Enable bus error interrupts */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00510}00510         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211reg_8h_a5432445835791619b0311984d0e342f9}{AR\_IMR\_S2}}, \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211reg_8h_a5432445835791619b0311984d0e342f9}{AR\_IMR\_S2}}) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00511}00511                  \mbox{\hyperlink{ar5211reg_8h_ab990390867904ea51dc644b3287d89d9}{AR\_IMR\_S2\_MCABT}} | \mbox{\hyperlink{ar5211reg_8h_add58d6458c892467fa21491cbdfb1b75}{AR\_IMR\_S2\_SSERR}} | \mbox{\hyperlink{ar5211reg_8h_ab3a4706490df4188f60ff78cf3f7f608}{AR\_IMR\_S2\_DPERR}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00512}00512 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00513}00513         \textcolor{comment}{/* Enable interrupts specific to AP */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00514}00514         \textcolor{keywordflow}{if} (opmode == \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3ae7ab5162a6e449287d9e8c63a4c4e628}{HAL\_M\_HOSTAP}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00515}00515                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a904d277c98b9f08a1aba1240dddfe135}{AR\_IMR}}, \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a904d277c98b9f08a1aba1240dddfe135}{AR\_IMR}}) | \mbox{\hyperlink{ar5211reg_8h_a017709e3266a1946a3ce781493e97b61}{AR\_IMR\_MIB}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00516}00516                 ahp-\/>\mbox{\hyperlink{structath__hal__5211_a4dcc41e9178cc6fabfa0be48cdfb9b58}{ah\_maskReg}} |= \mbox{\hyperlink{ar5211reg_8h_a017709e3266a1946a3ce781493e97b61}{AR\_IMR\_MIB}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00517}00517         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00518}00518 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00519}00519         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_rfkillEnabled)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00520}00520                 \mbox{\hyperlink{ar5211_8h_ab445e3385107cb85d2d5d0cf8fdf391b}{ar5211EnableRfKill}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00522}00522         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00523}00523 \textcolor{comment}{         * Writing to AR\_BEACON will start timers. Hence it should}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00524}00524 \textcolor{comment}{         * be the last register to be written. Do not reset tsf, do}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00525}00525 \textcolor{comment}{         * not enable beacons at this point, but preserve other values}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00526}00526 \textcolor{comment}{         * like beaconInterval.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00527}00527 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00528}00528         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a25442c5afbe0e1e1560e78d8f04afdea}{AR\_BEACON}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00529}00529                 (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a25442c5afbe0e1e1560e78d8f04afdea}{AR\_BEACON}}) \&\string~ (\mbox{\hyperlink{ar5210reg_8h_aaee1df3ac07714f7af017829af770e57}{AR\_BEACON\_EN}} | \mbox{\hyperlink{ar5210reg_8h_ab13f76484f387a0786c54d841041de9e}{AR\_BEACON\_RESET\_TSF}})));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00531}00531         \textcolor{comment}{/* Restore user-\/specified slot time and timeouts */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00532}00532         \textcolor{keywordflow}{if} (ahp-\/>\mbox{\hyperlink{structath__hal__5211_a2e8387807a4f9361397c68d37d6fa7e8}{ah\_sifstime}} != (u\_int) -\/1)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00533}00533                 \mbox{\hyperlink{ar5211_8h_a1ccb9b3debe44516f0c86ea0721045c2}{ar5211SetSifsTime}}(ah, ahp-\/>\mbox{\hyperlink{structath__hal__5211_a2e8387807a4f9361397c68d37d6fa7e8}{ah\_sifstime}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00534}00534         \textcolor{keywordflow}{if} (ahp-\/>\mbox{\hyperlink{structath__hal__5211_a236f3bcd3c74a822f02a1cde0072e694}{ah\_slottime}} != (u\_int) -\/1)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00535}00535                 \mbox{\hyperlink{ar5211_8h_abc174ee82713af4fc488858203166820}{ar5211SetSlotTime}}(ah, ahp-\/>\mbox{\hyperlink{structath__hal__5211_a236f3bcd3c74a822f02a1cde0072e694}{ah\_slottime}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00536}00536         \textcolor{keywordflow}{if} (ahp-\/>\mbox{\hyperlink{structath__hal__5211_a59264b73f4b9efe03653434a11646dc3}{ah\_acktimeout}} != (u\_int) -\/1)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00537}00537                 \mbox{\hyperlink{ar5211_8h_a7fbc976012172122dfbe3249005ff11b}{ar5211SetAckTimeout}}(ah, ahp-\/>\mbox{\hyperlink{structath__hal__5211_a59264b73f4b9efe03653434a11646dc3}{ah\_acktimeout}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00538}00538         \textcolor{keywordflow}{if} (ahp-\/>\mbox{\hyperlink{structath__hal__5211_a6c0af8a14bb746e9fe400226ea2917ee}{ah\_ctstimeout}} != (u\_int) -\/1)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00539}00539                 \mbox{\hyperlink{ar5211_8h_a92256b2568fcadfd8a753fd4c5e1fde9}{ar5211SetCTSTimeout}}(ah, ahp-\/>\mbox{\hyperlink{structath__hal__5211_a6c0af8a14bb746e9fe400226ea2917ee}{ah\_ctstimeout}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00540}00540         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_diagreg != 0)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00541}00541                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_aef907b410f065ff5672fc24bfe844d3e}{AR\_DIAG\_SW}}, \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_diagreg);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00543}00543         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_opmode = opmode;   \textcolor{comment}{/* record operating mode */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00545}00545         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea3476c6e4fcd910454cfdda4f7f0f25e6}{HAL\_DEBUG\_RESET}}, \textcolor{stringliteral}{"{}\%s: done\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00546}00546 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00547}00547         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00548}00548 bad:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00549}00549         \textcolor{keywordflow}{if} (status != \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}})}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00550}00550                 *status = ecode;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00551}00551         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00552}00552 \textcolor{preprocessor}{\#undef FAIL}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00553}00553 \textcolor{preprocessor}{\#undef N}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00554}00554 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00556}00556 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00557}00557 \textcolor{comment}{ * Places the PHY and Radio chips into reset.  A full reset}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00558}00558 \textcolor{comment}{ * must be called to leave this state.  The PCI/MAC/PCU are}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00559}00559 \textcolor{comment}{ * not placed into reset as we must receive interrupt to}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00560}00560 \textcolor{comment}{ * re-\/enable the hardware.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00561}00561 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00562}00562 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00563}\mbox{\hyperlink{ar5211_8h_aa0260952b5832089c44f55c04bc32c85}{00563}} \mbox{\hyperlink{ar5211__reset_8c_ab83d6920d1c311480667496670692b66}{ar5211PhyDisable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00564}00564 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00565}00565         \textcolor{keywordflow}{return} \mbox{\hyperlink{ar5211__reset_8c_a0daae57c1669bf29282c74dc75ca641b}{ar5211SetResetReg}}(ah, \mbox{\hyperlink{ar5211reg_8h_ac181d2ebc6eb7ba470ab40fbdcfdfa23}{AR\_RC\_BB}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00566}00566 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00567}00567 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00568}00568 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00569}00569 \textcolor{comment}{ * Places all of hardware into reset}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00570}00570 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00571}00571 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00572}\mbox{\hyperlink{ar5211_8h_a836b4aeb4cf27aa30898397d2bfbc121}{00572}} \mbox{\hyperlink{ar5211__reset_8c_af49c84a4b678641b5a3b99a8285149ff}{ar5211Disable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00573}00573 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00574}00574         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211_8h_ad0514d98c3d52a4782db6d63df2d7f96}{ar5211SetPowerMode}}(ah, \mbox{\hyperlink{ah_8h_a48c3115e12caf57353013063438be679a75d316373c0af3b3d0192bb3fe44fc7c}{HAL\_PM\_AWAKE}}, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}}))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00575}00575                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00576}00576         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00577}00577 \textcolor{comment}{         * Reset the HW -\/ PCI must be reset after the rest of the}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00578}00578 \textcolor{comment}{         * device has been reset.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00579}00579 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00580}00580         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a0daae57c1669bf29282c74dc75ca641b}{ar5211SetResetReg}}(ah, \mbox{\hyperlink{ar5211reg_8h_adc6e7d2af053dec707468d780febf84e}{AR\_RC\_MAC}} | \mbox{\hyperlink{ar5211reg_8h_ac181d2ebc6eb7ba470ab40fbdcfdfa23}{AR\_RC\_BB}} | \mbox{\hyperlink{ar5211reg_8h_a246b19a7cf6d7586a97d491c657459d8}{AR\_RC\_PCI}}))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00581}00581                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00582}00582         \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(2100);    \textcolor{comment}{/* 8245 @ 96Mhz hangs with 2000us. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00583}00583 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00584}00584         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00585}00585 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00586}00586 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00587}00587 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00588}00588 \textcolor{comment}{ * Places the hardware into reset and then pulls it out of reset}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00589}00589 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00590}00590 \textcolor{comment}{ * Only write the PLL if we're changing to or from CCK mode}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00591}00591 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00592}00592 \textcolor{comment}{ * Attach calls with channelFlags = 0, as the coldreset should have}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00593}00593 \textcolor{comment}{ * us in the correct mode and we cannot check the hwchannel flags.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00594}00594 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00595}00595 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00596}\mbox{\hyperlink{ar5211_8h_a3cac3b47b279a8f1a3d86a2050f3b820}{00596}} \mbox{\hyperlink{ar5211__reset_8c_a93bce73e4c71516a805115acba518071}{ar5211ChipReset}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00597}00597 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00598}00598         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211_8h_ad0514d98c3d52a4782db6d63df2d7f96}{ar5211SetPowerMode}}(ah, \mbox{\hyperlink{ah_8h_a48c3115e12caf57353013063438be679a75d316373c0af3b3d0192bb3fe44fc7c}{HAL\_PM\_AWAKE}}, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}}))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00599}00599                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00601}00601         \textcolor{comment}{/* NB: called from attach with chan null */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00602}00602         \textcolor{keywordflow}{if} (chan != \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00603}00603                 \textcolor{comment}{/* Set CCK and Turbo modes correctly */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00604}00604                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_a8d9f52f7eff54ed0b0f7aa87fa90800a}{AR\_PHY\_TURBO}}, IEEE80211\_IS\_CHAN\_TURBO(chan) ?}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00605}00605                     \mbox{\hyperlink{ar5211phy_8h_a8257fb470b3ae6cf76ec772de5720f32}{AR\_PHY\_FC\_TURBO\_MODE}} | \mbox{\hyperlink{ar5211phy_8h_a644a30806d1a246ec54bc50e96bf223d}{AR\_PHY\_FC\_TURBO\_SHORT}} : 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00606}00606                 \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_B(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00607}00607                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_ae0a282d9cd4d41d6300b5d8854a35518}{AR5211\_PHY\_MODE}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00608}00608                             \mbox{\hyperlink{ar5211phy_8h_a28591eeb013b158c0a57505aaf4c95ae}{AR5211\_PHY\_MODE\_CCK}} | \mbox{\hyperlink{ar5211phy_8h_a8db3245c1d307a524dddb3d16e992ed3}{AR5211\_PHY\_MODE\_RF2GHZ}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00609}00609                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_a4c1bfd7f78c84968a428f7af7ae8ece1}{AR\_PHY\_PLL\_CTL}}, \mbox{\hyperlink{ar5211phy_8h_af085779baa2dc2886e915b03f4485b44}{AR\_PHY\_PLL\_CTL\_44}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00610}00610                         \textcolor{comment}{/* Wait for the PLL to settle */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00611}00611                         \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(\mbox{\hyperlink{ar5211__reset_8c_ab69cf54552ef955d040b0161f3058793}{DELAY\_PLL\_SETTLE}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00612}00612                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_devid == \mbox{\hyperlink{ah__devid_8h_a2ed1f86faf19f0707c8f7ba1c65402f9}{AR5211\_DEVID}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00613}00613                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_a4c1bfd7f78c84968a428f7af7ae8ece1}{AR\_PHY\_PLL\_CTL}}, \mbox{\hyperlink{ar5211phy_8h_a6919e4bbeeb76f1092a87fc63aa7e27d}{AR\_PHY\_PLL\_CTL\_40}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00614}00614                         \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(\mbox{\hyperlink{ar5211__reset_8c_ab69cf54552ef955d040b0161f3058793}{DELAY\_PLL\_SETTLE}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00615}00615                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_ae0a282d9cd4d41d6300b5d8854a35518}{AR5211\_PHY\_MODE}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00616}00616                             \mbox{\hyperlink{ar5211phy_8h_a7e2cad11e4b494a475d930afea9ce291}{AR5211\_PHY\_MODE\_OFDM}} | (IEEE80211\_IS\_CHAN\_2GHZ(chan) ?}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00617}00617                                 \mbox{\hyperlink{ar5211phy_8h_a8db3245c1d307a524dddb3d16e992ed3}{AR5211\_PHY\_MODE\_RF2GHZ}} :}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00618}00618                                 \mbox{\hyperlink{ar5211phy_8h_af3131f521798bf9a90b598e9c7f7df37}{AR5211\_PHY\_MODE\_RF5GHZ}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00619}00619                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00620}00620         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00622}00622         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00623}00623 \textcolor{comment}{         * Reset the HW -\/ PCI must be reset after the rest of the}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00624}00624 \textcolor{comment}{         * device has been reset}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00625}00625 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00626}00626         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a0daae57c1669bf29282c74dc75ca641b}{ar5211SetResetReg}}(ah, \mbox{\hyperlink{ar5211reg_8h_adc6e7d2af053dec707468d780febf84e}{AR\_RC\_MAC}} | \mbox{\hyperlink{ar5211reg_8h_ac181d2ebc6eb7ba470ab40fbdcfdfa23}{AR\_RC\_BB}} | \mbox{\hyperlink{ar5211reg_8h_a246b19a7cf6d7586a97d491c657459d8}{AR\_RC\_PCI}}))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00627}00627                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00628}00628         \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(2100);    \textcolor{comment}{/* 8245 @ 96Mhz hangs with 2000us. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00629}00629 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00630}00630         \textcolor{comment}{/* Bring out of sleep mode (AGAIN) */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00631}00631         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211_8h_ad0514d98c3d52a4782db6d63df2d7f96}{ar5211SetPowerMode}}(ah, \mbox{\hyperlink{ah_8h_a48c3115e12caf57353013063438be679a75d316373c0af3b3d0192bb3fe44fc7c}{HAL\_PM\_AWAKE}}, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}}))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00632}00632                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00633}00633 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00634}00634         \textcolor{comment}{/* Clear warm reset register */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00635}00635         \textcolor{keywordflow}{return} \mbox{\hyperlink{ar5211__reset_8c_a0daae57c1669bf29282c74dc75ca641b}{ar5211SetResetReg}}(ah, 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00636}00636 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00637}00637 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00638}00638 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00639}00639 \textcolor{comment}{ * Recalibrate the lower PHY chips to account for temperature/environment}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00640}00640 \textcolor{comment}{ * changes.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00641}00641 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00642}00642 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00643}\mbox{\hyperlink{ar5211_8h_a4f3b0efaa364ffadab88c34ff18844f7}{00643}} \mbox{\hyperlink{ar5211__reset_8c_a4f3b0efaa364ffadab88c34ff18844f7}{ar5211PerCalibrationN}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah,  \textcolor{keyword}{struct} ieee80211\_channel *chan,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00644}00644         u\_int chainMask, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} longCal, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} *isCalDone)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00645}00645 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00646}00646         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00647}00647         \mbox{\hyperlink{structHAL__CHANNEL__INTERNAL}{HAL\_CHANNEL\_INTERNAL}} *ichan;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00648}00648         int32\_t qCoff, qCoffDenom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00649}00649         uint32\_t data;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00650}00650         int32\_t iqCorrMeas;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00651}00651         int32\_t iCoff, iCoffDenom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00652}00652         uint32\_t powerMeasQ, powerMeasI;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00653}00653 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00654}00654         ichan = \mbox{\hyperlink{ah__internal_8h_a43ec3662d6186b79cd289c466ed900fe}{ath\_hal\_checkchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00655}00655         \textcolor{keywordflow}{if} (ichan == \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00656}00656                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00657}00657                     \textcolor{stringliteral}{"{}\%s: invalid channel \%u/0x\%x; no mapping\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00658}00658                     \_\_func\_\_, chan-\/>ic\_freq, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00659}00659                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00660}00660         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00661}00661         \textcolor{comment}{/* IQ calibration in progress. Check to see if it has finished. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00662}00662         \textcolor{keywordflow}{if} (ahp-\/>\mbox{\hyperlink{structath__hal__5211_ab87d33d39a2e3acba8f1d64180062604}{ah\_bIQCalibration}} \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00663}00663             !(\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_ac5a185c33c643ef9f935af17e62c0c40}{AR\_PHY\_TIMING\_CTRL4}}) \& \mbox{\hyperlink{ar5211phy_8h_a276a3296dc4a95181e28da73f2d77307}{AR\_PHY\_TIMING\_CTRL4\_DO\_IQCAL}})) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00664}00664                 \textcolor{comment}{/* IQ Calibration has finished. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00665}00665                 ahp-\/>\mbox{\hyperlink{structath__hal__5211_ab87d33d39a2e3acba8f1d64180062604}{ah\_bIQCalibration}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00666}00666 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00667}00667                 \textcolor{comment}{/* Read calibration results. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00668}00668                 powerMeasI = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_a8ec8dfe3613b3a362734b4575fc27e50}{AR\_PHY\_IQCAL\_RES\_PWR\_MEAS\_I}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00669}00669                 powerMeasQ = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_aff2c94dfe08ae3c2905b602500b919a0}{AR\_PHY\_IQCAL\_RES\_PWR\_MEAS\_Q}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00670}00670                 iqCorrMeas = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_a1383c4ef6bbaacee6784a9b97d4bc45f}{AR\_PHY\_IQCAL\_RES\_IQ\_CORR\_MEAS}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00671}00671 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00672}00672                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00673}00673 \textcolor{comment}{                 * Prescale these values to remove 64-\/bit operation requirement at the loss}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00674}00674 \textcolor{comment}{                 * of a little precision.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00675}00675 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00676}00676                 iCoffDenom = (powerMeasI / 2 + powerMeasQ / 2) / 128;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00677}00677                 qCoffDenom = powerMeasQ / 64;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00678}00678 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00679}00679                 \textcolor{comment}{/* Protect against divide-\/by-\/0. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00680}00680                 \textcolor{keywordflow}{if} (iCoffDenom != 0 \&\& qCoffDenom != 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00681}00681                         iCoff = (-\/iqCorrMeas) / iCoffDenom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00682}00682                         \textcolor{comment}{/* IQCORR\_Q\_I\_COFF is a signed 6 bit number */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00683}00683                         iCoff = iCoff \& 0x3f;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00685}00685                         qCoff = ((int32\_t)powerMeasI / qCoffDenom) -\/ 64;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00686}00686                         \textcolor{comment}{/* IQCORR\_Q\_Q\_COFF is a signed 5 bit number */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00687}00687                         qCoff = qCoff \& 0x1f;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00688}00688 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00689}00689                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}}, \textcolor{stringliteral}{"{}powerMeasI = 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00690}00690                             powerMeasI);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00691}00691                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}}, \textcolor{stringliteral}{"{}powerMeasQ = 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00692}00692                             powerMeasQ);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00693}00693                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}}, \textcolor{stringliteral}{"{}iqCorrMeas = 0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00694}00694                             iqCorrMeas);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00695}00695                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}}, \textcolor{stringliteral}{"{}iCoff     = \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00696}00696                             iCoff);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00697}00697                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaa678c7a4886efa8d0808e336c494bdde}{HAL\_DEBUG\_PERCAL}}, \textcolor{stringliteral}{"{}qCoff     = \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00698}00698                             qCoff);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00699}00699 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00700}00700                         \textcolor{comment}{/* Write IQ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00701}00701                         data  = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_ac5a185c33c643ef9f935af17e62c0c40}{AR\_PHY\_TIMING\_CTRL4}}) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00702}00702                                 \mbox{\hyperlink{ar5211phy_8h_ae1769498adaad860b149c3863bdfde1c}{AR\_PHY\_TIMING\_CTRL4\_IQCORR\_ENABLE}} |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00703}00703                                 (((uint32\_t)iCoff) << \mbox{\hyperlink{ar5211phy_8h_acd7b040bf37ab50da3307c4916e65257}{AR\_PHY\_TIMING\_CTRL4\_IQCORR\_Q\_I\_COFF\_S}}) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00704}00704                                 ((uint32\_t)qCoff);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00705}00705                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_ac5a185c33c643ef9f935af17e62c0c40}{AR\_PHY\_TIMING\_CTRL4}}, data);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00706}00706                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00707}00707         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00708}00708         *isCalDone = !ahp-\/>\mbox{\hyperlink{structath__hal__5211_ab87d33d39a2e3acba8f1d64180062604}{ah\_bIQCalibration}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00709}00709 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00710}00710         \textcolor{keywordflow}{if} (longCal) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00711}00711                 \textcolor{comment}{/* Perform noise floor and set status */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00712}00712                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_ade820d57f34b131fd18d2fa9fef5e5e6}{ar5211IsNfGood}}(ah, chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00713}00713                         \textcolor{comment}{/* report up and clear internal state */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00714}00714                         chan-\/>ic\_state |= IEEE80211\_CHANSTATE\_CWINT;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00715}00715                         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00716}00716                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00717}00717                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a88273773545507a651ec19940946b42d}{ar5211CalNoiseFloor}}(ah, chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00718}00718                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00719}00719 \textcolor{comment}{                         * Delay 5ms before retrying the noise floor}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00720}00720 \textcolor{comment}{                         * just to make sure, as we are in an error}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00721}00721 \textcolor{comment}{                         * condition here.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00722}00722 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00723}00723                         \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(5000);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00724}00724                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a88273773545507a651ec19940946b42d}{ar5211CalNoiseFloor}}(ah, chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00725}00725                                 \textcolor{keywordflow}{if} (!IEEE80211\_IS\_CHAN\_CCK(chan))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00726}00726                                         chan-\/>ic\_state |= IEEE80211\_CHANSTATE\_CWINT;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00727}00727                                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00728}00728                         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00729}00729                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00730}00730                 \mbox{\hyperlink{ar5211__reset_8c_a2e22eca717c93e7d9e684527ab7fb3f0}{ar5211RequestRfgain}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00731}00731         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00732}00732         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00733}00733 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00734}00734 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00735}00735 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00736}\mbox{\hyperlink{ar5211_8h_afa20314a32efc6f99a8b3ff2f7d27c30}{00736}} \mbox{\hyperlink{ar5211__reset_8c_accae84e31ac887cad3ce1b3ceba9f70b}{ar5211PerCalibration}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{struct} ieee80211\_channel *chan,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00737}00737         \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} *isIQdone)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00738}00738 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00739}00739         \textcolor{keywordflow}{return} \mbox{\hyperlink{ar5211__reset_8c_a4f3b0efaa364ffadab88c34ff18844f7}{ar5211PerCalibrationN}}(ah,  chan, 0x1, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}}, isIQdone);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00740}00740 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00741}00741 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00742}00742 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00743}\mbox{\hyperlink{ar5211_8h_aafa736508baae159509ec7284b726f4f}{00743}} \mbox{\hyperlink{ar5211__reset_8c_a357009ab40808b0224d32c007e18e806}{ar5211ResetCalValid}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00744}00744 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00745}00745         \textcolor{comment}{/* XXX */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00746}00746         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00747}00747 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00749}00749 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00750}00750 \textcolor{comment}{ * Writes the given reset bit mask into the reset register}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00751}00751 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00752}00752 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00753}\mbox{\hyperlink{ar5211__reset_8c_a0daae57c1669bf29282c74dc75ca641b}{00753}} \mbox{\hyperlink{ar5211__reset_8c_a0daae57c1669bf29282c74dc75ca641b}{ar5211SetResetReg}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, uint32\_t resetMask)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00754}00754 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00755}00755         uint32\_t mask = resetMask ? resetMask : \string~0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00756}00756         \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} rt;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00758}00758         (void) \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a6b3262c8e9489c98e1776289f6baf9ec}{AR\_RXDP}});\textcolor{comment}{/* flush any pending MMR writes */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00759}00759         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_aed89c9a0254eba1d8ae9289d744d1824}{AR\_RC}}, resetMask);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00760}00760 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00761}00761         \textcolor{comment}{/* need to wait at least 128 clocks when reseting PCI before read */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00762}00762         \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(15);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00763}00763 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00764}00764         resetMask \&= \mbox{\hyperlink{ar5211reg_8h_adc6e7d2af053dec707468d780febf84e}{AR\_RC\_MAC}} | \mbox{\hyperlink{ar5211reg_8h_ac181d2ebc6eb7ba470ab40fbdcfdfa23}{AR\_RC\_BB}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00765}00765         mask \&= \mbox{\hyperlink{ar5211reg_8h_adc6e7d2af053dec707468d780febf84e}{AR\_RC\_MAC}} | \mbox{\hyperlink{ar5211reg_8h_ac181d2ebc6eb7ba470ab40fbdcfdfa23}{AR\_RC\_BB}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00766}00766         rt = \mbox{\hyperlink{ah_8c_ae13dc040798ba80daf9dc3da9e571146}{ath\_hal\_wait}}(ah, \mbox{\hyperlink{ar5210reg_8h_aed89c9a0254eba1d8ae9289d744d1824}{AR\_RC}}, mask, resetMask);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00767}00767         \textcolor{keywordflow}{if} ((resetMask \& \mbox{\hyperlink{ar5211reg_8h_adc6e7d2af053dec707468d780febf84e}{AR\_RC\_MAC}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00768}00768                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a891a01c9e645798221e218f3a5c82159}{isBigEndian}}()) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00769}00769                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00770}00770 \textcolor{comment}{                         * Set CFG, little-\/endian for descriptor accesses.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00771}00771 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00772}00772                         mask = \mbox{\hyperlink{ar5210_8h_ae711bf0b49ba9b7b2370826d3519c970}{INIT\_CONFIG\_STATUS}} | \mbox{\hyperlink{ar5210reg_8h_a1aa9204c1b76f412b62c5e039d76b917}{AR\_CFG\_SWTD}} | \mbox{\hyperlink{ar5210reg_8h_aa2ff8c75786127e72f1dc0e92f650d8c}{AR\_CFG\_SWRD}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00773}00773                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_aabe6a889defde22905387f48c41b34b4}{AR\_CFG}}, mask);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00774}00774                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00775}00775                         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_aabe6a889defde22905387f48c41b34b4}{AR\_CFG}}, \mbox{\hyperlink{ar5210_8h_ae711bf0b49ba9b7b2370826d3519c970}{INIT\_CONFIG\_STATUS}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00776}00776         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00777}00777         \textcolor{keywordflow}{return} rt;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00778}00778 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00779}00779 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00780}00780 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00781}00781 \textcolor{comment}{ * Takes the MHz channel value and sets the Channel value}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00782}00782 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00783}00783 \textcolor{comment}{ * ASSUMES: Writes enabled to analog bus before AGC is active}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00784}00784 \textcolor{comment}{ *   or by disabling the AGC.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00785}00785 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00786}00786 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00787}\mbox{\hyperlink{ar5211__reset_8c_ad1f9223fd8b95c01ce7603a1d4f40db8}{00787}} \mbox{\hyperlink{ar5211__reset_8c_ad1f9223fd8b95c01ce7603a1d4f40db8}{ar5211SetChannel}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00788}00788 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00789}00789         uint32\_t refClk, reg32, data2111;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00790}00790         int16\_t chan5111, chanIEEE;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00791}00791 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00792}00792         chanIEEE = chan-\/>ic\_ieee;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00793}00793         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_2GHZ(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00794}00794                 \textcolor{keyword}{const} \mbox{\hyperlink{structCHAN__INFO__2GHZ}{CHAN\_INFO\_2GHZ}}* ci =}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00795}00795                         \&\mbox{\hyperlink{ar5211__reset_8c_ae6e627f782bef358642c8aeed43ea2db}{chan2GHzData}}[chanIEEE + \mbox{\hyperlink{ar5211__reset_8c_af6130a9d3f26baa7a3d681c8d5fa7571}{CI\_2GHZ\_INDEX\_CORRECTION}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00796}00796 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00797}00797                 data2111 = ((\mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(ci-\/>\mbox{\hyperlink{structCHAN__INFO__2GHZ_a939578519805260791e9465fef98c7ed}{channelSelect}}, 8) \& 0xff)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00798}00798                                 << 5)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00799}00799                          | (ci-\/>\mbox{\hyperlink{structCHAN__INFO__2GHZ_a928918064992dec2559fb711c7835aae}{refClkSel}} << 4);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00800}00800                 chan5111 = ci-\/>\mbox{\hyperlink{structCHAN__INFO__2GHZ_af62eebe2b052e23d21ca9fb97ec4425f}{channel5111}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00801}00801         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00802}00802                 data2111 = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00803}00803                 chan5111 = chanIEEE;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00804}00804         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00805}00805 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00806}00806         \textcolor{comment}{/* Rest of the code is common for 5 GHz and 2.4 GHz. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00807}00807         \textcolor{keywordflow}{if} (chan5111 >= 145 || (chan5111 \& 0x1)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00808}00808                 reg32 = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(chan5111 -\/ 24, 8) \& 0xFF;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00809}00809                 refClk = 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00810}00810         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00811}00811                 reg32 = \mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(((chan5111 -\/ 24) / 2), 8) \& 0xFF;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00812}00812                 refClk = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00813}00813         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00814}00814 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00815}00815         reg32 = (reg32 << 2) | (refClk << 1) | (1 << 10) | 0x1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00816}00816         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(0x27), ((data2111 \& 0xff) << 8) | (reg32 \& 0xff));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00817}00817         reg32 >>= 8;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00818}00818         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(0x34), (data2111 \& 0xff00) | (reg32 \& 0xff));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00819}00819 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00820}00820         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_curchan = chan;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00821}00821         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00822}00822 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00823}00823 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00824}00824 \textcolor{keyword}{static} int16\_t}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00825}\mbox{\hyperlink{ar5211__reset_8c_ad9372736244f2d077e63d4ee24d187b2}{00825}} \mbox{\hyperlink{ar5211__reset_8c_ad9372736244f2d077e63d4ee24d187b2}{ar5211GetNoiseFloor}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00826}00826 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00827}00827         int16\_t nf;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00828}00828 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00829}00829         nf = (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(25)) >> 19) \& 0x1ff;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00830}00830         \textcolor{keywordflow}{if} (nf \& 0x100)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00831}00831                 nf = 0 -\/ ((nf \string^ 0x1ff) + 1);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00832}00832         \textcolor{keywordflow}{return} nf;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00833}00833 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00834}00834 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00835}00835 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00836}00836 \textcolor{comment}{ * Peform the noisefloor calibration for the length of time set}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00837}00837 \textcolor{comment}{ * in runTime (valid values 1 to 7)}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00838}00838 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00839}00839 \textcolor{comment}{ * Returns: The NF value at the end of the given time (or 0 for failure)}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00840}00840 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00841}00841 int16\_t}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00842}\mbox{\hyperlink{ar5211__reset_8c_ab644efdb414e7ffcd95b2f2ef3cede1c}{00842}} \mbox{\hyperlink{ar5211__reset_8c_ab644efdb414e7ffcd95b2f2ef3cede1c}{ar5211RunNoiseFloor}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, uint8\_t runTime, int16\_t startingNF)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00843}00843 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00844}00844         \textcolor{keywordtype}{int} i, searchTime;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00845}00845 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00846}00846         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(runTime <= 7);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00847}00847 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00848}00848         \textcolor{comment}{/* Setup  noise floor run time and starting value */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00849}00849         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(25),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00850}00850                 (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(25)) \& \string~0xFFF) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00851}00851                          ((runTime << 9) \& 0xE00) | (startingNF \& 0x1FF));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00852}00852         \textcolor{comment}{/* Calibrate the noise floor */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00853}00853         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00854}00854                 \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}}) | \mbox{\hyperlink{ar5211phy_8h_a45cf6c8a1190154b819e2e3556a4e9d3}{AR\_PHY\_AGC\_CONTROL\_NF}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00855}00855 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00856}00856         \textcolor{comment}{/* Compute the required amount of searchTime needed to finish NF */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00857}00857         \textcolor{keywordflow}{if} (runTime == 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00858}00858                 \textcolor{comment}{/* 8 search windows * 6.4us each */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00859}00859                 searchTime = 8  * 7;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00860}00860         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00861}00861                 \textcolor{comment}{/* 512 * runtime search windows * 6.4us each */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00862}00862                 searchTime = (runTime * 512)  * 7;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00863}00863         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00864}00864 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00865}00865         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00866}00866 \textcolor{comment}{         * Do not read noise floor until it has been updated}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00867}00867 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00868}00868 \textcolor{comment}{         * As a guesstimate -\/ we may only get 1/60th the time on}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00869}00869 \textcolor{comment}{         * the air to see search windows  in a heavily congested}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00870}00870 \textcolor{comment}{         * network (40 us every 2400 us of time)}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00871}00871 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00872}00872         \textcolor{keywordflow}{for} (i = 0; i < 60; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00873}00873                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}}) \& \mbox{\hyperlink{ar5211phy_8h_a45cf6c8a1190154b819e2e3556a4e9d3}{AR\_PHY\_AGC\_CONTROL\_NF}}) == 0)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00874}00874                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00875}00875                 \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(searchTime);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00876}00876         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00877}00877         \textcolor{keywordflow}{if} (i >= 60) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00878}00878                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea1c869e006c3f735c9931040bd2082f02}{HAL\_DEBUG\_NFCAL}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00879}00879                     \textcolor{stringliteral}{"{}NF with runTime \%d failed to end on channel \%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00880}00880                     runTime, \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_curchan-\/>ic\_freq);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00881}00881                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea1c869e006c3f735c9931040bd2082f02}{HAL\_DEBUG\_NFCAL}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00882}00882                     \textcolor{stringliteral}{"{}  PHY NF Reg state:         0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00883}00883                     \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00884}00884                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea1c869e006c3f735c9931040bd2082f02}{HAL\_DEBUG\_NFCAL}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00885}00885                     \textcolor{stringliteral}{"{}  PHY Active Reg state: 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00886}00886                     \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_ad7f16a59bcea7d2df60b7f3b0a5d29d8}{AR\_PHY\_ACTIVE}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00887}00887                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00888}00888         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00889}00889 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00890}00890         \textcolor{keywordflow}{return} \mbox{\hyperlink{ar5211__reset_8c_ad9372736244f2d077e63d4ee24d187b2}{ar5211GetNoiseFloor}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00891}00891 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00892}00892 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00893}00893 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00894}\mbox{\hyperlink{ar5211__reset_8c_a4fd31fe608eeb8532a6b42877288e790}{00894}} \mbox{\hyperlink{ar5211__reset_8c_a4fd31fe608eeb8532a6b42877288e790}{getNoiseFloorThresh}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00895}00895         int16\_t *nft)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00896}00896 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00897}00897         \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00898}00898 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00899}00899         \textcolor{keywordflow}{switch} (chan-\/>ic\_flags \& \mbox{\hyperlink{ah__internal_8h_aa10ba30f6e40d6c5be5f8b4d21794bcb}{IEEE80211\_CHAN\_ALLFULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00900}00900         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_A:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00901}00901                 *nft = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a8098bcb058da69d71ee9136206d0ede2}{ee\_noiseFloorThresh}}[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00902}00902                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00903}00903         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_B:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00904}00904                 *nft = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a8098bcb058da69d71ee9136206d0ede2}{ee\_noiseFloorThresh}}[1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00905}00905                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00906}00906         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_PUREG:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00907}00907                 *nft = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a8098bcb058da69d71ee9136206d0ede2}{ee\_noiseFloorThresh}}[2];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00908}00908                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00909}00909         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00910}00910                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: invalid channel flags 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00911}00911                     \_\_func\_\_, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00912}00912                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00913}00913         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00914}00914         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00915}00915 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00916}00916 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00917}00917 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00918}00918 \textcolor{comment}{ * Read the NF and check it against the noise floor threshold}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00919}00919 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00920}00920 \textcolor{comment}{ * Returns: TRUE if the NF is good}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00921}00921 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00922}00922 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00923}\mbox{\hyperlink{ar5211__reset_8c_ade820d57f34b131fd18d2fa9fef5e5e6}{00923}} \mbox{\hyperlink{ar5211__reset_8c_ade820d57f34b131fd18d2fa9fef5e5e6}{ar5211IsNfGood}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00924}00924 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00925}00925         \mbox{\hyperlink{structHAL__CHANNEL__INTERNAL}{HAL\_CHANNEL\_INTERNAL}} *ichan = \mbox{\hyperlink{ah__internal_8h_a43ec3662d6186b79cd289c466ed900fe}{ath\_hal\_checkchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00926}00926         int16\_t nf, nfThresh;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00927}00927 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00928}00928         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a4fd31fe608eeb8532a6b42877288e790}{getNoiseFloorThresh}}(ah, chan, \&nfThresh))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00929}00929                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00930}00930         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}}) \& \mbox{\hyperlink{ar5211phy_8h_a45cf6c8a1190154b819e2e3556a4e9d3}{AR\_PHY\_AGC\_CONTROL\_NF}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00931}00931                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00932}00932                     \textcolor{stringliteral}{"{}\%s: NF did not complete in calibration window\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00933}00933         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00934}00934         nf = \mbox{\hyperlink{ar5211__reset_8c_ad9372736244f2d077e63d4ee24d187b2}{ar5211GetNoiseFloor}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00935}00935         \textcolor{keywordflow}{if} (nf > nfThresh) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00936}00936                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00937}00937                     \textcolor{stringliteral}{"{}\%s: noise floor failed; detected \%u, threshold \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00938}00938                     \_\_func\_\_, nf, nfThresh);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00939}00939                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00940}00940 \textcolor{comment}{                 * NB: Don't discriminate 2.4 vs 5Ghz, if this}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00941}00941 \textcolor{comment}{                 *     happens it indicates a problem regardless}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00942}00942 \textcolor{comment}{                 *     of the band.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00943}00943 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00944}00944                 chan-\/>ic\_state |= IEEE80211\_CHANSTATE\_CWINT;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00945}00945         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00946}00946         ichan-\/>\mbox{\hyperlink{structHAL__CHANNEL__INTERNAL_ab819e5371a0ecd59795b007a81df2589}{rawNoiseFloor}} = nf;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00947}00947         \textcolor{keywordflow}{return} (nf <= nfThresh);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00948}00948 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00949}00949 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00950}00950 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00951}00951 \textcolor{comment}{ * Peform the noisefloor calibration and check for any constant channel}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00952}00952 \textcolor{comment}{ * interference.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00953}00953 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00954}00954 \textcolor{comment}{ * NOTE: preAR5211 have a lengthy carrier wave detection process -\/ hence}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00955}00955 \textcolor{comment}{ * it is if'ed for MKK regulatory domain only.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00956}00956 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00957}00957 \textcolor{comment}{ * Returns: TRUE for a successful noise floor calibration; else FALSE}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00958}00958 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00959}00959 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00960}\mbox{\hyperlink{ar5211_8h_a24f8f6f7ae60d818e7565344e1f18d3d}{00960}} \mbox{\hyperlink{ar5211__reset_8c_a88273773545507a651ec19940946b42d}{ar5211CalNoiseFloor}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00961}00961 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00962}00962 \textcolor{preprocessor}{\#define N(a)    (sizeof (a) / sizeof (a[0]))}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00963}00963         \textcolor{comment}{/* Check for Carrier Wave interference in MKK regulatory zone */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00964}00964         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion < \mbox{\hyperlink{ar5211reg_8h_aa68f39a7b4367b67addf2e0bf33c2727}{AR\_SREV\_VERSION\_OAHU}} \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00965}00965             (chan-\/>ic\_flags \& \mbox{\hyperlink{ah__internal_8h_ae07a47f938f1f14b52e5ed701cde36b1}{CHANNEL\_NFCREQUIRED}})) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00966}00966                 \textcolor{keyword}{static} \textcolor{keyword}{const} uint8\_t runtime[3] = \{ 0, 2, 7 \};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00967}00967                 \mbox{\hyperlink{structHAL__CHANNEL__INTERNAL}{HAL\_CHANNEL\_INTERNAL}} *ichan = \mbox{\hyperlink{ah__internal_8h_a43ec3662d6186b79cd289c466ed900fe}{ath\_hal\_checkchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00968}00968                 int16\_t nf, nfThresh;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00969}00969                 \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00970}00970 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00971}00971                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a4fd31fe608eeb8532a6b42877288e790}{getNoiseFloorThresh}}(ah, chan, \&nfThresh))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00972}00972                         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00973}00973                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00974}00974 \textcolor{comment}{                 * Run a quick noise floor that will hopefully}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00975}00975 \textcolor{comment}{                 * complete (decrease delay time).}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00976}00976 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00977}00977                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211__reset_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(runtime); i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00978}00978                         nf = \mbox{\hyperlink{ar5211__reset_8c_ab644efdb414e7ffcd95b2f2ef3cede1c}{ar5211RunNoiseFloor}}(ah, runtime[i], 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00979}00979                         \textcolor{keywordflow}{if} (nf > nfThresh) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00980}00980                                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00981}00981                                     \textcolor{stringliteral}{"{}\%s: run failed with \%u > threshold \%u "{}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00982}00982                                     \textcolor{stringliteral}{"{}(runtime \%u)\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00983}00983                                     nf, nfThresh, runtime[i]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00984}00984                                 ichan-\/>\mbox{\hyperlink{structHAL__CHANNEL__INTERNAL_ab819e5371a0ecd59795b007a81df2589}{rawNoiseFloor}} = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00985}00985                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00986}00986                                 ichan-\/>\mbox{\hyperlink{structHAL__CHANNEL__INTERNAL_ab819e5371a0ecd59795b007a81df2589}{rawNoiseFloor}} = nf;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00987}00987                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00988}00988                 \textcolor{keywordflow}{return} (i <= \mbox{\hyperlink{ar5211__reset_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(runtime));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00989}00989         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00990}00990                 \textcolor{comment}{/* Calibrate the noise floor */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00991}00991                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00992}00992                         \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_af3cbda44ba24e143086fb289fdf86826}{AR\_PHY\_AGC\_CONTROL}}) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00993}00993                                  \mbox{\hyperlink{ar5211phy_8h_a45cf6c8a1190154b819e2e3556a4e9d3}{AR\_PHY\_AGC\_CONTROL\_NF}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00994}00994         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00995}00995         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00996}00996 \textcolor{preprocessor}{\#undef N}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00997}00997 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00998}00998 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l00999}00999 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01000}01000 \textcolor{comment}{ * Adjust NF based on statistical values for 5GHz frequencies.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01001}01001 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01002}01002 int16\_t}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01003}\mbox{\hyperlink{ar5211_8h_a4a66a77198d632bde0b6dbedc5fba78a}{01003}} \mbox{\hyperlink{ar5211__reset_8c_a277cd9dcab489ae1316c31ab46fbfd44}{ar5211GetNfAdjust}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \mbox{\hyperlink{structHAL__CHANNEL__INTERNAL}{HAL\_CHANNEL\_INTERNAL}} *c)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01004}01004 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01005}01005         \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01006}01006                 uint16\_t freqLow;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01007}01007                 int16\_t   adjust;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01008}01008         \} adjust5111[] = \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01009}01009                 \{ 5790, 11 \},   \textcolor{comment}{/* NB: ordered high -\/> low */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01010}01010                 \{ 5730, 10 \},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01011}01011                 \{ 5690,  9 \},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01012}01012                 \{ 5660,  8 \},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01013}01013                 \{ 5610,  7 \},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01014}01014                 \{ 5530,  5 \},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01015}01015                 \{ 5450,  4 \},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01016}01016                 \{ 5379,  2 \},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01017}01017                 \{ 5209,  0 \},   \textcolor{comment}{/* XXX? bogus but doesn't matter */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01018}01018                 \{    0,  1 \},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01019}01019         \};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01020}01020         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01021}01021 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01022}01022         \textcolor{keywordflow}{for} (i = 0; c-\/>\mbox{\hyperlink{structHAL__CHANNEL__INTERNAL_afb5a6850ca1450448b70ae862d69dcfd}{channel}} <= adjust5111[i].freqLow; i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01023}01023                 ;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01024}01024         \textcolor{comment}{/* NB: placeholder for 5111's less severe requirement */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01025}01025         \textcolor{keywordflow}{return} adjust5111[i].adjust / 3;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01026}01026 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01027}01027 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01028}01028 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01029}01029 \textcolor{comment}{ * Reads EEPROM header info from device structure and programs}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01030}01030 \textcolor{comment}{ * analog registers 6 and 7}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01031}01031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01032}01032 \textcolor{comment}{ * REQUIRES: Access to the analog device}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01033}01033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01034}01034 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01035}\mbox{\hyperlink{ar5211__reset_8c_ae266d696ac06bbf296b284fd78e07658}{01035}} \mbox{\hyperlink{ar5211__reset_8c_ae266d696ac06bbf296b284fd78e07658}{ar5211SetRf6and7}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01036}01036 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01037}01037 \textcolor{preprocessor}{\#define N(a)    (sizeof (a) / sizeof (a[0]))}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01038}01038         uint16\_t freq = \mbox{\hyperlink{ah__internal_8h_a8aa798a770b881821a7dcf85e7b26ff5}{ath\_hal\_gethwchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01039}01039         \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01040}01040         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01041}01041         uint16\_t rfXpdGain, rfPloSel, rfPwdXpd;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01042}01042         uint16\_t tempOB, tempDB;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01043}01043         uint16\_t freqIndex;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01044}01044         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01045}01045 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01046}01046         freqIndex = IEEE80211\_IS\_CHAN\_2GHZ(chan) ? 2 : 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01047}01047 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01048}01048         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01049}01049 \textcolor{comment}{         * TODO: This array mode correspondes with the index used}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01050}01050 \textcolor{comment}{         *       during the read.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01051}01051 \textcolor{comment}{         * For readability, this should be changed to an enum or \#define}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01052}01052 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01053}01053         \textcolor{keywordflow}{switch} (chan-\/>ic\_flags \& \mbox{\hyperlink{ah__internal_8h_aa10ba30f6e40d6c5be5f8b4d21794bcb}{IEEE80211\_CHAN\_ALLFULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01054}01054         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_A:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01055}01055                 \textcolor{keywordflow}{if} (freq > 4000 \&\& freq < 5260) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01056}01056                         tempOB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5999225ba166b4198926122047bccd3c}{ee\_ob1}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01057}01057                         tempDB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a43593bbd3624c21d91840a7e0618f9ab}{ee\_db1}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01058}01058                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (freq >= 5260 \&\& freq < 5500) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01059}01059                         tempOB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a178b5feab1b367778bd626b4046a92cb}{ee\_ob2}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01060}01060                         tempDB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a41b0e0885024ac26456afeb343e51f1f}{ee\_db2}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01061}01061                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (freq >= 5500 \&\& freq < 5725) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01062}01062                         tempOB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aa2360e84d0cf68b74eb193aa46000466}{ee\_ob3}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01063}01063                         tempDB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5760b0a0d1036f3affe1930f8aa94e5c}{ee\_db3}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01064}01064                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (freq >= 5725) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01065}01065                         tempOB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a8f3e19a8c6e120c8415a33e0c8a6ca4e}{ee\_ob4}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01066}01066                         tempDB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a73fc7645ad1d55d7f867479aaeeeb488}{ee\_db4}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01067}01067                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01068}01068                         \textcolor{comment}{/* XXX panic?? */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01069}01069                         tempOB = tempDB = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01070}01070                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01071}01071 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01072}01072                 rfXpdGain = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a2b52063300bbf09e51d36a71b8927406}{ee\_xgain}}[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01073}01073                 rfPloSel  = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a44560454c70010895a781d704e9bf1e4}{ee\_xpd}}[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01074}01074                 rfPwdXpd  = !ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a44560454c70010895a781d704e9bf1e4}{ee\_xpd}}[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01075}01075 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01076}01076                 ar5211Rf6n7[5][freqIndex]  =}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01077}01077                         (ar5211Rf6n7[5][freqIndex] \& \string~0x10000000) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01078}01078                                 (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5f2d9efd25138b2c3d0e733948ccdef5}{ee\_cornerCal}}.\mbox{\hyperlink{structcornerCalInfo_ad549786f2bddd093a9ca0e2a78927803}{pd84}}<< 28);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01079}01079                 ar5211Rf6n7[6][freqIndex]  =}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01080}01080                         (ar5211Rf6n7[6][freqIndex] \& \string~0x04000000) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01081}01081                                 (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5f2d9efd25138b2c3d0e733948ccdef5}{ee\_cornerCal}}.\mbox{\hyperlink{structcornerCalInfo_a475ac47ae822f3a6afaf065ffa8f10d3}{pd90}} << 26);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01082}01082                 ar5211Rf6n7[21][freqIndex] =}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01083}01083                         (ar5211Rf6n7[21][freqIndex] \& \string~0x08) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01084}01084                                 (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5f2d9efd25138b2c3d0e733948ccdef5}{ee\_cornerCal}}.\mbox{\hyperlink{structcornerCalInfo_a63d4c6439e7f679fdde9e90376763d16}{gSel}} << 3);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01085}01085                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01086}01086         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_B:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01087}01087                 tempOB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a7dfbba4a0d790b7bb58a94f64fd972d4}{ee\_obFor24}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01088}01088                 tempDB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a6434acc897bbc2238a62c439a9d78b37}{ee\_dbFor24}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01089}01089                 rfXpdGain = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a2b52063300bbf09e51d36a71b8927406}{ee\_xgain}}[1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01090}01090                 rfPloSel  = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a44560454c70010895a781d704e9bf1e4}{ee\_xpd}}[1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01091}01091                 rfPwdXpd  = !ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a44560454c70010895a781d704e9bf1e4}{ee\_xpd}}[1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01092}01092                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01093}01093         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_PUREG:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01094}01094                 tempOB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a436123bd9725a787f00c2f17539db0ea}{ee\_obFor24g}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01095}01095                 tempDB = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aaebaeeb0a6b1923cd5b64f8708cfd0b6}{ee\_dbFor24g}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01096}01096                 rfXpdGain = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a2b52063300bbf09e51d36a71b8927406}{ee\_xgain}}[2];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01097}01097                 rfPloSel  = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a44560454c70010895a781d704e9bf1e4}{ee\_xpd}}[2];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01098}01098                 rfPwdXpd  = !ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a44560454c70010895a781d704e9bf1e4}{ee\_xpd}}[2];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01099}01099                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01100}01100         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01101}01101                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: invalid channel flags 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01102}01102                     \_\_func\_\_, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01103}01103                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01104}01104         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01105}01105 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01106}01106         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(1 <= tempOB \&\& tempOB <= 5);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01107}01107         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(1 <= tempDB \&\& tempDB <= 5);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01108}01108 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01109}01109         \textcolor{comment}{/* Set rfXpdGain and rfPwdXpd */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01110}01110         ar5211Rf6n7[11][freqIndex] =  (ar5211Rf6n7[11][freqIndex] \& \string~0xC0) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01111}01111                 (((\mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(rfXpdGain, 4) << 7) | (rfPwdXpd << 6)) \& 0xC0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01112}01112         ar5211Rf6n7[12][freqIndex] =  (ar5211Rf6n7[12][freqIndex] \& \string~0x07) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01113}01113                 ((\mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(rfXpdGain, 4) >> 1) \& 0x07);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01114}01114 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01115}01115         \textcolor{comment}{/* Set OB */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01116}01116         ar5211Rf6n7[12][freqIndex] =  (ar5211Rf6n7[12][freqIndex] \& \string~0x80) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01117}01117                 ((\mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(tempOB, 3) << 7) \& 0x80);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01118}01118         ar5211Rf6n7[13][freqIndex] =  (ar5211Rf6n7[13][freqIndex] \& \string~0x03) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01119}01119                 ((\mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(tempOB, 3) >> 1) \& 0x03);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01120}01120 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01121}01121         \textcolor{comment}{/* Set DB */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01122}01122         ar5211Rf6n7[13][freqIndex] =  (ar5211Rf6n7[13][freqIndex] \& \string~0x1C) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01123}01123                 ((\mbox{\hyperlink{ah_8c_a06d3b4640558879b794e86f233f41b2d}{ath\_hal\_reverseBits}}(tempDB, 3) << 2) \& 0x1C);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01124}01124 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01125}01125         \textcolor{comment}{/* Set rfPloSel */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01126}01126         ar5211Rf6n7[17][freqIndex] =  (ar5211Rf6n7[17][freqIndex] \& \string~0x08) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01127}01127                 ((rfPloSel << 3) \& 0x08);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01128}01128 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01129}01129         \textcolor{comment}{/* Write the Rf registers 6 \& 7 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01130}01130         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211__reset_8c_af04f8faa08e13b16b70b52a56fbc9c53}{N}}(ar5211Rf6n7); i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01131}01131                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, ar5211Rf6n7[i][0], ar5211Rf6n7[i][freqIndex]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01132}01132 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01133}01133         \textcolor{comment}{/* Now that we have reprogrammed rfgain value, clear the flag. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01134}01134         ahp-\/>\mbox{\hyperlink{structath__hal__5211_a3f894742c3a9118721dec16bd7e6a9f2}{ah\_rfgainState}} = \mbox{\hyperlink{ar5211_8h_aae05225933a42f81e7c4a9fb286596f9a59987accbad58499fa3b0d3d02a56809}{RFGAIN\_INACTIVE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01135}01135 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01136}01136         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01137}01137 \textcolor{preprocessor}{\#undef N}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01138}01138 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01139}01139 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01140}01140 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01141}\mbox{\hyperlink{ar5211_8h_a7ed14e8ce39846fd1a5bc01fa8a2dd21}{01141}} \mbox{\hyperlink{ar5211__reset_8c_aa3437771c320bf48e6896b1941a10ecb}{ar5211SetAntennaSwitchInternal}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{ah_8h_a7e5c8f950575db6c632757b79437eeb6}{HAL\_ANT\_SETTING}} settings,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01142}01142         \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01143}01143 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01144}01144 \textcolor{preprocessor}{\#define ANT\_SWITCH\_TABLE1       0x9960}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01145}01145 \textcolor{preprocessor}{\#define ANT\_SWITCH\_TABLE2       0x9964}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01146}01146         \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01147}01147         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01148}01148         uint32\_t antSwitchA, antSwitchB;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01149}01149         \textcolor{keywordtype}{int} ix;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01150}01150 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01151}01151         \textcolor{keywordflow}{switch} (chan-\/>ic\_flags \& \mbox{\hyperlink{ah__internal_8h_aa10ba30f6e40d6c5be5f8b4d21794bcb}{IEEE80211\_CHAN\_ALLFULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01152}01152         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_A:          ix = 0; \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01153}01153         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_B:          ix = 1; \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01154}01154         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_PUREG:      ix = 2; \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01155}01155         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01156}01156                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: invalid channel flags 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01157}01157                     \_\_func\_\_, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01158}01158                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01159}01159         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01160}01160 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01161}01161         antSwitchA =  ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[1][ix]}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01162}01162                    | (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[2][ix] << 6)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01163}01163                    | (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[3][ix] << 12) }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01164}01164                    | (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[4][ix] << 18)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01165}01165                    | (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[5][ix] << 24)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01166}01166                    ;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01167}01167         antSwitchB =  ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[6][ix]}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01168}01168                    | (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[7][ix] << 6)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01169}01169                    | (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[8][ix] << 12)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01170}01170                    | (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[9][ix] << 18)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01171}01171                    | (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[10][ix] << 24)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01172}01172                    ;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01173}01173         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01174}01174 \textcolor{comment}{         * For fixed antenna, give the same setting for both switch banks}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01175}01175 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01176}01176         \textcolor{keywordflow}{switch} (settings) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01177}01177         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a7e5c8f950575db6c632757b79437eeb6af573f3f1770d17656b338b4493c77300}{HAL\_ANT\_FIXED\_A}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01178}01178                 antSwitchB = antSwitchA;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01179}01179                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01180}01180         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a7e5c8f950575db6c632757b79437eeb6a3a753ba227670d160ac834fe71b68cea}{HAL\_ANT\_FIXED\_B}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01181}01181                 antSwitchA = antSwitchB;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01182}01182                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01183}01183         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a7e5c8f950575db6c632757b79437eeb6a6f6e39d7e6c6ffb19bd4b1ea46f054da}{HAL\_ANT\_VARIABLE}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01184}01184                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01185}01185         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01186}01186                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: bad antenna setting \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01187}01187                     \_\_func\_\_, settings);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01188}01188                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01189}01189         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01190}01190         ahp-\/>\mbox{\hyperlink{structath__hal__5211_ae2f8a94defda9a4f3c05f055942e08e1}{ah\_diversityControl}} = settings;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01191}01191 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01192}01192         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211__reset_8c_a628541d2c6f321b13351980c0fe870de}{ANT\_SWITCH\_TABLE1}}, antSwitchA);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01193}01193         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211__reset_8c_a614aa050dd6bfe2cf22b5825fd7f60f7}{ANT\_SWITCH\_TABLE2}}, antSwitchB);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01194}01194 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01195}01195         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01196}01196 \textcolor{preprocessor}{\#undef ANT\_SWITCH\_TABLE1}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01197}01197 \textcolor{preprocessor}{\#undef ANT\_SWITCH\_TABLE2}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01198}01198 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01199}01199 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01200}01200 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01201}01201 \textcolor{comment}{ * Reads EEPROM header info and programs the device for correct operation}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01202}01202 \textcolor{comment}{ * given the channel value}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01203}01203 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01204}01204 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01205}\mbox{\hyperlink{ar5211__reset_8c_a7d8bdf217b5f2ac849e63aed002b6e7f}{01205}} \mbox{\hyperlink{ar5211__reset_8c_a7d8bdf217b5f2ac849e63aed002b6e7f}{ar5211SetBoardValues}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01206}01206 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01207}01207         \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01208}01208         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01209}01209         \textcolor{keywordtype}{int} arrayMode, falseDectectBackoff;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01210}01210 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01211}01211         \textcolor{keywordflow}{switch} (chan-\/>ic\_flags \& \mbox{\hyperlink{ah__internal_8h_aa10ba30f6e40d6c5be5f8b4d21794bcb}{IEEE80211\_CHAN\_ALLFULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01212}01212         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_A:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01213}01213                 arrayMode = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01214}01214                 \mbox{\hyperlink{ah__internal_8h_ab80ff599cda88f9223505d0ecbb53bcd}{OS\_REG\_RMW\_FIELD}}(ah, \mbox{\hyperlink{ar5211phy_8h_af544c44a8a68c588d2fc768ec4c010ac}{AR\_PHY\_FRAME\_CTL}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01215}01215                         \mbox{\hyperlink{ar5211phy_8h_a1eab182586535a796420b5afe490ac00}{AR\_PHY\_FRAME\_CTL\_TX\_CLIP}}, ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5f2d9efd25138b2c3d0e733948ccdef5}{ee\_cornerCal}}.\mbox{\hyperlink{structcornerCalInfo_a33ae111caedee187bef9e228bc93188d}{clip}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01216}01216                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01217}01217         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_B:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01218}01218                 arrayMode = 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01219}01219                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01220}01220         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_PUREG:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01221}01221                 arrayMode = 2;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01222}01222                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01223}01223         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01224}01224                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: invalid channel flags 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01225}01225                     \_\_func\_\_, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01226}01226                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01227}01227         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01228}01228 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01229}01229         \textcolor{comment}{/* Set the antenna register(s) correctly for the chip revision */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01230}01230         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion < \mbox{\hyperlink{ar5211reg_8h_aa68f39a7b4367b67addf2e0bf33c2727}{AR\_SREV\_VERSION\_OAHU}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01231}01231                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(68),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01232}01232                         (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(68)) \& 0xFFFFFFFC) | 0x3);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01233}01233         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01234}01234                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(68),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01235}01235                         (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(68)) \& 0xFFFFFC06) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01236}01236                         (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a4aef828bb85271e326359020bb2b1293}{ee\_antennaControl}}[0][arrayMode] << 4) | 0x1);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01237}01237 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01238}01238                 \mbox{\hyperlink{ar5211__reset_8c_aa3437771c320bf48e6896b1941a10ecb}{ar5211SetAntennaSwitchInternal}}(ah,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01239}01239                         ahp-\/>\mbox{\hyperlink{structath__hal__5211_ae2f8a94defda9a4f3c05f055942e08e1}{ah\_diversityControl}}, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01240}01240 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01241}01241                 \textcolor{comment}{/* Set the Noise Floor Thresh on ar5211 devices */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01242}01242                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (90 << 2),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01243}01243                         (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a8098bcb058da69d71ee9136206d0ede2}{ee\_noiseFloorThresh}}[arrayMode] \& 0x1FF) | (1<<9));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01244}01244         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01245}01245         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (17 << 2),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01246}01246                 (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (17 << 2)) \& 0xFFFFC07F) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01247}01247                 ((ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a713305ce0404c0a840123bbfa000e6d7}{ee\_switchSettling}}[arrayMode] << 7) \& 0x3F80));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01248}01248         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (18 << 2),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01249}01249                 (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (18 << 2)) \& 0xFFFC0FFF) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01250}01250                 ((ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aea4696adabb70827f6b14c16d27c824e}{ee\_txrxAtten}}[arrayMode] << 12) \& 0x3F000));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01251}01251         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (20 << 2),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01252}01252                 (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (20 << 2)) \& 0xFFFF0000) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01253}01253                 ((ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a2ee03108dd2de9b3eed0937545d048b1}{ee\_pgaDesiredSize}}[arrayMode] << 8) \& 0xFF00) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01254}01254                 (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_ac84046735009d04e2c10c31a5ea0bb49}{ee\_adcDesiredSize}}[arrayMode] \& 0x00FF));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01255}01255         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (13 << 2),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01256}01256                 (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_acfc6ba7a6c57c2d50e9b0e7c3e2c0388}{ee\_txEndToXPAOff}}[arrayMode] << 24) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01257}01257                 (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_acfc6ba7a6c57c2d50e9b0e7c3e2c0388}{ee\_txEndToXPAOff}}[arrayMode] << 16) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01258}01258                 (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a61a3f6a7f49ae804178d9e30a498b7ac}{ee\_txFrameToXPAOn}}[arrayMode] << 8) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01259}01259                 ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a61a3f6a7f49ae804178d9e30a498b7ac}{ee\_txFrameToXPAOn}}[arrayMode]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01260}01260         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (10 << 2),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01261}01261                 (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (10 << 2)) \& 0xFFFF00FF) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01262}01262                 (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_ab5fb2536b6ccead5a0ff6cf7baa2075d}{ee\_txEndToXLNAOn}}[arrayMode] << 8));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01263}01263         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (25 << 2),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01264}01264                 (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (25 << 2)) \& 0xFFF80FFF) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01265}01265                 ((ee-\/>\mbox{\hyperlink{structHAL__EEPROM_adb1c1824d7f5b03ccff94cf77d4c3254}{ee\_thresh62}}[arrayMode] << 12) \& 0x7F000));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01266}01266 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01267}01267 \textcolor{preprocessor}{\#define NO\_FALSE\_DETECT\_BACKOFF   2}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01268}01268 \textcolor{preprocessor}{\#define CB22\_FALSE\_DETECT\_BACKOFF 6}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01269}01269         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01270}01270 \textcolor{comment}{         * False detect backoff -\/ suspected 32 MHz spur causes}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01271}01271 \textcolor{comment}{         * false detects in OFDM, causing Tx Hangs.  Decrease}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01272}01272 \textcolor{comment}{         * weak signal sensitivity for this card.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01273}01273 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01274}01274         falseDectectBackoff = \mbox{\hyperlink{ar5211__reset_8c_abe9ef3d7ad626fe1669432ceb68e97d7}{NO\_FALSE\_DETECT\_BACKOFF}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01275}01275         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeversion < \mbox{\hyperlink{ah__eeprom_8h_a8ba49b5b38142c5f1c8a6c37ecf609ac}{AR\_EEPROM\_VER3\_3}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01276}01276                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_subvendorid == 0x1022 \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01277}01277                     IEEE80211\_IS\_CHAN\_OFDM(chan))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01278}01278                         falseDectectBackoff += \mbox{\hyperlink{ar5211__reset_8c_a56e5ef0419dc5bdab4bf1b1c21954e6f}{CB22\_FALSE\_DETECT\_BACKOFF}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01279}01279         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01280}01280                 uint16\_t freq = \mbox{\hyperlink{ah__internal_8h_a8aa798a770b881821a7dcf85e7b26ff5}{ath\_hal\_gethwchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01281}01281                 uint32\_t remainder = freq \% 32;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01282}01282 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01283}01283                 \textcolor{keywordflow}{if} (remainder \&\& (remainder < 10 || remainder > 22))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01284}01284                         falseDectectBackoff += ee-\/>\mbox{\hyperlink{structHAL__EEPROM_ad01d3b9b2d76ac8d0ac10475d3bccbbd}{ee\_falseDetectBackoff}}[arrayMode];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01285}01285         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01286}01286         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, 0x9924,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01287}01287                 (\mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, 0x9924) \& 0xFFFFFF01)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01288}01288                 | ((falseDectectBackoff << 1) \& 0xF7));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01289}01289 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01290}01290         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01291}01291 \textcolor{preprocessor}{\#undef NO\_FALSE\_DETECT\_BACKOFF}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01292}01292 \textcolor{preprocessor}{\#undef CB22\_FALSE\_DETECT\_BACKOFF}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01293}01293 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01294}01294 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01295}01295 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01296}01296 \textcolor{comment}{ * Set the limit on the overall output power.  Used for dynamic}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01297}01297 \textcolor{comment}{ * transmit power control and the like.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01298}01298 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01299}01299 \textcolor{comment}{ * NOTE: The power is passed in is in units of 0.5 dBm.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01300}01300 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01301}01301 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01302}\mbox{\hyperlink{ar5211_8h_a1c08de95a99e2df4c160b184f0d05b0b}{01302}} \mbox{\hyperlink{ar5211__reset_8c_a3ff9ad576bddf066b768f2ffa425854c}{ar5211SetTxPowerLimit}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, uint32\_t limit)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01303}01303 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01304}01304 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01305}01305         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_powerLimit = \mbox{\hyperlink{ah__internal_8h_ac30e119c6b74a0f91da4788b206a3121}{AH\_MIN}}(limit, \mbox{\hyperlink{ah__eeprom_8h_a60a1718acbd203c82cfbc89dfba9d28d}{MAX\_RATE\_POWER}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01306}01306         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_aa721d9c39e364e5b9f0786509d68e17f}{AR\_PHY\_POWER\_TX\_RATE\_MAX}}, limit);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01307}01307         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01308}01308 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01309}01309 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01310}01310 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01311}01311 \textcolor{comment}{ * Sets the transmit power in the baseband for the given}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01312}01312 \textcolor{comment}{ * operating channel and mode.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01313}01313 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01314}01314 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01315}\mbox{\hyperlink{ar5211__reset_8c_aedab42df3abd366fa213b4d4c6eb9f96}{01315}} \mbox{\hyperlink{ar5211__reset_8c_aedab42df3abd366fa213b4d4c6eb9f96}{ar5211SetTransmitPower}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01316}01316 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01317}01317         uint16\_t freq = \mbox{\hyperlink{ah__internal_8h_a8aa798a770b881821a7dcf85e7b26ff5}{ath\_hal\_gethwchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01318}01318         \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01319}01319         \mbox{\hyperlink{structtrgtPowerInfo}{TRGT\_POWER\_INFO}} *pi;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01320}01320         \mbox{\hyperlink{structRD__EDGES__POWER}{RD\_EDGES\_POWER}} *rep;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01321}01321         \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} eepromPcdacs;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01322}01322         u\_int nchan, cfgCtl;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01323}01323         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01324}01324 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01325}01325         \textcolor{comment}{/* setup the pcdac struct to point to the correct info, based on mode */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01326}01326         \textcolor{keywordflow}{switch} (chan-\/>ic\_flags \& \mbox{\hyperlink{ah__internal_8h_aa10ba30f6e40d6c5be5f8b4d21794bcb}{IEEE80211\_CHAN\_ALLFULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01327}01327         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_A:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01328}01328                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a990ae16ba943c44f97d3ebcb56ae570b}{numChannels}} = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aa6c09ea3c4d59b137fd257cc15a9c2b6}{ee\_numChannels11a}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01329}01329                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a3e9b6cf4ec86c221c9176bd399423e45}{pChannelList}}= ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a0c5a27571153400f301a0e34d3c7057b}{ee\_channels11a}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01330}01330                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a85f108677c90ae9e7ae97aadb6a69456}{pDataPerChannel}} = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a47673fe975463a502f9c50df4be5c9c9}{ee\_dataPerChannel11a}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01331}01331                 nchan = ee-\/>ee\_numTargetPwr\_11a;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01332}01332                 pi = ee-\/>ee\_trgtPwr\_11a;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01333}01333                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01334}01334         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_PUREG:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01335}01335                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a990ae16ba943c44f97d3ebcb56ae570b}{numChannels}} = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aacd01385a33c99cc5e7fa8b5a7f4fa1e}{ee\_numChannels2\_4}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01336}01336                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a3e9b6cf4ec86c221c9176bd399423e45}{pChannelList}}= ee-\/>\mbox{\hyperlink{structHAL__EEPROM_ae34141e5162bf65cb058620f6f16f61b}{ee\_channels11g}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01337}01337                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a85f108677c90ae9e7ae97aadb6a69456}{pDataPerChannel}} = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_accb6105cc52d4194a47b29bdcd8437c2}{ee\_dataPerChannel11g}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01338}01338                 nchan = ee-\/>ee\_numTargetPwr\_11g;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01339}01339                 pi = ee-\/>ee\_trgtPwr\_11g;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01340}01340                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01341}01341         \textcolor{keywordflow}{case} IEEE80211\_CHAN\_B:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01342}01342                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a990ae16ba943c44f97d3ebcb56ae570b}{numChannels}} = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aacd01385a33c99cc5e7fa8b5a7f4fa1e}{ee\_numChannels2\_4}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01343}01343                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a3e9b6cf4ec86c221c9176bd399423e45}{pChannelList}}= ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a7b6b8e283e261a2f78e6706332689fa6}{ee\_channels11b}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01344}01344                 eepromPcdacs.\mbox{\hyperlink{structpcdacsEeprom_a85f108677c90ae9e7ae97aadb6a69456}{pDataPerChannel}} = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a9fcc97bf1ba38b7d8dee1ca209a2682e}{ee\_dataPerChannel11b}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01345}01345                 nchan = ee-\/>ee\_numTargetPwr\_11b;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01346}01346                 pi = ee-\/>ee\_trgtPwr\_11b;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01347}01347                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01348}01348         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01349}01349                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: invalid channel flags 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01350}01350                     \_\_func\_\_, chan-\/>ic\_flags);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01351}01351                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01352}01352         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01353}01353 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01354}01354         \mbox{\hyperlink{ar5211__reset_8c_a665bb511b45cdd65287d4781a08f89a8}{ar5211SetPowerTable}}(ah, \&eepromPcdacs, freq);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01355}01355 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01356}01356         rep = \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01357}01357         \textcolor{comment}{/* Match CTL to EEPROM value */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01358}01358         cfgCtl = \mbox{\hyperlink{ah__internal_8h_a195ff223d41f767e8e1aaff18a914c70}{ath\_hal\_getctl}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01359}01359         \textcolor{keywordflow}{for} (i = 0; i < ee-\/>\mbox{\hyperlink{structHAL__EEPROM_ab9c2134444c5db5462395be130a701dd}{ee\_numCtls}}; i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01360}01360                 \textcolor{keywordflow}{if} (ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aed7cc333a31ccecfc9a318ec37a157ef}{ee\_ctl}}[i] != 0 \&\& ee-\/>\mbox{\hyperlink{structHAL__EEPROM_aed7cc333a31ccecfc9a318ec37a157ef}{ee\_ctl}}[i] == cfgCtl) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01361}01361                         rep = \&ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a0cd9191d121e0b02f0391a7bc855c25b}{ee\_rdEdgesPower}}[i * \mbox{\hyperlink{ah__eeprom__9287_8h_af3fd05475d9b55d3a1988070b5d26ddb}{NUM\_EDGES}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01362}01362                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01363}01363                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01364}01364         \mbox{\hyperlink{ar5211__reset_8c_acb60fa8b312cd28560b5373576f4c29d}{ar5211SetRateTable}}(ah, rep, pi, nchan, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01365}01365 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01366}01366         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01367}01367 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01368}01368 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01369}01369 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01370}01370 \textcolor{comment}{ * Read the transmit power levels from the structures taken}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01371}01371 \textcolor{comment}{ * from EEPROM. Interpolate read transmit power values for}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01372}01372 \textcolor{comment}{ * this channel. Organize the transmit power values into a}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01373}01373 \textcolor{comment}{ * table for writing into the hardware.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01374}01374 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01375}01375 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01376}\mbox{\hyperlink{ar5211__reset_8c_a665bb511b45cdd65287d4781a08f89a8}{01376}} \mbox{\hyperlink{ar5211__reset_8c_a665bb511b45cdd65287d4781a08f89a8}{ar5211SetPowerTable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} *pSrcStruct,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01377}01377         uint16\_t channel)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01378}01378 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01379}01379         \textcolor{keyword}{static} \mbox{\hyperlink{structfullPcdacStruct}{FULL\_PCDAC\_STRUCT}} pcdacStruct;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01380}01380         \textcolor{keyword}{static} uint16\_t pcdacTable[\mbox{\hyperlink{ah__eeprom__v3_8h_aabaa8deb5f9cf69c70fa1527a4a1e4c7}{PWR\_TABLE\_SIZE}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01381}01381 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01382}01382         uint16\_t         i, j;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01383}01383         uint16\_t         *pPcdacValues;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01384}01384         int16\_t   *pScaledUpDbm;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01385}01385         int16\_t   minScaledPwr;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01386}01386         int16\_t   maxScaledPwr;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01387}01387         int16\_t   pwr;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01388}01388         uint16\_t         pcdacMin = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01389}01389         uint16\_t         pcdacMax = 63;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01390}01390         uint16\_t         pcdacTableIndex;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01391}01391         uint16\_t         scaledPcdac;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01392}01392         uint32\_t         addr;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01393}01393         uint32\_t         temp32;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01394}01394 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01395}01395         \mbox{\hyperlink{ah__osdep_8h_a7fe5b3aa939ce794d6247468c5389e1a}{OS\_MEMZERO}}(\&pcdacStruct, \textcolor{keyword}{sizeof}(\mbox{\hyperlink{structfullPcdacStruct}{FULL\_PCDAC\_STRUCT}}));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01396}01396         \mbox{\hyperlink{ah__osdep_8h_a7fe5b3aa939ce794d6247468c5389e1a}{OS\_MEMZERO}}(pcdacTable, \textcolor{keyword}{sizeof}(uint16\_t) * \mbox{\hyperlink{ah__eeprom__v3_8h_aabaa8deb5f9cf69c70fa1527a4a1e4c7}{PWR\_TABLE\_SIZE}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01397}01397         pPcdacValues = pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_ad4e86b5636a2a3c04af8efd6afd01d54}{PcdacValues}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01398}01398         pScaledUpDbm = pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_a091fc9d955266eb8f6534c34a3bcc51a}{PwrValues}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01399}01399 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01400}01400         \textcolor{comment}{/* Initialize the pcdacs to dBM structs pcdacs to be 1 to 63 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01401}01401         \textcolor{keywordflow}{for} (i = \mbox{\hyperlink{ah__eeprom__v3_8h_a8a6a607e4e01cd094e98c2d3466235f0}{PCDAC\_START}}, j = 0; i <= \mbox{\hyperlink{ah__eeprom__v3_8h_a643f5eb8992af95c2773cb3ff91eb744}{PCDAC\_STOP}}; i+= \mbox{\hyperlink{ah__eeprom__v3_8h_ad2b3e7db7dda63e958a375abeb2c37ef}{PCDAC\_STEP}}, j++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01402}01402                 pPcdacValues[j] = i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01403}01403 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01404}01404         pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_adcfdff45c8c52849fb62a58ad3b1c3a2}{numPcdacValues}} = j;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01405}01405         pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_a871f0b536681ff7e2a56dd6c0c28c46b}{pcdacMin}} = \mbox{\hyperlink{ah__eeprom__v3_8h_a8a6a607e4e01cd094e98c2d3466235f0}{PCDAC\_START}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01406}01406         pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_a6a9af3984187ca631a19c04153fc9352}{pcdacMax}} = \mbox{\hyperlink{ah__eeprom__v3_8h_a643f5eb8992af95c2773cb3ff91eb744}{PCDAC\_STOP}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01407}01407 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01408}01408         \textcolor{comment}{/* Fill out the power values for this channel */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01409}01409         \textcolor{keywordflow}{for} (j = 0; j < pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_adcfdff45c8c52849fb62a58ad3b1c3a2}{numPcdacValues}}; j++ )}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01410}01410                 pScaledUpDbm[j] = \mbox{\hyperlink{ar5211__reset_8c_ae493ba2c1980b5c8654009ade758e45a}{ar5211GetScaledPower}}(channel, pPcdacValues[j], pSrcStruct);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01411}01411 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01412}01412         \textcolor{comment}{/* Now scale the pcdac values to fit in the 64 entry power table */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01413}01413         minScaledPwr = pScaledUpDbm[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01414}01414         maxScaledPwr = pScaledUpDbm[pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_adcfdff45c8c52849fb62a58ad3b1c3a2}{numPcdacValues}} -\/ 1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01415}01415 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01416}01416         \textcolor{comment}{/* find minimum and make monotonic */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01417}01417         \textcolor{keywordflow}{for} (j = 0; j < pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_adcfdff45c8c52849fb62a58ad3b1c3a2}{numPcdacValues}}; j++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01418}01418                 \textcolor{keywordflow}{if} (minScaledPwr >= pScaledUpDbm[j]) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01419}01419                         minScaledPwr = pScaledUpDbm[j];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01420}01420                         pcdacMin = j;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01421}01421                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01422}01422                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01423}01423 \textcolor{comment}{                 * Make the full\_hsh monotonically increasing otherwise}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01424}01424 \textcolor{comment}{                 * interpolation algorithm will get fooled gotta start}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01425}01425 \textcolor{comment}{                 * working from the top, hence i = 63 -\/ j.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01426}01426 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01427}01427                 i = (uint16\_t)(pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_adcfdff45c8c52849fb62a58ad3b1c3a2}{numPcdacValues}} -\/ 1 -\/ j);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01428}01428                 \textcolor{keywordflow}{if} (i == 0)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01429}01429                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01430}01430                 \textcolor{keywordflow}{if} (pScaledUpDbm[i-\/1] > pScaledUpDbm[i]) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01431}01431                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01432}01432 \textcolor{comment}{                         * It could be a glitch, so make the power for}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01433}01433 \textcolor{comment}{                         * this pcdac the same as the power from the}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01434}01434 \textcolor{comment}{                         * next highest pcdac.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01435}01435 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01436}01436                         pScaledUpDbm[i -\/ 1] = pScaledUpDbm[i];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01437}01437                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01438}01438         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01439}01439 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01440}01440         \textcolor{keywordflow}{for} (j = 0; j < pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_adcfdff45c8c52849fb62a58ad3b1c3a2}{numPcdacValues}}; j++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01441}01441                 \textcolor{keywordflow}{if} (maxScaledPwr < pScaledUpDbm[j]) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01442}01442                         maxScaledPwr = pScaledUpDbm[j];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01443}01443                         pcdacMax = j;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01444}01444                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01445}01445 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01446}01446         \textcolor{comment}{/* Find the first power level with a pcdac */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01447}01447         pwr = (uint16\_t)(\mbox{\hyperlink{ah__eeprom__v3_8h_aba6f2e71b8dd65795dd6677b1926b247}{PWR\_STEP}} * ((minScaledPwr -\/ \mbox{\hyperlink{ah__eeprom__v3_8h_a7bc683a872c7ca77fccc90591fb08af4}{PWR\_MIN}} + \mbox{\hyperlink{ah__eeprom__v3_8h_aba6f2e71b8dd65795dd6677b1926b247}{PWR\_STEP}} / 2) / \mbox{\hyperlink{ah__eeprom__v3_8h_aba6f2e71b8dd65795dd6677b1926b247}{PWR\_STEP}})  + \mbox{\hyperlink{ah__eeprom__v3_8h_a7bc683a872c7ca77fccc90591fb08af4}{PWR\_MIN}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01448}01448 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01449}01449         \textcolor{comment}{/* Write all the first pcdac entries based off the pcdacMin */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01450}01450         pcdacTableIndex = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01451}01451         \textcolor{keywordflow}{for} (i = 0; i < (2 * (pwr -\/ \mbox{\hyperlink{ah__eeprom__v3_8h_a7bc683a872c7ca77fccc90591fb08af4}{PWR\_MIN}}) / \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} + 1); i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01452}01452                 pcdacTable[pcdacTableIndex++] = pcdacMin;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01453}01453 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01454}01454         i = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01455}01455         \textcolor{keywordflow}{while} (pwr < pScaledUpDbm[pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_adcfdff45c8c52849fb62a58ad3b1c3a2}{numPcdacValues}} -\/ 1]) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01456}01456                 pwr += \mbox{\hyperlink{ah__eeprom__v3_8h_aba6f2e71b8dd65795dd6677b1926b247}{PWR\_STEP}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01457}01457                 \textcolor{comment}{/* stop if dbM > max\_power\_possible */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01458}01458                 \textcolor{keywordflow}{while} (pwr < pScaledUpDbm[pcdacStruct.\mbox{\hyperlink{structfullPcdacStruct_adcfdff45c8c52849fb62a58ad3b1c3a2}{numPcdacValues}} -\/ 1] \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01459}01459                        (pwr -\/ pScaledUpDbm[i])*(pwr -\/ pScaledUpDbm[i+1]) > 0)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01460}01460                         i++;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01461}01461                 \textcolor{comment}{/* scale by 2 and add 1 to enable round up or down as needed */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01462}01462                 scaledPcdac = (uint16\_t)(\mbox{\hyperlink{ar5211__reset_8c_af7c8bbd712238de0779ffe911fb6bd1a}{ar5211GetInterpolatedValue}}(pwr,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01463}01463                                 pScaledUpDbm[i], pScaledUpDbm[i+1],}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01464}01464                                 (uint16\_t)(pPcdacValues[i] * 2),}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01465}01465                                 (uint16\_t)(pPcdacValues[i+1] * 2), 0) + 1);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01466}01466 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01467}01467                 pcdacTable[pcdacTableIndex] = scaledPcdac / 2;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01468}01468                 \textcolor{keywordflow}{if} (pcdacTable[pcdacTableIndex] > pcdacMax)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01469}01469                         pcdacTable[pcdacTableIndex] = pcdacMax;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01470}01470                 pcdacTableIndex++;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01471}01471         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01472}01472 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01473}01473         \textcolor{comment}{/* Write all the last pcdac entries based off the last valid pcdac */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01474}01474         \textcolor{keywordflow}{while} (pcdacTableIndex < \mbox{\hyperlink{ah__eeprom__v3_8h_aabaa8deb5f9cf69c70fa1527a4a1e4c7}{PWR\_TABLE\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01475}01475                 pcdacTable[pcdacTableIndex] = pcdacTable[pcdacTableIndex -\/ 1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01476}01476                 pcdacTableIndex++;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01477}01477         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01478}01478 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01479}01479         \textcolor{comment}{/* Finally, write the power values into the baseband power table */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01480}01480         addr = \mbox{\hyperlink{ar5210phy_8h_a2000723342e695c00dc9e00102852d64}{AR\_PHY\_BASE}} + (608 << 2);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01481}01481         \textcolor{keywordflow}{for} (i = 0; i < 32; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01482}01482                 temp32 = 0xffff \& ((pcdacTable[2 * i + 1] << 8) | 0xff);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01483}01483                 temp32 = (temp32 << 16) | (0xffff \& ((pcdacTable[2 * i] << 8) | 0xff));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01484}01484                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, addr, temp32);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01485}01485                 addr += 4;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01486}01486         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01487}01487 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01488}01488 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01489}01489 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01490}01490 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01491}01491 \textcolor{comment}{ * Set the transmit power in the baseband for the given}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01492}01492 \textcolor{comment}{ * operating channel and mode.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01493}01493 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01494}01494 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01495}\mbox{\hyperlink{ar5211__reset_8c_acb60fa8b312cd28560b5373576f4c29d}{01495}} \mbox{\hyperlink{ar5211__reset_8c_acb60fa8b312cd28560b5373576f4c29d}{ar5211SetRateTable}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{structRD__EDGES__POWER}{RD\_EDGES\_POWER}} *pRdEdgesPower,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01496}01496         \mbox{\hyperlink{structtrgtPowerInfo}{TRGT\_POWER\_INFO}} *pPowerInfo, uint16\_t numChannels,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01497}01497         \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01498}01498 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01499}01499         uint16\_t freq = \mbox{\hyperlink{ah__internal_8h_a8aa798a770b881821a7dcf85e7b26ff5}{ath\_hal\_gethwchannel}}(ah, chan);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01500}01500         \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01501}01501         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01502}01502         \textcolor{keyword}{static} uint16\_t ratesArray[\mbox{\hyperlink{ar5211__reset_8c_a645e6e4b2b86edabb8055e43055b1b02}{NUM\_RATES}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01503}01503         \textcolor{keyword}{static} \textcolor{keyword}{const} uint16\_t tpcScaleReductionTable[5] =}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01504}01504                 \{ 0, 3, 6, 9, \mbox{\hyperlink{ah__eeprom_8h_a60a1718acbd203c82cfbc89dfba9d28d}{MAX\_RATE\_POWER}} \};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01505}01505 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01506}01506         uint16\_t        *pRatesPower;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01507}01507         uint16\_t        lowerChannel, lowerIndex=0, lowerPower=0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01508}01508         uint16\_t        upperChannel, upperIndex=0, upperPower=0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01509}01509         uint16\_t        twiceMaxEdgePower=63;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01510}01510         uint16\_t        twicePower = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01511}01511         uint16\_t        i, numEdges;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01512}01512         uint16\_t        tempChannelList[\mbox{\hyperlink{ah__eeprom__9287_8h_af3fd05475d9b55d3a1988070b5d26ddb}{NUM\_EDGES}}]; \textcolor{comment}{/* temp array for holding edge channels */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01513}01513         uint16\_t        twiceMaxRDPower;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01514}01514         int16\_t  scaledPower = 0;               \textcolor{comment}{/* for gcc -\/O2 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01515}01515         uint16\_t        mask = 0x3f;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01516}01516         \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}          paPreDEnable = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01517}01517         int8\_t    twiceAntennaGain, twiceAntennaReduction = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01518}01518 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01519}01519         pRatesPower = ratesArray;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01520}01520         twiceMaxRDPower = chan-\/>ic\_maxregpower * 2;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01521}01521 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01522}01522         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_5GHZ(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01523}01523                 twiceAntennaGain = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a69e2e52415cf2140313ca2537bd90c1a}{ee\_antennaGainMax}}[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01524}01524         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01525}01525                 twiceAntennaGain = ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a69e2e52415cf2140313ca2537bd90c1a}{ee\_antennaGainMax}}[1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01526}01526         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01527}01527 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01528}01528         twiceAntennaReduction = \mbox{\hyperlink{ah__internal_8h_a1632f664a910ac6d4c326bb37c01d6dc}{ath\_hal\_getantennareduction}}(ah, chan, twiceAntennaGain);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01529}01529 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01530}01530         \textcolor{keywordflow}{if} (pRdEdgesPower) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01531}01531                 \textcolor{comment}{/* Get the edge power */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01532}01532                 \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ah__eeprom__9287_8h_af3fd05475d9b55d3a1988070b5d26ddb}{NUM\_EDGES}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01533}01533                         \textcolor{keywordflow}{if} (pRdEdgesPower[i].rdEdge == 0)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01534}01534                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01535}01535                         tempChannelList[i] = pRdEdgesPower[i].\mbox{\hyperlink{structRD__EDGES__POWER_af7339256cedd3cc7a8c3bb9f510f9517}{rdEdge}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01536}01536                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01537}01537                 numEdges = i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01538}01538 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01539}01539                 \mbox{\hyperlink{ar5211__reset_8c_a0525b0fa3ecd4d2e55c6067548f2ce53}{ar5211GetLowerUpperValues}}(freq, tempChannelList,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01540}01540                         numEdges, \&lowerChannel, \&upperChannel);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01541}01541                 \textcolor{comment}{/* Get the index for this channel */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01542}01542                 \textcolor{keywordflow}{for} (i = 0; i < numEdges; i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01543}01543                         \textcolor{keywordflow}{if} (lowerChannel == tempChannelList[i])}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01544}01544                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01545}01545                 \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(i != numEdges);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01546}01546 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01547}01547                 \textcolor{keywordflow}{if} ((lowerChannel == upperChannel \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01548}01548                      lowerChannel == freq) ||}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01549}01549                     pRdEdgesPower[i].flag) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01550}01550                         twiceMaxEdgePower = pRdEdgesPower[i].\mbox{\hyperlink{structRD__EDGES__POWER_a29e27a36210b15a460d080e3c4fc8405}{twice\_rdEdgePower}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01551}01551                         \mbox{\hyperlink{ah__internal_8h_abb8bdaf7438fdc315b333ab07ed68c9c}{HALASSERT}}(twiceMaxEdgePower > 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01552}01552                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01553}01553         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01554}01554 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01555}01555         \textcolor{comment}{/* extrapolate the power values for the test Groups */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01556}01556         \textcolor{keywordflow}{for} (i = 0; i < numChannels; i++)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01557}01557                 tempChannelList[i] = pPowerInfo[i].testChannel;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01558}01558 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01559}01559         \mbox{\hyperlink{ar5211__reset_8c_a0525b0fa3ecd4d2e55c6067548f2ce53}{ar5211GetLowerUpperValues}}(freq, tempChannelList,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01560}01560                 numChannels, \&lowerChannel, \&upperChannel);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01561}01561 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01562}01562         \textcolor{comment}{/* get the index for the channel */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01563}01563         \textcolor{keywordflow}{for} (i = 0; i < numChannels; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01564}01564                 \textcolor{keywordflow}{if} (lowerChannel == tempChannelList[i])}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01565}01565                         lowerIndex = i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01566}01566                 \textcolor{keywordflow}{if} (upperChannel == tempChannelList[i]) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01567}01567                         upperIndex = i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01568}01568                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01569}01569                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01570}01570         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01571}01571 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01572}01572         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{ar5211__reset_8c_a645e6e4b2b86edabb8055e43055b1b02}{NUM\_RATES}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01573}01573                 \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_OFDM(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01574}01574                         \textcolor{comment}{/* power for rates 6,9,12,18,24 is all the same */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01575}01575                         \textcolor{keywordflow}{if} (i < 5) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01576}01576                                 lowerPower = pPowerInfo[lowerIndex].\mbox{\hyperlink{structtrgtPowerInfo_a46920baec1ffaea73aa2dd31fe3ce7c3}{twicePwr6\_24}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01577}01577                                 upperPower = pPowerInfo[upperIndex].\mbox{\hyperlink{structtrgtPowerInfo_a46920baec1ffaea73aa2dd31fe3ce7c3}{twicePwr6\_24}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01578}01578                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (i == 5) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01579}01579                                 lowerPower = pPowerInfo[lowerIndex].\mbox{\hyperlink{structtrgtPowerInfo_aee8fa04c9ae9289f8b1348944365389e}{twicePwr36}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01580}01580                                 upperPower = pPowerInfo[upperIndex].\mbox{\hyperlink{structtrgtPowerInfo_aee8fa04c9ae9289f8b1348944365389e}{twicePwr36}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01581}01581                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (i == 6) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01582}01582                                 lowerPower = pPowerInfo[lowerIndex].\mbox{\hyperlink{structtrgtPowerInfo_a3fc15e47f5fdf07b5ff998ac7214b96a}{twicePwr48}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01583}01583                                 upperPower = pPowerInfo[upperIndex].\mbox{\hyperlink{structtrgtPowerInfo_a3fc15e47f5fdf07b5ff998ac7214b96a}{twicePwr48}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01584}01584                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (i == 7) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01585}01585                                 lowerPower = pPowerInfo[lowerIndex].\mbox{\hyperlink{structtrgtPowerInfo_a1ca8179cb3f59f582251f7f240fa07a1}{twicePwr54}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01586}01586                                 upperPower = pPowerInfo[upperIndex].\mbox{\hyperlink{structtrgtPowerInfo_a1ca8179cb3f59f582251f7f240fa07a1}{twicePwr54}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01587}01587                         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01588}01588                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01589}01589                         \textcolor{keywordflow}{switch} (i) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01590}01590                         \textcolor{keywordflow}{case} 0:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01591}01591                         \textcolor{keywordflow}{case} 1:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01592}01592                                 lowerPower = pPowerInfo[lowerIndex].\mbox{\hyperlink{structtrgtPowerInfo_a46920baec1ffaea73aa2dd31fe3ce7c3}{twicePwr6\_24}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01593}01593                                 upperPower = pPowerInfo[upperIndex].\mbox{\hyperlink{structtrgtPowerInfo_a46920baec1ffaea73aa2dd31fe3ce7c3}{twicePwr6\_24}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01594}01594                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01595}01595                         \textcolor{keywordflow}{case} 2:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01596}01596                         \textcolor{keywordflow}{case} 3:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01597}01597                                 lowerPower = pPowerInfo[lowerIndex].\mbox{\hyperlink{structtrgtPowerInfo_aee8fa04c9ae9289f8b1348944365389e}{twicePwr36}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01598}01598                                 upperPower = pPowerInfo[upperIndex].\mbox{\hyperlink{structtrgtPowerInfo_aee8fa04c9ae9289f8b1348944365389e}{twicePwr36}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01599}01599                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01600}01600                         \textcolor{keywordflow}{case} 4:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01601}01601                         \textcolor{keywordflow}{case} 5:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01602}01602                                 lowerPower = pPowerInfo[lowerIndex].\mbox{\hyperlink{structtrgtPowerInfo_a3fc15e47f5fdf07b5ff998ac7214b96a}{twicePwr48}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01603}01603                                 upperPower = pPowerInfo[upperIndex].\mbox{\hyperlink{structtrgtPowerInfo_a3fc15e47f5fdf07b5ff998ac7214b96a}{twicePwr48}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01604}01604                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01605}01605                         \textcolor{keywordflow}{case} 6:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01606}01606                         \textcolor{keywordflow}{case} 7:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01607}01607                                 lowerPower = pPowerInfo[lowerIndex].\mbox{\hyperlink{structtrgtPowerInfo_a1ca8179cb3f59f582251f7f240fa07a1}{twicePwr54}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01608}01608                                 upperPower = pPowerInfo[upperIndex].\mbox{\hyperlink{structtrgtPowerInfo_a1ca8179cb3f59f582251f7f240fa07a1}{twicePwr54}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01609}01609                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01610}01610                         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01611}01611                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01612}01612 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01613}01613                 twicePower = \mbox{\hyperlink{ar5211__reset_8c_af7c8bbd712238de0779ffe911fb6bd1a}{ar5211GetInterpolatedValue}}(freq,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01614}01614                         lowerChannel, upperChannel, lowerPower, upperPower, 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01615}01615 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01616}01616                 \textcolor{comment}{/* Reduce power by band edge restrictions */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01617}01617                 twicePower = \mbox{\hyperlink{ah__internal_8h_ac30e119c6b74a0f91da4788b206a3121}{AH\_MIN}}(twicePower, twiceMaxEdgePower);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01618}01618 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01619}01619                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01620}01620 \textcolor{comment}{                 * If turbo is set, reduce power to keep power}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01621}01621 \textcolor{comment}{                 * consumption under 2 Watts.  Note that we always do}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01622}01622 \textcolor{comment}{                 * this unless specially configured.  Then we limit}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01623}01623 \textcolor{comment}{                 * power only for non-\/AP operation.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01624}01624 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01625}01625                 \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_TURBO(chan) \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01626}01626                     \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeversion >= \mbox{\hyperlink{ah__eeprom_8h_a290d6128e664a89fbfef32fddf72f599}{AR\_EEPROM\_VER3\_1}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01627}01627 \#ifdef AH\_ENABLE\_AP\_SUPPORT}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01628}01628                     \&\& \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_opmode != \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3ae7ab5162a6e449287d9e8c63a4c4e628}{HAL\_M\_HOSTAP}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01629}01629 \#endif}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01630}01630                 ) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01631}01631                         twicePower = \mbox{\hyperlink{ah__internal_8h_ac30e119c6b74a0f91da4788b206a3121}{AH\_MIN}}(twicePower, ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a9592be7c1784ac4388899176a391b514}{ee\_turbo2WMaxPower5}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01632}01632                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01633}01633 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01634}01634                 \textcolor{comment}{/* Reduce power by max regulatory domain allowed restrictions */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01635}01635                 pRatesPower[i] = \mbox{\hyperlink{ah__internal_8h_ac30e119c6b74a0f91da4788b206a3121}{AH\_MIN}}(twicePower, twiceMaxRDPower -\/ twiceAntennaReduction);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01636}01636 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01637}01637                 \textcolor{comment}{/* Use 6 Mb power level for transmit power scaling reduction */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01638}01638                 \textcolor{comment}{/* We don't want to reduce higher rates if its not needed */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01639}01639                 \textcolor{keywordflow}{if} (i == 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01640}01640                         scaledPower = pRatesPower[0] -\/}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01641}01641                                 (tpcScaleReductionTable[\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_tpScale] * 2);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01642}01642                         \textcolor{keywordflow}{if} (scaledPower < 1)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01643}01643                                 scaledPower = 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01644}01644                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01645}01645 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01646}01646                 pRatesPower[i] = \mbox{\hyperlink{ah__internal_8h_ac30e119c6b74a0f91da4788b206a3121}{AH\_MIN}}(pRatesPower[i], scaledPower);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01647}01647         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01648}01648 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01649}01649         \textcolor{comment}{/* Record txPower at Rate 6 for info gathering */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01650}01650         ahp-\/>\mbox{\hyperlink{structath__hal__5211_aefeecc6dd299e4ed849133f358b714de}{ah\_tx6PowerInHalfDbm}} = pRatesPower[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01651}01651 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01652}01652 \textcolor{preprocessor}{\#ifdef AH\_DEBUG}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01653}01653         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea3476c6e4fcd910454cfdda4f7f0f25e6}{HAL\_DEBUG\_RESET}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01654}01654             \textcolor{stringliteral}{"{}\%s: final output power setting \%d MHz:\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01655}01655             \_\_func\_\_, chan-\/>ic\_freq);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01656}01656         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea3476c6e4fcd910454cfdda4f7f0f25e6}{HAL\_DEBUG\_RESET}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01657}01657             \textcolor{stringliteral}{"{}6 Mb \%d dBm, MaxRD: \%d dBm, MaxEdge \%d dBm\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01658}01658             scaledPower / 2, twiceMaxRDPower / 2, twiceMaxEdgePower / 2);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01659}01659         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea3476c6e4fcd910454cfdda4f7f0f25e6}{HAL\_DEBUG\_RESET}}, \textcolor{stringliteral}{"{}TPC Scale \%d dBm -\/ Ant Red \%d dBm\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01660}01660             tpcScaleReductionTable[\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_tpScale] * 2,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01661}01661             twiceAntennaReduction / 2);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01662}01662         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_TURBO(chan) \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01663}01663             \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeversion >= \mbox{\hyperlink{ah__eeprom_8h_a290d6128e664a89fbfef32fddf72f599}{AR\_EEPROM\_VER3\_1}})}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01664}01664                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea3476c6e4fcd910454cfdda4f7f0f25e6}{HAL\_DEBUG\_RESET}}, \textcolor{stringliteral}{"{}Max Turbo \%d dBm\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01665}01665                     ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a9592be7c1784ac4388899176a391b514}{ee\_turbo2WMaxPower5}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01666}01666         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea3476c6e4fcd910454cfdda4f7f0f25e6}{HAL\_DEBUG\_RESET}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01667}01667             \textcolor{stringliteral}{"{}  \%2d | \%2d | \%2d | \%2d | \%2d | \%2d | \%2d | \%2d dBm\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01668}01668             pRatesPower[0] / 2, pRatesPower[1] / 2, pRatesPower[2] / 2,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01669}01669             pRatesPower[3] / 2, pRatesPower[4] / 2, pRatesPower[5] / 2,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01670}01670             pRatesPower[6] / 2, pRatesPower[7] / 2);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01671}01671 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* AH\_DEBUG */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01672}01672 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01673}01673         \textcolor{comment}{/* Write the power table into the hardware */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01674}01674         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_a6f360d3d9130aa931a281304257a56cb}{AR\_PHY\_POWER\_TX\_RATE1}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01675}01675                  ((paPreDEnable \& 1)<< 30) | ((pRatesPower[3] \& mask) << 24) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01676}01676                  ((paPreDEnable \& 1)<< 22) | ((pRatesPower[2] \& mask) << 16) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01677}01677                  ((paPreDEnable \& 1)<< 14) | ((pRatesPower[1] \& mask) << 8) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01678}01678                  ((paPreDEnable \& 1)<< 6 ) |  (pRatesPower[0] \& mask));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01679}01679         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_a06ea3949799b15150a687875d659f248}{AR\_PHY\_POWER\_TX\_RATE2}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01680}01680                  ((paPreDEnable \& 1)<< 30) | ((pRatesPower[7] \& mask) << 24) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01681}01681                  ((paPreDEnable \& 1)<< 22) | ((pRatesPower[6] \& mask) << 16) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01682}01682                  ((paPreDEnable \& 1)<< 14) | ((pRatesPower[5] \& mask) << 8) |}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01683}01683                  ((paPreDEnable \& 1)<< 6 ) |  (pRatesPower[4] \& mask));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01684}01684 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01685}01685         \textcolor{comment}{/* set max power to the power value at rate 6 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01686}01686         \mbox{\hyperlink{ar5211__reset_8c_a3ff9ad576bddf066b768f2ffa425854c}{ar5211SetTxPowerLimit}}(ah, pRatesPower[0]);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01687}01687 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01688}01688         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_maxPowerLevel = pRatesPower[0];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01689}01689 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01690}01690 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01691}01691 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01692}01692 \textcolor{comment}{ * Get or interpolate the pcdac value from the calibrated data}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01693}01693 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01694}01694 uint16\_t}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01695}\mbox{\hyperlink{ar5211__reset_8c_ae493ba2c1980b5c8654009ade758e45a}{01695}} \mbox{\hyperlink{ar5211__reset_8c_ae493ba2c1980b5c8654009ade758e45a}{ar5211GetScaledPower}}(uint16\_t channel, uint16\_t pcdacValue,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01696}01696         \textcolor{keyword}{const} \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} *pSrcStruct)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01697}01697 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01698}01698         uint16\_t powerValue;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01699}01699         uint16\_t lFreq, rFreq;          \textcolor{comment}{/* left and right frequency values */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01700}01700         uint16\_t llPcdac, ulPcdac;      \textcolor{comment}{/* lower and upper left pcdac values */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01701}01701         uint16\_t lrPcdac, urPcdac;      \textcolor{comment}{/* lower and upper right pcdac values */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01702}01702         uint16\_t lPwr, uPwr;            \textcolor{comment}{/* lower and upper temp pwr values */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01703}01703         uint16\_t lScaledPwr, rScaledPwr; \textcolor{comment}{/* left and right scaled power */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01704}01704 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01705}01705         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ar5211__reset_8c_a1568bea89384cef35cd0345c97b2cd8f}{ar5211FindValueInList}}(channel, pcdacValue, pSrcStruct, \&powerValue))}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01706}01706                 \textcolor{comment}{/* value was copied from srcStruct */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01707}01707                 \textcolor{keywordflow}{return} powerValue;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01708}01708 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01709}01709         \mbox{\hyperlink{ar5211__reset_8c_a0525b0fa3ecd4d2e55c6067548f2ce53}{ar5211GetLowerUpperValues}}(channel, pSrcStruct-\/>\mbox{\hyperlink{structpcdacsEeprom_a3e9b6cf4ec86c221c9176bd399423e45}{pChannelList}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01710}01710                 pSrcStruct-\/>\mbox{\hyperlink{structpcdacsEeprom_a990ae16ba943c44f97d3ebcb56ae570b}{numChannels}}, \&lFreq, \&rFreq);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01711}01711         \mbox{\hyperlink{ar5211__reset_8c_a9c1a6d8cbb60fd9c8cde2d02e6a7737c}{ar5211GetLowerUpperPcdacs}}(pcdacValue, lFreq, pSrcStruct,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01712}01712                 \&llPcdac, \&ulPcdac);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01713}01713         \mbox{\hyperlink{ar5211__reset_8c_a9c1a6d8cbb60fd9c8cde2d02e6a7737c}{ar5211GetLowerUpperPcdacs}}(pcdacValue, rFreq, pSrcStruct,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01714}01714                 \&lrPcdac, \&urPcdac);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01715}01715 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01716}01716         \textcolor{comment}{/* get the power index for the pcdac value */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01717}01717         \mbox{\hyperlink{ar5211__reset_8c_a1568bea89384cef35cd0345c97b2cd8f}{ar5211FindValueInList}}(lFreq, llPcdac, pSrcStruct, \&lPwr);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01718}01718         \mbox{\hyperlink{ar5211__reset_8c_a1568bea89384cef35cd0345c97b2cd8f}{ar5211FindValueInList}}(lFreq, ulPcdac, pSrcStruct, \&uPwr);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01719}01719         lScaledPwr = \mbox{\hyperlink{ar5211__reset_8c_af7c8bbd712238de0779ffe911fb6bd1a}{ar5211GetInterpolatedValue}}(pcdacValue,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01720}01720                                 llPcdac, ulPcdac, lPwr, uPwr, 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01721}01721 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01722}01722         \mbox{\hyperlink{ar5211__reset_8c_a1568bea89384cef35cd0345c97b2cd8f}{ar5211FindValueInList}}(rFreq, lrPcdac, pSrcStruct, \&lPwr);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01723}01723         \mbox{\hyperlink{ar5211__reset_8c_a1568bea89384cef35cd0345c97b2cd8f}{ar5211FindValueInList}}(rFreq, urPcdac, pSrcStruct, \&uPwr);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01724}01724         rScaledPwr = \mbox{\hyperlink{ar5211__reset_8c_af7c8bbd712238de0779ffe911fb6bd1a}{ar5211GetInterpolatedValue}}(pcdacValue,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01725}01725                                 lrPcdac, urPcdac, lPwr, uPwr, 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01726}01726 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01727}01727         \textcolor{keywordflow}{return} \mbox{\hyperlink{ar5211__reset_8c_af7c8bbd712238de0779ffe911fb6bd1a}{ar5211GetInterpolatedValue}}(channel, lFreq, rFreq,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01728}01728                 lScaledPwr, rScaledPwr, 0);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01729}01729 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01730}01730 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01731}01731 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01732}01732 \textcolor{comment}{ * Find the value from the calibrated source data struct}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01733}01733 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01734}01734 \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01735}\mbox{\hyperlink{ar5211__reset_8c_a1568bea89384cef35cd0345c97b2cd8f}{01735}} \mbox{\hyperlink{ar5211__reset_8c_a1568bea89384cef35cd0345c97b2cd8f}{ar5211FindValueInList}}(uint16\_t channel, uint16\_t pcdacValue,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01736}01736         \textcolor{keyword}{const} \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} *pSrcStruct, uint16\_t *powerValue)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01737}01737 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01738}01738         \textcolor{keyword}{const} \mbox{\hyperlink{structdataPerChannel}{DATA\_PER\_CHANNEL}} *pChannelData;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01739}01739         \textcolor{keyword}{const} uint16\_t *pPcdac;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01740}01740         uint16\_t i, j;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01741}01741 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01742}01742         pChannelData = pSrcStruct-\/>\mbox{\hyperlink{structpcdacsEeprom_a85f108677c90ae9e7ae97aadb6a69456}{pDataPerChannel}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01743}01743         \textcolor{keywordflow}{for} (i = 0; i < pSrcStruct-\/>\mbox{\hyperlink{structpcdacsEeprom_a990ae16ba943c44f97d3ebcb56ae570b}{numChannels}}; i++ ) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01744}01744                 \textcolor{keywordflow}{if} (pChannelData-\/>\mbox{\hyperlink{structdataPerChannel_af08354e56869f299b989b6a5502a4ca7}{channelValue}} == channel) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01745}01745                         pPcdac = pChannelData-\/>\mbox{\hyperlink{structdataPerChannel_a2d107c04bcb27e47d07b1b33a9490c17}{PcdacValues}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01746}01746                         \textcolor{keywordflow}{for} (j = 0; j < pChannelData-\/>\mbox{\hyperlink{structdataPerChannel_a4e3ecce3f07967df46b7f5f5eb3ec1cd}{numPcdacValues}}; j++ ) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01747}01747                                 \textcolor{keywordflow}{if} (*pPcdac == pcdacValue) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01748}01748                                         *powerValue = pChannelData-\/>\mbox{\hyperlink{structdataPerChannel_a07f07f8b8a5a3f0abeee25520ac59dbf}{PwrValues}}[j];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01749}01749                                         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01750}01750                                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01751}01751                                 pPcdac++;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01752}01752                         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01753}01753                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01754}01754                 pChannelData++;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01755}01755         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01756}01756         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01757}01757 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01758}01758 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01759}01759 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01760}01760 \textcolor{comment}{ * Returns interpolated or the scaled up interpolated value}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01761}01761 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01762}01762 uint16\_t}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01763}\mbox{\hyperlink{ar5211__reset_8c_af7c8bbd712238de0779ffe911fb6bd1a}{01763}} \mbox{\hyperlink{ar5211__reset_8c_af7c8bbd712238de0779ffe911fb6bd1a}{ar5211GetInterpolatedValue}}(uint16\_t target,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01764}01764         uint16\_t srcLeft, uint16\_t srcRight,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01765}01765         uint16\_t targetLeft, uint16\_t targetRight,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01766}01766         \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} scaleUp)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01767}01767 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01768}01768         uint16\_t rv;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01769}01769         int16\_t lRatio;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01770}01770         uint16\_t scaleValue = \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01771}01771 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01772}01772         \textcolor{comment}{/* to get an accurate ratio, always scale, if want to scale, then don't scale back down */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01773}01773         \textcolor{keywordflow}{if} ((targetLeft * targetRight) == 0)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01774}01774                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01775}01775         \textcolor{keywordflow}{if} (scaleUp)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01776}01776                 scaleValue = 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01777}01777 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01778}01778         \textcolor{keywordflow}{if} (srcRight != srcLeft) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01779}01779                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01780}01780 \textcolor{comment}{                 * Note the ratio always need to be scaled,}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01781}01781 \textcolor{comment}{                 * since it will be a fraction.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01782}01782 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01783}01783                 lRatio = (target -\/ srcLeft) * \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} / (srcRight -\/ srcLeft);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01784}01784                 \textcolor{keywordflow}{if} (lRatio < 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01785}01785                     \textcolor{comment}{/* Return as Left target if value would be negative */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01786}01786                     rv = targetLeft * (scaleUp ? \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} : 1);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01787}01787                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (lRatio > \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01788}01788                     \textcolor{comment}{/* Return as Right target if Ratio is greater than 100\% (SCALE) */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01789}01789                     rv = targetRight * (scaleUp ? \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} : 1);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01790}01790                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01791}01791                         rv = (lRatio * targetRight + (\mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} -\/ lRatio) *}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01792}01792                                         targetLeft) / scaleValue;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01793}01793                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01794}01794         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01795}01795                 rv = targetLeft;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01796}01796                 \textcolor{keywordflow}{if} (scaleUp)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01797}01797                         rv *= \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01798}01798         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01799}01799         \textcolor{keywordflow}{return} rv;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01800}01800 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01801}01801 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01802}01802 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01803}01803 \textcolor{comment}{ *  Look for value being within 0.1 of the search values}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01804}01804 \textcolor{comment}{ *  however, NDIS can't do float calculations, so multiply everything}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01805}01805 \textcolor{comment}{ *  up by EEP\_SCALE so can do integer arithmatic}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01806}01806 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01807}01807 \textcolor{comment}{ * INPUT  value    -\/value to search for}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01808}01808 \textcolor{comment}{ * INPUT  pList    -\/ptr to the list to search}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01809}01809 \textcolor{comment}{ * INPUT  listSize      -\/number of entries in list}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01810}01810 \textcolor{comment}{ * OUTPUT pLowerValue -\/return the lower value}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01811}01811 \textcolor{comment}{ * OUTPUT pUpperValue -\/return the upper value}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01812}01812 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01813}01813 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01814}\mbox{\hyperlink{ar5211__reset_8c_a0525b0fa3ecd4d2e55c6067548f2ce53}{01814}} \mbox{\hyperlink{ar5211__reset_8c_a0525b0fa3ecd4d2e55c6067548f2ce53}{ar5211GetLowerUpperValues}}(uint16\_t value,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01815}01815         \textcolor{keyword}{const} uint16\_t *pList, uint16\_t listSize,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01816}01816         uint16\_t *pLowerValue, uint16\_t *pUpperValue)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01817}01817 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01818}01818         \textcolor{keyword}{const} uint16\_t listEndValue = *(pList + listSize -\/ 1);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01819}01819         uint32\_t target = value * \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01820}01820         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01821}01821 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01822}01822         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01823}01823 \textcolor{comment}{         * See if value is lower than the first value in the list}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01824}01824 \textcolor{comment}{         * if so return first value}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01825}01825 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01826}01826         \textcolor{keywordflow}{if} (target < (uint32\_t)(*pList * \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} -\/ \mbox{\hyperlink{ah__eeprom__v3_8h_ac7bbb55d84e9c3be6c18f5796fc4d409}{EEP\_DELTA}})) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01827}01827                 *pLowerValue = *pList;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01828}01828                 *pUpperValue = *pList;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01829}01829                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01830}01830         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01831}01831 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01832}01832         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01833}01833 \textcolor{comment}{         * See if value is greater than last value in list}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01834}01834 \textcolor{comment}{         * if so return last value}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01835}01835 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01836}01836         \textcolor{keywordflow}{if} (target > (uint32\_t)(listEndValue * \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} + \mbox{\hyperlink{ah__eeprom__v3_8h_ac7bbb55d84e9c3be6c18f5796fc4d409}{EEP\_DELTA}})) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01837}01837                 *pLowerValue = listEndValue;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01838}01838                 *pUpperValue = listEndValue;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01839}01839                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01840}01840         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01841}01841 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01842}01842         \textcolor{comment}{/* look for value being near or between 2 values in list */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01843}01843         \textcolor{keywordflow}{for} (i = 0; i < listSize; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01844}01844                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01845}01845 \textcolor{comment}{                 * If value is close to the current value of the list}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01846}01846 \textcolor{comment}{                 * then target is not between values, it is one of the values}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01847}01847 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01848}01848                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__osdep_8h_a06756c2733c4868d44918eda97dcacac}{abs}}(pList[i] * \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} -\/ (int32\_t) target) < \mbox{\hyperlink{ah__eeprom__v3_8h_ac7bbb55d84e9c3be6c18f5796fc4d409}{EEP\_DELTA}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01849}01849                         *pLowerValue = pList[i];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01850}01850                         *pUpperValue = pList[i];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01851}01851                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01852}01852                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01853}01853 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01854}01854                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01855}01855 \textcolor{comment}{                 * Look for value being between current value and next value}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01856}01856 \textcolor{comment}{                 * if so return these 2 values}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01857}01857 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01858}01858                 \textcolor{keywordflow}{if} (target < (uint32\_t)(pList[i + 1] * \mbox{\hyperlink{ah__eeprom__v3_8h_aae39ef99215edcbb230a316135982cfd}{EEP\_SCALE}} -\/ \mbox{\hyperlink{ah__eeprom__v3_8h_ac7bbb55d84e9c3be6c18f5796fc4d409}{EEP\_DELTA}})) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01859}01859                         *pLowerValue = pList[i];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01860}01860                         *pUpperValue = pList[i + 1];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01861}01861                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01862}01862                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01863}01863         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01864}01864 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01865}01865 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01866}01866 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01867}01867 \textcolor{comment}{ * Get the upper and lower pcdac given the channel and the pcdac}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01868}01868 \textcolor{comment}{ * used in the search}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01869}01869 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01870}01870 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01871}\mbox{\hyperlink{ar5211__reset_8c_a9c1a6d8cbb60fd9c8cde2d02e6a7737c}{01871}} \mbox{\hyperlink{ar5211__reset_8c_a9c1a6d8cbb60fd9c8cde2d02e6a7737c}{ar5211GetLowerUpperPcdacs}}(uint16\_t pcdac, uint16\_t channel,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01872}01872         \textcolor{keyword}{const} \mbox{\hyperlink{structpcdacsEeprom}{PCDACS\_EEPROM}} *pSrcStruct,}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01873}01873         uint16\_t *pLowerPcdac, uint16\_t *pUpperPcdac)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01874}01874 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01875}01875         \textcolor{keyword}{const} \mbox{\hyperlink{structdataPerChannel}{DATA\_PER\_CHANNEL}} *pChannelData;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01876}01876         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01877}01877 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01878}01878         \textcolor{comment}{/* Find the channel information */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01879}01879         pChannelData = pSrcStruct-\/>\mbox{\hyperlink{structpcdacsEeprom_a85f108677c90ae9e7ae97aadb6a69456}{pDataPerChannel}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01880}01880         \textcolor{keywordflow}{for} (i = 0; i < pSrcStruct-\/>\mbox{\hyperlink{structpcdacsEeprom_a990ae16ba943c44f97d3ebcb56ae570b}{numChannels}}; i++) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01881}01881                 \textcolor{keywordflow}{if} (pChannelData-\/>\mbox{\hyperlink{structdataPerChannel_af08354e56869f299b989b6a5502a4ca7}{channelValue}} == channel)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01882}01882                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01883}01883                 pChannelData++;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01884}01884         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01885}01885         \mbox{\hyperlink{ar5211__reset_8c_a0525b0fa3ecd4d2e55c6067548f2ce53}{ar5211GetLowerUpperValues}}(pcdac, pChannelData-\/>\mbox{\hyperlink{structdataPerChannel_a2d107c04bcb27e47d07b1b33a9490c17}{PcdacValues}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01886}01886                 pChannelData-\/>\mbox{\hyperlink{structdataPerChannel_a4e3ecce3f07967df46b7f5f5eb3ec1cd}{numPcdacValues}}, pLowerPcdac, pUpperPcdac);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01887}01887 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01888}01888 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01889}\mbox{\hyperlink{ar5211__reset_8c_a199aedd05cc99b25d1a3f9ff1d89cac5}{01889}} \textcolor{preprocessor}{\#define DYN\_ADJ\_UP\_MARGIN       15}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01890}\mbox{\hyperlink{ar5211__reset_8c_a5ac90975a66d24d903d0a815200b7624}{01890}} \textcolor{preprocessor}{\#define DYN\_ADJ\_LO\_MARGIN       20}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01891}01891 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01892}\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{01892}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER}{GAIN\_OPTIMIZATION\_LADDER}} \mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}} = \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01893}01893         9,                                      \textcolor{comment}{/* numStepsInLadder */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01894}01894         4,                                      \textcolor{comment}{/* defaultStepNum */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01895}01895         \{ \{ \{4, 1, 1, 1\},  6, \textcolor{stringliteral}{"{}FG8"{}}\},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01896}01896           \{ \{4, 0, 1, 1\},  4, \textcolor{stringliteral}{"{}FG7"{}}\},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01897}01897           \{ \{3, 1, 1, 1\},  3, \textcolor{stringliteral}{"{}FG6"{}}\},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01898}01898           \{ \{4, 0, 0, 1\},  1, \textcolor{stringliteral}{"{}FG5"{}}\},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01899}01899           \{ \{4, 1, 1, 0\},  0, \textcolor{stringliteral}{"{}FG4"{}}\},   \textcolor{comment}{/* noJack */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01900}01900           \{ \{4, 0, 1, 0\}, -\/2, \textcolor{stringliteral}{"{}FG3"{}}\},   \textcolor{comment}{/* halfJack */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01901}01901           \{ \{3, 1, 1, 0\}, -\/3, \textcolor{stringliteral}{"{}FG2"{}}\},   \textcolor{comment}{/* clip3 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01902}01902           \{ \{4, 0, 0, 0\}, -\/4, \textcolor{stringliteral}{"{}FG1"{}}\},   \textcolor{comment}{/* noJack */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01903}01903           \{ \{2, 1, 1, 0\}, -\/6, \textcolor{stringliteral}{"{}FG0"{}}\}    \textcolor{comment}{/* clip2 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01904}01904         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01905}01905 \};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01906}01906 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01907}01907 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01908}01908 \textcolor{comment}{ * Initialize the gain structure to good values}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01909}01909 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01910}01910 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01911}\mbox{\hyperlink{ar5211_8h_aa07c3bfa898b4fd8d13a85d5a9f74ec2}{01911}} \mbox{\hyperlink{ar5211__reset_8c_a4850be4885c6c6136405d9ca42752ae7}{ar5211InitializeGainValues}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01912}01912 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01913}01913         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01914}01914         \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *gv = \&ahp-\/>\mbox{\hyperlink{structath__hal__5211_a5e345f179df8c4743c4480e90570b4bb}{ah\_gainValues}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01915}01915 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01916}01916         \textcolor{comment}{/* initialize gain optimization values */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01917}01917         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}} = \mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_a4eae75bde63ea5bb7c8fc60a9b710537}{defaultStepNum}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01918}01918         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}} = \&\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_a9262026250e17c769f9387c27a51fcd8}{optStep}}[\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_a4eae75bde63ea5bb7c8fc60a9b710537}{defaultStepNum}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01919}01919         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a22acca3ee398b8364589950a615e8c30}{active}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01920}01920         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a53e9ed5a64819f1bf1df7fd3f016a57c}{loTrig}} = 20;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01921}01921         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a6625a3343b515b46017cb598a2d6a1f9}{hiTrig}} = 35;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01922}01922 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01923}01923 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01924}01924 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01925}\mbox{\hyperlink{ar5211__reset_8c_a6a8ed9524913cafe8bd1b1a272a4702c}{01925}} \mbox{\hyperlink{ar5211__reset_8c_a6a8ed9524913cafe8bd1b1a272a4702c}{ar5211InvalidGainReadback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *gv)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01926}01926 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01927}01927         \textcolor{keyword}{const} \textcolor{keyword}{struct }ieee80211\_channel *chan = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_curchan;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01928}01928         uint32\_t gStep, g;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01929}01929         uint32\_t L1, L2, L3, L4;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01930}01930 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01931}01931         \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_CCK(chan)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01932}01932                 gStep = 0x18;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01933}01933                 L1 = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01934}01934                 L2 = gStep + 4;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01935}01935                 L3 = 0x40;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01936}01936                 L4 = L3 + 50;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01937}01937 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01938}01938                 gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a53e9ed5a64819f1bf1df7fd3f016a57c}{loTrig}} = L1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01939}01939                 gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a6625a3343b515b46017cb598a2d6a1f9}{hiTrig}} = L4+5;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01940}01940         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01941}01941                 gStep = 0x3f;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01942}01942                 L1 = 0;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01943}01943                 L2 = 50;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01944}01944                 L3 = L1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01945}01945                 L4 = L3 + 50;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01946}01946 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01947}01947                 gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a53e9ed5a64819f1bf1df7fd3f016a57c}{loTrig}} = L1 + \mbox{\hyperlink{ar5211__reset_8c_a5ac90975a66d24d903d0a815200b7624}{DYN\_ADJ\_LO\_MARGIN}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01948}01948                 gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a6625a3343b515b46017cb598a2d6a1f9}{hiTrig}} = L4 -\/ \mbox{\hyperlink{ar5211__reset_8c_a199aedd05cc99b25d1a3f9ff1d89cac5}{DYN\_ADJ\_UP\_MARGIN}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01949}01949         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01950}01950         g = gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01951}01951 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01952}01952         \textcolor{keywordflow}{return} !((g >= L1 \&\& g<= L2) || (g >= L3 \&\& g <= L4));}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01953}01953 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01954}01954 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01955}01955 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01956}01956 \textcolor{comment}{ * Enable the probe gain check on the next packet}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01957}01957 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01958}01958 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01959}\mbox{\hyperlink{ar5211__reset_8c_a2e22eca717c93e7d9e684527ab7fb3f0}{01959}} \mbox{\hyperlink{ar5211__reset_8c_a2e22eca717c93e7d9e684527ab7fb3f0}{ar5211RequestRfgain}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01960}01960 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01961}01961         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01962}01962 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01963}01963         \textcolor{comment}{/* Enable the gain readback probe */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01964}01964         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5211phy_8h_ad6ec7f87d27a6799dd520219ed0eb0d3}{AR\_PHY\_PAPD\_PROBE}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01965}01965                   \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(ahp-\/>\mbox{\hyperlink{structath__hal__5211_aefeecc6dd299e4ed849133f358b714de}{ah\_tx6PowerInHalfDbm}}, \mbox{\hyperlink{ar5211phy_8h_a956e5d9299efcbd9886a81d2115be589}{AR\_PHY\_PAPD\_PROBE\_POWERTX}})}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01966}01966                 | \mbox{\hyperlink{ar5211phy_8h_ae09c8e0bc20d9780f6dbe4561f64793e}{AR\_PHY\_PAPD\_PROBE\_NEXT\_TX}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01967}01967 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01968}01968         ahp-\/>\mbox{\hyperlink{structath__hal__5211_a3f894742c3a9118721dec16bd7e6a9f2}{ah\_rfgainState}} = \mbox{\hyperlink{ah_8h_ae556b918a5e9b31dde154d742576a905ab86a2708fd6d70dc887e3bf35bb087b8}{HAL\_RFGAIN\_READ\_REQUESTED}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01969}01969 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01970}01970 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01971}01971 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01972}01972 \textcolor{comment}{ * Exported call to check for a recent gain reading and return}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01973}01973 \textcolor{comment}{ * the current state of the thermal calibration gain engine.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01974}01974 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01975}01975 \mbox{\hyperlink{ah_8h_ae556b918a5e9b31dde154d742576a905}{HAL\_RFGAIN}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01976}\mbox{\hyperlink{ar5211_8h_a31254c423140e349cf9d94ba3b4781bd}{01976}} \mbox{\hyperlink{ar5211__reset_8c_a9d656f709c79f148171d69075c6c3514}{ar5211GetRfgain}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01977}01977 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01978}01978         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01979}01979         \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *gv = \&ahp-\/>\mbox{\hyperlink{structath__hal__5211_a5e345f179df8c4743c4480e90570b4bb}{ah\_gainValues}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01980}01980         uint32\_t rddata;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01981}01981 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01982}01982         \textcolor{keywordflow}{if} (!gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a22acca3ee398b8364589950a615e8c30}{active}})}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01983}01983                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae556b918a5e9b31dde154d742576a905a30aac39ec9bf5799fd60b7132951e7e4}{HAL\_RFGAIN\_INACTIVE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01984}01984 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01985}01985         \textcolor{keywordflow}{if} (ahp-\/>\mbox{\hyperlink{structath__hal__5211_a3f894742c3a9118721dec16bd7e6a9f2}{ah\_rfgainState}} == \mbox{\hyperlink{ah_8h_ae556b918a5e9b31dde154d742576a905ab86a2708fd6d70dc887e3bf35bb087b8}{HAL\_RFGAIN\_READ\_REQUESTED}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01986}01986                 \textcolor{comment}{/* Caller had asked to setup a new reading. Check it. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01987}01987                 rddata = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_ad6ec7f87d27a6799dd520219ed0eb0d3}{AR\_PHY\_PAPD\_PROBE}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01988}01988 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01989}01989                 \textcolor{keywordflow}{if} ((rddata \& \mbox{\hyperlink{ar5211phy_8h_ae09c8e0bc20d9780f6dbe4561f64793e}{AR\_PHY\_PAPD\_PROBE\_NEXT\_TX}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01990}01990                         \textcolor{comment}{/* bit got cleared, we have a new reading. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01991}01991                         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}} = rddata >> \mbox{\hyperlink{ar5211phy_8h_abb44612d6128e1e205374216c16d2d8b}{AR\_PHY\_PAPD\_PROBE\_GAINF\_S}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01992}01992                         \textcolor{comment}{/* inactive by default */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01993}01993                         ahp-\/>\mbox{\hyperlink{structath__hal__5211_a3f894742c3a9118721dec16bd7e6a9f2}{ah\_rfgainState}} = \mbox{\hyperlink{ah_8h_ae556b918a5e9b31dde154d742576a905a30aac39ec9bf5799fd60b7132951e7e4}{HAL\_RFGAIN\_INACTIVE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01994}01994 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01995}01995                         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5211__reset_8c_a6a8ed9524913cafe8bd1b1a272a4702c}{ar5211InvalidGainReadback}}(ah, gv) \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01996}01996                             \mbox{\hyperlink{ar5211__reset_8c_aac4c9f9ca911cdbd92eeb38ccb0cb5e7}{ar5211IsGainAdjustNeeded}}(ah, gv) \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01997}01997                             \mbox{\hyperlink{ar5211__reset_8c_a420cbe76f65b9d7ef969b40c4a737eba}{ar5211AdjustGain}}(ah, gv) > 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01998}01998                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l01999}01999 \textcolor{comment}{                                 * Change needed. Copy ladder info}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02000}02000 \textcolor{comment}{                                 * into eeprom info.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02001}02001 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02002}02002                                 \mbox{\hyperlink{ar5211__reset_8c_a2f24a06af637ac702d4870a05d78cc66}{ar5211SetRfgain}}(ah, gv);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02003}02003                                 ahp-\/>\mbox{\hyperlink{structath__hal__5211_a3f894742c3a9118721dec16bd7e6a9f2}{ah\_rfgainState}} = \mbox{\hyperlink{ah_8h_ae556b918a5e9b31dde154d742576a905a98e92bac2dec956dedb021f2814e732e}{HAL\_RFGAIN\_NEED\_CHANGE}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02004}02004                         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02005}02005                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02006}02006         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02007}02007         \textcolor{keywordflow}{return} ahp-\/>\mbox{\hyperlink{structath__hal__5211_a3f894742c3a9118721dec16bd7e6a9f2}{ah\_rfgainState}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02008}02008 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02009}02009 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02010}02010 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02011}02011 \textcolor{comment}{ * Check to see if our readback gain level sits within the linear}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02012}02012 \textcolor{comment}{ * region of our current variable attenuation window}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02013}02013 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02014}02014 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02015}\mbox{\hyperlink{ar5211__reset_8c_aac4c9f9ca911cdbd92eeb38ccb0cb5e7}{02015}} \mbox{\hyperlink{ar5211__reset_8c_aac4c9f9ca911cdbd92eeb38ccb0cb5e7}{ar5211IsGainAdjustNeeded}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *gv)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02016}02016 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02017}02017         \textcolor{keywordflow}{return} (gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}} <= gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a53e9ed5a64819f1bf1df7fd3f016a57c}{loTrig}} || gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}} >= gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a6625a3343b515b46017cb598a2d6a1f9}{hiTrig}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02018}02018 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02019}02019 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02020}02020 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02021}02021 \textcolor{comment}{ * Move the rabbit ears in the correct direction.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02022}02022 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02023}02023 \textcolor{keyword}{static} int32\_t }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02024}\mbox{\hyperlink{ar5211__reset_8c_a420cbe76f65b9d7ef969b40c4a737eba}{02024}} \mbox{\hyperlink{ar5211__reset_8c_a420cbe76f65b9d7ef969b40c4a737eba}{ar5211AdjustGain}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *gv)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02025}02025 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02026}02026         \textcolor{comment}{/* return > 0 for valid adjustments. */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02027}02027         \textcolor{keywordflow}{if} (!gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a22acca3ee398b8364589950a615e8c30}{active}})}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02028}02028                 \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02029}02029 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02030}02030         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}} = \&\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_a9262026250e17c769f9387c27a51fcd8}{optStep}}[gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02031}02031         \textcolor{keywordflow}{if} (gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}} >= gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a6625a3343b515b46017cb598a2d6a1f9}{hiTrig}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02032}02032                 \textcolor{keywordflow}{if} (gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02033}02033                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02034}02034                             \textcolor{stringliteral}{"{}\%s: Max gain limit.\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02035}02035                         \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02036}02036                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02037}02037                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02038}02038                     \textcolor{stringliteral}{"{}\%s: Adding gain: currG=\%d [\%s] -\/-\/> "{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02039}02039                     \_\_func\_\_, gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}}, gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_a112893652f8077db25e859bf3aa54bde}{stepName}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02040}02040                 gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a35d0feee32d5296d9cb76022121eaa5b}{targetGain}} = gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02041}02041                 \textcolor{keywordflow}{while} (gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a35d0feee32d5296d9cb76022121eaa5b}{targetGain}} >= gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a6625a3343b515b46017cb598a2d6a1f9}{hiTrig}} \&\& gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}} > 0) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02042}02042                         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a35d0feee32d5296d9cb76022121eaa5b}{targetGain}} -\/= 2 * (\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_a9262026250e17c769f9387c27a51fcd8}{optStep}}[-\/-\/(gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}})].stepGain -\/}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02043}02043                                 gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_ae6ed7fee12d271b7ed92865118c4a8b8}{stepGain}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02044}02044                         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}} = \&\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_a9262026250e17c769f9387c27a51fcd8}{optStep}}[gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02045}02045                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02046}02046                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}}, \textcolor{stringliteral}{"{}targG=\%d [\%s]\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02047}02047                     gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a35d0feee32d5296d9cb76022121eaa5b}{targetGain}}, gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_a112893652f8077db25e859bf3aa54bde}{stepName}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02048}02048                 \textcolor{keywordflow}{return} 1;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02049}02049         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02050}02050         \textcolor{keywordflow}{if} (gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}} <= gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a53e9ed5a64819f1bf1df7fd3f016a57c}{loTrig}}) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02051}02051                 \textcolor{keywordflow}{if} (gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}} == \mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_ab9db910eb3586485a8cf0db109883001}{numStepsInLadder}}-\/1) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02052}02052                         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02053}02053                             \textcolor{stringliteral}{"{}\%s: Min gain limit.\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02054}02054                         \textcolor{keywordflow}{return} -\/2;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02055}02055                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02056}02056                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02057}02057                     \textcolor{stringliteral}{"{}\%s: Deducting gain: currG=\%d [\%s] -\/-\/> "{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02058}02058                     \_\_func\_\_, gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}}, gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_a112893652f8077db25e859bf3aa54bde}{stepName}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02059}02059                 gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a35d0feee32d5296d9cb76022121eaa5b}{targetGain}} = gv-\/>\mbox{\hyperlink{structGAIN__VALUES_aa7e59c0b982277970958584048aee1fe}{currGain}};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02060}02060                 \textcolor{keywordflow}{while} (gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a35d0feee32d5296d9cb76022121eaa5b}{targetGain}} <= gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a53e9ed5a64819f1bf1df7fd3f016a57c}{loTrig}} \&\&}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02061}02061                       gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}} < (\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_ab9db910eb3586485a8cf0db109883001}{numStepsInLadder}} -\/ 1)) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02062}02062                         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a35d0feee32d5296d9cb76022121eaa5b}{targetGain}} -\/= 2 *}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02063}02063                                 (\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_a9262026250e17c769f9387c27a51fcd8}{optStep}}[++(gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}})].stepGain -\/ gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_ae6ed7fee12d271b7ed92865118c4a8b8}{stepGain}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02064}02064                         gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}} = \&\mbox{\hyperlink{ar5211__reset_8c_ac1489e625b1e570e747aba5dea8bcd44}{gainLadder}}.\mbox{\hyperlink{structGAIN__OPTIMIZATION__LADDER_a9262026250e17c769f9387c27a51fcd8}{optStep}}[gv-\/>\mbox{\hyperlink{structGAIN__VALUES_af8dab8369124f64875b7c53f6e58ce4a}{currStepNum}}];}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02065}02065                 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02066}02066                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eaeceafe3dc0f9a65e6b5235d69285b996}{HAL\_DEBUG\_RFPARAM}}, \textcolor{stringliteral}{"{}targG=\%d [\%s]\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02067}02067                     gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a35d0feee32d5296d9cb76022121eaa5b}{targetGain}}, gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_a112893652f8077db25e859bf3aa54bde}{stepName}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02068}02068                 \textcolor{keywordflow}{return} 2;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02069}02069         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02070}02070         \textcolor{keywordflow}{return} 0;               \textcolor{comment}{/* caller didn't call needAdjGain first */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02071}02071 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02072}02072 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02073}02073 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02074}02074 \textcolor{comment}{ * Adjust the 5GHz EEPROM information with the desired calibration values.}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02075}02075 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02076}02076 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02077}\mbox{\hyperlink{ar5211__reset_8c_a2f24a06af637ac702d4870a05d78cc66}{02077}} \mbox{\hyperlink{ar5211__reset_8c_a2f24a06af637ac702d4870a05d78cc66}{ar5211SetRfgain}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \mbox{\hyperlink{structGAIN__VALUES}{GAIN\_VALUES}} *gv)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02078}02078 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02079}02079         \mbox{\hyperlink{structHAL__EEPROM}{HAL\_EEPROM}} *ee = \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_eeprom;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02080}02080 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02081}02081         \textcolor{keywordflow}{if} (!gv-\/>\mbox{\hyperlink{structGAIN__VALUES_a22acca3ee398b8364589950a615e8c30}{active}})}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02082}02082                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02083}02083         ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5f2d9efd25138b2c3d0e733948ccdef5}{ee\_cornerCal}}.\mbox{\hyperlink{structcornerCalInfo_a33ae111caedee187bef9e228bc93188d}{clip}} = gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_a6311baea3daef49a8f4e0d3aa5918304}{paramVal}}[0]; \textcolor{comment}{/* bb\_tx\_clip */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02084}02084         ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5f2d9efd25138b2c3d0e733948ccdef5}{ee\_cornerCal}}.\mbox{\hyperlink{structcornerCalInfo_a475ac47ae822f3a6afaf065ffa8f10d3}{pd90}} = gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_a6311baea3daef49a8f4e0d3aa5918304}{paramVal}}[1]; \textcolor{comment}{/* rf\_pwd\_90 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02085}02085         ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5f2d9efd25138b2c3d0e733948ccdef5}{ee\_cornerCal}}.\mbox{\hyperlink{structcornerCalInfo_ad549786f2bddd093a9ca0e2a78927803}{pd84}} = gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_a6311baea3daef49a8f4e0d3aa5918304}{paramVal}}[2]; \textcolor{comment}{/* rf\_pwd\_84 */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02086}02086         ee-\/>\mbox{\hyperlink{structHAL__EEPROM_a5f2d9efd25138b2c3d0e733948ccdef5}{ee\_cornerCal}}.\mbox{\hyperlink{structcornerCalInfo_a63d4c6439e7f679fdde9e90376763d16}{gSel}} = gv-\/>\mbox{\hyperlink{structGAIN__VALUES_ab5c8ca467af77c6cdc25cdb02d5655fc}{currStep}}-\/>\mbox{\hyperlink{struct__gainOptStep_a6311baea3daef49a8f4e0d3aa5918304}{paramVal}}[3]; \textcolor{comment}{/* rf\_rfgainsel */}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02087}02087 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02088}02088 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02089}02089 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02090}\mbox{\hyperlink{ar5211__reset_8c_a7602af326b5930af3c6f60d4360d98cf}{02090}} \mbox{\hyperlink{ar5211__reset_8c_a7602af326b5930af3c6f60d4360d98cf}{ar5211SetOperatingMode}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keywordtype}{int} opmode)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02091}02091 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02092}02092         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5211}{ath\_hal\_5211}} *ahp = \mbox{\hyperlink{ar5211_8h_aba490419ff25bbeb9727b9a7b3f653ba}{AH5211}}(ah);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02093}02093         uint32\_t val;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02094}02094 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02095}02095         val = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a3449425878b8a4ad684aa58673c97f9e}{AR\_STA\_ID1}}) \& 0xffff;}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02096}02096         \textcolor{keywordflow}{switch} (opmode) \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02097}02097         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3ae7ab5162a6e449287d9e8c63a4c4e628}{HAL\_M\_HOSTAP}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02098}02098                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a3449425878b8a4ad684aa58673c97f9e}{AR\_STA\_ID1}}, val}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02099}02099                         | \mbox{\hyperlink{ar5211reg_8h_a772d3aa68ac43d22346a1893c4bdcda6}{AR\_STA\_ID1\_STA\_AP}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02100}02100                         | \mbox{\hyperlink{ar5211reg_8h_a3f5a30aa7e0892948e08c5dcf45d892e}{AR\_STA\_ID1\_RTS\_USE\_DEF}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02101}02101                         | ahp-\/>\mbox{\hyperlink{structath__hal__5211_afc3e72c7675af8e3a8c7367f1c75ec69}{ah\_staId1Defaults}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02102}02102                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02103}02103         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3a0944a9d007b1d97b31eefcde3ff6e92a}{HAL\_M\_IBSS}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02104}02104                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a3449425878b8a4ad684aa58673c97f9e}{AR\_STA\_ID1}}, val}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02105}02105                         | \mbox{\hyperlink{ar5210reg_8h_adb4fc9220982b69ee72ce7d1bd85a14c}{AR\_STA\_ID1\_ADHOC}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02106}02106                         | \mbox{\hyperlink{ar5210reg_8h_ad8d5ddab3912fd8175fe9d20b13d1345}{AR\_STA\_ID1\_DESC\_ANTENNA}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02107}02107                         | ahp-\/>\mbox{\hyperlink{structath__hal__5211_afc3e72c7675af8e3a8c7367f1c75ec69}{ah\_staId1Defaults}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02108}02108                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02109}02109         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3ab5bcbfc7b87ac33ac0da97127bbd6138}{HAL\_M\_STA}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02110}02110         \textcolor{keywordflow}{case} \mbox{\hyperlink{ah_8h_a46d2f8970b742983f3248797883a77c3a9182c471b73c905660273a4b428ac753}{HAL\_M\_MONITOR}}:}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02111}02111                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210reg_8h_a3449425878b8a4ad684aa58673c97f9e}{AR\_STA\_ID1}}, val}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02112}02112                         | \mbox{\hyperlink{ar5210reg_8h_af7f644f04e528237c3d2b1e2afc0d610}{AR\_STA\_ID1\_DEFAULT\_ANTENNA}}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02113}02113                         | ahp-\/>\mbox{\hyperlink{structath__hal__5211_afc3e72c7675af8e3a8c7367f1c75ec69}{ah\_staId1Defaults}});}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02114}02114                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02115}02115         \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02116}02116 \}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02117}02117 }
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02118}02118 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02119}\mbox{\hyperlink{ar5211_8h_af040eeba4137724457612d4f4fe0e8e7}{02119}} \mbox{\hyperlink{ar5211__reset_8c_a08441879ba7d5d2002d69134d0cf2736}{ar5211SetPCUConfig}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02120}02120 \{}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02121}02121         \mbox{\hyperlink{ar5211__reset_8c_a7602af326b5930af3c6f60d4360d98cf}{ar5211SetOperatingMode}}(ah, \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_opmode);}
\DoxyCodeLine{\Hypertarget{ar5211__reset_8c_source_l02122}02122 \}}

\end{DoxyCode}
