\hypertarget{ar9160__attach_8c_source}{}\doxysection{ar9160\+\_\+attach.\+c}
\label{ar9160__attach_8c_source}\index{dev/ath/ath\_hal/ar9001/ar9160\_attach.c@{dev/ath/ath\_hal/ar9001/ar9160\_attach.c}}
\mbox{\hyperlink{ar9160__attach_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: ISC}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2008 Sam Leffler, Errno Consulting}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 2008 Atheros Communications, Inc.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00007}00007 \textcolor{comment}{ * Permission to use, copy, modify, and/or distribute this software for any}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00008}00008 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00009}00009 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00010}00010 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00011}00011 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00012}00012 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00013}00013 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00014}00014 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00015}00015 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00016}00016 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00017}00017 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00019}00019 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00020}00020 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00021}00021 \textcolor{preprocessor}{\#include "{}opt\_ah.h"{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00022}00022 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00023}00023 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah_8h}{ah.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00024}00024 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__internal_8h}{ah\_internal.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00025}00025 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ah__devid_8h}{ah\_devid.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00026}00026 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00027}00027 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5416_8h}{ar5416/ar5416.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00028}00028 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5416reg_8h}{ar5416/ar5416reg.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00029}00029 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{ar5416phy_8h}{ar5416/ar5416phy.h}}"{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00031}00031 \textcolor{preprocessor}{\#include "{}ar9001/ar9160.ini"{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00032}00032 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00033}\mbox{\hyperlink{ar9160__attach_8c_a27a13e05fc89fe7564041dbb8eb5641b}{00033}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{structper__cal__data}{HAL\_PERCAL\_DATA}} \mbox{\hyperlink{ar9160__attach_8c_a27a13e05fc89fe7564041dbb8eb5641b}{ar9160\_iq\_cal}} = \{              \textcolor{comment}{/* multi sample */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00034}00034         .\mbox{\hyperlink{structper__cal__data_a39400c39f72eb61a8242a9620ed41296}{calName}} = \textcolor{stringliteral}{"{}IQ"{}}, .calType = \mbox{\hyperlink{ar5416__cal_8h_a5908bd03a01fa81f199a3e1f2bb56fb0abcd60c39469bff6836c58ccff47727b7}{IQ\_MISMATCH\_CAL}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00035}00035         .calNumSamples  = \mbox{\hyperlink{ar5416__cal_8h_ae0bba7bd440f49ce3a8d1838c510a145}{MAX\_CAL\_SAMPLES}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00036}00036         .calCountMax    = \mbox{\hyperlink{ar5416__cal_8h_af0bfaa1217054082e39bc8e79b19e5eb}{PER\_MIN\_LOG\_COUNT}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00037}00037         .calCollect     = \mbox{\hyperlink{ar5416__cal_8h_aef97368e51186d319d59691f619f2dc0}{ar5416IQCalCollect}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00038}00038         .calPostProc    = \mbox{\hyperlink{ar5416__cal_8h_afd7827ac18ac5e4f67b97c534240b1c3}{ar5416IQCalibration}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00039}00039 \};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00040}\mbox{\hyperlink{ar9160__attach_8c_ab526eee0b52730a0682d089ade2852ae}{00040}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{structper__cal__data}{HAL\_PERCAL\_DATA}} \mbox{\hyperlink{ar9160__attach_8c_ab526eee0b52730a0682d089ade2852ae}{ar9160\_adc\_gain\_cal}} = \{  \textcolor{comment}{/* multi sample */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00041}00041         .\mbox{\hyperlink{structper__cal__data_a39400c39f72eb61a8242a9620ed41296}{calName}} = \textcolor{stringliteral}{"{}ADC Gain"{}}, .calType = \mbox{\hyperlink{ar5416__cal_8h_a5908bd03a01fa81f199a3e1f2bb56fb0ad96af00183b6a12f5cf857f9388cd06a}{ADC\_GAIN\_CAL}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00042}00042         .calNumSamples  = \mbox{\hyperlink{ar5416__cal_8h_ae0bba7bd440f49ce3a8d1838c510a145}{MAX\_CAL\_SAMPLES}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00043}00043         .calCountMax    = \mbox{\hyperlink{ar5416__cal_8h_af0bfaa1217054082e39bc8e79b19e5eb}{PER\_MIN\_LOG\_COUNT}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00044}00044         .calCollect     = \mbox{\hyperlink{ar5416__cal_8h_a9a722ca53761516c06e432e0198f9936}{ar5416AdcGainCalCollect}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00045}00045         .calPostProc    = \mbox{\hyperlink{ar5416__cal_8h_a9a3578fe89c606854bb80da8d44cf447}{ar5416AdcGainCalibration}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00046}00046 \};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00047}\mbox{\hyperlink{ar9160__attach_8c_a1cd3d42ceeb6dbd4bd1784f373427d32}{00047}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{structper__cal__data}{HAL\_PERCAL\_DATA}} \mbox{\hyperlink{ar9160__attach_8c_a1cd3d42ceeb6dbd4bd1784f373427d32}{ar9160\_adc\_dc\_cal}} = \{      \textcolor{comment}{/* multi sample */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00048}00048         .\mbox{\hyperlink{structper__cal__data_a39400c39f72eb61a8242a9620ed41296}{calName}} = \textcolor{stringliteral}{"{}ADC DC"{}}, .calType = \mbox{\hyperlink{ar5416__cal_8h_a5908bd03a01fa81f199a3e1f2bb56fb0a00f7ebc2b11529215f01ef1fb7921822}{ADC\_DC\_CAL}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00049}00049         .calNumSamples  = \mbox{\hyperlink{ar5416__cal_8h_ae0bba7bd440f49ce3a8d1838c510a145}{MAX\_CAL\_SAMPLES}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00050}00050         .calCountMax    = \mbox{\hyperlink{ar5416__cal_8h_af0bfaa1217054082e39bc8e79b19e5eb}{PER\_MIN\_LOG\_COUNT}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00051}00051         .calCollect     = \mbox{\hyperlink{ar5416__cal_8h_a454fb5677f40b5cb4a4e29d9956c91d1}{ar5416AdcDcCalCollect}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00052}00052         .calPostProc    = \mbox{\hyperlink{ar5416__cal_8h_a8b24b478a93121ee40581b237bfbd166}{ar5416AdcDcCalibration}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00053}00053 \};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00054}\mbox{\hyperlink{ar9160__attach_8c_a88da4bbe1c1295a94c17e666b70b675a}{00054}} \textcolor{keyword}{static} \textcolor{keyword}{const} \mbox{\hyperlink{structper__cal__data}{HAL\_PERCAL\_DATA}} \mbox{\hyperlink{ar9160__attach_8c_a88da4bbe1c1295a94c17e666b70b675a}{ar9160\_adc\_init\_dc\_cal}} = \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00055}00055         .\mbox{\hyperlink{structper__cal__data_a39400c39f72eb61a8242a9620ed41296}{calName}} = \textcolor{stringliteral}{"{}ADC Init DC"{}}, .calType = \mbox{\hyperlink{ar5416__cal_8h_a5908bd03a01fa81f199a3e1f2bb56fb0a17d1414c22c596d37aaae10755154ed1}{ADC\_DC\_INIT\_CAL}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00056}00056         .calNumSamples  = \mbox{\hyperlink{ar5416__cal_8h_a8704a6cf093e078caf127bca2de14ee8}{MIN\_CAL\_SAMPLES}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00057}00057         .calCountMax    = \mbox{\hyperlink{ar5416__cal_8h_a00f7656ed42c2944f6b59963f070b178}{INIT\_LOG\_COUNT}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00058}00058         .calCollect     = \mbox{\hyperlink{ar5416__cal_8h_a454fb5677f40b5cb4a4e29d9956c91d1}{ar5416AdcDcCalCollect}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00059}00059         .calPostProc    = \mbox{\hyperlink{ar5416__cal_8h_a8b24b478a93121ee40581b237bfbd166}{ar5416AdcDcCalibration}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00060}00060 \};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00062}00062 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} \mbox{\hyperlink{ar9160__attach_8c_a3cee6d230e7ce1e4aa391df1f69be3e5}{ar9160FillCapabilityInfo}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00064}00064 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00065}\mbox{\hyperlink{ar9160__attach_8c_a51dba8cd60d184be6e3ccbc38cdb5af5}{00065}} \mbox{\hyperlink{ar9160__attach_8c_a51dba8cd60d184be6e3ccbc38cdb5af5}{ar9160AniSetup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00066}00066 \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00067}00067         \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structar5212AniParams}{ar5212AniParams}} aniparams = \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00068}00068                 .\mbox{\hyperlink{structar5212AniParams_a7d93041b1eda9e7d73463d4052e856a2}{maxNoiseImmunityLevel}}     = 4,    \textcolor{comment}{/* levels 0..4 */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00069}00069                 .totalSizeDesired       = \{ -\/55, -\/55, -\/55, -\/55, -\/62 \},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00070}00070                 .coarseHigh             = \{ -\/14, -\/14, -\/14, -\/14, -\/12 \},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00071}00071                 .coarseLow              = \{ -\/64, -\/64, -\/64, -\/64, -\/70 \},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00072}00072                 .firpwr                 = \{ -\/78, -\/78, -\/78, -\/78, -\/80 \},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00073}00073                 .maxSpurImmunityLevel   = 7,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00074}00074                 .cycPwrThr1             = \{ 2, 4, 6, 8, 10, 12, 14, 16 \},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00075}00075                 .maxFirstepLevel        = 2,    \textcolor{comment}{/* levels 0..2 */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00076}00076                 .firstep                = \{ 0, 4, 8 \},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00077}00077                 .ofdmTrigHigh           = 500,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00078}00078                 .ofdmTrigLow            = 200,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00079}00079                 .cckTrigHigh            = 200,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00080}00080                 .cckTrigLow             = 100,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00081}00081                 .rssiThrHigh            = 40,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00082}00082                 .rssiThrLow             = 7,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00083}00083                 .period                 = 100,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00084}00084         \};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00086}00086         \textcolor{comment}{/* NB: disable ANI noise immmunity for reliable RIFS rx */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00087}00087         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ani\_function \&= \string~(1 << \mbox{\hyperlink{ah_8h_ac7a8b9db1bcca5b28d6e48cb466fea92ab3915a1e11778a335be5a33762ad0a2d}{HAL\_ANI\_NOISE\_IMMUNITY\_LEVEL}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00088}00088         \mbox{\hyperlink{ar5416_8h_ad6300f2716e7b27efde12c280d929bc1}{ar5416AniAttach}}(ah, \&aniparams, \&aniparams, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00089}00089 \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00091}00091 \textcolor{keyword}{static} \textcolor{keywordtype}{void} }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00092}\mbox{\hyperlink{ar9160__attach_8c_af38d7cf9e5157dadd5cd752d1fda099d}{00092}} \mbox{\hyperlink{ar9160__attach_8c_af38d7cf9e5157dadd5cd752d1fda099d}{ar9160InitPLL}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah, \textcolor{keyword}{const} \textcolor{keyword}{struct} ieee80211\_channel *chan)}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00093}00093 \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00094}00094         uint32\_t pll = \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(0x5, \mbox{\hyperlink{ar5416reg_8h_ab4ab1c39a196edf6112711f76644d2cf}{AR\_RTC\_SOWL\_PLL\_REFDIV}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00095}00095         \textcolor{keywordflow}{if} (chan != \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00096}00096                 \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_HALF(chan))}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00097}00097                         pll |= \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(0x1, \mbox{\hyperlink{ar5416reg_8h_a0546d0d5b2bfdf729a38e40fdc686aa3}{AR\_RTC\_SOWL\_PLL\_CLKSEL}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00098}00098                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_QUARTER(chan))}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00099}00099                         pll |= \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(0x2, \mbox{\hyperlink{ar5416reg_8h_a0546d0d5b2bfdf729a38e40fdc686aa3}{AR\_RTC\_SOWL\_PLL\_CLKSEL}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00101}00101                 \textcolor{keywordflow}{if} (IEEE80211\_IS\_CHAN\_5GHZ(chan))}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00102}00102                         pll |= \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(0x50, \mbox{\hyperlink{ar5416reg_8h_a3563a44d6b5e2a52456847d7ca48bc92}{AR\_RTC\_SOWL\_PLL\_DIV}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00103}00103                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00104}00104                         pll |= \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(0x58, \mbox{\hyperlink{ar5416reg_8h_a3563a44d6b5e2a52456847d7ca48bc92}{AR\_RTC\_SOWL\_PLL\_DIV}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00105}00105         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00106}00106                 pll |= \mbox{\hyperlink{ah__internal_8h_a3219d5c091f63b52ee0ceba3969ba8c1}{SM}}(0x58, \mbox{\hyperlink{ar5416reg_8h_a3563a44d6b5e2a52456847d7ca48bc92}{AR\_RTC\_SOWL\_PLL\_DIV}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00107}00107 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00108}00108         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5416reg_8h_ad40e7156a084193bcd7f2085094b75db}{AR\_RTC\_PLL\_CONTROL}}, pll);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00109}00109         \mbox{\hyperlink{ah__osdep_8h_a34b88156c4561e13f775e8b9cd9a5374}{OS\_DELAY}}(\mbox{\hyperlink{ar5416__reset_8c_ac496648cab5944260296246565a6ba2f}{RTC\_PLL\_SETTLE\_DELAY}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00110}00110         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5416reg_8h_ac35ebc4dc573eda66ee7491b4bb8ddf4}{AR\_RTC\_SLEEP\_CLK}}, \mbox{\hyperlink{ar5416reg_8h_ad1732fef987b4664f5300ebc9910c3f3}{AR\_RTC\_SLEEP\_DERIVED\_CLK}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00111}00111 \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00113}00113 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00114}00114 \textcolor{comment}{ * Attach for an AR9160 part.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00115}00115 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00116}00116 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal}{ath\_hal}} *}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00117}\mbox{\hyperlink{ar9160__attach_8c_a88dd1ef94bd0146dbc8e13d3988c5515}{00117}} \mbox{\hyperlink{ar9160__attach_8c_a88dd1ef94bd0146dbc8e13d3988c5515}{ar9160Attach}}(uint16\_t devid, \mbox{\hyperlink{ah__osdep_8h_a992b4d201fa7972b414c5dfeac3e18e5}{HAL\_SOFTC}} sc,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00118}00118         \mbox{\hyperlink{ah__osdep_8h_a77249ffa9316d2580fbb830304c59d99}{HAL\_BUS\_TAG}} st, \mbox{\hyperlink{ah__osdep_8h_abcad28debd6fa3485fe27752662fb605}{HAL\_BUS\_HANDLE}} sh, uint16\_t *eepromdata,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00119}00119         \mbox{\hyperlink{structHAL__OPS__CONFIG}{HAL\_OPS\_CONFIG}} *\mbox{\hyperlink{structath__hal_a7865226c677aa67240c2a04e7f64175a}{ah\_config}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00120}00120         \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0}{HAL\_STATUS}} *status)}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00121}00121 \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00122}00122         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5416}{ath\_hal\_5416}} *ahp5416;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00123}00123         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal__5212}{ath\_hal\_5212}} *ahp;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00124}00124         \textcolor{keyword}{struct }\mbox{\hyperlink{structath__hal}{ath\_hal}} *ah;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00125}00125         uint32\_t val;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00126}00126         \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0}{HAL\_STATUS}} ecode;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00127}00127         \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}} rfStatus;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00129}00129         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(\mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eae6b6ecc851ab8e4b694d5a0b8dcb429c}{HAL\_DEBUG\_ATTACH}}, \textcolor{stringliteral}{"{}\%s: sc \%p st \%p sh \%p\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00130}00130             \_\_func\_\_, sc, (\textcolor{keywordtype}{void}*) st, (\textcolor{keywordtype}{void}*) sh);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00131}00131 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00132}00132         \textcolor{comment}{/* NB: memory is returned zero'd */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00133}00133         ahp5416 = \mbox{\hyperlink{ah__internal_8h_a7f8ca8d72271b356d041c10bd5598ce1}{ath\_hal\_malloc}}(\textcolor{keyword}{sizeof} (\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal__5416}{ath\_hal\_5416}}));}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00134}00134         \textcolor{keywordflow}{if} (ahp5416 == \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00135}00135                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(\mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00136}00136                     \textcolor{stringliteral}{"{}\%s: cannot allocate memory for state block\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00137}00137                 *status = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0ab19ce53cce6a6d5f053082bebffd7392}{HAL\_ENOMEM}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00138}00138                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00139}00139         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00140}00140         \mbox{\hyperlink{ar5416_8h_a3fee804ccede99d241e9aae0cf6f5985}{ar5416InitState}}(ahp5416, devid, sc, st, sh, status);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00141}00141         ahp = \&ahp5416-\/>\mbox{\hyperlink{structath__hal__5416_a882a1d840574d665e7c4cf32b278f860}{ah\_5212}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00142}00142         ah = \&ahp-\/>\mbox{\hyperlink{structath__hal__5212_abbfb69bab53f5daa1bae95dddeef9727}{ah\_priv}}.\mbox{\hyperlink{structath__hal__private_a471791635bccf364356464b73a67568c}{h}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00144}00144         \textcolor{comment}{/* XXX override with 9160 specific state */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00145}00145         \textcolor{comment}{/* override 5416 methods for our needs */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00146}00146         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_initPLL = \mbox{\hyperlink{ar9160__attach_8c_af38d7cf9e5157dadd5cd752d1fda099d}{ar9160InitPLL}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00148}00148         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_cal.iqCalData.calData = \&\mbox{\hyperlink{ar9160__attach_8c_a27a13e05fc89fe7564041dbb8eb5641b}{ar9160\_iq\_cal}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00149}00149         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_cal.adcGainCalData.calData = \&\mbox{\hyperlink{ar9160__attach_8c_ab526eee0b52730a0682d089ade2852ae}{ar9160\_adc\_gain\_cal}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00150}00150         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_cal.adcDcCalData.calData = \&\mbox{\hyperlink{ar9160__attach_8c_a1cd3d42ceeb6dbd4bd1784f373427d32}{ar9160\_adc\_dc\_cal}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00151}00151         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_cal.adcDcCalInitData.calData = \&\mbox{\hyperlink{ar9160__attach_8c_a88da4bbe1c1295a94c17e666b70b675a}{ar9160\_adc\_init\_dc\_cal}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00152}00152         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_cal.suppCals = \mbox{\hyperlink{ar5416__cal_8h_a5908bd03a01fa81f199a3e1f2bb56fb0ad96af00183b6a12f5cf857f9388cd06a}{ADC\_GAIN\_CAL}} | \mbox{\hyperlink{ar5416__cal_8h_a5908bd03a01fa81f199a3e1f2bb56fb0a00f7ebc2b11529215f01ef1fb7921822}{ADC\_DC\_CAL}} | \mbox{\hyperlink{ar5416__cal_8h_a5908bd03a01fa81f199a3e1f2bb56fb0abcd60c39469bff6836c58ccff47727b7}{IQ\_MISMATCH\_CAL}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00154}00154         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5416_8h_ae8ae0b50e36c92ff07152a6794502f31}{ar5416SetResetReg}}(ah, \mbox{\hyperlink{ah_8h_adf764cbdea00d65edcd07bb9953ad2b7a75635359649da89bfc314ba4323824cb}{HAL\_RESET\_POWER\_ON}})) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00155}00155                 \textcolor{comment}{/* reset chip */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00156}00156                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: couldn't reset chip\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00157}00157                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00158}00158                 ecode = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a163bd2fc79bfcdd646cf57ed3d46542a}{HAL\_EIO}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00159}00159                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00160}00160         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00162}00162         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5416_8h_a6a8d652f69557e641d37d02568f44c39}{ar5416SetPowerMode}}(ah, \mbox{\hyperlink{ah_8h_a48c3115e12caf57353013063438be679a75d316373c0af3b3d0192bb3fe44fc7c}{HAL\_PM\_AWAKE}}, \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}})) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00163}00163                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: couldn't wakeup chip\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00164}00164                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00165}00165                 ecode = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a163bd2fc79bfcdd646cf57ed3d46542a}{HAL\_EIO}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00166}00166                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00167}00167         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00168}00168         \textcolor{comment}{/* Read Revisions from Chips before taking out of reset */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00169}00169         val = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5210reg_8h_a3485721f98ae256a3d29263330c4cf76}{AR\_SREV}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00170}00170         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eae6b6ecc851ab8e4b694d5a0b8dcb429c}{HAL\_DEBUG\_ATTACH}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00171}00171             \textcolor{stringliteral}{"{}\%s: ID 0x\%x VERSION 0x\%x TYPE 0x\%x REVISION 0x\%x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00172}00172             \_\_func\_\_, \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(val, \mbox{\hyperlink{ar5416reg_8h_a963ea4000fc28bc4b44ddea6a39ae5c4}{AR\_XSREV\_ID}}), \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(val, \mbox{\hyperlink{ar5416reg_8h_a35359c0755c4c2eafc2f29f8e76ef3e9}{AR\_XSREV\_VERSION}}),}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00173}00173             \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(val, \mbox{\hyperlink{ar5416reg_8h_a3c1fa10ef62bacbbf78901f6dbb9428a}{AR\_XSREV\_TYPE}}), \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(val, \mbox{\hyperlink{ar5416reg_8h_adc7bec9c416cf84438dea53d316ad54d}{AR\_XSREV\_REVISION}}));}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00174}00174         \textcolor{comment}{/* NB: include chip type to differentiate from pre-\/Sowl versions */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00175}00175         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macVersion =}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00176}00176             (val \& \mbox{\hyperlink{ar5416reg_8h_a35359c0755c4c2eafc2f29f8e76ef3e9}{AR\_XSREV\_VERSION}}) >> \mbox{\hyperlink{ar5416reg_8h_ac379f35dcc879b5eac7a89363d257652}{AR\_XSREV\_TYPE\_S}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00177}00177         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_macRev = \mbox{\hyperlink{ah__internal_8h_a3cb92725e12650d7447b06c9db39aac9}{MS}}(val, \mbox{\hyperlink{ar5416reg_8h_adc7bec9c416cf84438dea53d316ad54d}{AR\_XSREV\_REVISION}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00178}00178         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_ispcie = (val \& \mbox{\hyperlink{ar5416reg_8h_a9eaf88158cb7f3a88135554f0b9bbe02}{AR\_XSREV\_TYPE\_HOST\_MODE}}) == 0;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00180}00180         \textcolor{comment}{/* setup common ini data; rf backends handle remainder */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00181}00181         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&ahp-\/>\mbox{\hyperlink{structath__hal__5212_afcd8096832a396e9b57b13af70e6d64b}{ah\_ini\_modes}}, ar9160Modes, 6);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00182}00182         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&ahp-\/>\mbox{\hyperlink{structath__hal__5212_a233dfec0de99d6efafa3ecad07c6e406}{ah\_ini\_common}}, ar9160Common, 2);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00183}00183 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00184}00184         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_bb\_rfgain, ar9160BB\_RfGain, 3);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00185}00185         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_bank0, ar9160Bank0, 2);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00186}00186         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_bank1, ar9160Bank1, 2);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00187}00187         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_bank2, ar9160Bank2, 2);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00188}00188         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_bank3, ar9160Bank3, 3);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00189}00189         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_bank6, ar9160Bank6TPC, 3);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00190}00190         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_bank7, ar9160Bank7, 2);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00191}00191         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ar5416reg_8h_a341691872253e51dc985a342fca02d7b}{AR\_SREV\_SOWL\_11}}(ah))}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00192}00192                 \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_addac, ar9160Addac\_1\_1, 2);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00193}00193         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00194}00194                 \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_addac, ar9160Addac, 2);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00196}00196         ecode = \mbox{\hyperlink{ah__eeprom_8h_ae893c314c55e63a0f4abc39c1b5ecfc0}{ath\_hal\_v14EepromAttach}}(ah);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00197}00197         \textcolor{keywordflow}{if} (ecode != \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a6eb724a07061d89a4a2052744e5a3632}{HAL\_OK}})}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00198}00198                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00200}00200         \mbox{\hyperlink{ah__internal_8h_a2c792c3aa33994fcc208cc0bdac5209e}{HAL\_INI\_INIT}}(\&\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_ini\_pcieserdes, ar9160PciePhy, 2);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00201}00201         \mbox{\hyperlink{ar5416_8h_a6c4d3a45afb45b6869725dcdc95e566d}{ar5416AttachPCIE}}(ah);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00202}00202 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00203}00203         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5416_8h_a5971389672a07665c78ae9ac554f6a1e}{ar5416ChipReset}}(ah, \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}}, \mbox{\hyperlink{ah_8h_a5d39e0ba467d3f62f525498655ccb497a9c2195e6eea41d6fed29492df68a3c21}{HAL\_RESET\_NORMAL}})) \{    \textcolor{comment}{/* reset chip */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00204}00204                 \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{ar9160__attach_8c_source_l00205}00205                 ecode = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a163bd2fc79bfcdd646cf57ed3d46542a}{HAL\_EIO}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00206}00206                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00207}00207         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00209}00209         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_phyRev = \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5211phy_8h_a8b73b787f7a466d09bd86381b7403e97}{AR\_PHY\_CHIP\_ID}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00211}00211         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5212_8h_a6c3138c4c5db80e0adfe4eae9e540bed}{ar5212ChipTest}}(ah)) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00212}00212                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: hardware self-\/test failed\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00213}00213                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00214}00214                 ecode = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a2e77505b12c2310e62c98361ff7330ae}{HAL\_ESELFTEST}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00215}00215                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00216}00216         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00218}00218         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00219}00219 \textcolor{comment}{         * Set correct Baseband to analog shift}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00220}00220 \textcolor{comment}{         * setting to access analog chips.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00221}00221 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00222}00222         \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5210phy_8h_a9bee63043ebe7123ce88256276643e38}{AR\_PHY}}(0), 0x00000007);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00224}00224         \textcolor{comment}{/* Read Radio Chip Rev Extract */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00225}00225         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_analog5GhzRev = \mbox{\hyperlink{ar5416_8h_ae939670134bdc7aa6972d92e7699b3d5}{ar5416GetRadioRev}}(ah);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00226}00226         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>\mbox{\hyperlink{structath__hal_a9680c90b7900e544d1d75ac57d9822e8}{ah\_analog5GhzRev}} \& \mbox{\hyperlink{ar5212reg_8h_ad1497f58d2af3510277cdf8c41122a62}{AR\_RADIO\_SREV\_MAJOR}}) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00227}00227         \textcolor{keywordflow}{case} \mbox{\hyperlink{ar5416reg_8h_a881afdfe33c4571c824d5607360d888c}{AR\_RAD2133\_SREV\_MAJOR}}:        \textcolor{comment}{/* Sowl: 2G/3x3 */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00228}00228         \textcolor{keywordflow}{case} \mbox{\hyperlink{ar5416reg_8h_a2b0a46a4f9f0a6b4dc3fe966d1e066d8}{AR\_RAD5133\_SREV\_MAJOR}}:        \textcolor{comment}{/* Sowl: 2+5G/3x3 */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00229}00229                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00230}00230         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00231}00231                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>\mbox{\hyperlink{structath__hal_a9680c90b7900e544d1d75ac57d9822e8}{ah\_analog5GhzRev}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00232}00232                         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_analog5GhzRev =}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00233}00233                                 \mbox{\hyperlink{ar5416reg_8h_a2b0a46a4f9f0a6b4dc3fe966d1e066d8}{AR\_RAD5133\_SREV\_MAJOR}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00234}00234                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00235}00235                 \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00236}00236 \textcolor{preprocessor}{\#ifdef AH\_DEBUG}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00237}00237                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00238}00238                     \textcolor{stringliteral}{"{}\%s: 5G Radio Chip Rev 0x\%02X is not supported by "{}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00239}00239                     \textcolor{stringliteral}{"{}this driver\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00240}00240                     \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>\mbox{\hyperlink{structath__hal_a9680c90b7900e544d1d75ac57d9822e8}{ah\_analog5GhzRev}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00241}00241                 ecode = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a37dabb34ab9f9c9c54ccb1eff36c11bd}{HAL\_ENOTSUPP}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00242}00242                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00243}00243 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00244}00244         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00245}00245         rfStatus = \mbox{\hyperlink{ar2133_8c_a8d9d69c63a0f1d6a7daf47d841289738}{ar2133RfAttach}}(ah, \&ecode);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00246}00246         \textcolor{keywordflow}{if} (!rfStatus) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00247}00247                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}}, \textcolor{stringliteral}{"{}\%s: RF setup failed, status \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00248}00248                     \_\_func\_\_, ecode);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00249}00249                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00250}00250         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00252}00252         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00253}00253 \textcolor{comment}{         * Got everything we need now to setup the capabilities.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00254}00254 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00255}00255         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar9160__attach_8c_a3cee6d230e7ce1e4aa391df1f69be3e5}{ar9160FillCapabilityInfo}}(ah)) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00256}00256                 ecode = \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a36a0dc448fea942d381bbd3a0acc0928}{HAL\_EEREAD}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00257}00257                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00258}00258         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00260}00260         ecode = \mbox{\hyperlink{ah__internal_8h_a7176b52a6180c0ebb56fa0eae8146024}{ath\_hal\_eepromGet}}(ah, \mbox{\hyperlink{ah__eeprom_8h_ac36f475ca5b446f4fde4c9b90bec77c8a209439dcd49d103dc439ef84b4d9498f}{AR\_EEP\_MACADDR}}, ahp-\/>\mbox{\hyperlink{structath__hal__5212_a91d7ac1444967cb16f36db70520d252a}{ah\_macaddr}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00261}00261         \textcolor{keywordflow}{if} (ecode != \mbox{\hyperlink{ah_8h_a064b8990700c1dbc7801f3eb616153b0a6eb724a07061d89a4a2052744e5a3632}{HAL\_OK}}) \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00262}00262                 \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9ea35506ea938627da4c44204d0895d0bf8}{HAL\_DEBUG\_ANY}},}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00263}00263                     \textcolor{stringliteral}{"{}\%s: error getting mac address from EEPROM\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00264}00264                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00265}00265         \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00266}00266         \textcolor{comment}{/* XXX How about the serial number ? */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00267}00267         \textcolor{comment}{/* Read Reg Domain */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00268}00268         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_currentRD =}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00269}00269             \mbox{\hyperlink{ah__internal_8h_a7176b52a6180c0ebb56fa0eae8146024}{ath\_hal\_eepromGet}}(ah, \mbox{\hyperlink{ah__eeprom_8h_ac36f475ca5b446f4fde4c9b90bec77c8a5657219335c902a7f5e5800e6825240d}{AR\_EEP\_REGDMN\_0}}, \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00270}00270         \mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_currentRDext =}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00271}00271             \mbox{\hyperlink{ah__internal_8h_a7176b52a6180c0ebb56fa0eae8146024}{ath\_hal\_eepromGet}}(ah, \mbox{\hyperlink{ah__eeprom_8h_ac36f475ca5b446f4fde4c9b90bec77c8ab6519e3e875a54a19ec139dfca11fccf}{AR\_EEP\_REGDMN\_1}}, \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00272}00272 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00273}00273         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00274}00274 \textcolor{comment}{         * ah\_miscMode is populated by ar5416FillCapabilityInfo()}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00275}00275 \textcolor{comment}{         * starting from griffin. Set here to make sure that}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00276}00276 \textcolor{comment}{         * AR\_MISC\_MODE\_MIC\_NEW\_LOC\_ENABLE is set before a GTK is}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00277}00277 \textcolor{comment}{         * placed into hardware.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00278}00278 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00279}00279         \textcolor{keywordflow}{if} (ahp-\/>\mbox{\hyperlink{structath__hal__5212_a012e4d5ed8630284d09df100689d1d3a}{ah\_miscMode}} != 0)}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00280}00280                 \mbox{\hyperlink{ah__osdep_8h_a8e19d34bdc4596d48a978fc59e1b60fb}{OS\_REG\_WRITE}}(ah, \mbox{\hyperlink{ar5212reg_8h_a8fc6d95a175a700e88e63266a4b7ac16}{AR\_MISC\_MODE}}, \mbox{\hyperlink{ah__osdep_8h_afded631196d59ba3443fc37addc9a2a6}{OS\_REG\_READ}}(ah, \mbox{\hyperlink{ar5212reg_8h_a8fc6d95a175a700e88e63266a4b7ac16}{AR\_MISC\_MODE}}) | ahp-\/>\mbox{\hyperlink{structath__hal__5212_a012e4d5ed8630284d09df100689d1d3a}{ah\_miscMode}});}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00282}00282         \mbox{\hyperlink{ar9160__attach_8c_a51dba8cd60d184be6e3ccbc38cdb5af5}{ar9160AniSetup}}(ah);                       \textcolor{comment}{/* Anti Noise Immunity */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00283}00283 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00284}00284         \textcolor{comment}{/* This just uses the AR5416 NF values */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00285}00285         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>nf\_2g.max = \mbox{\hyperlink{ar5416phy_8h_acb7c0b9cd56c52021c8e05b4e6c00c2a}{AR\_PHY\_CCA\_MAX\_GOOD\_VAL\_5416\_2GHZ}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00286}00286         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>nf\_2g.min = \mbox{\hyperlink{ar5416phy_8h_a9c0aea6009d3fea734f07a41da453fa1}{AR\_PHY\_CCA\_MIN\_GOOD\_VAL\_5416\_2GHZ}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00287}00287         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>nf\_2g.nominal = \mbox{\hyperlink{ar5416phy_8h_aeae4e20ffb1b4972d50e5135b1100702}{AR\_PHY\_CCA\_NOM\_VAL\_5416\_2GHZ}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00288}00288         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>nf\_5g.max = \mbox{\hyperlink{ar5416phy_8h_a2b71ee3543f087b4a37e17e560927a92}{AR\_PHY\_CCA\_MAX\_GOOD\_VAL\_5416\_5GHZ}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00289}00289         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>nf\_5g.min = \mbox{\hyperlink{ar5416phy_8h_a0b6465a23e63158c876dbb309bf7293c}{AR\_PHY\_CCA\_MIN\_GOOD\_VAL\_5416\_5GHZ}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00290}00290         \mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>nf\_5g.nominal = \mbox{\hyperlink{ar5416phy_8h_a920c52e820aeedf63aae9b3525aae49a}{AR\_PHY\_CCA\_NOM\_VAL\_5416\_5GHZ}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00292}00292         \mbox{\hyperlink{ar5416__cal_8c_a98ec9fc1757338551dde53d63a1e43b1}{ar5416InitNfHistBuff}}(\mbox{\hyperlink{ar5416_8h_a2d8648a62309d936106c5710b0fae06c}{AH5416}}(ah)-\/>ah\_cal.nfCalHist);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00293}00293 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00294}00294         \mbox{\hyperlink{ah__internal_8h_ac09ac07206a85dc5f4079553a0520c4e}{HALDEBUG}}(ah, \mbox{\hyperlink{ah__debug_8h_a61dadd085c1777f559549e05962b2c9eae6b6ecc851ab8e4b694d5a0b8dcb429c}{HAL\_DEBUG\_ATTACH}}, \textcolor{stringliteral}{"{}\%s: return\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00296}00296         \textcolor{keywordflow}{return} ah;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00297}00297 bad:}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00298}00298         \textcolor{keywordflow}{if} (ahp)}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00299}00299                 \mbox{\hyperlink{ar5416_8h_a6935af6528b6779fa2ceff087c6551cf}{ar5416Detach}}((\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *) ahp);}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00300}00300         \textcolor{keywordflow}{if} (status)}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00301}00301                 *status = ecode;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00302}00302         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00303}00303 \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00305}00305 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00306}00306 \textcolor{comment}{ * Fill all software cached or static hardware state information.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00307}00307 \textcolor{comment}{ * Return failure if capabilities are to come from EEPROM and}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00308}00308 \textcolor{comment}{ * cannot be read.}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00309}00309 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00310}00310 \textcolor{keyword}{static} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39a}{HAL\_BOOL}}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00311}\mbox{\hyperlink{ar9160__attach_8c_a3cee6d230e7ce1e4aa391df1f69be3e5}{00311}} \mbox{\hyperlink{ar9160__attach_8c_a3cee6d230e7ce1e4aa391df1f69be3e5}{ar9160FillCapabilityInfo}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structath__hal}{ath\_hal}} *ah)}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00312}00312 \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00313}00313         \mbox{\hyperlink{structHAL__CAPABILITIES}{HAL\_CAPABILITIES}} *pCap = \&\mbox{\hyperlink{ah__internal_8h_a7a57bc6086e9d3ed4c9d81f5d0a136cc}{AH\_PRIVATE}}(ah)-\/>ah\_caps;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00315}00315         \textcolor{keywordflow}{if} (!\mbox{\hyperlink{ar5416_8h_ad1f033aec6f0aed4987322e8604f463e}{ar5416FillCapabilityInfo}}(ah))}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00316}00316                 \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00317}00317         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a4c361320b42779f57c69a0aeadde84a1}{halCSTSupport}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00318}00318         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_ad87f6eeca2739d9d4c7303441507fe56}{halRifsRxSupport}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00319}00319         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a2b3b881bf7f8cd662fe0a04c1825d6f1}{halRifsTxSupport}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00320}00320         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a03f6f870c341940e925f6c416957666f}{halRtsAggrLimit}} = 64*1024; \textcolor{comment}{/* 802.11n max */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00321}00321         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_aa27706b168f28b6bc45713c313c6aa1a}{halExtChanDfsSupport}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00322}00322         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a39e114b6f780f27417214c29849d8826}{halUseCombinedRadarRssi}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00323}00323         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a0f8f29e7e8692cd20a473760864a294a}{halAutoSleepSupport}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aa46085f3e46cbceb46c46b0bde64a6c20}{AH\_FALSE}};        \textcolor{comment}{/* XXX? */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00324}00324         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a03eeb8647db143792236a2fe5a44d5ed}{halMbssidAggrSupport}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00325}00325         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a0d19e5dc4272ca558cd8e029527e2582}{hal4AddrAggrSupport}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00326}00326         \textcolor{comment}{/* BB Read WAR */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00327}00327         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_ae0ce94edd4bb4de57bdcb0803d11868a}{halHasBBReadWar}} = \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00328}00328 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00329}00329         \textcolor{comment}{/* AR9160 is a 2x2 stream device */}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00330}00330         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a93e0fc66d9dcfa621901dac603a3d23c}{halTxStreams}} = 2;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00331}00331         pCap-\/>\mbox{\hyperlink{structHAL__CAPABILITIES_a02794709a49cf24acde40cda22a3b5f4}{halRxStreams}} = 2;}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00332}00332 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00333}00333         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah_8h_ae8793e83d29537653565625006f5c39aadc898cbb91e577b40c005576c51e8fdb}{AH\_TRUE}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00334}00334 \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00336}00336 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}*}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00337}\mbox{\hyperlink{ar9160__attach_8c_a64f46dc3789f135f09e49d19b2c0b967}{00337}} \mbox{\hyperlink{ar9160__attach_8c_a64f46dc3789f135f09e49d19b2c0b967}{ar9160Probe}}(uint16\_t vendorid, uint16\_t devid)}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00338}00338 \{}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00339}00339         \textcolor{keywordflow}{if} (vendorid == \mbox{\hyperlink{ah__devid_8h_aeaeb2ee471d2af0336f6fa3276426316}{ATHEROS\_VENDOR\_ID}} \&\& devid == \mbox{\hyperlink{ah__devid_8h_aecb83e02cad6c085869e400acc04f9e5}{AR9160\_DEVID\_PCI}})}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00340}00340                 \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Atheros 9160"{}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00341}00341         \textcolor{keywordflow}{return} \mbox{\hyperlink{ah__internal_8h_ab933afbd431099f80d5e58c5a6271b4a}{AH\_NULL}};}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00342}00342 \}}
\DoxyCodeLine{\Hypertarget{ar9160__attach_8c_source_l00343}\mbox{\hyperlink{ar9160__attach_8c_afa0af010d647126ab053ea462fc4ce09}{00343}} \mbox{\hyperlink{ar9160__attach_8c_afa0af010d647126ab053ea462fc4ce09}{AH\_CHIP}}(AR9160, \mbox{\hyperlink{ar9160__attach_8c_a64f46dc3789f135f09e49d19b2c0b967}{ar9160Probe}}, \mbox{\hyperlink{ar9160__attach_8c_a88dd1ef94bd0146dbc8e13d3988c5515}{ar9160Attach}});}

\end{DoxyCode}
