\hypertarget{r88ee__init_8c_source}{}\doxysection{r88ee\+\_\+init.\+c}
\label{r88ee__init_8c_source}\index{dev/rtwn/rtl8188e/pci/r88ee\_init.c@{dev/rtwn/rtl8188e/pci/r88ee\_init.c}}
\mbox{\hyperlink{r88ee__init_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2017 Farhan Khan <khanzf@gmail.com>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00004}00004 \textcolor{comment}{ * Permission to use, copy, modify, and distribute this software for any}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00005}00005 \textcolor{comment}{ * purpose with or without fee is hereby granted, provided that the above}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00006}00006 \textcolor{comment}{ * copyright notice and this permission notice appear in all copies.}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00008}00008 \textcolor{comment}{ * THE SOFTWARE IS PROVIDED "{}AS IS"{} AND THE AUTHOR DISCLAIMS ALL WARRANTIES}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00009}00009 \textcolor{comment}{ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00010}00010 \textcolor{comment}{ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00011}00011 \textcolor{comment}{ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00012}00012 \textcolor{comment}{ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00013}00013 \textcolor{comment}{ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00014}00014 \textcolor{comment}{ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00015}00015 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00016}00016 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00017}00017 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00018}\mbox{\hyperlink{r88ee__init_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00018}} \mbox{\hyperlink{r88ee__init_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00019}00019 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00020}00020 \textcolor{preprocessor}{\#include "{}opt\_wlan.h"{}}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00021}00021 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00022}00022 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00023}00023 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00024}00024 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00025}00025 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00026}00026 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00027}00027 \textcolor{preprocessor}{\#include <sys/socket.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00028}00028 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/taskqueue.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/endian.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/linker.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <machine/resource.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <net/if.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <net/ethernet.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <net/if\_media.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <net80211/ieee80211\_var.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <net80211/ieee80211\_radiotap.h>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{if__rtwnvar_8h}{dev/rtwn/if\_rtwnvar.h}}>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{rtwn__pci__var_8h}{dev/rtwn/pci/rtwn\_pci\_var.h}}>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{r92c_8h}{dev/rtwn/rtl8192c/r92c.h}}>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{r88ee_8h}{dev/rtwn/rtl8188e/pci/r88ee.h}}>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{r88ee__reg_8h}{dev/rtwn/rtl8188e/pci/r88ee\_reg.h}}>}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00056}00056 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00057}\mbox{\hyperlink{r88ee_8h_af896a8b7065c6ee6852fa52125ad6d2a}{00057}} \mbox{\hyperlink{r88ee__init_8c_adeeb205d40997f3ab561c5102497ff7b}{r88ee\_init\_bb}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structrtwn__softc}{rtwn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00058}00058 \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00060}00060         \textcolor{comment}{/* Enable BB and RF. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00061}00061         \mbox{\hyperlink{if__rtwnvar_8h_a19dd59b88241da2e33bd2e5329011f9c}{rtwn\_setbits\_2}}(sc, \mbox{\hyperlink{r92c__reg_8h_a3534d19cce76efcebdaa962fddfc4166}{R92C\_SYS\_FUNC\_EN}}, 0,}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00062}00062             \mbox{\hyperlink{r92c__reg_8h_ae61fad0791b681870fb984d8ea43f12d}{R92C\_SYS\_FUNC\_EN\_BBRSTB}} | \mbox{\hyperlink{r92c__reg_8h_a78857fde38782fb8dfb39c4316443f22}{R92C\_SYS\_FUNC\_EN\_BB\_GLB\_RST}} |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00063}00063             \mbox{\hyperlink{r92c__reg_8h_a4ee76dc1ac67f65fb2ffb04f492095f1}{R92C\_SYS\_FUNC\_EN\_DIO\_RF}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00065}00065         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ae7bfaeca12e4bc3528b5511e98d58bc3}{R92C\_RF\_CTRL}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00066}00066             \mbox{\hyperlink{r92c__reg_8h_a1c3b76c431ccd791c7455da3aaf7fef9}{R92C\_RF\_CTRL\_EN}} | \mbox{\hyperlink{r92c__reg_8h_a48d4dbe460caae13552dfb1aecf3d017}{R92C\_RF\_CTRL\_RSTB}} | \mbox{\hyperlink{r92c__reg_8h_ae1375cd35a7411a24f96bb05fdbba5d8}{R92C\_RF\_CTRL\_SDMRSTB}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00067}00067         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a3534d19cce76efcebdaa962fddfc4166}{R92C\_SYS\_FUNC\_EN}}, \mbox{\hyperlink{r92c__reg_8h_aaec515f1de8a69817297cb89ac65fe5c}{R92C\_SYS\_FUNC\_EN\_PPLL}} |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00068}00068             \mbox{\hyperlink{r92c__reg_8h_a38086b9ca0d71867134ac43b00b545f7}{R92C\_SYS\_FUNC\_EN\_PCIEA}} | \mbox{\hyperlink{r92c__reg_8h_a34651ae4c734ba59b1233bad1bafe38b}{R92C\_SYS\_FUNC\_EN\_DIO\_PCIE}} |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00069}00069             \mbox{\hyperlink{r92c__reg_8h_a78857fde38782fb8dfb39c4316443f22}{R92C\_SYS\_FUNC\_EN\_BB\_GLB\_RST}} | \mbox{\hyperlink{r92c__reg_8h_ae61fad0791b681870fb984d8ea43f12d}{R92C\_SYS\_FUNC\_EN\_BBRSTB}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00071}00071         \mbox{\hyperlink{r88e_8h_a33d8c6ef1e52cb1a9b21b51d2dcfe42d}{r88e\_init\_bb\_common}}(sc);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00072}00072 \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00074}00074 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00075}\mbox{\hyperlink{r88ee_8h_acd59e6346dbe663b8b2ca5eaafcb9371}{00075}} \mbox{\hyperlink{r88ee__init_8c_aa9f9f651e8be8c1aa150a06f40a4b17d}{r88ee\_init\_intr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structrtwn__softc}{rtwn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00076}00076 \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00077}00077         \textcolor{comment}{/* Disable interrupts. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00078}00078         \mbox{\hyperlink{if__rtwnvar_8h_a7f17e4877feb5ff91f23223e6e1b885c}{rtwn\_write\_4}}(sc, \mbox{\hyperlink{r88e__reg_8h_ab289c40e42a71b0f1436908fa3e8e1e6}{R88E\_HIMR}}, 0x00000000);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00079}00079         \mbox{\hyperlink{if__rtwnvar_8h_a7f17e4877feb5ff91f23223e6e1b885c}{rtwn\_write\_4}}(sc, \mbox{\hyperlink{r88e__reg_8h_ae0faa4e2c87ef972364a5facd9332df1}{R88E\_HIMRE}}, 0x00000000);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00080}00080 \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00082}00082 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00083}\mbox{\hyperlink{r88ee_8h_af155f241d18c86cbb86f3486006c7d05}{00083}} \mbox{\hyperlink{r88ee__init_8c_acc1782f08503a23d08d78804d6de1cfa}{r88ee\_power\_on}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structrtwn__softc}{rtwn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00084}00084 \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00085}00085         \textcolor{keywordtype}{int} ntries;}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00087}00087         \textcolor{comment}{/* Disable XTAL output for power saving. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00088}00088         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r88e__reg_8h_a24d98e330282b33ddc7b97b710e4d4e4}{R88E\_XCK\_OUT\_CTRL}}, \mbox{\hyperlink{r88e__reg_8h_aa4fa22b4ae3862ca3e7c6d28204469ef}{R88E\_XCK\_OUT\_CTRL\_EN}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00090}00090         \textcolor{comment}{/* Unlock ISO/CLK/Power control register. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00091}00091         \mbox{\hyperlink{if__rtwnvar_8h_a19dd59b88241da2e33bd2e5329011f9c}{rtwn\_setbits\_2}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}}, \mbox{\hyperlink{r92c__reg_8h_adecf1166efde07489549aa462aef104a}{R92C\_APS\_FSMCO\_APDM\_HPDN}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00092}00092         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ab71a68501e2b950097ea7fe1f782bf90}{R92C\_RSV\_CTRL}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00094}00094         \textcolor{comment}{/* Wait for power ready bit */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00095}00095         \textcolor{keywordflow}{for}(ntries = 0; ntries < 5000; ntries++) \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00096}00096                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__rtwnvar_8h_a4ae5fb745e3dc54fb5469820e706d25d}{rtwn\_read\_4}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}}) \& \mbox{\hyperlink{r92c__reg_8h_a488454ab473e4ce276a37edfa3433d21}{R92C\_APS\_FSMCO\_SUS\_HOST}})}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00097}00097                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00098}00098                 \mbox{\hyperlink{if__rtwnvar_8h_a3fe76ab201bc261d0950f661104812e2}{rtwn\_delay}}(sc, 10);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00099}00099         \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00100}00100         \textcolor{keywordflow}{if} (ntries == 5000) \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00101}00101                 device\_printf(sc-\/>\mbox{\hyperlink{structrtwn__softc_a299d18a16d08213b975a1585651583f9}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00102}00102                     \textcolor{stringliteral}{"{}timeout waiting for chip power up\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00103}00103                 \textcolor{keywordflow}{return} (ETIMEDOUT);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00104}00104         \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00106}00106         \textcolor{comment}{/* Reset BB. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00107}00107         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a3534d19cce76efcebdaa962fddfc4166}{R92C\_SYS\_FUNC\_EN}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00108}00108             \mbox{\hyperlink{r92c__reg_8h_ae61fad0791b681870fb984d8ea43f12d}{R92C\_SYS\_FUNC\_EN\_BBRSTB}} | \mbox{\hyperlink{r92c__reg_8h_a78857fde38782fb8dfb39c4316443f22}{R92C\_SYS\_FUNC\_EN\_BB\_GLB\_RST}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00109}00109 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00110}00110         \textcolor{comment}{/* schmit trigger */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00111}00111         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_af212fd3fbdfa56bab341e50deefe6b7b}{R92C\_AFE\_XTAL\_CTRL}} + 2, 0, 0x80);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00112}00112 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00113}00113         \textcolor{comment}{/* Disable HWPDN. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00114}00114         \mbox{\hyperlink{if__rtwnvar_8h_a0b4a07b836b7fb793728d6961caa8bc7}{rtwn\_setbits\_1\_shift}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00115}00115             \mbox{\hyperlink{r92c__reg_8h_adecf1166efde07489549aa462aef104a}{R92C\_APS\_FSMCO\_APDM\_HPDN}}, 0, 1);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00117}00117         \textcolor{comment}{/* Disable WL suspend. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00118}00118         \mbox{\hyperlink{if__rtwnvar_8h_a0b4a07b836b7fb793728d6961caa8bc7}{rtwn\_setbits\_1\_shift}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00119}00119             \mbox{\hyperlink{r92c__reg_8h_a996897ff8df09128bea560b4dbbf417b}{R92C\_APS\_FSMCO\_AFSM\_HSUS}} | \mbox{\hyperlink{r92c__reg_8h_a8d4e85edad63570b2010d64c5515cf1f}{R92C\_APS\_FSMCO\_AFSM\_PCIE}}, 0, 1);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00121}00121         \textcolor{comment}{/* Auto-\/enable WLAN */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00122}00122         \mbox{\hyperlink{if__rtwnvar_8h_a0b4a07b836b7fb793728d6961caa8bc7}{rtwn\_setbits\_1\_shift}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00123}00123             0, \mbox{\hyperlink{r92c__reg_8h_a0237660ecf94328890974f72974b5917}{R92C\_APS\_FSMCO\_APFM\_ONMAC}}, 1);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00124}00124         \textcolor{keywordflow}{for} (ntries = 0; ntries < 5000; ntries++) \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00125}00125                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{if__rtwnvar_8h_a0b472837d38e093cf4962967cf9c34bb}{rtwn\_read\_2}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}}) \&}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00126}00126                     \mbox{\hyperlink{r92c__reg_8h_a0237660ecf94328890974f72974b5917}{R92C\_APS\_FSMCO\_APFM\_ONMAC}}))}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00127}00127                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00128}00128                 \mbox{\hyperlink{if__rtwnvar_8h_a3fe76ab201bc261d0950f661104812e2}{rtwn\_delay}}(sc, 10);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00129}00129         \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00130}00130         \textcolor{keywordflow}{if} (ntries == 5000)}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00131}00131                 \textcolor{keywordflow}{return} (ETIMEDOUT);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00133}00133         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92ce__reg_8h_aa2a2f8f12a26105949530fd3fd470355}{R92C\_PCIE\_CTRL\_REG}} + 2, 0, 0x04);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00135}00135         \textcolor{comment}{/* Enable LDO normal mode. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00136}00136         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ae4c6b3df1ab3ec9c1e193688782767d6}{R92C\_LPLDO\_CTRL}}, \mbox{\hyperlink{r92c__reg_8h_a9ac0c0c6ce766e06385dbbe1707d4bdb}{R92C\_LPLDO\_CTRL\_SLEEP}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00138}00138         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}}, 0, \mbox{\hyperlink{r92c__reg_8h_ac5b20827da8454d4ee893494808ffcd4}{R92C\_APS\_FSMCO\_PDN\_EN}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00139}00139         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92ce__reg_8h_aa2a2f8f12a26105949530fd3fd470355}{R92C\_PCIE\_CTRL\_REG}} + 2, 0, 0x04);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00140}00140         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a9b4899b4de19306951c659ee578a0ea3}{R92C\_AFE\_XTAL\_CTRL\_EXT}} + 1, 0, 0x02);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00141}00141         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a05688d9d62569eed012600cd6496e371}{R92C\_SYS\_CLKR}}, 0, 0x08);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00142}00142         \mbox{\hyperlink{if__rtwnvar_8h_a19dd59b88241da2e33bd2e5329011f9c}{rtwn\_setbits\_2}}(sc, \mbox{\hyperlink{r92c__reg_8h_a35bf89bb411444c6db8142184dfce194}{R92C\_GPIO\_MUXCFG}}, \mbox{\hyperlink{r92c__reg_8h_a67b8e4f2b6a27dca9062a4f452ef15bf}{R92C\_GPIO\_MUXCFG\_ENSIC}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00144}00144         \textcolor{comment}{/* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00145}00145         \mbox{\hyperlink{if__rtwnvar_8h_a61d56a364bbdf0b209f7e07ebb59b823}{rtwn\_write\_2}}(sc, \mbox{\hyperlink{r92c__reg_8h_ab4fda584b9e7924463ec9158b75f6a42}{R92C\_CR}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00146}00146         \mbox{\hyperlink{if__rtwnvar_8h_a19dd59b88241da2e33bd2e5329011f9c}{rtwn\_setbits\_2}}(sc, \mbox{\hyperlink{r92c__reg_8h_ab4fda584b9e7924463ec9158b75f6a42}{R92C\_CR}}, 0,}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00147}00147             \mbox{\hyperlink{r92c__reg_8h_ade3a80d4a9af64ae124374ae62cb6254}{R92C\_CR\_HCI\_TXDMA\_EN}} | \mbox{\hyperlink{r92c__reg_8h_a174ddd2b01fd819252dcb54af8a67bdb}{R92C\_CR\_TXDMA\_EN}} |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00148}00148             \mbox{\hyperlink{r92c__reg_8h_ab5b4b721210e3f26dfa0a8fd3372d119}{R92C\_CR\_HCI\_RXDMA\_EN}} | \mbox{\hyperlink{r92c__reg_8h_aa11d3abf7e63175473aed2d2a51611ba}{R92C\_CR\_RXDMA\_EN}} |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00149}00149             \mbox{\hyperlink{r92c__reg_8h_a73295692bd24219708b84d331d267882}{R92C\_CR\_PROTOCOL\_EN}} | \mbox{\hyperlink{r92c__reg_8h_a074479cba8d8e122fc0d8d1523fefc35}{R92C\_CR\_SCHEDULE\_EN}} |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00150}00150             ((sc-\/>\mbox{\hyperlink{structrtwn__softc_ab74acaa2bcd97893a2dd4612b39b2fec}{sc\_hwcrypto}} != \mbox{\hyperlink{if__rtwnvar_8h_abc6126af1d45847bc59afa0aa3216b04a250caa5c9c1a3c13cd67f7690dfa1132}{RTWN\_CRYPTO\_SW}}) ? \mbox{\hyperlink{r92c__reg_8h_a2140a526a1b1c55b4e04ab24d635cf10}{R92C\_CR\_ENSEC}} : 0) |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00151}00151             \mbox{\hyperlink{r92c__reg_8h_ab934961e4e9295e1234294e8ec4524e1}{R92C\_CR\_CALTMR\_EN}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00153}00153         \mbox{\hyperlink{if__rtwnvar_8h_a7f17e4877feb5ff91f23223e6e1b885c}{rtwn\_write\_4}}(sc, \mbox{\hyperlink{r92ce__reg_8h_af4cc9f761126913a34c2c94ab8e2adfb}{R92C\_INT\_MIG}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00154}00154         \mbox{\hyperlink{if__rtwnvar_8h_a7f17e4877feb5ff91f23223e6e1b885c}{rtwn\_write\_4}}(sc, \mbox{\hyperlink{r92c__reg_8h_a5ac1a712652c5c62d6c2488a9a7ebd26}{R92C\_MCUTST\_1}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00156}00156         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00157}00157 \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00158}00158 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00159}00159 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00160}\mbox{\hyperlink{r88ee_8h_acf6009ebc0b7466f384c95b0575dd27f}{00160}} \mbox{\hyperlink{r88ee__init_8c_ac9204b91e5d2737d12c561dbfb0febc0}{r88ee\_power\_off}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structrtwn__softc}{rtwn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00161}00161 \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00162}00162         uint8\_t reg;}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00163}00163         \textcolor{keywordtype}{int} ntries;}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00164}00164 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00165}00165         \textcolor{comment}{/* Disable any kind of TX reports. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00166}00166         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r88e__reg_8h_a1a8a69cac52e41d2c6435267be7bf3ba}{R88E\_TX\_RPT\_CTRL}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00167}00167             \mbox{\hyperlink{r88e__reg_8h_a562b23fb67dadea5266982e23f767d19}{R88E\_TX\_RPT1\_ENA}} | \mbox{\hyperlink{r88e__reg_8h_a7dcc53981e472caecad380e0e3f5589c}{R88E\_TX\_RPT2\_ENA}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00169}00169         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92ce__reg_8h_aa2a2f8f12a26105949530fd3fd470355}{R92C\_PCIE\_CTRL\_REG}} + 1, 0xFF);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00170}00170 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00171}00171         \textcolor{comment}{/* Move card to Low Power State. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00172}00172         \textcolor{comment}{/* Block all Tx queues. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00173}00173         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_aa5498c80d68d968addfe48f4d25261dc}{R92C\_TXPAUSE}}, \mbox{\hyperlink{r92c__reg_8h_a7c5e31f1bd55b73df812d568359dcd70}{R92C\_TX\_QUEUE\_ALL}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00175}00175         \textcolor{keywordflow}{for} (ntries = 0; ntries < 10; ntries++) \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00176}00176                 \textcolor{comment}{/* Should be zero if no packet is transmitting. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00177}00177                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__rtwnvar_8h_a4ae5fb745e3dc54fb5469820e706d25d}{rtwn\_read\_4}}(sc, \mbox{\hyperlink{r88e__reg_8h_a7b024c1103db9e9cf1edc4e2dc6b0d86}{R88E\_SCH\_TXCMD}}) == 0)}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00178}00178                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00180}00180                 \mbox{\hyperlink{if__rtwnvar_8h_a3fe76ab201bc261d0950f661104812e2}{rtwn\_delay}}(sc, 5000);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00181}00181         \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00182}00182         \textcolor{keywordflow}{if} (ntries == 10) \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00183}00183                 device\_printf(sc-\/>\mbox{\hyperlink{structrtwn__softc_a299d18a16d08213b975a1585651583f9}{sc\_dev}}, \textcolor{stringliteral}{"{}\%s: failed to block Tx queues\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00184}00184                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00185}00185                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00186}00186         \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00188}00188         \textcolor{comment}{/* CCK and OFDM are disabled, and clock are gated. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00189}00189         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a3534d19cce76efcebdaa962fddfc4166}{R92C\_SYS\_FUNC\_EN}}, \mbox{\hyperlink{r92c__reg_8h_ae61fad0791b681870fb984d8ea43f12d}{R92C\_SYS\_FUNC\_EN\_BBRSTB}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00191}00191         \mbox{\hyperlink{if__rtwnvar_8h_a3fe76ab201bc261d0950f661104812e2}{rtwn\_delay}}(sc, 1);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00193}00193         \textcolor{comment}{/* Reset MAC TRX */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00194}00194         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ab4fda584b9e7924463ec9158b75f6a42}{R92C\_CR}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00195}00195             \mbox{\hyperlink{r92c__reg_8h_ade3a80d4a9af64ae124374ae62cb6254}{R92C\_CR\_HCI\_TXDMA\_EN}} | \mbox{\hyperlink{r92c__reg_8h_ab5b4b721210e3f26dfa0a8fd3372d119}{R92C\_CR\_HCI\_RXDMA\_EN}} |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00196}00196             \mbox{\hyperlink{r92c__reg_8h_a174ddd2b01fd819252dcb54af8a67bdb}{R92C\_CR\_TXDMA\_EN}} | \mbox{\hyperlink{r92c__reg_8h_aa11d3abf7e63175473aed2d2a51611ba}{R92C\_CR\_RXDMA\_EN}} |}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00197}00197             \mbox{\hyperlink{r92c__reg_8h_a73295692bd24219708b84d331d267882}{R92C\_CR\_PROTOCOL\_EN}} | \mbox{\hyperlink{r92c__reg_8h_a074479cba8d8e122fc0d8d1523fefc35}{R92C\_CR\_SCHEDULE\_EN}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00198}00198 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00199}00199         \textcolor{comment}{/* Disable h/w encryption. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00200}00200         \mbox{\hyperlink{if__rtwnvar_8h_a0b4a07b836b7fb793728d6961caa8bc7}{rtwn\_setbits\_1\_shift}}(sc, \mbox{\hyperlink{r92c__reg_8h_ab4fda584b9e7924463ec9158b75f6a42}{R92C\_CR}}, \mbox{\hyperlink{r92c__reg_8h_a2140a526a1b1c55b4e04ab24d635cf10}{R92C\_CR\_ENSEC}}, 0, 1);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00202}00202         \textcolor{comment}{/* Respond TxOK to scheduler */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00203}00203         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a89340007c90fe69b503d27f87be4c886}{R92C\_DUAL\_TSF\_RST}}, 0, 0x20);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00204}00204 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00205}00205         \textcolor{comment}{/* If firmware in ram code, do reset. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00206}00206 \textcolor{preprocessor}{\#ifndef RTWN\_WITHOUT\_UCODE}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00207}00207         \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__rtwnvar_8h_aac420dec51bde7fb227f4b85ff462485}{rtwn\_read\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a58f55c57360040d3336b1d36f40089ba}{R92C\_MCUFWDL}}) \& \mbox{\hyperlink{r92c__reg_8h_ab600aa0e8a645789f3b0673149522eaf}{R92C\_MCUFWDL\_RDY}})}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00208}00208                 \mbox{\hyperlink{r88e_8h_a35b74f7d9f150fc7152336f45b9c4714}{r88e\_fw\_reset}}(sc, \mbox{\hyperlink{if__rtwnvar_8h_adf764cbdea00d65edcd07bb9953ad2b7a2e5aeb2c8fac10c210acb48983a32ec8}{RTWN\_FW\_RESET\_SHUTDOWN}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00209}00209 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00211}00211         \textcolor{comment}{/* Reset MCU ready status. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00212}00212         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a58f55c57360040d3336b1d36f40089ba}{R92C\_MCUFWDL}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00214}00214         \textcolor{comment}{/* Disable 32k. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00215}00215         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r88e__reg_8h_a188fe184c59cc4a0b0cf42054d59463a}{R88E\_32K\_CTRL}}, 0x01, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00216}00216 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00217}00217         \textcolor{comment}{/* Move card to Disabled state. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00218}00218         \textcolor{comment}{/* Turn off RF. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00219}00219         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ae7bfaeca12e4bc3528b5511e98d58bc3}{R92C\_RF\_CTRL}}, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00220}00220 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00221}00221         \textcolor{comment}{/* LDO Sleep mode. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00222}00222         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ae4c6b3df1ab3ec9c1e193688782767d6}{R92C\_LPLDO\_CTRL}}, 0, \mbox{\hyperlink{r92c__reg_8h_a9ac0c0c6ce766e06385dbbe1707d4bdb}{R92C\_LPLDO\_CTRL\_SLEEP}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00224}00224         \textcolor{comment}{/* Turn off MAC by HW state machine */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00225}00225         \mbox{\hyperlink{if__rtwnvar_8h_a0b4a07b836b7fb793728d6961caa8bc7}{rtwn\_setbits\_1\_shift}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}}, 0,}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00226}00226             \mbox{\hyperlink{r92c__reg_8h_a1d95d1ce6c88355564e4c06e4c2880ba}{R92C\_APS\_FSMCO\_APFM\_OFF}}, 1);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00228}00228         \textcolor{keywordflow}{for} (ntries = 0; ntries < 10; ntries++) \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00229}00229                 \textcolor{comment}{/* Wait until it will be disabled. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00230}00230                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{if__rtwnvar_8h_a0b472837d38e093cf4962967cf9c34bb}{rtwn\_read\_2}}(sc, \mbox{\hyperlink{r92c__reg_8h_aaa07258bd4198d9d17f1b9b22232dfcd}{R92C\_APS\_FSMCO}}) \&}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00231}00231                     \mbox{\hyperlink{r92c__reg_8h_a1d95d1ce6c88355564e4c06e4c2880ba}{R92C\_APS\_FSMCO\_APFM\_OFF}}) == 0)}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00232}00232                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00234}00234                 \mbox{\hyperlink{if__rtwnvar_8h_a3fe76ab201bc261d0950f661104812e2}{rtwn\_delay}}(sc, 5000);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00235}00235         \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00236}00236         \textcolor{keywordflow}{if} (ntries == 10) \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00237}00237                 device\_printf(sc-\/>\mbox{\hyperlink{structrtwn__softc_a299d18a16d08213b975a1585651583f9}{sc\_dev}}, \textcolor{stringliteral}{"{}\%s: could not turn off MAC\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00238}00238                     \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00239}00239                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00240}00240         \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00241}00241 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00242}00242         \textcolor{comment}{/* schmit trigger */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00243}00243         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_af212fd3fbdfa56bab341e50deefe6b7b}{R92C\_AFE\_XTAL\_CTRL}} + 2, 0, 0x80);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00245}00245         \textcolor{comment}{/* Reset MCU IO Wrapper. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00246}00246         reg = \mbox{\hyperlink{if__rtwnvar_8h_aac420dec51bde7fb227f4b85ff462485}{rtwn\_read\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ab71a68501e2b950097ea7fe1f782bf90}{R92C\_RSV\_CTRL}} + 1);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00247}00247         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ab71a68501e2b950097ea7fe1f782bf90}{R92C\_RSV\_CTRL}} + 1, reg \& \string~0x08);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00248}00248         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_ab71a68501e2b950097ea7fe1f782bf90}{R92C\_RSV\_CTRL}} + 1, reg | 0x08);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00249}00249 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00250}00250         \textcolor{comment}{/* marked as 'For Power Consumption' code. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00251}00251         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a6d3e14c6cdeea49c853c42e91e27d5fd}{R92C\_GPIO\_OUT}}, \mbox{\hyperlink{if__rtwnvar_8h_aac420dec51bde7fb227f4b85ff462485}{rtwn\_read\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_acfa33aa5fb0f80da9f574a3c030cf01a}{R92C\_GPIO\_IN}}));}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00252}00252         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a98c463b02d0a1c8c2a4cc0e4379c9178}{R92C\_GPIO\_IOSEL}}, 0xff);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00253}00253 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00254}00254         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a38f04d72c18c684adfb13645406c4632}{R92C\_GPIO\_IO\_SEL}},}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00255}00255             \mbox{\hyperlink{if__rtwnvar_8h_aac420dec51bde7fb227f4b85ff462485}{rtwn\_read\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a38f04d72c18c684adfb13645406c4632}{R92C\_GPIO\_IO\_SEL}}) << 4);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00256}00256         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r92c__reg_8h_a264a5750364204b67649da972037d052}{R92C\_GPIO\_MOD}}, 0, 0x0f);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00257}00257 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00258}00258         \textcolor{comment}{/* Set LNA, TRSW, EX\_PA Pin to output mode. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00259}00259         \mbox{\hyperlink{if__rtwnvar_8h_a7f17e4877feb5ff91f23223e6e1b885c}{rtwn\_write\_4}}(sc, \mbox{\hyperlink{r88e__reg_8h_ac09c64b56a666b8480c228cf79b8229b}{R88E\_BB\_PAD\_CTRL}}, 0x00080808);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00260}00260 \}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00261}00261 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00262}00262 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00263}\mbox{\hyperlink{r88ee_8h_a9af909b5d2702228625e313095406169}{00263}} \mbox{\hyperlink{r88ee__init_8c_a53827dd88eae7ff8a55149216e3de08b}{r88ee\_post\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structrtwn__softc}{rtwn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00264}00264 \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00265}00265 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00266}00266         \textcolor{comment}{/* Enable per-\/packet TX report. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00267}00267         \mbox{\hyperlink{if__rtwnvar_8h_a7884b9ec832912e02680a76200618a74}{rtwn\_setbits\_1}}(sc, \mbox{\hyperlink{r88e__reg_8h_a1a8a69cac52e41d2c6435267be7bf3ba}{R88E\_TX\_RPT\_CTRL}}, 0, \mbox{\hyperlink{r88e__reg_8h_a562b23fb67dadea5266982e23f767d19}{R88E\_TX\_RPT1\_ENA}});}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00269}00269         \textcolor{comment}{/* Disable Tx if MACID is not associated. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00270}00270         \mbox{\hyperlink{if__rtwnvar_8h_a7f17e4877feb5ff91f23223e6e1b885c}{rtwn\_write\_4}}(sc, \mbox{\hyperlink{r88e__reg_8h_a7d8ce4044546006959e3ac31a12429b7}{R88E\_MACID\_NO\_LINK}}, 0xffffffff);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00271}00271         \mbox{\hyperlink{if__rtwnvar_8h_a7f17e4877feb5ff91f23223e6e1b885c}{rtwn\_write\_4}}(sc, \mbox{\hyperlink{r88e__reg_8h_a7d8ce4044546006959e3ac31a12429b7}{R88E\_MACID\_NO\_LINK}} + 4, 0xffffffff);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00272}00272         \mbox{\hyperlink{r88e_8h_a1eacd048619b31f051ede2020e5fddb0}{r88e\_macid\_enable\_link}}(sc, \mbox{\hyperlink{if__rtwnvar_8h_a580343034aea8de49909df7709a3398b}{RTWN\_MACID\_BC}}, 1);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00273}00273 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00274}00274         \textcolor{comment}{/* Perform LO and IQ calibrations. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00275}00275         \mbox{\hyperlink{r88e_8h_a9d50edf3d3990095664ab5dbf7c1e169}{r88e\_iq\_calib}}(sc);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00276}00276         \textcolor{comment}{/* Perform LC calibration. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00277}00277         \mbox{\hyperlink{r92c_8h_ac9387cf875ee8c5d9f4d88a47905d164}{r92c\_lc\_calib}}(sc);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00278}00278 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00279}00279         \textcolor{comment}{/* Enable Rx DMA */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00280}00280         \mbox{\hyperlink{if__rtwnvar_8h_a7d7ea5512c1c28b20889a89730770795}{rtwn\_write\_1}}(sc, \mbox{\hyperlink{r92ce__reg_8h_aa2a2f8f12a26105949530fd3fd470355}{R92C\_PCIE\_CTRL\_REG}} + 1, 0);}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00282}00282         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structrtwn__softc_a825fa1d7897f874314c5c38d3fe91140}{sc\_ratectl\_sysctl}} == \mbox{\hyperlink{if__rtwnvar_8h_a99fb83031ce9923c84392b4e92f956b5ac1cde1453e8075e2360cee297668d4c5}{RTWN\_RATECTL\_FW}}) \{}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00283}00283                 \textcolor{comment}{/* No support (yet?) for f/w rate adaptation. */}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00284}00284                 sc-\/>\mbox{\hyperlink{structrtwn__softc_a9204a934cbe9d7b913c5982547e5da6e}{sc\_ratectl}} = \mbox{\hyperlink{if__rtwnvar_8h_a99fb83031ce9923c84392b4e92f956b5a50bca7109d0efa7461cfdaf8fb83c476}{RTWN\_RATECTL\_NET80211}};}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00285}00285         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00286}00286                 sc-\/>\mbox{\hyperlink{structrtwn__softc_a9204a934cbe9d7b913c5982547e5da6e}{sc\_ratectl}} = sc-\/>\mbox{\hyperlink{structrtwn__softc_a825fa1d7897f874314c5c38d3fe91140}{sc\_ratectl\_sysctl}};}
\DoxyCodeLine{\Hypertarget{r88ee__init_8c_source_l00287}00287 \}}

\end{DoxyCode}
