\hypertarget{hifn7751_8c_source}{}\doxysection{hifn7751.\+c}
\label{hifn7751_8c_source}\index{dev/hifn/hifn7751.c@{dev/hifn/hifn7751.c}}
\mbox{\hyperlink{hifn7751_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00001}00001 \textcolor{comment}{/*      \$OpenBSD: hifn7751.c,v 1.120 2002/05/17 00:33:34 deraadt Exp \$  */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00002}00002 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00003}00003 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00004}00004 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/3-\/Clause}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00006}00006 \textcolor{comment}{ * Invertex AEON / Hifn 7751 driver}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00007}00007 \textcolor{comment}{ * Copyright (c) 1999 Invertex Inc. All rights reserved.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00008}00008 \textcolor{comment}{ * Copyright (c) 1999 Theo de Raadt}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00009}00009 \textcolor{comment}{ * Copyright (c) 2000-\/2001 Network Security Technologies, Inc.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00010}00010 \textcolor{comment}{ *                      http://www.netsec.net}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00011}00011 \textcolor{comment}{ * Copyright (c) 2003 Hifn Inc.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00012}00012 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00013}00013 \textcolor{comment}{ * This driver is based on a previous driver by Invertex, for which they}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00014}00014 \textcolor{comment}{ * requested:  Please send any comments, feedback, bug-\/fixes, or feature}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00015}00015 \textcolor{comment}{ * requests to software@invertex.com.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00017}00017 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00018}00018 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00019}00019 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00020}00020 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00021}00021 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00022}00022 \textcolor{comment}{ *   notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00023}00023 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00024}00024 \textcolor{comment}{ *   notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00025}00025 \textcolor{comment}{ *   documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00026}00026 \textcolor{comment}{ * 3. The name of the author may not be used to endorse or promote products}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00027}00027 \textcolor{comment}{ *   derived from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00028}00028 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00029}00029 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00030}00030 \textcolor{comment}{ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00031}00031 \textcolor{comment}{ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00032}00032 \textcolor{comment}{ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00033}00033 \textcolor{comment}{ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00034}00034 \textcolor{comment}{ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00035}00035 \textcolor{comment}{ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00036}00036 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00037}00037 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00038}00038 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00039}00039 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00040}00040 \textcolor{comment}{ * Effort sponsored in part by the Defense Advanced Research Projects}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00041}00041 \textcolor{comment}{ * Agency (DARPA) and Air Force Research Laboratory, Air Force}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00042}00042 \textcolor{comment}{ * Materiel Command, USAF, under agreement number F30602-\/01-\/2-\/0537.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00043}00043 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00046}\mbox{\hyperlink{hifn7751_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00046}} \mbox{\hyperlink{hifn7751_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00048}00048 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00049}00049 \textcolor{comment}{ * Driver for various Hifn encryption processors.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00050}00050 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00051}00051 \textcolor{preprocessor}{\#include "{}opt\_hifn.h"{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <sys/proc.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <sys/mbuf.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <sys/uio.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00065}00065 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <vm/vm.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00067}00067 \textcolor{preprocessor}{\#include <vm/pmap.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00069}00069 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00070}00070 \textcolor{preprocessor}{\#include <machine/resource.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00071}00071 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <opencrypto/cryptodev.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00075}00075 \textcolor{preprocessor}{\#include <opencrypto/xform\_auth.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00076}00076 \textcolor{preprocessor}{\#include <sys/random.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <sys/kobj.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00079}00079 \textcolor{preprocessor}{\#include "{}cryptodev\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00081}00081 \textcolor{preprocessor}{\#include <dev/pci/pcivar.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00082}00082 \textcolor{preprocessor}{\#include <dev/pci/pcireg.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00084}00084 \textcolor{preprocessor}{\#ifdef HIFN\_RNDTEST}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00085}00085 \textcolor{preprocessor}{\#include <dev/rndtest/rndtest.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00086}00086 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00087}00087 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{hifn7751reg_8h}{dev/hifn/hifn7751reg.h}}>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00088}00088 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{hifn7751var_8h}{dev/hifn/hifn7751var.h}}>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00089}00089 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00090}00090 \textcolor{preprocessor}{\#ifdef HIFN\_VULCANDEV}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00091}00091 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00092}00092 \textcolor{preprocessor}{\#include <sys/uio.h>}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00094}00094 \textcolor{keyword}{static} \textcolor{keyword}{struct }cdevsw vulcanpk\_cdevsw; \textcolor{comment}{/* forward declaration */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00095}00095 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00096}00096 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00097}00097 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00098}00098 \textcolor{comment}{ * Prototypes and count for the pci\_device structure}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00099}00099 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00100}00100 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a8fff9065d6b7fbf16fec97511b405453}{hifn\_probe}}(device\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00101}00101 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_adead41feacc81dd8f2f7520ec88423b0}{hifn\_attach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00102}00102 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_aa636c26344cfda578935eeb22a2c0dc3}{hifn\_detach}}(device\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00103}00103 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_aced75140937433f71eef1710b63bf2a2}{hifn\_suspend}}(device\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00104}00104 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_ae130bd7c1ff5d1de909b5e00133448d5}{hifn\_resume}}(device\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00105}00105 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a5afc4d336965740b852802b204760f67}{hifn\_shutdown}}(device\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00107}00107 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a262d5ab62fabd5c79d610656fab95297}{hifn\_probesession}}(device\_t, \textcolor{keyword}{const} \textcolor{keyword}{struct} crypto\_session\_params *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00108}00108 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_af2d9da0302576127fb08342ff73865ad}{hifn\_newsession}}(device\_t, crypto\_session\_t,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00109}00109     \textcolor{keyword}{const} \textcolor{keyword}{struct} crypto\_session\_params *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00110}00110 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_afff96704740907d759b04caa42eaff14}{hifn\_process}}(device\_t, \textcolor{keyword}{struct} cryptop *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00112}\mbox{\hyperlink{hifn7751_8c_a3e69997096a9655d9337e0e78a1359da}{00112}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{hifn7751_8c_a3e69997096a9655d9337e0e78a1359da}{hifn\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00113}00113         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00114}00114         DEVMETHOD(device\_probe,         \mbox{\hyperlink{hifn7751_8c_a8fff9065d6b7fbf16fec97511b405453}{hifn\_probe}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00115}00115         DEVMETHOD(device\_attach,        \mbox{\hyperlink{hifn7751_8c_adead41feacc81dd8f2f7520ec88423b0}{hifn\_attach}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00116}00116         DEVMETHOD(device\_detach,        \mbox{\hyperlink{hifn7751_8c_aa636c26344cfda578935eeb22a2c0dc3}{hifn\_detach}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00117}00117         DEVMETHOD(device\_suspend,       \mbox{\hyperlink{hifn7751_8c_aced75140937433f71eef1710b63bf2a2}{hifn\_suspend}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00118}00118         DEVMETHOD(device\_resume,        \mbox{\hyperlink{hifn7751_8c_ae130bd7c1ff5d1de909b5e00133448d5}{hifn\_resume}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00119}00119         DEVMETHOD(device\_shutdown,      \mbox{\hyperlink{hifn7751_8c_a5afc4d336965740b852802b204760f67}{hifn\_shutdown}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00121}00121         \textcolor{comment}{/* crypto device methods */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00122}00122         DEVMETHOD(cryptodev\_probesession, \mbox{\hyperlink{hifn7751_8c_a262d5ab62fabd5c79d610656fab95297}{hifn\_probesession}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00123}00123         DEVMETHOD(cryptodev\_newsession, \mbox{\hyperlink{hifn7751_8c_af2d9da0302576127fb08342ff73865ad}{hifn\_newsession}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00124}00124         DEVMETHOD(cryptodev\_process,    \mbox{\hyperlink{hifn7751_8c_afff96704740907d759b04caa42eaff14}{hifn\_process}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00126}00126         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00127}00127 \};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00128}\mbox{\hyperlink{hifn7751_8c_a369ccccb67e09aacf8acb996453f23df}{00128}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{hifn7751_8c_a369ccccb67e09aacf8acb996453f23df}{hifn\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00129}00129         \textcolor{stringliteral}{"{}hifn"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00130}00130         \mbox{\hyperlink{hifn7751_8c_a3e69997096a9655d9337e0e78a1359da}{hifn\_methods}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00131}00131         \textcolor{keyword}{sizeof} (\textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00132}00132 \};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00133}\mbox{\hyperlink{hifn7751_8c_a8d4a34c7f6c2d85dec255df696a47653}{00133}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{hifn7751_8c_a8d4a34c7f6c2d85dec255df696a47653}{hifn\_devclass}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00135}\mbox{\hyperlink{hifn7751_8c_a0b1ef7905a39cacf720905629c34f4ad}{00135}} \mbox{\hyperlink{hifn7751_8c_a0b1ef7905a39cacf720905629c34f4ad}{DRIVER\_MODULE}}(hifn, pci, \mbox{\hyperlink{hifn7751_8c_a369ccccb67e09aacf8acb996453f23df}{hifn\_driver}}, \mbox{\hyperlink{hifn7751_8c_a8d4a34c7f6c2d85dec255df696a47653}{hifn\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00136}\mbox{\hyperlink{hifn7751_8c_abf3028be3c191eb88532270227065af2}{00136}} \mbox{\hyperlink{hifn7751_8c_abf3028be3c191eb88532270227065af2}{MODULE\_DEPEND}}(hifn, crypto, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00137}00137 \textcolor{preprocessor}{\#ifdef HIFN\_RNDTEST}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00138}00138 \mbox{\hyperlink{hifn7751_8c_abf3028be3c191eb88532270227065af2}{MODULE\_DEPEND}}(hifn, rndtest, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00139}00139 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00140}00140 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00141}00141 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_a71599fa17dcb8905a389dc3a179160c1}{hifn\_reset\_board}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00142}00142 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_a5bcc4d5bdcbfa4b78d81bb9a565e1f42}{hifn\_reset\_puc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00143}00143 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_ad4c8b24eb89c5ec2d14c0be084c08fa8}{hifn\_puc\_wait}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00144}00144 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_abb986ed4571f09fe6bc19deba0aaf0cd}{hifn\_enable\_crypto}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00145}00145 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_ae9c98c2559aecf31de0592518d046e4b}{hifn\_set\_retry}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00146}00146 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_aa14652c9bdd205405f8581c222fde517}{hifn\_init\_dma}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00147}00147 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_a62f6d9df338d7da9f3e2a5d61d5d8187}{hifn\_init\_pci\_registers}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00148}00148 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_ae4cdb0c16783aa27d55b0500fc4a769c}{hifn\_sramsize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00149}00149 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a2f03d75700162fba997a5aa2d3445c8d}{hifn\_dramsize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00150}00150 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_adc0457e7ca7390813d1cd8f03aac4409}{hifn\_ramtype}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00151}00151 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_af6c12e4067052444aff7f9f02775538c}{hifn\_sessions}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00152}00152 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_a64a879aa44af33b500fb8d8aa14d0354}{hifn\_intr}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00153}00153 \textcolor{keyword}{static}  u\_int \mbox{\hyperlink{hifn7751_8c_ac50d99c2de980fb096110efe06f2f6da}{hifn\_write\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00154}00154 \textcolor{keyword}{static}  u\_int32\_t \mbox{\hyperlink{hifn7751_8c_a21e9b1d0d992b10a5d99d46f8a8af7b0}{hifn\_next\_signature}}(u\_int32\_t a, u\_int cnt);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00155}00155 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_af62302409d3e9339e5bf98a2788700d1}{hifn\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00156}00156 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a808d5a8facede620b7138c29745b6a3c}{hifn\_crypto}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *, \textcolor{keyword}{struct} cryptop *, \textcolor{keywordtype}{int});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00157}00157 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a0a1b763f64952472b539202990dd4a15}{hifn\_readramaddr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, \textcolor{keywordtype}{int}, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00158}00158 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a47b07bf1f6f9aa634c50ecc6f88f5cb8}{hifn\_writeramaddr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, \textcolor{keywordtype}{int}, u\_int8\_t *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00159}00159 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a5b94630e8696abc18a2e7cb9329200ca}{hifn\_dmamap\_load\_src}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00160}00160 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_ac87c6fdf4f589ed658b20b77995bbcc9}{hifn\_dmamap\_load\_dst}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00161}00161 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_a2c164b12ac8bfc13ee2639641c29559c}{hifn\_init\_pubrng}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00162}00162 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_a95dcd11c3ef539353c258d6911bf4fbc}{hifn\_rng}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00163}00163 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_af7de08206bc84abf506bb668c78113c3}{hifn\_tick}}(\textcolor{keywordtype}{void} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00164}00164 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_a532751a6fec82e34539231800d783195}{hifn\_abort}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00165}00165 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_a3a3d13791258f613ce4f7909590d4258}{hifn\_alloc\_slot}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, \textcolor{keywordtype}{int} *, \textcolor{keywordtype}{int} *, \textcolor{keywordtype}{int} *, \textcolor{keywordtype}{int} *);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00167}00167 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_a742b07283a021779b8b9a74fba4773e5}{hifn\_write\_reg\_0}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, bus\_size\_t, u\_int32\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00168}00168 \textcolor{keyword}{static}  \textcolor{keywordtype}{void} \mbox{\hyperlink{hifn7751_8c_aaaecdf8927790231b663b101be25ce06}{hifn\_write\_reg\_1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *, bus\_size\_t, u\_int32\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00169}00169 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00170}00170 \textcolor{keyword}{static} \_\_inline u\_int32\_t}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00171}\mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{00171}} \mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, bus\_size\_t reg)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00172}00172 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00173}00173     u\_int32\_t v = bus\_space\_read\_4(sc-\/>\mbox{\hyperlink{structhifn__softc_a4bea2ff7a49ab9af07070a428a48727e}{sc\_st0}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a545d6fb19a481446f0053c352deea59b}{sc\_sh0}}, reg);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00174}00174     sc-\/>\mbox{\hyperlink{structhifn__softc_a46ab41553cde8385c2f79bdf586eeb75}{sc\_bar0\_lastreg}} = (bus\_size\_t) -\/1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00175}00175     \textcolor{keywordflow}{return} (v);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00176}00176 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00177}\mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{00177}} \textcolor{preprocessor}{\#define WRITE\_REG\_0(sc, reg, val)       hifn\_write\_reg\_0(sc, reg, val)}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00179}00179 \textcolor{keyword}{static} \_\_inline u\_int32\_t}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00180}\mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{00180}} \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, bus\_size\_t reg)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00181}00181 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00182}00182     u\_int32\_t v = bus\_space\_read\_4(sc-\/>\mbox{\hyperlink{structhifn__softc_adfc3566b4313401fe0782634481192c0}{sc\_st1}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a179bfb917f559eb2b9a37623a7a276d9}{sc\_sh1}}, reg);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00183}00183     sc-\/>\mbox{\hyperlink{structhifn__softc_a73de5e38577f4d36ebed531f4211bf29}{sc\_bar1\_lastreg}} = (bus\_size\_t) -\/1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00184}00184     \textcolor{keywordflow}{return} (v);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00185}00185 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00186}\mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{00186}} \textcolor{preprocessor}{\#define WRITE\_REG\_1(sc, reg, val)       hifn\_write\_reg\_1(sc, reg, val)}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00188}\mbox{\hyperlink{hifn7751_8c_a842c15c43b72b0309cca9ecfc31a924f}{00188}} \textcolor{keyword}{static} \mbox{\hyperlink{hifn7751_8c_a842c15c43b72b0309cca9ecfc31a924f}{SYSCTL\_NODE}}(\_hw, OID\_AUTO, hifn, CTLFLAG\_RD | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00189}00189     \textcolor{stringliteral}{"{}Hifn driver parameters"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00190}00190 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00191}00191 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00192}00192 \textcolor{keyword}{static}  \textcolor{keywordtype}{int} hifn\_debug = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00193}00193 \mbox{\hyperlink{hifn7751_8c_a68aa49f0acd461a8f0f3ff858b40f60a}{SYSCTL\_INT}}(\_hw\_hifn, OID\_AUTO, debug, CTLFLAG\_RW, \&hifn\_debug,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00194}00194             0, \textcolor{stringliteral}{"{}control debugging msgs"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00195}00195 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00197}\mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{00197}} \textcolor{keyword}{static}  \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__stats}{hifn\_stats}} \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00198}\mbox{\hyperlink{hifn7751_8c_a0983bfd9688be52e581eed6fb2046770}{00198}} \mbox{\hyperlink{hifn7751_8c_a0983bfd9688be52e581eed6fb2046770}{SYSCTL\_STRUCT}}(\_hw\_hifn, OID\_AUTO, stats, CTLFLAG\_RD, \&\mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00199}00199             \mbox{\hyperlink{structhifn__stats}{hifn\_stats}}, \textcolor{stringliteral}{"{}driver statistics"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00200}\mbox{\hyperlink{hifn7751_8c_af0660575e36ca7c8238fe25ccd4c7d9a}{00200}} \textcolor{keyword}{static}  \textcolor{keywordtype}{int} \mbox{\hyperlink{hifn7751_8c_af0660575e36ca7c8238fe25ccd4c7d9a}{hifn\_maxbatch}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00201}\mbox{\hyperlink{hifn7751_8c_a68aa49f0acd461a8f0f3ff858b40f60a}{00201}} \mbox{\hyperlink{hifn7751_8c_a68aa49f0acd461a8f0f3ff858b40f60a}{SYSCTL\_INT}}(\_hw\_hifn, OID\_AUTO, maxbatch, CTLFLAG\_RW, \&\mbox{\hyperlink{hifn7751_8c_af0660575e36ca7c8238fe25ccd4c7d9a}{hifn\_maxbatch}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00202}00202             0, \textcolor{stringliteral}{"{}max ops to batch w/o interrupt"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00204}00204 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00205}00205 \textcolor{comment}{ * Probe for a supported device.  The PCI vendor and device}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00206}00206 \textcolor{comment}{ * IDs are used to detect devices we know how to handle.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00207}00207 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00208}00208 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00209}\mbox{\hyperlink{hifn7751_8c_a8fff9065d6b7fbf16fec97511b405453}{00209}} \mbox{\hyperlink{hifn7751_8c_a8fff9065d6b7fbf16fec97511b405453}{hifn\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00210}00210 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00211}00211         \textcolor{keywordflow}{if} (pci\_get\_vendor(dev) == \mbox{\hyperlink{hifn7751reg_8h_a12fd262b8c51cb91fd012d139272ed44}{PCI\_VENDOR\_INVERTEX}} \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00212}00212             pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_af1f85052f187a695d4c531190fcf0707}{PCI\_PRODUCT\_INVERTEX\_AEON}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00213}00213                 \textcolor{keywordflow}{return} (BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00214}00214         \textcolor{keywordflow}{if} (pci\_get\_vendor(dev) == \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}} \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00215}00215             (pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_ac6a13bb7a1a21ae971578b57be6adc04}{PCI\_PRODUCT\_HIFN\_7751}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00216}00216              pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_aedb53b06d113691a35944827926af86b}{PCI\_PRODUCT\_HIFN\_7951}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00217}00217              pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_a6e565d09d00dce0cf9d0aa9fbad02440}{PCI\_PRODUCT\_HIFN\_7955}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00218}00218              pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_aad0579f7c2b9a7eae4b619a463568360}{PCI\_PRODUCT\_HIFN\_7956}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00219}00219              pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_a5cdc4c36d691b8a8403012769682c95e}{PCI\_PRODUCT\_HIFN\_7811}}))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00220}00220                 \textcolor{keywordflow}{return} (BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00221}00221         \textcolor{keywordflow}{if} (pci\_get\_vendor(dev) == \mbox{\hyperlink{hifn7751reg_8h_aa3d48c2358f2f0d82edb6f57b442dac0}{PCI\_VENDOR\_NETSEC}} \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00222}00222             pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_a6f2ea3c08f8648c5d87b88a2e7e7bc93}{PCI\_PRODUCT\_NETSEC\_7751}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00223}00223                 \textcolor{keywordflow}{return} (BUS\_PROBE\_DEFAULT);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00224}00224         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00225}00225 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00227}00227 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00228}\mbox{\hyperlink{hifn7751_8c_a33f611b8c89c1a9a92316a74b8b8332a}{00228}} \mbox{\hyperlink{hifn7751_8c_a33f611b8c89c1a9a92316a74b8b8332a}{hifn\_dmamap\_cb}}(\textcolor{keywordtype}{void} *arg, bus\_dma\_segment\_t *segs, \textcolor{keywordtype}{int} nseg, \textcolor{keywordtype}{int} error)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00229}00229 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00230}00230         bus\_addr\_t *paddr = (bus\_addr\_t*) arg;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00231}00231         *paddr = segs-\/>ds\_addr;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00232}00232 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00234}00234 \textcolor{keyword}{static} \textcolor{keyword}{const} \textcolor{keywordtype}{char}*}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00235}\mbox{\hyperlink{hifn7751_8c_a25b3c7fbf6d6419df1d3edeeba570a5a}{00235}} \mbox{\hyperlink{hifn7751_8c_a25b3c7fbf6d6419df1d3edeeba570a5a}{hifn\_partname}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00236}00236 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00237}00237         \textcolor{comment}{/* XXX sprintf numbers when not decoded */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00238}00238         \textcolor{keywordflow}{switch} (pci\_get\_vendor(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00239}00239         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00240}00240                 \textcolor{keywordflow}{switch} (pci\_get\_device(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00241}00241                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a479a947078be5c8a1d197d1a99765afb}{PCI\_PRODUCT\_HIFN\_6500}}:        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Hifn 6500"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00242}00242                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_ac6a13bb7a1a21ae971578b57be6adc04}{PCI\_PRODUCT\_HIFN\_7751}}:        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Hifn 7751"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00243}00243                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a5cdc4c36d691b8a8403012769682c95e}{PCI\_PRODUCT\_HIFN\_7811}}:        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Hifn 7811"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00244}00244                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_aedb53b06d113691a35944827926af86b}{PCI\_PRODUCT\_HIFN\_7951}}:        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Hifn 7951"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00245}00245                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a6e565d09d00dce0cf9d0aa9fbad02440}{PCI\_PRODUCT\_HIFN\_7955}}:        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Hifn 7955"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00246}00246                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_aad0579f7c2b9a7eae4b619a463568360}{PCI\_PRODUCT\_HIFN\_7956}}:        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Hifn 7956"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00247}00247                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00248}00248                 \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Hifn unknown-\/part"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00249}00249         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a12fd262b8c51cb91fd012d139272ed44}{PCI\_VENDOR\_INVERTEX}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00250}00250                 \textcolor{keywordflow}{switch} (pci\_get\_device(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00251}00251                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_af1f85052f187a695d4c531190fcf0707}{PCI\_PRODUCT\_INVERTEX\_AEON}}:        \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Invertex AEON"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00252}00252                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00253}00253                 \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Invertex unknown-\/part"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00254}00254         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_aa3d48c2358f2f0d82edb6f57b442dac0}{PCI\_VENDOR\_NETSEC}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00255}00255                 \textcolor{keywordflow}{switch} (pci\_get\_device(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00256}00256                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a6f2ea3c08f8648c5d87b88a2e7e7bc93}{PCI\_PRODUCT\_NETSEC\_7751}}:    \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}NetSec 7751"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00257}00257                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00258}00258                 \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}NetSec unknown-\/part"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00259}00259         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00260}00260         \textcolor{keywordflow}{return} \textcolor{stringliteral}{"{}Unknown-\/vendor unknown-\/part"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00261}00261 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00263}00263 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00264}\mbox{\hyperlink{hifn7751_8c_a7ce217062812f329950acc7c9a680b79}{00264}} \mbox{\hyperlink{hifn7751_8c_a7ce217062812f329950acc7c9a680b79}{default\_harvest}}(\textcolor{keyword}{struct} rndtest\_state *rsp, \textcolor{keywordtype}{void} *buf, u\_int count)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00265}00265 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00266}00266         \textcolor{comment}{/* MarkM: FIX!! Check that this does not swamp the harvester! */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00267}00267         random\_harvest\_queue(buf, count, RANDOM\_PURE\_HIFN);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00268}00268 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00270}00270 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00271}\mbox{\hyperlink{hifn7751_8c_a3121f775d70d660b36b533a55057c722}{00271}} \mbox{\hyperlink{hifn7751_8c_a3121f775d70d660b36b533a55057c722}{checkmaxmin}}(device\_t dev, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *what, u\_int v, u\_int min, u\_int max)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00272}00272 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00273}00273         \textcolor{keywordflow}{if} (v > max) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00274}00274                 device\_printf(dev, \textcolor{stringliteral}{"{}Warning, \%s \%u out of range, "{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00275}00275                         \textcolor{stringliteral}{"{}using max \%u\(\backslash\)n"{}}, what, v, max);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00276}00276                 v = max;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00277}00277         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (v < min) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00278}00278                 device\_printf(dev, \textcolor{stringliteral}{"{}Warning, \%s \%u out of range, "{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00279}00279                         \textcolor{stringliteral}{"{}using min \%u\(\backslash\)n"{}}, what, v, min);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00280}00280                 v = min;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00281}00281         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00282}00282         \textcolor{keywordflow}{return} v;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00283}00283 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00285}00285 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00286}00286 \textcolor{comment}{ * Select PLL configuration for 795x parts.  This is complicated in}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00287}00287 \textcolor{comment}{ * that we cannot determine the optimal parameters without user input.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00288}00288 \textcolor{comment}{ * The reference clock is derived from an external clock through a}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00289}00289 \textcolor{comment}{ * multiplier.  The external clock is either the host bus (i.e. PCI)}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00290}00290 \textcolor{comment}{ * or an external clock generator.  When using the PCI bus we assume}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00291}00291 \textcolor{comment}{ * the clock is either 33 or 66 MHz; for an external source we cannot}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00292}00292 \textcolor{comment}{ * tell the speed.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00293}00293 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00294}00294 \textcolor{comment}{ * PLL configuration is done with a string: "{}pci"{} for PCI bus, or "{}ext"{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00295}00295 \textcolor{comment}{ * for an external source, followed by the frequency.  We calculate}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00296}00296 \textcolor{comment}{ * the appropriate multiplier and PLL register contents accordingly.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00297}00297 \textcolor{comment}{ * When no configuration is given we default to "{}pci66"{} since that}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00298}00298 \textcolor{comment}{ * always will allow the card to work.  If a card is using the PCI}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00299}00299 \textcolor{comment}{ * bus clock and in a 33MHz slot then it will be operating at half}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00300}00300 \textcolor{comment}{ * speed until the correct information is provided.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00301}00301 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00302}00302 \textcolor{comment}{ * We use a default setting of "{}ext66"{} because according to Mike Ham}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00303}00303 \textcolor{comment}{ * of HiFn, almost every board in existence has an external crystal}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00304}00304 \textcolor{comment}{ * populated at 66Mhz. Using PCI can be a problem on modern motherboards,}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00305}00305 \textcolor{comment}{ * because PCI33 can have clocks from 0 to 33Mhz, and some have}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00306}00306 \textcolor{comment}{ * non-\/PCI-\/compliant spread-\/spectrum clocks, which can confuse the pll.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00307}00307 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00308}00308 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00309}\mbox{\hyperlink{hifn7751_8c_a80cf3905b5b0bd643ab121c2da6535e7}{00309}} \mbox{\hyperlink{hifn7751_8c_a80cf3905b5b0bd643ab121c2da6535e7}{hifn\_getpllconfig}}(device\_t dev, u\_int *pll)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00310}00310 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00311}00311         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *pllspec;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00312}00312         u\_int freq, mul, fl, fh;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00313}00313         u\_int32\_t pllconfig;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00314}00314         \textcolor{keywordtype}{char} *nxt;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00315}00315 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00316}00316         \textcolor{keywordflow}{if} (resource\_string\_value(\textcolor{stringliteral}{"{}hifn"{}}, device\_get\_unit(dev),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00317}00317             \textcolor{stringliteral}{"{}pllconfig"{}}, \&pllspec))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00318}00318                 pllspec = \textcolor{stringliteral}{"{}ext66"{}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00319}00319         fl = 33, fh = 66;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00320}00320         pllconfig = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00321}00321         \textcolor{keywordflow}{if} (strncmp(pllspec, \textcolor{stringliteral}{"{}ext"{}}, 3) == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00322}00322                 pllspec += 3;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00323}00323                 pllconfig |= \mbox{\hyperlink{hifn7751reg_8h_a04ff6687e6b72cacbdd49883ff6edb89}{HIFN\_PLL\_REF\_SEL}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00324}00324                 \textcolor{keywordflow}{switch} (pci\_get\_device(dev)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00325}00325                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a6e565d09d00dce0cf9d0aa9fbad02440}{PCI\_PRODUCT\_HIFN\_7955}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00326}00326                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_aad0579f7c2b9a7eae4b619a463568360}{PCI\_PRODUCT\_HIFN\_7956}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00327}00327                         fl = 20, fh = 100;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00328}00328                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00329}00329 \textcolor{preprocessor}{\#ifdef notyet}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00330}00330                 \textcolor{keywordflow}{case} PCI\_PRODUCT\_HIFN\_7954:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00331}00331                         fl = 20, fh = 66;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00332}00332                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00333}00333 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00334}00334                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00335}00335         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strncmp(pllspec, \textcolor{stringliteral}{"{}pci"{}}, 3) == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00336}00336                 pllspec += 3;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00337}00337         freq = strtoul(pllspec, \&nxt, 10);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00338}00338         \textcolor{keywordflow}{if} (nxt == pllspec)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00339}00339                 freq = 66;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00340}00340         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00341}00341                 freq = \mbox{\hyperlink{hifn7751_8c_a3121f775d70d660b36b533a55057c722}{checkmaxmin}}(dev, \textcolor{stringliteral}{"{}frequency"{}}, freq, fl, fh);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00342}00342         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00343}00343 \textcolor{comment}{         * Calculate multiplier.  We target a Fck of 266 MHz,}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00344}00344 \textcolor{comment}{         * allowing only even values, possibly rounded down.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00345}00345 \textcolor{comment}{         * Multipliers > 8 must set the charge pump current.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00346}00346 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00347}00347         mul = \mbox{\hyperlink{hifn7751_8c_a3121f775d70d660b36b533a55057c722}{checkmaxmin}}(dev, \textcolor{stringliteral}{"{}PLL divisor"{}}, (266 / freq) \&\string~ 1, 2, 12);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00348}00348         pllconfig |= (mul / 2 -\/ 1) << \mbox{\hyperlink{hifn7751reg_8h_a30b1e3882b5e85b8b62c81a744efc586}{HIFN\_PLL\_ND\_SHIFT}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00349}00349         \textcolor{keywordflow}{if} (mul > 8)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00350}00350                 pllconfig |= \mbox{\hyperlink{hifn7751reg_8h_a9bcf0539ce59681428a2bbe763f74982}{HIFN\_PLL\_IS}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00351}00351         *pll = pllconfig;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00352}00352 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00353}00353 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00354}00354 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00355}00355 \textcolor{comment}{ * Attach an interface that successfully probed.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00356}00356 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00357}00357 \textcolor{keyword}{static} \textcolor{keywordtype}{int} }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00358}\mbox{\hyperlink{hifn7751_8c_adead41feacc81dd8f2f7520ec88423b0}{00358}} \mbox{\hyperlink{hifn7751_8c_adead41feacc81dd8f2f7520ec88423b0}{hifn\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00359}00359 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00360}00360         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00361}00361         caddr\_t kva;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00362}00362         \textcolor{keywordtype}{int} rseg, rid;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00363}00363         \textcolor{keywordtype}{char} rbase;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00364}00364         uint16\_t rev;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00365}00365 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00366}00366         sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00367}00367 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00368}00368         mtx\_init(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a757d72448b4383c124e9c408d702dcf3}{sc\_mtx}}, device\_get\_nameunit(dev), \textcolor{stringliteral}{"{}hifn driver"{}}, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00370}00370         \textcolor{comment}{/* XXX handle power management */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00371}00371 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00372}00372         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00373}00373 \textcolor{comment}{         * The 7951 and 795x have a random number generator and}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00374}00374 \textcolor{comment}{         * public key support; note this.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00375}00375 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00376}00376         \textcolor{keywordflow}{if} (pci\_get\_vendor(dev) == \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}} \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00377}00377             (pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_aedb53b06d113691a35944827926af86b}{PCI\_PRODUCT\_HIFN\_7951}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00378}00378              pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_a6e565d09d00dce0cf9d0aa9fbad02440}{PCI\_PRODUCT\_HIFN\_7955}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00379}00379              pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_aad0579f7c2b9a7eae4b619a463568360}{PCI\_PRODUCT\_HIFN\_7956}}))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00380}00380                 sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} = \mbox{\hyperlink{hifn7751var_8h_aa17260f258870ca6486af12a897aab13}{HIFN\_HAS\_RNG}} | \mbox{\hyperlink{hifn7751var_8h_a1e2651b6242cc07fb2e772b5d55eefbd}{HIFN\_HAS\_PUBLIC}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00381}00381         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00382}00382 \textcolor{comment}{         * The 7811 has a random number generator and}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00383}00383 \textcolor{comment}{         * we also note it's identity 'cuz of some quirks.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00384}00384 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00385}00385         \textcolor{keywordflow}{if} (pci\_get\_vendor(dev) == \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}} \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00386}00386             pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_a5cdc4c36d691b8a8403012769682c95e}{PCI\_PRODUCT\_HIFN\_7811}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00387}00387                 sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} |= \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}} | \mbox{\hyperlink{hifn7751var_8h_aa17260f258870ca6486af12a897aab13}{HIFN\_HAS\_RNG}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00388}00388 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00389}00389         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00390}00390 \textcolor{comment}{         * The 795x parts support AES.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00391}00391 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00392}00392         \textcolor{keywordflow}{if} (pci\_get\_vendor(dev) == \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}} \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00393}00393             (pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_a6e565d09d00dce0cf9d0aa9fbad02440}{PCI\_PRODUCT\_HIFN\_7955}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00394}00394              pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_aad0579f7c2b9a7eae4b619a463568360}{PCI\_PRODUCT\_HIFN\_7956}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00395}00395                 sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} |= \mbox{\hyperlink{hifn7751var_8h_a5afb3dcac6f745581b312503d6bb8b5e}{HIFN\_IS\_7956}} | \mbox{\hyperlink{hifn7751var_8h_a674b1c60894c6090cd8cfcbabb53f8e3}{HIFN\_HAS\_AES}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00396}00396                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00397}00397 \textcolor{comment}{                 * Select PLL configuration.  This depends on the}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00398}00398 \textcolor{comment}{                 * bus and board design and must be manually configured}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00399}00399 \textcolor{comment}{                 * if the default setting is unacceptable.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00400}00400 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00401}00401                 \mbox{\hyperlink{hifn7751_8c_a80cf3905b5b0bd643ab121c2da6535e7}{hifn\_getpllconfig}}(dev, \&sc-\/>\mbox{\hyperlink{structhifn__softc_aab1c12dce9f1bb59446e629e8749d5e0}{sc\_pllconfig}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00402}00402         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00403}00403 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00404}00404         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00405}00405 \textcolor{comment}{         * Setup PCI resources. Note that we record the bus}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00406}00406 \textcolor{comment}{         * tag and handle for each register mapping, this is}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00407}00407 \textcolor{comment}{         * used by the READ\_REG\_0, WRITE\_REG\_0, READ\_REG\_1,}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00408}00408 \textcolor{comment}{         * and WRITE\_REG\_1 macros throughout the driver.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00409}00409 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00410}00410         pci\_enable\_busmaster(dev);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00411}00411 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00412}00412         rid = \mbox{\hyperlink{hifn7751reg_8h_a07b615d822272833d889fb116e93a6ed}{HIFN\_BAR0}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00413}00413         sc-\/>\mbox{\hyperlink{structhifn__softc_afec66dfadb217348bf666b95fe577bcf}{sc\_bar0res}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_MEMORY, \&rid,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00414}00414                                                 RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00415}00415         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_afec66dfadb217348bf666b95fe577bcf}{sc\_bar0res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00416}00416                 device\_printf(dev, \textcolor{stringliteral}{"{}cannot map bar\%d register space\(\backslash\)n"{}}, 0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00417}00417                 \textcolor{keywordflow}{goto} fail\_pci;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00418}00418         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00419}00419         sc-\/>\mbox{\hyperlink{structhifn__softc_a4bea2ff7a49ab9af07070a428a48727e}{sc\_st0}} = rman\_get\_bustag(sc-\/>\mbox{\hyperlink{structhifn__softc_afec66dfadb217348bf666b95fe577bcf}{sc\_bar0res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00420}00420         sc-\/>\mbox{\hyperlink{structhifn__softc_a545d6fb19a481446f0053c352deea59b}{sc\_sh0}} = rman\_get\_bushandle(sc-\/>\mbox{\hyperlink{structhifn__softc_afec66dfadb217348bf666b95fe577bcf}{sc\_bar0res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00421}00421         sc-\/>\mbox{\hyperlink{structhifn__softc_a46ab41553cde8385c2f79bdf586eeb75}{sc\_bar0\_lastreg}} = (bus\_size\_t) -\/1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00422}00422 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00423}00423         rid = \mbox{\hyperlink{hifn7751reg_8h_a3ae638fdcf9bd45b5ede7ef3caa19071}{HIFN\_BAR1}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00424}00424         sc-\/>\mbox{\hyperlink{structhifn__softc_a44f1ec98e8e93ce8e6ea684952f93e15}{sc\_bar1res}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_MEMORY, \&rid,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00425}00425                                                 RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00426}00426         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a44f1ec98e8e93ce8e6ea684952f93e15}{sc\_bar1res}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00427}00427                 device\_printf(dev, \textcolor{stringliteral}{"{}cannot map bar\%d register space\(\backslash\)n"{}}, 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00428}00428                 \textcolor{keywordflow}{goto} fail\_io0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00429}00429         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00430}00430         sc-\/>\mbox{\hyperlink{structhifn__softc_adfc3566b4313401fe0782634481192c0}{sc\_st1}} = rman\_get\_bustag(sc-\/>\mbox{\hyperlink{structhifn__softc_a44f1ec98e8e93ce8e6ea684952f93e15}{sc\_bar1res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00431}00431         sc-\/>\mbox{\hyperlink{structhifn__softc_a179bfb917f559eb2b9a37623a7a276d9}{sc\_sh1}} = rman\_get\_bushandle(sc-\/>\mbox{\hyperlink{structhifn__softc_a44f1ec98e8e93ce8e6ea684952f93e15}{sc\_bar1res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00432}00432         sc-\/>\mbox{\hyperlink{structhifn__softc_a73de5e38577f4d36ebed531f4211bf29}{sc\_bar1\_lastreg}} = (bus\_size\_t) -\/1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00433}00433 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00434}00434         \mbox{\hyperlink{hifn7751_8c_ae9c98c2559aecf31de0592518d046e4b}{hifn\_set\_retry}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00435}00435 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00436}00436         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00437}00437 \textcolor{comment}{         * Setup the area where the Hifn DMA's descriptors}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00438}00438 \textcolor{comment}{         * and associated data structures.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00439}00439 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00440}00440         \textcolor{keywordflow}{if} (bus\_dma\_tag\_create(bus\_get\_dma\_tag(dev),    \textcolor{comment}{/* PCI parent */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00441}00441                                1, 0,                    \textcolor{comment}{/* alignment,boundary */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00442}00442                                BUS\_SPACE\_MAXADDR\_32BIT, \textcolor{comment}{/* lowaddr */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00443}00443                                BUS\_SPACE\_MAXADDR,       \textcolor{comment}{/* highaddr */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00444}00444                                NULL, NULL,              \textcolor{comment}{/* filter, filterarg */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00445}00445                                \mbox{\hyperlink{hifn7751reg_8h_abf82b6950b01f2e03326671e49a9eb28}{HIFN\_MAX\_DMALEN}},          \textcolor{comment}{/* maxsize */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00446}00446                                \mbox{\hyperlink{hifn7751var_8h_a4dfc304917c2b88a1ffca6681de540a0}{MAX\_SCATTER}},          \textcolor{comment}{/* nsegments */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00447}00447                                \mbox{\hyperlink{hifn7751reg_8h_ab6f1b3b9069668856e2bcf8181834645}{HIFN\_MAX\_SEGLEN}},          \textcolor{comment}{/* maxsegsize */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00448}00448                                BUS\_DMA\_ALLOCNOW,        \textcolor{comment}{/* flags */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00449}00449                                NULL,                    \textcolor{comment}{/* lockfunc */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00450}00450                                NULL,                    \textcolor{comment}{/* lockarg */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00451}00451                                \&sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00452}00452                 device\_printf(dev, \textcolor{stringliteral}{"{}cannot allocate DMA tag\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00453}00453                 \textcolor{keywordflow}{goto} fail\_io1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00454}00454         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00455}00455         \textcolor{keywordflow}{if} (bus\_dmamap\_create(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, BUS\_DMA\_NOWAIT, \&sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00456}00456                 device\_printf(dev, \textcolor{stringliteral}{"{}cannot create dma map\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00457}00457                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00458}00458                 \textcolor{keywordflow}{goto} fail\_io1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00459}00459         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00460}00460         \textcolor{keywordflow}{if} (bus\_dmamem\_alloc(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, (\textcolor{keywordtype}{void}**) \&kva, BUS\_DMA\_NOWAIT, \&sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00461}00461                 device\_printf(dev, \textcolor{stringliteral}{"{}cannot alloc dma buffer\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00462}00462                 bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00463}00463                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00464}00464                 \textcolor{keywordflow}{goto} fail\_io1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00465}00465         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00466}00466         \textcolor{keywordflow}{if} (bus\_dmamap\_load(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}}, kva,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00467}00467                              sizeof (*sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00468}00468                              \mbox{\hyperlink{hifn7751_8c_a33f611b8c89c1a9a92316a74b8b8332a}{hifn\_dmamap\_cb}}, \&sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00469}00469                              BUS\_DMA\_NOWAIT)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00470}00470                 device\_printf(dev, \textcolor{stringliteral}{"{}cannot load dma map\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00471}00471                 bus\_dmamem\_free(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, kva, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00472}00472                 bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00473}00473                 \textcolor{keywordflow}{goto} fail\_io1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00474}00474         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00475}00475         sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *)kva;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00476}00476         bzero(sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}}, \textcolor{keyword}{sizeof}(*sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00477}00477 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00478}00478         KASSERT(sc-\/>\mbox{\hyperlink{structhifn__softc_a4bea2ff7a49ab9af07070a428a48727e}{sc\_st0}} != 0, (\textcolor{stringliteral}{"{}hifn\_attach: null bar0 tag!"{}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00479}00479         KASSERT(sc-\/>\mbox{\hyperlink{structhifn__softc_a545d6fb19a481446f0053c352deea59b}{sc\_sh0}} != 0, (\textcolor{stringliteral}{"{}hifn\_attach: null bar0 handle!"{}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00480}00480         KASSERT(sc-\/>\mbox{\hyperlink{structhifn__softc_adfc3566b4313401fe0782634481192c0}{sc\_st1}} != 0, (\textcolor{stringliteral}{"{}hifn\_attach: null bar1 tag!"{}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00481}00481         KASSERT(sc-\/>\mbox{\hyperlink{structhifn__softc_a179bfb917f559eb2b9a37623a7a276d9}{sc\_sh1}} != 0, (\textcolor{stringliteral}{"{}hifn\_attach: null bar1 handle!"{}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00483}00483         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00484}00484 \textcolor{comment}{         * Reset the board and do the ``secret handshake''}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00485}00485 \textcolor{comment}{         * to enable the crypto support.  Then complete the}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00486}00486 \textcolor{comment}{         * initialization procedure by setting up the interrupt}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00487}00487 \textcolor{comment}{         * and hooking in to the system crypto support so we'll}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00488}00488 \textcolor{comment}{         * get used for system services like the crypto device,}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00489}00489 \textcolor{comment}{         * IPsec, RNG device, etc.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00490}00490 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00491}00491         \mbox{\hyperlink{hifn7751_8c_a71599fa17dcb8905a389dc3a179160c1}{hifn\_reset\_board}}(sc, 0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00492}00492 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00493}00493         \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_abb986ed4571f09fe6bc19deba0aaf0cd}{hifn\_enable\_crypto}}(sc) != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00494}00494                 device\_printf(dev, \textcolor{stringliteral}{"{}crypto enabling failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00495}00495                 \textcolor{keywordflow}{goto} fail\_mem;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00496}00496         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00497}00497         \mbox{\hyperlink{hifn7751_8c_a5bcc4d5bdcbfa4b78d81bb9a565e1f42}{hifn\_reset\_puc}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00498}00498 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00499}00499         \mbox{\hyperlink{hifn7751_8c_aa14652c9bdd205405f8581c222fde517}{hifn\_init\_dma}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00500}00500         \mbox{\hyperlink{hifn7751_8c_a62f6d9df338d7da9f3e2a5d61d5d8187}{hifn\_init\_pci\_registers}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00502}00502         \textcolor{comment}{/* XXX can't dynamically determine ram type for 795x; force dram */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00503}00503         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a5afb3dcac6f745581b312503d6bb8b5e}{HIFN\_IS\_7956}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00504}00504                 sc-\/>\mbox{\hyperlink{structhifn__softc_aa01fe430c0d1155dc71878bbd41e7599}{sc\_drammodel}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00505}00505         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_adc0457e7ca7390813d1cd8f03aac4409}{hifn\_ramtype}}(sc))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00506}00506                 \textcolor{keywordflow}{goto} fail\_mem;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00507}00507 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00508}00508         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_aa01fe430c0d1155dc71878bbd41e7599}{sc\_drammodel}} == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00509}00509                 \mbox{\hyperlink{hifn7751_8c_ae4cdb0c16783aa27d55b0500fc4a769c}{hifn\_sramsize}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00510}00510         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00511}00511                 \mbox{\hyperlink{hifn7751_8c_a2f03d75700162fba997a5aa2d3445c8d}{hifn\_dramsize}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00512}00512 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00513}00513         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00514}00514 \textcolor{comment}{         * Workaround for NetSec 7751 rev A: half ram size because two}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00515}00515 \textcolor{comment}{         * of the address lines were left floating}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00516}00516 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00517}00517         \textcolor{keywordflow}{if} (pci\_get\_vendor(dev) == \mbox{\hyperlink{hifn7751reg_8h_aa3d48c2358f2f0d82edb6f57b442dac0}{PCI\_VENDOR\_NETSEC}} \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00518}00518             pci\_get\_device(dev) == \mbox{\hyperlink{hifn7751reg_8h_a6f2ea3c08f8648c5d87b88a2e7e7bc93}{PCI\_PRODUCT\_NETSEC\_7751}} \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00519}00519             pci\_get\_revid(dev) == 0x61) \textcolor{comment}{/*XXX???*/}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00520}00520                 sc-\/>\mbox{\hyperlink{structhifn__softc_a6cc21d73c86ae8f4d05960c8ff1e6225}{sc\_ramsize}} >>= 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00522}00522         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00523}00523 \textcolor{comment}{         * Arrange the interrupt line.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00524}00524 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00525}00525         rid = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00526}00526         sc-\/>\mbox{\hyperlink{structhifn__softc_a0b293a9f64c6433556a70698f44293f5}{sc\_irq}} = bus\_alloc\_resource\_any(dev, SYS\_RES\_IRQ, \&rid,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00527}00527                                             RF\_SHAREABLE|RF\_ACTIVE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00528}00528         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a0b293a9f64c6433556a70698f44293f5}{sc\_irq}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00529}00529                 device\_printf(dev, \textcolor{stringliteral}{"{}could not map interrupt\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00530}00530                 \textcolor{keywordflow}{goto} fail\_mem;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00531}00531         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00532}00532         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00533}00533 \textcolor{comment}{         * NB: Network code assumes we are blocked with splimp()}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00534}00534 \textcolor{comment}{         *     so make sure the IRQ is marked appropriately.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00535}00535 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00536}00536         \textcolor{keywordflow}{if} (bus\_setup\_intr(dev, sc-\/>\mbox{\hyperlink{structhifn__softc_a0b293a9f64c6433556a70698f44293f5}{sc\_irq}}, INTR\_TYPE\_NET | INTR\_MPSAFE,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00537}00537                            NULL, \mbox{\hyperlink{hifn7751_8c_a64a879aa44af33b500fb8d8aa14d0354}{hifn\_intr}}, sc, \&sc-\/>\mbox{\hyperlink{structhifn__softc_aad0a1b1ca1c88a6f93741ccf2528d9b8}{sc\_intrhand}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00538}00538                 device\_printf(dev, \textcolor{stringliteral}{"{}could not setup interrupt\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00539}00539                 \textcolor{keywordflow}{goto} fail\_intr2;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00540}00540         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00542}00542         \mbox{\hyperlink{hifn7751_8c_af6c12e4067052444aff7f9f02775538c}{hifn\_sessions}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00543}00543 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00544}00544         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00545}00545 \textcolor{comment}{         * NB: Keep only the low 16 bits; this masks the chip id}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00546}00546 \textcolor{comment}{         *     from the 7951.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00547}00547 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00548}00548         rev = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_af2577fe937c7b1db041e1b3a4ae9aca4}{HIFN\_1\_REVID}}) \& 0xffff;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00549}00549 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00550}00550         rseg = sc-\/>\mbox{\hyperlink{structhifn__softc_a6cc21d73c86ae8f4d05960c8ff1e6225}{sc\_ramsize}} / 1024;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00551}00551         rbase = \textcolor{charliteral}{'K'};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00552}00552         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a6cc21d73c86ae8f4d05960c8ff1e6225}{sc\_ramsize}} >= (1024 * 1024)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00553}00553                 rbase = \textcolor{charliteral}{'M'};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00554}00554                 rseg /= 1024;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00555}00555         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00556}00556         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}\%s, rev \%u, \%d\%cB \%cram"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00557}00557                 \mbox{\hyperlink{hifn7751_8c_a25b3c7fbf6d6419df1d3edeeba570a5a}{hifn\_partname}}(sc), rev,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00558}00558                 rseg, rbase, sc-\/>\mbox{\hyperlink{structhifn__softc_aa01fe430c0d1155dc71878bbd41e7599}{sc\_drammodel}} ? \textcolor{charliteral}{'d'} : \textcolor{charliteral}{'s'});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00559}00559         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a5afb3dcac6f745581b312503d6bb8b5e}{HIFN\_IS\_7956}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00560}00560                 printf(\textcolor{stringliteral}{"{}, pll=0x\%x<\%s clk, \%ux mult>"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00561}00561                         sc-\/>\mbox{\hyperlink{structhifn__softc_aab1c12dce9f1bb59446e629e8749d5e0}{sc\_pllconfig}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00562}00562                         sc-\/>\mbox{\hyperlink{structhifn__softc_aab1c12dce9f1bb59446e629e8749d5e0}{sc\_pllconfig}} \& \mbox{\hyperlink{hifn7751reg_8h_a04ff6687e6b72cacbdd49883ff6edb89}{HIFN\_PLL\_REF\_SEL}} ? \textcolor{stringliteral}{"{}ext"{}} : \textcolor{stringliteral}{"{}pci"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00563}00563                         2 + 2*((sc-\/>\mbox{\hyperlink{structhifn__softc_aab1c12dce9f1bb59446e629e8749d5e0}{sc\_pllconfig}} \& \mbox{\hyperlink{hifn7751reg_8h_a8ae4286e3470991d6481a118314b7a93}{HIFN\_PLL\_ND}}) >> 11));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00564}00564         printf(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00565}00565 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00566}00566         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00567}00567             \mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}}) | \mbox{\hyperlink{hifn7751reg_8h_a1b547a1508e5754cf13b4452e5f54db4}{HIFN\_PUCNFG\_CHIPID}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00568}00568         sc-\/>\mbox{\hyperlink{structhifn__softc_aa2fdea2d407548757dea5e8fb398ef91}{sc\_ena}} = \mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a8abc672dbae117253b046022ef55a8cd}{HIFN\_0\_PUSTAT}}) \& \mbox{\hyperlink{hifn7751reg_8h_a9a07dd7963d7e2034a707119ca012190}{HIFN\_PUSTAT\_CHIPENA}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00569}00569 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00570}00570         \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structhifn__softc_aa2fdea2d407548757dea5e8fb398ef91}{sc\_ena}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00571}00571         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a86f5c652fe99fe432b6e5721039fbf73}{HIFN\_PUSTAT\_ENA\_2}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00572}00572         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a6353fcc34fd7787036abaf0a68beb675}{HIFN\_PUSTAT\_ENA\_1}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00573}00573                 sc-\/>\mbox{\hyperlink{structhifn__softc_adab72b54430de648b44d93e61d68ba90}{sc\_cid}} = crypto\_get\_driverid(dev,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00574}00574                     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__session}{hifn\_session}}), CRYPTOCAP\_F\_HARDWARE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00575}00575                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_adab72b54430de648b44d93e61d68ba90}{sc\_cid}} < 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00576}00576                         device\_printf(dev, \textcolor{stringliteral}{"{}could not get crypto driver id\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00577}00577                         \textcolor{keywordflow}{goto} fail\_intr;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00578}00578                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00579}00579                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00580}00580         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00581}00581                 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00582}00582         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00583}00583             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00584}00584 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00585}00585         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& (\mbox{\hyperlink{hifn7751var_8h_a1e2651b6242cc07fb2e772b5d55eefbd}{HIFN\_HAS\_PUBLIC}} | \mbox{\hyperlink{hifn7751var_8h_aa17260f258870ca6486af12a897aab13}{HIFN\_HAS\_RNG}}))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00586}00586                 \mbox{\hyperlink{hifn7751_8c_a2c164b12ac8bfc13ee2639641c29559c}{hifn\_init\_pubrng}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00588}00588         callout\_init(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a848a093614a153dd76498bb6a160fe48}{sc\_tickto}}, 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00589}00589         callout\_reset(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a848a093614a153dd76498bb6a160fe48}{sc\_tickto}}, hz, \mbox{\hyperlink{hifn7751_8c_af7de08206bc84abf506bb668c78113c3}{hifn\_tick}}, sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00590}00590 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00591}00591         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00592}00592 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00593}00593 fail\_intr:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00594}00594         bus\_teardown\_intr(dev, sc-\/>\mbox{\hyperlink{structhifn__softc_a0b293a9f64c6433556a70698f44293f5}{sc\_irq}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aad0a1b1ca1c88a6f93741ccf2528d9b8}{sc\_intrhand}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00595}00595 fail\_intr2:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00596}00596         \textcolor{comment}{/* XXX don't store rid */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00597}00597         bus\_release\_resource(dev, SYS\_RES\_IRQ, 0, sc-\/>\mbox{\hyperlink{structhifn__softc_a0b293a9f64c6433556a70698f44293f5}{sc\_irq}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00598}00598 fail\_mem:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00599}00599         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00600}00600         bus\_dmamem\_free(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00601}00601         bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00602}00602 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00603}00603         \textcolor{comment}{/* Turn off DMA polling */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00604}00604         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}}, \mbox{\hyperlink{hifn7751reg_8h_ab8658b7ec09268ed1ee7092f2825cee7}{HIFN\_DMACNFG\_MSTRESET}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00605}00605             \mbox{\hyperlink{hifn7751reg_8h_ad1e24758fd60bab794fcefe2519cf97b}{HIFN\_DMACNFG\_DMARESET}} | \mbox{\hyperlink{hifn7751reg_8h_ab186ba536671fc35ec22f246f13f7481}{HIFN\_DMACNFG\_MODE}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00606}00606 fail\_io1:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00607}00607         bus\_release\_resource(dev, SYS\_RES\_MEMORY, \mbox{\hyperlink{hifn7751reg_8h_a3ae638fdcf9bd45b5ede7ef3caa19071}{HIFN\_BAR1}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a44f1ec98e8e93ce8e6ea684952f93e15}{sc\_bar1res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00608}00608 fail\_io0:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00609}00609         bus\_release\_resource(dev, SYS\_RES\_MEMORY, \mbox{\hyperlink{hifn7751reg_8h_a07b615d822272833d889fb116e93a6ed}{HIFN\_BAR0}}, sc-\/>\mbox{\hyperlink{structhifn__softc_afec66dfadb217348bf666b95fe577bcf}{sc\_bar0res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00610}00610 fail\_pci:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00611}00611         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a757d72448b4383c124e9c408d702dcf3}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00612}00612         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00613}00613 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00614}00614 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00615}00615 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00616}00616 \textcolor{comment}{ * Detach an interface that successfully probed.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00617}00617 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00618}00618 \textcolor{keyword}{static} \textcolor{keywordtype}{int} }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00619}\mbox{\hyperlink{hifn7751_8c_aa636c26344cfda578935eeb22a2c0dc3}{00619}} \mbox{\hyperlink{hifn7751_8c_aa636c26344cfda578935eeb22a2c0dc3}{hifn\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00620}00620 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00621}00621         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00622}00622 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00623}00623         KASSERT(sc != NULL, (\textcolor{stringliteral}{"{}hifn\_detach: null software carrier!"{}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00624}00624 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00625}00625         \textcolor{comment}{/* disable interrupts */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00626}00626         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aafdcca42c86f7cb0ddb01c5a0cc4abc9}{HIFN\_1\_DMA\_IER}}, 0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00627}00627 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00628}00628         \textcolor{comment}{/*XXX other resources */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00629}00629         callout\_stop(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a848a093614a153dd76498bb6a160fe48}{sc\_tickto}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00630}00630         callout\_stop(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a143138dcc035982ed6b6491fdcdc1f1e}{sc\_rngto}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00631}00631 \textcolor{preprocessor}{\#ifdef HIFN\_RNDTEST}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00632}00632         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a9245bb03ac7a90b2a3391c5e3d404cf1}{sc\_rndtest}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00633}00633                 rndtest\_detach(sc-\/>\mbox{\hyperlink{structhifn__softc_a9245bb03ac7a90b2a3391c5e3d404cf1}{sc\_rndtest}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00634}00634 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00635}00635 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00636}00636         \textcolor{comment}{/* Turn off DMA polling */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00637}00637         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}}, \mbox{\hyperlink{hifn7751reg_8h_ab8658b7ec09268ed1ee7092f2825cee7}{HIFN\_DMACNFG\_MSTRESET}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00638}00638             \mbox{\hyperlink{hifn7751reg_8h_ad1e24758fd60bab794fcefe2519cf97b}{HIFN\_DMACNFG\_DMARESET}} | \mbox{\hyperlink{hifn7751reg_8h_ab186ba536671fc35ec22f246f13f7481}{HIFN\_DMACNFG\_MODE}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00639}00639 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00640}00640         crypto\_unregister\_all(sc-\/>\mbox{\hyperlink{structhifn__softc_adab72b54430de648b44d93e61d68ba90}{sc\_cid}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00641}00641 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00642}00642         bus\_generic\_detach(dev);        \textcolor{comment}{/*XXX should be no children, right? */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00643}00643 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00644}00644         bus\_teardown\_intr(dev, sc-\/>\mbox{\hyperlink{structhifn__softc_a0b293a9f64c6433556a70698f44293f5}{sc\_irq}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aad0a1b1ca1c88a6f93741ccf2528d9b8}{sc\_intrhand}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00645}00645         \textcolor{comment}{/* XXX don't store rid */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00646}00646         bus\_release\_resource(dev, SYS\_RES\_IRQ, 0, sc-\/>\mbox{\hyperlink{structhifn__softc_a0b293a9f64c6433556a70698f44293f5}{sc\_irq}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00647}00647 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00648}00648         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00649}00649         bus\_dmamem\_free(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00650}00650         bus\_dma\_tag\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00651}00651 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00652}00652         bus\_release\_resource(dev, SYS\_RES\_MEMORY, \mbox{\hyperlink{hifn7751reg_8h_a3ae638fdcf9bd45b5ede7ef3caa19071}{HIFN\_BAR1}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a44f1ec98e8e93ce8e6ea684952f93e15}{sc\_bar1res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00653}00653         bus\_release\_resource(dev, SYS\_RES\_MEMORY, \mbox{\hyperlink{hifn7751reg_8h_a07b615d822272833d889fb116e93a6ed}{HIFN\_BAR0}}, sc-\/>\mbox{\hyperlink{structhifn__softc_afec66dfadb217348bf666b95fe577bcf}{sc\_bar0res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00654}00654 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00655}00655         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a757d72448b4383c124e9c408d702dcf3}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00656}00656 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00657}00657         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00658}00658 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00659}00659 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00660}00660 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00661}00661 \textcolor{comment}{ * Stop all chip I/O so that the kernel's probe routines don't}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00662}00662 \textcolor{comment}{ * get confused by errant DMAs when rebooting.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00663}00663 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00664}00664 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00665}\mbox{\hyperlink{hifn7751_8c_a5afc4d336965740b852802b204760f67}{00665}} \mbox{\hyperlink{hifn7751_8c_a5afc4d336965740b852802b204760f67}{hifn\_shutdown}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00666}00666 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00667}00667 \textcolor{preprocessor}{\#ifdef notyet}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00668}00668         hifn\_stop(device\_get\_softc(dev));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00669}00669 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00670}00670         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00671}00671 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00672}00672 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00673}00673 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00674}00674 \textcolor{comment}{ * Device suspend routine.  Stop the interface and save some PCI}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00675}00675 \textcolor{comment}{ * settings in case the BIOS doesn't restore them properly on}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00676}00676 \textcolor{comment}{ * resume.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00677}00677 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00678}00678 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00679}\mbox{\hyperlink{hifn7751_8c_aced75140937433f71eef1710b63bf2a2}{00679}} \mbox{\hyperlink{hifn7751_8c_aced75140937433f71eef1710b63bf2a2}{hifn\_suspend}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00680}00680 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00681}00681         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00682}00682 \textcolor{preprocessor}{\#ifdef notyet}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00683}00683         hifn\_stop(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00684}00684 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00685}00685         sc-\/>\mbox{\hyperlink{structhifn__softc_ac8070b13971c3cfc38489ad9d88d5277}{sc\_suspended}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00686}00686 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00687}00687         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00688}00688 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00689}00689 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00690}00690 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00691}00691 \textcolor{comment}{ * Device resume routine.  Restore some PCI settings in case the BIOS}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00692}00692 \textcolor{comment}{ * doesn't, re-\/enable busmastering, and restart the interface if}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00693}00693 \textcolor{comment}{ * appropriate.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00694}00694 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00695}00695 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00696}\mbox{\hyperlink{hifn7751_8c_ae130bd7c1ff5d1de909b5e00133448d5}{00696}} \mbox{\hyperlink{hifn7751_8c_ae130bd7c1ff5d1de909b5e00133448d5}{hifn\_resume}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00697}00697 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00698}00698         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00699}00699 \textcolor{preprocessor}{\#ifdef notyet}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00700}00700         \textcolor{comment}{/* reinitialize interface if necessary */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00701}00701         \textcolor{keywordflow}{if} (ifp-\/>if\_flags \& IFF\_UP)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00702}00702                 rl\_init(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00703}00703 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00704}00704         sc-\/>\mbox{\hyperlink{structhifn__softc_ac8070b13971c3cfc38489ad9d88d5277}{sc\_suspended}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00705}00705 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00706}00706         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00707}00707 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00709}00709 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00710}\mbox{\hyperlink{hifn7751_8c_a2c164b12ac8bfc13ee2639641c29559c}{00710}} \mbox{\hyperlink{hifn7751_8c_a2c164b12ac8bfc13ee2639641c29559c}{hifn\_init\_pubrng}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00711}00711 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00712}00712         u\_int32\_t r;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00713}00713         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00714}00714 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00715}00715 \textcolor{preprocessor}{\#ifdef HIFN\_RNDTEST}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00716}00716         sc-\/>\mbox{\hyperlink{structhifn__softc_a9245bb03ac7a90b2a3391c5e3d404cf1}{sc\_rndtest}} = rndtest\_attach(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00717}00717         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a9245bb03ac7a90b2a3391c5e3d404cf1}{sc\_rndtest}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00718}00718                 sc-\/>\mbox{\hyperlink{structhifn__softc_a2b60bc6158f515601983b8b4e464dc9f}{sc\_harvest}} = rndtest\_harvest;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00719}00719         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00720}00720                 sc-\/>\mbox{\hyperlink{structhifn__softc_a2b60bc6158f515601983b8b4e464dc9f}{sc\_harvest}} = \mbox{\hyperlink{hifn7751_8c_a7ce217062812f329950acc7c9a680b79}{default\_harvest}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00721}00721 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00722}00722         sc-\/>\mbox{\hyperlink{structhifn__softc_a2b60bc6158f515601983b8b4e464dc9f}{sc\_harvest}} = \mbox{\hyperlink{hifn7751_8c_a7ce217062812f329950acc7c9a680b79}{default\_harvest}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00723}00723 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00724}00724         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00725}00725                 \textcolor{comment}{/* Reset 7951 public key/rng engine */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00726}00726                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a3a16216d4996b2df84d268da25e185f2}{HIFN\_1\_PUB\_RESET}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00727}00727                     \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a3a16216d4996b2df84d268da25e185f2}{HIFN\_1\_PUB\_RESET}}) | \mbox{\hyperlink{hifn7751reg_8h_a94ed0943f849c7bf12b52dcec69411ad}{HIFN\_PUBRST\_RESET}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00728}00728 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00729}00729                 \textcolor{keywordflow}{for} (i = 0; i < 100; i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00730}00730                         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00731}00731                         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a3a16216d4996b2df84d268da25e185f2}{HIFN\_1\_PUB\_RESET}}) \&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00732}00732                             \mbox{\hyperlink{hifn7751reg_8h_a94ed0943f849c7bf12b52dcec69411ad}{HIFN\_PUBRST\_RESET}}) == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00733}00733                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00734}00734                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00735}00735 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00736}00736                 \textcolor{keywordflow}{if} (i == 100) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00737}00737                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}public key init failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00738}00738                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00739}00739                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00740}00740         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00741}00741 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00742}00742         \textcolor{comment}{/* Enable the rng, if available */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00743}00743         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_aa17260f258870ca6486af12a897aab13}{HIFN\_HAS\_RNG}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00744}00744                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00745}00745                         r = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a7ae8051443709eeb5cf84ab0932525f4}{HIFN\_1\_7811\_RNGENA}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00746}00746                         \textcolor{keywordflow}{if} (r \& \mbox{\hyperlink{hifn7751reg_8h_ae7c8fb2a58830d58eebce802b891b94d}{HIFN\_7811\_RNGENA\_ENA}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00747}00747                                 r \&= \string~HIFN\_7811\_RNGENA\_ENA;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00748}00748                                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a7ae8051443709eeb5cf84ab0932525f4}{HIFN\_1\_7811\_RNGENA}}, r);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00749}00749                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00750}00750                         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_af43f6c0a138d7343f80027e5b191e4f3}{HIFN\_1\_7811\_RNGCFG}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00751}00751                             \mbox{\hyperlink{hifn7751reg_8h_a2befdcf46f5adfdf36c2d0164e1ce978}{HIFN\_7811\_RNGCFG\_DEFL}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00752}00752                         r |= \mbox{\hyperlink{hifn7751reg_8h_ae7c8fb2a58830d58eebce802b891b94d}{HIFN\_7811\_RNGENA\_ENA}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00753}00753                         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a7ae8051443709eeb5cf84ab0932525f4}{HIFN\_1\_7811\_RNGENA}}, r);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00754}00754                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00755}00755                         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aff9a66dc8ed33437b98623ee0e65e983}{HIFN\_1\_RNG\_CONFIG}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00756}00756                             \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aff9a66dc8ed33437b98623ee0e65e983}{HIFN\_1\_RNG\_CONFIG}}) |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00757}00757                             \mbox{\hyperlink{hifn7751reg_8h_a92cb22b71f04912005bf930b209e0d05}{HIFN\_RNGCFG\_ENA}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00758}00758 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00759}00759                 sc-\/>\mbox{\hyperlink{structhifn__softc_a1d63640f425bc8ad5ec347e96e1fdeb2}{sc\_rngfirst}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00760}00760                 \textcolor{keywordflow}{if} (hz >= 100)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00761}00761                         sc-\/>\mbox{\hyperlink{structhifn__softc_a5a9c776dc704cca47b34dd6c646780f6}{sc\_rnghz}} = hz / 100;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00762}00762                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00763}00763                         sc-\/>\mbox{\hyperlink{structhifn__softc_a5a9c776dc704cca47b34dd6c646780f6}{sc\_rnghz}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00764}00764                 callout\_init(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a143138dcc035982ed6b6491fdcdc1f1e}{sc\_rngto}}, 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00765}00765                 callout\_reset(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a143138dcc035982ed6b6491fdcdc1f1e}{sc\_rngto}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a5a9c776dc704cca47b34dd6c646780f6}{sc\_rnghz}}, \mbox{\hyperlink{hifn7751_8c_a95dcd11c3ef539353c258d6911bf4fbc}{hifn\_rng}}, sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00766}00766         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00767}00767 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00768}00768         \textcolor{comment}{/* Enable public key engine, if available */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00769}00769         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a1e2651b6242cc07fb2e772b5d55eefbd}{HIFN\_HAS\_PUBLIC}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00770}00770                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aa044ba493292e7847dac6971abf13e5b}{HIFN\_1\_PUB\_IEN}}, \mbox{\hyperlink{hifn7751reg_8h_a25c959890a4aaa289ecd52c2a9162c87}{HIFN\_PUBIEN\_DONE}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00771}00771                 sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}} |= \mbox{\hyperlink{hifn7751reg_8h_a1ee87747e3614e28c8880eccecde694a}{HIFN\_DMAIER\_PUBDONE}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00772}00772                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aafdcca42c86f7cb0ddb01c5a0cc4abc9}{HIFN\_1\_DMA\_IER}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00773}00773 \textcolor{preprocessor}{\#ifdef HIFN\_VULCANDEV}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00774}00774                 sc-\/>sc\_pkdev = make\_dev(\&vulcanpk\_cdevsw, 0, }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00775}00775                                         UID\_ROOT, GID\_WHEEL, 0666,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00776}00776                                         \textcolor{stringliteral}{"{}vulcanpk"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00777}00777                 sc-\/>sc\_pkdev-\/>si\_drv1 = sc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00778}00778 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00779}00779         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00780}00780 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00781}00781         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00782}00782 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00783}00783 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00784}00784 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00785}\mbox{\hyperlink{hifn7751_8c_a95dcd11c3ef539353c258d6911bf4fbc}{00785}} \mbox{\hyperlink{hifn7751_8c_a95dcd11c3ef539353c258d6911bf4fbc}{hifn\_rng}}(\textcolor{keywordtype}{void} *vsc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00786}00786 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00787}00787 \textcolor{preprocessor}{\#define RANDOM\_BITS(n)  (n)*sizeof (u\_int32\_t), (n)*sizeof (u\_int32\_t)*NBBY, 0}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00788}00788         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc = vsc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00789}00789         u\_int32\_t sts, num[2];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00790}00790         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00791}00791 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00792}00792         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00793}00793                 \textcolor{comment}{/* ONLY VALID ON 7811!!!! */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00794}00794                 \textcolor{keywordflow}{for} (i = 0; i < 5; i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00795}00795                         sts = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a19b2a9eb8b6157b2cb17e0910ae3bee4}{HIFN\_1\_7811\_RNGSTS}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00796}00796                         \textcolor{keywordflow}{if} (sts \& \mbox{\hyperlink{hifn7751reg_8h_acc7beb09eb0b11e2239d8ea7ae24d3cb}{HIFN\_7811\_RNGSTS\_UFL}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00797}00797                                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00798}00798                                               \textcolor{stringliteral}{"{}RNG underflow: disabling\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00799}00799                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00800}00800                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00801}00801                         \textcolor{keywordflow}{if} ((sts \& \mbox{\hyperlink{hifn7751reg_8h_a0e094cb10985dd7e664c20c266be9227}{HIFN\_7811\_RNGSTS\_RDY}}) == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00802}00802                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00803}00803 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00804}00804                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00805}00805 \textcolor{comment}{                         * There are at least two words in the RNG FIFO}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00806}00806 \textcolor{comment}{                         * at this point.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00807}00807 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00808}00808                         num[0] = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a141981597a5f84b62bc1d73df855c0cf}{HIFN\_1\_7811\_RNGDAT}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00809}00809                         num[1] = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a141981597a5f84b62bc1d73df855c0cf}{HIFN\_1\_7811\_RNGDAT}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00810}00810                         \textcolor{comment}{/* NB: discard first data read */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00811}00811                         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a1d63640f425bc8ad5ec347e96e1fdeb2}{sc\_rngfirst}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00812}00812                                 sc-\/>\mbox{\hyperlink{structhifn__softc_a1d63640f425bc8ad5ec347e96e1fdeb2}{sc\_rngfirst}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00813}00813                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00814}00814                                 (*sc-\/>\mbox{\hyperlink{structhifn__softc_a2b60bc6158f515601983b8b4e464dc9f}{sc\_harvest}})(sc-\/>\mbox{\hyperlink{structhifn__softc_a9245bb03ac7a90b2a3391c5e3d404cf1}{sc\_rndtest}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00815}00815                                         num, \textcolor{keyword}{sizeof} (num));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00816}00816                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00817}00817         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00818}00818                 num[0] = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a798db02fae2e3e1e01e2534db9e08bfe}{HIFN\_1\_RNG\_DATA}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00819}00819 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00820}00820                 \textcolor{comment}{/* NB: discard first data read */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00821}00821                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a1d63640f425bc8ad5ec347e96e1fdeb2}{sc\_rngfirst}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00822}00822                         sc-\/>\mbox{\hyperlink{structhifn__softc_a1d63640f425bc8ad5ec347e96e1fdeb2}{sc\_rngfirst}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00823}00823                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00824}00824                         (*sc-\/>\mbox{\hyperlink{structhifn__softc_a2b60bc6158f515601983b8b4e464dc9f}{sc\_harvest}})(sc-\/>\mbox{\hyperlink{structhifn__softc_a9245bb03ac7a90b2a3391c5e3d404cf1}{sc\_rndtest}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00825}00825                                 num, \textcolor{keyword}{sizeof} (num[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00826}00826         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00827}00827 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00828}00828         callout\_reset(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a143138dcc035982ed6b6491fdcdc1f1e}{sc\_rngto}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a5a9c776dc704cca47b34dd6c646780f6}{sc\_rnghz}}, \mbox{\hyperlink{hifn7751_8c_a95dcd11c3ef539353c258d6911bf4fbc}{hifn\_rng}}, sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00829}00829 \textcolor{preprocessor}{\#undef RANDOM\_BITS}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00830}00830 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00831}00831 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00832}00832 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00833}\mbox{\hyperlink{hifn7751_8c_ad4c8b24eb89c5ec2d14c0be084c08fa8}{00833}} \mbox{\hyperlink{hifn7751_8c_ad4c8b24eb89c5ec2d14c0be084c08fa8}{hifn\_puc\_wait}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00834}00834 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00835}00835         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00836}00836         \textcolor{keywordtype}{int} reg = \mbox{\hyperlink{hifn7751reg_8h_ad8ce67da6b60e75539ea2b94fc0335a5}{HIFN\_0\_PUCTRL}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00837}00837 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00838}00838         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a5afb3dcac6f745581b312503d6bb8b5e}{HIFN\_IS\_7956}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00839}00839                 reg = \mbox{\hyperlink{hifn7751reg_8h_a28eb3fa32bd27a324490a7bd44615058}{HIFN\_0\_PUCTRL2}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00840}00840         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00841}00841 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00842}00842         \textcolor{keywordflow}{for} (i = 5000; i > 0; i-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00843}00843                 DELAY(1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00844}00844                 \textcolor{keywordflow}{if} (!(\mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(sc, reg) \& \mbox{\hyperlink{hifn7751reg_8h_a12ce87f9982aca84bc76857947265906}{HIFN\_PUCTRL\_RESET}}))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00845}00845                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00846}00846         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00847}00847         \textcolor{keywordflow}{if} (!i)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00848}00848                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}proc unit did not reset\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00849}00849 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00850}00850 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00851}00851 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00852}00852 \textcolor{comment}{ * Reset the processing unit.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00853}00853 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00854}00854 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00855}\mbox{\hyperlink{hifn7751_8c_a5bcc4d5bdcbfa4b78d81bb9a565e1f42}{00855}} \mbox{\hyperlink{hifn7751_8c_a5bcc4d5bdcbfa4b78d81bb9a565e1f42}{hifn\_reset\_puc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00856}00856 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00857}00857         \textcolor{comment}{/* Reset processing unit */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00858}00858         \textcolor{keywordtype}{int} reg = \mbox{\hyperlink{hifn7751reg_8h_ad8ce67da6b60e75539ea2b94fc0335a5}{HIFN\_0\_PUCTRL}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00859}00859 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00860}00860         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a5afb3dcac6f745581b312503d6bb8b5e}{HIFN\_IS\_7956}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00861}00861                 reg = \mbox{\hyperlink{hifn7751reg_8h_a28eb3fa32bd27a324490a7bd44615058}{HIFN\_0\_PUCTRL2}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00862}00862         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00863}00863         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, reg, \mbox{\hyperlink{hifn7751reg_8h_a7412d78448423e56f65aba2e57ce81e0}{HIFN\_PUCTRL\_DMAENA}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00864}00864 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00865}00865         \mbox{\hyperlink{hifn7751_8c_ad4c8b24eb89c5ec2d14c0be084c08fa8}{hifn\_puc\_wait}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00866}00866 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00867}00867 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00868}00868 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00869}00869 \textcolor{comment}{ * Set the Retry and TRDY registers; note that we set them to}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00870}00870 \textcolor{comment}{ * zero because the 7811 locks up when forced to retry (section}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00871}00871 \textcolor{comment}{ * 3.6 of "{}Specification Update SU-\/0014-\/04"{}.  Not clear if we}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00872}00872 \textcolor{comment}{ * should do this for all Hifn parts, but it doesn't seem to hurt.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00873}00873 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00874}00874 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00875}\mbox{\hyperlink{hifn7751_8c_ae9c98c2559aecf31de0592518d046e4b}{00875}} \mbox{\hyperlink{hifn7751_8c_ae9c98c2559aecf31de0592518d046e4b}{hifn\_set\_retry}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00876}00876 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00877}00877         \textcolor{comment}{/* NB: RETRY only responds to 8-\/bit reads/writes */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00878}00878         pci\_write\_config(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \mbox{\hyperlink{hifn7751reg_8h_ab5a878be8bd45568dcc0139d4d0f074d}{HIFN\_RETRY\_TIMEOUT}}, 0, 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00879}00879         pci\_write\_config(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \mbox{\hyperlink{hifn7751reg_8h_a50a849436a82f3660c7883464705df04}{HIFN\_TRDY\_TIMEOUT}}, 0, 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00880}00880 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00881}00881 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00882}00882 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00883}00883 \textcolor{comment}{ * Resets the board.  Values in the regesters are left as is}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00884}00884 \textcolor{comment}{ * from the reset (i.e. initial values are assigned elsewhere).}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00885}00885 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00886}00886 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00887}\mbox{\hyperlink{hifn7751_8c_a71599fa17dcb8905a389dc3a179160c1}{00887}} \mbox{\hyperlink{hifn7751_8c_a71599fa17dcb8905a389dc3a179160c1}{hifn\_reset\_board}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keywordtype}{int} full)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00888}00888 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00889}00889         u\_int32\_t reg;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00890}00890 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00891}00891         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00892}00892 \textcolor{comment}{         * Set polling in the DMA configuration register to zero.  0x7 avoids}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00893}00893 \textcolor{comment}{         * resetting the board and zeros out the other fields.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00894}00894 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00895}00895         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}}, \mbox{\hyperlink{hifn7751reg_8h_ab8658b7ec09268ed1ee7092f2825cee7}{HIFN\_DMACNFG\_MSTRESET}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00896}00896             \mbox{\hyperlink{hifn7751reg_8h_ad1e24758fd60bab794fcefe2519cf97b}{HIFN\_DMACNFG\_DMARESET}} | \mbox{\hyperlink{hifn7751reg_8h_ab186ba536671fc35ec22f246f13f7481}{HIFN\_DMACNFG\_MODE}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00897}00897 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00898}00898         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00899}00899 \textcolor{comment}{         * Now that polling has been disabled, we have to wait 1 ms}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00900}00900 \textcolor{comment}{         * before resetting the board.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00901}00901 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00902}00902         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00903}00903 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00904}00904         \textcolor{comment}{/* Reset the DMA unit */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00905}00905         \textcolor{keywordflow}{if} (full) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00906}00906                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}}, \mbox{\hyperlink{hifn7751reg_8h_ab186ba536671fc35ec22f246f13f7481}{HIFN\_DMACNFG\_MODE}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00907}00907                 DELAY(1000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00908}00908         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00909}00909                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00910}00910                     \mbox{\hyperlink{hifn7751reg_8h_ab186ba536671fc35ec22f246f13f7481}{HIFN\_DMACNFG\_MODE}} | \mbox{\hyperlink{hifn7751reg_8h_ab8658b7ec09268ed1ee7092f2825cee7}{HIFN\_DMACNFG\_MSTRESET}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00911}00911                 \mbox{\hyperlink{hifn7751_8c_a5bcc4d5bdcbfa4b78d81bb9a565e1f42}{hifn\_reset\_puc}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00912}00912         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00913}00913 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00914}00914         KASSERT(sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}} != NULL, (\textcolor{stringliteral}{"{}hifn\_reset\_board: null DMA tag!"{}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00915}00915         bzero(sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}}, \textcolor{keyword}{sizeof}(*sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00916}00916 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00917}00917         \textcolor{comment}{/* Bring dma unit out of reset */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00918}00918         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}}, \mbox{\hyperlink{hifn7751reg_8h_ab8658b7ec09268ed1ee7092f2825cee7}{HIFN\_DMACNFG\_MSTRESET}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00919}00919             \mbox{\hyperlink{hifn7751reg_8h_ad1e24758fd60bab794fcefe2519cf97b}{HIFN\_DMACNFG\_DMARESET}} | \mbox{\hyperlink{hifn7751reg_8h_ab186ba536671fc35ec22f246f13f7481}{HIFN\_DMACNFG\_MODE}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00920}00920 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00921}00921         \mbox{\hyperlink{hifn7751_8c_ad4c8b24eb89c5ec2d14c0be084c08fa8}{hifn\_puc\_wait}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00922}00922         \mbox{\hyperlink{hifn7751_8c_ae9c98c2559aecf31de0592518d046e4b}{hifn\_set\_retry}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00923}00923 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00924}00924         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00925}00925                 \textcolor{keywordflow}{for} (reg = 0; reg < 1000; reg++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00926}00926                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2d68289a40bda0177c043876992d4f08}{HIFN\_1\_7811\_MIPSRST}}) \&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00927}00927                             \mbox{\hyperlink{hifn7751reg_8h_a5326d086b69159b41489f1b02075ec07}{HIFN\_MIPSRST\_CRAMINIT}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00928}00928                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00929}00929                         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00930}00930                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00931}00931                 \textcolor{keywordflow}{if} (reg == 1000)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00932}00932                         printf(\textcolor{stringliteral}{"{}: cram init timeout\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00933}00933         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00934}00934           \textcolor{comment}{/* set up DMA configuration register \#2 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00935}00935           \textcolor{comment}{/* turn off all PK and BAR0 swaps */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00936}00936           \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a26019379b1035aa7f7d976f22f34e62f}{HIFN\_1\_DMA\_CNFG2}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00937}00937                       (3 << \mbox{\hyperlink{hifn7751reg_8h_a0f52127d2442b9fad5e1aabbd694112b}{HIFN\_DMACNFG2\_INIT\_WRITE\_BURST\_SHIFT}})|}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00938}00938                       (3 << \mbox{\hyperlink{hifn7751reg_8h_ae7fac6248b2e0a56682adb0535c62d16}{HIFN\_DMACNFG2\_INIT\_READ\_BURST\_SHIFT}})|}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00939}00939                       (2 << \mbox{\hyperlink{hifn7751reg_8h_ac5d3ef3c64af6f0d7f77e36a911767b3}{HIFN\_DMACNFG2\_TGT\_WRITE\_BURST\_SHIFT}})|}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00940}00940                       (2 << \mbox{\hyperlink{hifn7751reg_8h_af8986a5cecb3ee9a964911871824b520}{HIFN\_DMACNFG2\_TGT\_READ\_BURST\_SHIFT}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00941}00941         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00942}00942                       }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00943}00943 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00944}00944 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00945}00945 \textcolor{keyword}{static} u\_int32\_t}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00946}\mbox{\hyperlink{hifn7751_8c_a21e9b1d0d992b10a5d99d46f8a8af7b0}{00946}} \mbox{\hyperlink{hifn7751_8c_a21e9b1d0d992b10a5d99d46f8a8af7b0}{hifn\_next\_signature}}(u\_int32\_t a, u\_int cnt)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00947}00947 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00948}00948         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00949}00949         u\_int32\_t v;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00950}00950 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00951}00951         \textcolor{keywordflow}{for} (i = 0; i < cnt; i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00952}00952 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00953}00953                 \textcolor{comment}{/* get the parity */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00954}00954                 v = a \& 0x80080125;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00955}00955                 v \string^= v >> 16;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00956}00956                 v \string^= v >> 8;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00957}00957                 v \string^= v >> 4;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00958}00958                 v \string^= v >> 2;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00959}00959                 v \string^= v >> 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00960}00960 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00961}00961                 a = (v \& 1) \string^ (a << 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00962}00962         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00963}00963 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00964}00964         \textcolor{keywordflow}{return} a;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00965}00965 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00966}00966 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00967}\mbox{\hyperlink{structpci2id}{00967}} \textcolor{keyword}{struct }\mbox{\hyperlink{structpci2id}{pci2id}} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00968}\mbox{\hyperlink{structpci2id_ad301bb378927d0d50df9655fa9d4e3b9}{00968}}         u\_short         \mbox{\hyperlink{structpci2id_ad301bb378927d0d50df9655fa9d4e3b9}{pci\_vendor}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00969}\mbox{\hyperlink{structpci2id_afa90de37f81bffd51e59b620e928a2a5}{00969}}         u\_short         \mbox{\hyperlink{structpci2id_afa90de37f81bffd51e59b620e928a2a5}{pci\_prod}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00970}\mbox{\hyperlink{structpci2id_acb2bb9582fbee112e99327957d92eac6}{00970}}         \textcolor{keywordtype}{char}            \mbox{\hyperlink{structpci2id_acb2bb9582fbee112e99327957d92eac6}{card\_id}}[13];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00971}00971 \};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00972}\mbox{\hyperlink{hifn7751_8c_aa955b326eff15f9c8ecdcd0d839d53a7}{00972}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structpci2id}{pci2id}} \mbox{\hyperlink{structpci2id}{pci2id}}[] = \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00973}00973         \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00974}00974                 \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00975}00975                 \mbox{\hyperlink{hifn7751reg_8h_aedb53b06d113691a35944827926af86b}{PCI\_PRODUCT\_HIFN\_7951}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00976}00976                 \{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00977}00977                   0x00, 0x00, 0x00, 0x00, 0x00 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00978}00978         \}, \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00979}00979                 \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00980}00980                 \mbox{\hyperlink{hifn7751reg_8h_a6e565d09d00dce0cf9d0aa9fbad02440}{PCI\_PRODUCT\_HIFN\_7955}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00981}00981                 \{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00982}00982                   0x00, 0x00, 0x00, 0x00, 0x00 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00983}00983         \}, \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00984}00984                 \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00985}00985                 \mbox{\hyperlink{hifn7751reg_8h_aad0579f7c2b9a7eae4b619a463568360}{PCI\_PRODUCT\_HIFN\_7956}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00986}00986                 \{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00987}00987                   0x00, 0x00, 0x00, 0x00, 0x00 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00988}00988         \}, \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00989}00989                 \mbox{\hyperlink{hifn7751reg_8h_aa3d48c2358f2f0d82edb6f57b442dac0}{PCI\_VENDOR\_NETSEC}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00990}00990                 \mbox{\hyperlink{hifn7751reg_8h_a6f2ea3c08f8648c5d87b88a2e7e7bc93}{PCI\_PRODUCT\_NETSEC\_7751}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00991}00991                 \{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00992}00992                   0x00, 0x00, 0x00, 0x00, 0x00 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00993}00993         \}, \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00994}00994                 \mbox{\hyperlink{hifn7751reg_8h_a12fd262b8c51cb91fd012d139272ed44}{PCI\_VENDOR\_INVERTEX}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00995}00995                 \mbox{\hyperlink{hifn7751reg_8h_af1f85052f187a695d4c531190fcf0707}{PCI\_PRODUCT\_INVERTEX\_AEON}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00996}00996                 \{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00997}00997                   0x00, 0x00, 0x00, 0x00, 0x00 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00998}00998         \}, \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l00999}00999                 \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01000}01000                 \mbox{\hyperlink{hifn7751reg_8h_a5cdc4c36d691b8a8403012769682c95e}{PCI\_PRODUCT\_HIFN\_7811}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01001}01001                 \{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01002}01002                   0x00, 0x00, 0x00, 0x00, 0x00 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01003}01003         \}, \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01004}01004                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01005}01005 \textcolor{comment}{                 * Other vendors share this PCI ID as well, such as}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01006}01006 \textcolor{comment}{                 * http://www.powercrypt.com, and obviously they also}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01007}01007 \textcolor{comment}{                 * use the same key.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01008}01008 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01009}01009                 \mbox{\hyperlink{hifn7751reg_8h_a8724c15293d6ef21bd58af2f98b8a836}{PCI\_VENDOR\_HIFN}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01010}01010                 \mbox{\hyperlink{hifn7751reg_8h_ac6a13bb7a1a21ae971578b57be6adc04}{PCI\_PRODUCT\_HIFN\_7751}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01011}01011                 \{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01012}01012                   0x00, 0x00, 0x00, 0x00, 0x00 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01013}01013         \},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01014}01014 \};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01015}01015 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01016}01016 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01017}01017 \textcolor{comment}{ * Checks to see if crypto is already enabled.  If crypto isn't enable,}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01018}01018 \textcolor{comment}{ * "{}hifn\_enable\_crypto"{} is called to enable it.  The check is important,}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01019}01019 \textcolor{comment}{ * as enabling crypto twice will lock the board.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01020}01020 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01021}01021 \textcolor{keyword}{static} \textcolor{keywordtype}{int} }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01022}\mbox{\hyperlink{hifn7751_8c_abb986ed4571f09fe6bc19deba0aaf0cd}{01022}} \mbox{\hyperlink{hifn7751_8c_abb986ed4571f09fe6bc19deba0aaf0cd}{hifn\_enable\_crypto}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01023}01023 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01024}01024         u\_int32\_t dmacfg, ramcfg, encl, addr, i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01025}01025         \textcolor{keywordtype}{char} *offtbl = NULL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01026}01026 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01027}01027         \textcolor{keywordflow}{for} (i = 0; i < nitems(\mbox{\hyperlink{structpci2id}{pci2id}}); i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01028}01028                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structpci2id}{pci2id}}[i].\mbox{\hyperlink{structpci2id_ad301bb378927d0d50df9655fa9d4e3b9}{pci\_vendor}} == pci\_get\_vendor(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}) \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01029}01029                     \mbox{\hyperlink{structpci2id}{pci2id}}[i].\mbox{\hyperlink{structpci2id_afa90de37f81bffd51e59b620e928a2a5}{pci\_prod}} == pci\_get\_device(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01030}01030                         offtbl = \mbox{\hyperlink{structpci2id}{pci2id}}[i].\mbox{\hyperlink{structpci2id_acb2bb9582fbee112e99327957d92eac6}{card\_id}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01031}01031                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01032}01032                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01033}01033         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01034}01034         \textcolor{keywordflow}{if} (offtbl == NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01035}01035                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}Unknown card!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01036}01036                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01037}01037         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01038}01038 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01039}01039         ramcfg = \mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01040}01040         dmacfg = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01041}01041 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01042}01042         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01043}01043 \textcolor{comment}{         * The RAM config register's encrypt level bit needs to be set before}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01044}01044 \textcolor{comment}{         * every read performed on the encryption level register.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01045}01045 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01046}01046         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}}, ramcfg | \mbox{\hyperlink{hifn7751reg_8h_a1b547a1508e5754cf13b4452e5f54db4}{HIFN\_PUCNFG\_CHIPID}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01047}01047 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01048}01048         encl = \mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a8abc672dbae117253b046022ef55a8cd}{HIFN\_0\_PUSTAT}}) \& \mbox{\hyperlink{hifn7751reg_8h_a9a07dd7963d7e2034a707119ca012190}{HIFN\_PUSTAT\_CHIPENA}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01049}01049 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01050}01050         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01051}01051 \textcolor{comment}{         * Make sure we don't re-\/unlock.  Two unlocks kills chip until the}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01052}01052 \textcolor{comment}{         * next reboot.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01053}01053 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01054}01054         \textcolor{keywordflow}{if} (encl == \mbox{\hyperlink{hifn7751reg_8h_a6353fcc34fd7787036abaf0a68beb675}{HIFN\_PUSTAT\_ENA\_1}} || encl == \mbox{\hyperlink{hifn7751reg_8h_a86f5c652fe99fe432b6e5721039fbf73}{HIFN\_PUSTAT\_ENA\_2}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01055}01055 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01056}01056                 \textcolor{keywordflow}{if} (hifn\_debug)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01057}01057                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01058}01058                             \textcolor{stringliteral}{"{}Strong crypto already enabled!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01059}01059 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01060}01060                 \textcolor{keywordflow}{goto} report;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01061}01061         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01062}01062 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01063}01063         \textcolor{keywordflow}{if} (encl != 0 \&\& encl != \mbox{\hyperlink{hifn7751reg_8h_a4252a2b7254e64ecdb6be22817598bfa}{HIFN\_PUSTAT\_ENA\_0}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01064}01064 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01065}01065                 \textcolor{keywordflow}{if} (hifn\_debug)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01066}01066                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01067}01067                               \textcolor{stringliteral}{"{}Unknown encryption level 0x\%x\(\backslash\)n"{}}, encl);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01068}01068 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01069}01069                 \textcolor{keywordflow}{return} 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01070}01070         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01071}01071 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01072}01072         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}}, \mbox{\hyperlink{hifn7751reg_8h_add71f88c2e077431937dfc9948a8c9df}{HIFN\_DMACNFG\_UNLOCK}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01073}01073             \mbox{\hyperlink{hifn7751reg_8h_ab8658b7ec09268ed1ee7092f2825cee7}{HIFN\_DMACNFG\_MSTRESET}} | \mbox{\hyperlink{hifn7751reg_8h_ad1e24758fd60bab794fcefe2519cf97b}{HIFN\_DMACNFG\_DMARESET}} | \mbox{\hyperlink{hifn7751reg_8h_ab186ba536671fc35ec22f246f13f7481}{HIFN\_DMACNFG\_MODE}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01074}01074         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01075}01075         addr = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a92e0ebfa0499a37afbbfc883a936299a}{HIFN\_UNLOCK\_SECRET1}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01076}01076         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01077}01077         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a4e68862072b136d37bc6781b62315638}{HIFN\_UNLOCK\_SECRET2}}, 0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01078}01078         DELAY(1000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01079}01079 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01080}01080         \textcolor{keywordflow}{for} (i = 0; i <= 12; i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01081}01081                 addr = \mbox{\hyperlink{hifn7751_8c_a21e9b1d0d992b10a5d99d46f8a8af7b0}{hifn\_next\_signature}}(addr, offtbl[i] + 0x101);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01082}01082                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a4e68862072b136d37bc6781b62315638}{HIFN\_UNLOCK\_SECRET2}}, addr);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01083}01083 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01084}01084                 DELAY(1000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01085}01085         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01086}01086 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01087}01087         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}}, ramcfg | \mbox{\hyperlink{hifn7751reg_8h_a1b547a1508e5754cf13b4452e5f54db4}{HIFN\_PUCNFG\_CHIPID}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01088}01088         encl = \mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a8abc672dbae117253b046022ef55a8cd}{HIFN\_0\_PUSTAT}}) \& \mbox{\hyperlink{hifn7751reg_8h_a9a07dd7963d7e2034a707119ca012190}{HIFN\_PUSTAT\_CHIPENA}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01089}01089 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01090}01090 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01091}01091         \textcolor{keywordflow}{if} (hifn\_debug) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01092}01092                 \textcolor{keywordflow}{if} (encl != \mbox{\hyperlink{hifn7751reg_8h_a6353fcc34fd7787036abaf0a68beb675}{HIFN\_PUSTAT\_ENA\_1}} \&\& encl != \mbox{\hyperlink{hifn7751reg_8h_a86f5c652fe99fe432b6e5721039fbf73}{HIFN\_PUSTAT\_ENA\_2}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01093}01093                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}Engine is permanently "{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01094}01094                                 \textcolor{stringliteral}{"{}locked until next system reset!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01095}01095                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01096}01096                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}Engine enabled "{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01097}01097                                 \textcolor{stringliteral}{"{}successfully!\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01098}01098         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01099}01099 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01100}01100 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01101}01101 report:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01102}01102         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}}, ramcfg);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01103}01103         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}}, dmacfg);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01104}01104 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01105}01105         \textcolor{keywordflow}{switch} (encl) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01106}01106         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a6353fcc34fd7787036abaf0a68beb675}{HIFN\_PUSTAT\_ENA\_1}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01107}01107         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a86f5c652fe99fe432b6e5721039fbf73}{HIFN\_PUSTAT\_ENA\_2}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01108}01108                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01109}01109         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a4252a2b7254e64ecdb6be22817598bfa}{HIFN\_PUSTAT\_ENA\_0}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01110}01110         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01111}01111                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}disabled"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01112}01112                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01113}01113         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01114}01114 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01115}01115         \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01116}01116 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01117}01117 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01118}01118 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01119}01119 \textcolor{comment}{ * Give initial values to the registers listed in the "{}Register Space"{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01120}01120 \textcolor{comment}{ * section of the HIFN Software Development reference manual.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01121}01121 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01122}01122 \textcolor{keyword}{static} \textcolor{keywordtype}{void} }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01123}\mbox{\hyperlink{hifn7751_8c_a62f6d9df338d7da9f3e2a5d61d5d8187}{01123}} \mbox{\hyperlink{hifn7751_8c_a62f6d9df338d7da9f3e2a5d61d5d8187}{hifn\_init\_pci\_registers}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01124}01124 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01125}01125         \textcolor{comment}{/* write fixed values needed by the Initialization registers */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01126}01126         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ad8ce67da6b60e75539ea2b94fc0335a5}{HIFN\_0\_PUCTRL}}, \mbox{\hyperlink{hifn7751reg_8h_a7412d78448423e56f65aba2e57ce81e0}{HIFN\_PUCTRL\_DMAENA}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01127}01127         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a67b0ec5d2bdd9b68f6ecd63a75d234b2}{HIFN\_0\_FIFOCNFG}}, \mbox{\hyperlink{hifn7751reg_8h_a06bc28711b9a2fec8f2f1288331f0a52}{HIFN\_FIFOCNFG\_THRESHOLD}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01128}01128         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a6e844ede54414cbbef7e2639f43c784a}{HIFN\_0\_PUIER}}, \mbox{\hyperlink{hifn7751reg_8h_a507086a466f29261f91d4685713d4504}{HIFN\_PUIER\_DSTOVER}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01129}01129 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01130}01130         \textcolor{comment}{/* write all 4 ring address registers */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01131}01131         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a299f0ce2055c3dac8b41fea02a10384a}{HIFN\_1\_DMA\_CRAR}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01132}01132             offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, cmdr[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01133}01133         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2d6cffcc12584f0f7d483c20b70f0c5e}{HIFN\_1\_DMA\_SRAR}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01134}01134             offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, srcr[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01135}01135         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a93623513be4535734709336cc658c3f2}{HIFN\_1\_DMA\_DRAR}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01136}01136             offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, dstr[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01137}01137         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a90e12f1603ff639e4e44c6240c254207}{HIFN\_1\_DMA\_RRAR}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01138}01138             offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, resr[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01139}01139 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01140}01140         DELAY(2000);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01141}01141 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01142}01142         \textcolor{comment}{/* write status register */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01143}01143         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01144}01144             \mbox{\hyperlink{hifn7751reg_8h_a732033d4199e8dbfa27aa8669f3077ff}{HIFN\_DMACSR\_D\_CTRL\_DIS}} | \mbox{\hyperlink{hifn7751reg_8h_aa4b40911890600e2f3183b53ed9d483e}{HIFN\_DMACSR\_R\_CTRL\_DIS}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01145}01145             \mbox{\hyperlink{hifn7751reg_8h_a6f23e20a8d783d7c0f552cc63a2e487f}{HIFN\_DMACSR\_S\_CTRL\_DIS}} | \mbox{\hyperlink{hifn7751reg_8h_a5d0566278c41f8958ecb928d08314cde}{HIFN\_DMACSR\_C\_CTRL\_DIS}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01146}01146             \mbox{\hyperlink{hifn7751reg_8h_a43faa68af12666cc25c2546a7dc20ad5}{HIFN\_DMACSR\_D\_ABORT}} | \mbox{\hyperlink{hifn7751reg_8h_af413c5aa87bf1f6e7f7e6309b105c6cf}{HIFN\_DMACSR\_D\_DONE}} | \mbox{\hyperlink{hifn7751reg_8h_a8ac9dbd5582eaecbc6860c651e830feb}{HIFN\_DMACSR\_D\_LAST}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01147}01147             \mbox{\hyperlink{hifn7751reg_8h_a747ee7cdfc64613e35494e3ac40b19c8}{HIFN\_DMACSR\_D\_WAIT}} | \mbox{\hyperlink{hifn7751reg_8h_acd03d214548ae5b4231b49a7e1d05f07}{HIFN\_DMACSR\_D\_OVER}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01148}01148             \mbox{\hyperlink{hifn7751reg_8h_aa89fc126fd3a348d2c0901435bba0b8b}{HIFN\_DMACSR\_R\_ABORT}} | \mbox{\hyperlink{hifn7751reg_8h_a36398cabea9cb7a6239d6f8fcd717e49}{HIFN\_DMACSR\_R\_DONE}} | \mbox{\hyperlink{hifn7751reg_8h_a6cd27a8cbd3e12e41da2f0a64c73fcc8}{HIFN\_DMACSR\_R\_LAST}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01149}01149             \mbox{\hyperlink{hifn7751reg_8h_a9118be234f3d2cc81ac321f45315311f}{HIFN\_DMACSR\_R\_WAIT}} | \mbox{\hyperlink{hifn7751reg_8h_a56ba8cc5f651408015d920c9b1149383}{HIFN\_DMACSR\_R\_OVER}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01150}01150             \mbox{\hyperlink{hifn7751reg_8h_af9cb246cbb877dc2f50333181e804e61}{HIFN\_DMACSR\_S\_ABORT}} | \mbox{\hyperlink{hifn7751reg_8h_a5db1ca7d07ad6f9b7e229aa5e5a9f254}{HIFN\_DMACSR\_S\_DONE}} | \mbox{\hyperlink{hifn7751reg_8h_a5b51d55defbd1d1da3e7a15584da2202}{HIFN\_DMACSR\_S\_LAST}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01151}01151             \mbox{\hyperlink{hifn7751reg_8h_abf5b4e01a2511499b974e9bfecf1221d}{HIFN\_DMACSR\_S\_WAIT}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01152}01152             \mbox{\hyperlink{hifn7751reg_8h_a89d9bb4f52507e0480d671a35470a224}{HIFN\_DMACSR\_C\_ABORT}} | \mbox{\hyperlink{hifn7751reg_8h_a1c37c962842527aef4df59112a9b6d80}{HIFN\_DMACSR\_C\_DONE}} | \mbox{\hyperlink{hifn7751reg_8h_a49812443a1f191555ab4d52ec6930ee8}{HIFN\_DMACSR\_C\_LAST}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01153}01153             \mbox{\hyperlink{hifn7751reg_8h_a57bfdfae942a72d5616c6494cc04b297}{HIFN\_DMACSR\_C\_WAIT}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01154}01154             \mbox{\hyperlink{hifn7751reg_8h_a81825b62a9f262811265d0a815c4c7a9}{HIFN\_DMACSR\_ENGINE}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01155}01155             ((sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a1e2651b6242cc07fb2e772b5d55eefbd}{HIFN\_HAS\_PUBLIC}}) ?}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01156}01156                 \mbox{\hyperlink{hifn7751reg_8h_a918d01773e775f0d56ff45ea733d1424}{HIFN\_DMACSR\_PUBDONE}} : 0) |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01157}01157             ((sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) ?}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01158}01158                 \mbox{\hyperlink{hifn7751reg_8h_abc051d8ab61048cfdf5a836edc836c01}{HIFN\_DMACSR\_ILLW}} | \mbox{\hyperlink{hifn7751reg_8h_ab81cb8ae1838d7d16026a277820daaf1}{HIFN\_DMACSR\_ILLR}} : 0));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01159}01159 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01160}01160         sc-\/>\mbox{\hyperlink{structhifn__softc_a7514fe950d3d396c918487463c6a2d86}{sc\_d\_busy}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a2c0b5d1999596e60f507c9f2d1290f3b}{sc\_r\_busy}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a3a34b0e9358cdcb3bc8c26ce81941384}{sc\_s\_busy}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a5dcbd2360055d34c3cc0dca48f78f119}{sc\_c\_busy}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01161}01161         sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}} |= \mbox{\hyperlink{hifn7751reg_8h_aebb00075bc6e3b64f78bb71ba58ae7c6}{HIFN\_DMAIER\_R\_DONE}} | \mbox{\hyperlink{hifn7751reg_8h_a3591f8ef39a2788d1115427a2d03a013}{HIFN\_DMAIER\_C\_ABORT}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01162}01162             \mbox{\hyperlink{hifn7751reg_8h_a448c5959ca25609dd315344641624ec2}{HIFN\_DMAIER\_D\_OVER}} | \mbox{\hyperlink{hifn7751reg_8h_ab2c61034f00a260c1f89afb969f1dbb8}{HIFN\_DMAIER\_R\_OVER}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01163}01163             \mbox{\hyperlink{hifn7751reg_8h_a12e99dbaf06886bf8845f505e3f1f9fb}{HIFN\_DMAIER\_S\_ABORT}} | \mbox{\hyperlink{hifn7751reg_8h_af8852a31e40b1f5907e0ed569e5ee987}{HIFN\_DMAIER\_D\_ABORT}} | \mbox{\hyperlink{hifn7751reg_8h_ad32ed03a859d713e08a94fd56dbe1ec6}{HIFN\_DMAIER\_R\_ABORT}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01164}01164             ((sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) ?}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01165}01165                 \mbox{\hyperlink{hifn7751reg_8h_a9d956c4f90791c327f20b6bd9a4e47fb}{HIFN\_DMAIER\_ILLW}} | \mbox{\hyperlink{hifn7751reg_8h_a59f571fe913e21342d156e6a4d5212ce}{HIFN\_DMAIER\_ILLR}} : 0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01166}01166         sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}} \&= \string~HIFN\_DMAIER\_C\_WAIT;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01167}01167         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aafdcca42c86f7cb0ddb01c5a0cc4abc9}{HIFN\_1\_DMA\_IER}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01168}01168 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01169}01169 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01170}01170         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a5afb3dcac6f745581b312503d6bb8b5e}{HIFN\_IS\_7956}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01171}01171                 u\_int32\_t pll;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01172}01172 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01173}01173                 \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}}, \mbox{\hyperlink{hifn7751reg_8h_a8209c2fbf7407ae4cbd557095a05af05}{HIFN\_PUCNFG\_COMPSING}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01174}01174                     \mbox{\hyperlink{hifn7751reg_8h_a4042a58a290b7508fcde0582cbb38110}{HIFN\_PUCNFG\_TCALLPHASES}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01175}01175                     \mbox{\hyperlink{hifn7751reg_8h_ab3be81199f7f06776ea13e30f791336d}{HIFN\_PUCNFG\_TCDRVTOTEM}} | \mbox{\hyperlink{hifn7751reg_8h_a5a3bd5d8fb8caa372d757a91fc567fce}{HIFN\_PUCNFG\_BUS32}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01176}01176 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01177}01177                 \textcolor{comment}{/* turn off the clocks and insure bypass is set */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01178}01178                 pll = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aea3c1956589dd29dd50e3dd29fab9fdc}{HIFN\_1\_PLL}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01179}01179                 pll = (pll \&\string~ (\mbox{\hyperlink{hifn7751reg_8h_a0ccc6e9cf8de0527a4d2b87523bd9a34}{HIFN\_PLL\_PK\_CLK\_SEL}} | \mbox{\hyperlink{hifn7751reg_8h_a707fbab05d22b08c4f07a40218e78b6b}{HIFN\_PLL\_PE\_CLK\_SEL}}))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01180}01180                   | \mbox{\hyperlink{hifn7751reg_8h_a794efe4bcf07f091e81cf6d8dbad2b8a}{HIFN\_PLL\_BP}} | \mbox{\hyperlink{hifn7751reg_8h_a79faf16b166c1dcde235037fa3fabe31}{HIFN\_PLL\_MBSET}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01181}01181                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aea3c1956589dd29dd50e3dd29fab9fdc}{HIFN\_1\_PLL}}, pll);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01182}01182                 DELAY(10*1000);         \textcolor{comment}{/* 10ms */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01183}01183 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01184}01184                 \textcolor{comment}{/* change configuration */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01185}01185                 pll = (pll \&\string~ HIFN\_PLL\_CONFIG) | sc-\/>\mbox{\hyperlink{structhifn__softc_aab1c12dce9f1bb59446e629e8749d5e0}{sc\_pllconfig}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01186}01186                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aea3c1956589dd29dd50e3dd29fab9fdc}{HIFN\_1\_PLL}}, pll);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01187}01187                 DELAY(10*1000);         \textcolor{comment}{/* 10ms */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01188}01188 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01189}01189                 \textcolor{comment}{/* disable bypass */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01190}01190                 pll \&= \string~HIFN\_PLL\_BP;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01191}01191                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aea3c1956589dd29dd50e3dd29fab9fdc}{HIFN\_1\_PLL}}, pll);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01192}01192                 \textcolor{comment}{/* enable clocks with new configuration */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01193}01193                 pll |= \mbox{\hyperlink{hifn7751reg_8h_a0ccc6e9cf8de0527a4d2b87523bd9a34}{HIFN\_PLL\_PK\_CLK\_SEL}} | \mbox{\hyperlink{hifn7751reg_8h_a707fbab05d22b08c4f07a40218e78b6b}{HIFN\_PLL\_PE\_CLK\_SEL}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01194}01194                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aea3c1956589dd29dd50e3dd29fab9fdc}{HIFN\_1\_PLL}}, pll);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01195}01195         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01196}01196                 \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}}, \mbox{\hyperlink{hifn7751reg_8h_a8209c2fbf7407ae4cbd557095a05af05}{HIFN\_PUCNFG\_COMPSING}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01197}01197                     \mbox{\hyperlink{hifn7751reg_8h_a17e820715c2bbb346e07b2ad654d3c53}{HIFN\_PUCNFG\_DRFR\_128}} | \mbox{\hyperlink{hifn7751reg_8h_a4042a58a290b7508fcde0582cbb38110}{HIFN\_PUCNFG\_TCALLPHASES}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01198}01198                     \mbox{\hyperlink{hifn7751reg_8h_ab3be81199f7f06776ea13e30f791336d}{HIFN\_PUCNFG\_TCDRVTOTEM}} | \mbox{\hyperlink{hifn7751reg_8h_a5a3bd5d8fb8caa372d757a91fc567fce}{HIFN\_PUCNFG\_BUS32}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01199}01199                     (sc-\/>\mbox{\hyperlink{structhifn__softc_aa01fe430c0d1155dc71878bbd41e7599}{sc\_drammodel}} ? \mbox{\hyperlink{hifn7751reg_8h_ab77a6097ed4ea7225887264d8ae8945e}{HIFN\_PUCNFG\_DRAM}} : \mbox{\hyperlink{hifn7751reg_8h_a0c5a490bf230992321d0515fa845d33a}{HIFN\_PUCNFG\_SRAM}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01200}01200         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01201}01201 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01202}01202         \mbox{\hyperlink{hifn7751_8c_a292274f3d8f8e38e97e38104fce2379f}{WRITE\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a5aa02988389ca32f0996126665869454}{HIFN\_0\_PUISR}}, \mbox{\hyperlink{hifn7751reg_8h_a0ecdf4c357f1f981f9774e25f7ef465e}{HIFN\_PUISR\_DSTOVER}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01203}01203         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae670e7f91c52a76d0c2c6746f9eaf3d5}{HIFN\_1\_DMA\_CNFG}}, \mbox{\hyperlink{hifn7751reg_8h_ab8658b7ec09268ed1ee7092f2825cee7}{HIFN\_DMACNFG\_MSTRESET}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01204}01204             \mbox{\hyperlink{hifn7751reg_8h_ad1e24758fd60bab794fcefe2519cf97b}{HIFN\_DMACNFG\_DMARESET}} | \mbox{\hyperlink{hifn7751reg_8h_ab186ba536671fc35ec22f246f13f7481}{HIFN\_DMACNFG\_MODE}} | \mbox{\hyperlink{hifn7751reg_8h_ad5fb696c48040bbde2b0883486e42898}{HIFN\_DMACNFG\_LAST}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01205}01205             ((\mbox{\hyperlink{hifn7751reg_8h_a07d77b1d8d354f5d2664fb8eedd65d79}{HIFN\_POLL\_FREQUENCY}} << 16 ) \& \mbox{\hyperlink{hifn7751reg_8h_ae2dec024c551d2f7c9019db88d2308d9}{HIFN\_DMACNFG\_POLLFREQ}}) |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01206}01206             ((\mbox{\hyperlink{hifn7751reg_8h_ae37c89c0d71508d0f10ad67fc02f8e6e}{HIFN\_POLL\_SCALAR}} << 8) \& \mbox{\hyperlink{hifn7751reg_8h_a25e17a85ca7486c46bea7f5a70a07eeb}{HIFN\_DMACNFG\_POLLINVAL}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01207}01207 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01208}01208 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01209}01209 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01210}01210 \textcolor{comment}{ * The maximum number of sessions supported by the card}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01211}01211 \textcolor{comment}{ * is dependent on the amount of context ram, which}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01212}01212 \textcolor{comment}{ * encryption algorithms are enabled, and how compression}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01213}01213 \textcolor{comment}{ * is configured.  This should be configured before this}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01214}01214 \textcolor{comment}{ * routine is called.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01215}01215 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01216}01216 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01217}\mbox{\hyperlink{hifn7751_8c_af6c12e4067052444aff7f9f02775538c}{01217}} \mbox{\hyperlink{hifn7751_8c_af6c12e4067052444aff7f9f02775538c}{hifn\_sessions}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01218}01218 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01219}01219         u\_int32\_t pucnfg;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01220}01220         \textcolor{keywordtype}{int} ctxsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01221}01221 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01222}01222         pucnfg = \mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01223}01223 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01224}01224         \textcolor{keywordflow}{if} (pucnfg \& \mbox{\hyperlink{hifn7751reg_8h_a8209c2fbf7407ae4cbd557095a05af05}{HIFN\_PUCNFG\_COMPSING}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01225}01225                 \textcolor{keywordflow}{if} (pucnfg \& \mbox{\hyperlink{hifn7751reg_8h_a5ae4210448d846ff11cba98afde132bd}{HIFN\_PUCNFG\_ENCCNFG}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01226}01226                         ctxsize = 128;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01227}01227                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01228}01228                         ctxsize = 512;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01229}01229                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01230}01230 \textcolor{comment}{                 * 7955/7956 has internal context memory of 32K}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01231}01231 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01232}01232                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a5afb3dcac6f745581b312503d6bb8b5e}{HIFN\_IS\_7956}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01233}01233                         sc-\/>\mbox{\hyperlink{structhifn__softc_abaf361457147e3ebde95dfe7a601affa}{sc\_maxses}} = 32768 / ctxsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01234}01234                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01235}01235                         sc-\/>\mbox{\hyperlink{structhifn__softc_abaf361457147e3ebde95dfe7a601affa}{sc\_maxses}} = 1 +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01236}01236                             ((sc-\/>\mbox{\hyperlink{structhifn__softc_a6cc21d73c86ae8f4d05960c8ff1e6225}{sc\_ramsize}} -\/ 32768) / ctxsize);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01237}01237         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01238}01238                 sc-\/>\mbox{\hyperlink{structhifn__softc_abaf361457147e3ebde95dfe7a601affa}{sc\_maxses}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a6cc21d73c86ae8f4d05960c8ff1e6225}{sc\_ramsize}} / 16384;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01239}01239 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01240}01240         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_abaf361457147e3ebde95dfe7a601affa}{sc\_maxses}} > 2048)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01241}01241                 sc-\/>\mbox{\hyperlink{structhifn__softc_abaf361457147e3ebde95dfe7a601affa}{sc\_maxses}} = 2048;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01242}01242 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01243}01243 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01244}01244 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01245}01245 \textcolor{comment}{ * Determine ram type (sram or dram).  Board should be just out of a reset}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01246}01246 \textcolor{comment}{ * state when this is called.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01247}01247 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01248}01248 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01249}\mbox{\hyperlink{hifn7751_8c_adc0457e7ca7390813d1cd8f03aac4409}{01249}} \mbox{\hyperlink{hifn7751_8c_adc0457e7ca7390813d1cd8f03aac4409}{hifn\_ramtype}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01250}01250 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01251}01251         u\_int8\_t data[8], dataexpect[8];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01252}01252         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01253}01253 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01254}01254         \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(data); i++)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01255}01255                 data[i] = dataexpect[i] = 0x55;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01256}01256         \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_a47b07bf1f6f9aa634c50ecc6f88f5cb8}{hifn\_writeramaddr}}(sc, 0, data))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01257}01257                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01258}01258         \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_a0a1b763f64952472b539202990dd4a15}{hifn\_readramaddr}}(sc, 0, data))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01259}01259                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01260}01260         \textcolor{keywordflow}{if} (bcmp(data, dataexpect, \textcolor{keyword}{sizeof}(data)) != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01261}01261                 sc-\/>\mbox{\hyperlink{structhifn__softc_aa01fe430c0d1155dc71878bbd41e7599}{sc\_drammodel}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01262}01262                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01263}01263         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01264}01264 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01265}01265         \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(data); i++)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01266}01266                 data[i] = dataexpect[i] = 0xaa;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01267}01267         \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_a47b07bf1f6f9aa634c50ecc6f88f5cb8}{hifn\_writeramaddr}}(sc, 0, data))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01268}01268                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01269}01269         \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_a0a1b763f64952472b539202990dd4a15}{hifn\_readramaddr}}(sc, 0, data))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01270}01270                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01271}01271         \textcolor{keywordflow}{if} (bcmp(data, dataexpect, \textcolor{keyword}{sizeof}(data)) != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01272}01272                 sc-\/>\mbox{\hyperlink{structhifn__softc_aa01fe430c0d1155dc71878bbd41e7599}{sc\_drammodel}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01273}01273                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01274}01274         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01275}01275 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01276}01276         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01277}01277 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01278}01278 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01279}\mbox{\hyperlink{hifn7751_8c_abb7ec104c0c32e13448e5239a3a054fd}{01279}} \textcolor{preprocessor}{\#define HIFN\_SRAM\_MAX           (32 << 20)}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01280}\mbox{\hyperlink{hifn7751_8c_a812ff8bd0c81ab39434244663aad9152}{01280}} \textcolor{preprocessor}{\#define HIFN\_SRAM\_STEP\_SIZE     16384}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01281}\mbox{\hyperlink{hifn7751_8c_a8c920b15f1b8dcc60ff3514345e7d4b6}{01281}} \textcolor{preprocessor}{\#define HIFN\_SRAM\_GRANULARITY   (HIFN\_SRAM\_MAX / HIFN\_SRAM\_STEP\_SIZE)}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01282}01282 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01283}01283 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01284}\mbox{\hyperlink{hifn7751_8c_ae4cdb0c16783aa27d55b0500fc4a769c}{01284}} \mbox{\hyperlink{hifn7751_8c_ae4cdb0c16783aa27d55b0500fc4a769c}{hifn\_sramsize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01285}01285 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01286}01286         u\_int32\_t a;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01287}01287         u\_int8\_t data[8];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01288}01288         u\_int8\_t dataexpect[\textcolor{keyword}{sizeof}(data)];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01289}01289         int32\_t i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01290}01290 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01291}01291         \textcolor{keywordflow}{for} (i = 0; i < \textcolor{keyword}{sizeof}(data); i++)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01292}01292                 data[i] = dataexpect[i] = i \string^ 0x5a;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01293}01293 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01294}01294         \textcolor{keywordflow}{for} (i = \mbox{\hyperlink{hifn7751_8c_a8c920b15f1b8dcc60ff3514345e7d4b6}{HIFN\_SRAM\_GRANULARITY}} -\/ 1; i >= 0; i-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01295}01295                 a = i * \mbox{\hyperlink{hifn7751_8c_a812ff8bd0c81ab39434244663aad9152}{HIFN\_SRAM\_STEP\_SIZE}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01296}01296                 bcopy(\&i, data, \textcolor{keyword}{sizeof}(i));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01297}01297                 \mbox{\hyperlink{hifn7751_8c_a47b07bf1f6f9aa634c50ecc6f88f5cb8}{hifn\_writeramaddr}}(sc, a, data);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01298}01298         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01299}01299 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01300}01300         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{hifn7751_8c_a8c920b15f1b8dcc60ff3514345e7d4b6}{HIFN\_SRAM\_GRANULARITY}}; i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01301}01301                 a = i * \mbox{\hyperlink{hifn7751_8c_a812ff8bd0c81ab39434244663aad9152}{HIFN\_SRAM\_STEP\_SIZE}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01302}01302                 bcopy(\&i, dataexpect, \textcolor{keyword}{sizeof}(i));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01303}01303                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_a0a1b763f64952472b539202990dd4a15}{hifn\_readramaddr}}(sc, a, data) < 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01304}01304                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01305}01305                 \textcolor{keywordflow}{if} (bcmp(data, dataexpect, \textcolor{keyword}{sizeof}(data)) != 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01306}01306                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01307}01307                 sc-\/>\mbox{\hyperlink{structhifn__softc_a6cc21d73c86ae8f4d05960c8ff1e6225}{sc\_ramsize}} = a + \mbox{\hyperlink{hifn7751_8c_a812ff8bd0c81ab39434244663aad9152}{HIFN\_SRAM\_STEP\_SIZE}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01308}01308         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01309}01309 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01310}01310         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01311}01311 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01312}01312 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01313}01313 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01314}01314 \textcolor{comment}{ * XXX For dram boards, one should really try all of the}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01315}01315 \textcolor{comment}{ * HIFN\_PUCNFG\_DSZ\_*'s.  This just assumes that PUCNFG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01316}01316 \textcolor{comment}{ * is already set up correctly.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01317}01317 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01318}01318 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01319}\mbox{\hyperlink{hifn7751_8c_a2f03d75700162fba997a5aa2d3445c8d}{01319}} \mbox{\hyperlink{hifn7751_8c_a2f03d75700162fba997a5aa2d3445c8d}{hifn\_dramsize}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01320}01320 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01321}01321         u\_int32\_t cnfg;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01322}01322 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01323}01323         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a5afb3dcac6f745581b312503d6bb8b5e}{HIFN\_IS\_7956}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01324}01324                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01325}01325 \textcolor{comment}{                 * 7955/7956 have a fixed internal ram of only 32K.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01326}01326 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01327}01327                 sc-\/>\mbox{\hyperlink{structhifn__softc_a6cc21d73c86ae8f4d05960c8ff1e6225}{sc\_ramsize}} = 32768;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01328}01328         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01329}01329                 cnfg = \mbox{\hyperlink{hifn7751_8c_ac57384094ea3977b05e5a1b1d572081f}{READ\_REG\_0}}(sc, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}}) \&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01330}01330                     \mbox{\hyperlink{hifn7751reg_8h_a66f4685388c4ce611482fd58ae4ec48b}{HIFN\_PUCNFG\_DRAMMASK}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01331}01331                 sc-\/>\mbox{\hyperlink{structhifn__softc_a6cc21d73c86ae8f4d05960c8ff1e6225}{sc\_ramsize}} = 1 << ((cnfg >> 13) + 18);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01332}01332         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01333}01333         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01334}01334 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01335}01335 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01336}01336 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01337}\mbox{\hyperlink{hifn7751_8c_a3a3d13791258f613ce4f7909590d4258}{01337}} \mbox{\hyperlink{hifn7751_8c_a3a3d13791258f613ce4f7909590d4258}{hifn\_alloc\_slot}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keywordtype}{int} *cmdp, \textcolor{keywordtype}{int} *srcp, \textcolor{keywordtype}{int} *dstp, \textcolor{keywordtype}{int} *resp)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01338}01338 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01339}01339         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01340}01340 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01341}01341         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}} == \mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01342}01342                 sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01343}01343                 dma-\/>\mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[\mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01344}01344                     \mbox{\hyperlink{hifn7751reg_8h_a1384c0bccb4d42695eed62ce16c86ca1}{HIFN\_D\_JUMP}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01345}01345                 \mbox{\hyperlink{hifn7751var_8h_af150a4c532dcc797db19d55401b5533a}{HIFN\_CMDR\_SYNC}}(sc, \mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01346}01346                     BUS\_DMASYNC\_PREWRITE | BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01347}01347         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01348}01348         *cmdp = sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01349}01349         sc-\/>\mbox{\hyperlink{structhifn__softc_ac5a5b513e2da6c3e4f482c71ffc89a12}{sc\_cmdk}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01350}01350 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01351}01351         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_ae73faa9a7bf3a27de6fe007735758ffc}{sc\_srci}} == \mbox{\hyperlink{hifn7751var_8h_af6b9447faa1e6b7e1ff31262114754e4}{HIFN\_D\_SRC\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01352}01352                 sc-\/>\mbox{\hyperlink{structhifn__softc_ae73faa9a7bf3a27de6fe007735758ffc}{sc\_srci}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01353}01353                 dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[\mbox{\hyperlink{hifn7751var_8h_af6b9447faa1e6b7e1ff31262114754e4}{HIFN\_D\_SRC\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01354}01354                     \mbox{\hyperlink{hifn7751reg_8h_a1384c0bccb4d42695eed62ce16c86ca1}{HIFN\_D\_JUMP}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01355}01355                 \mbox{\hyperlink{hifn7751var_8h_a58d0cea76bd4e709130d8581a04fede0}{HIFN\_SRCR\_SYNC}}(sc, \mbox{\hyperlink{hifn7751var_8h_af6b9447faa1e6b7e1ff31262114754e4}{HIFN\_D\_SRC\_RSIZE}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01356}01356                     BUS\_DMASYNC\_PREWRITE | BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01357}01357         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01358}01358         *srcp = sc-\/>\mbox{\hyperlink{structhifn__softc_ae73faa9a7bf3a27de6fe007735758ffc}{sc\_srci}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01359}01359         sc-\/>\mbox{\hyperlink{structhifn__softc_a29258460f1734f78fd202555d5c8aa82}{sc\_srck}} = sc-\/>\mbox{\hyperlink{structhifn__softc_ae73faa9a7bf3a27de6fe007735758ffc}{sc\_srci}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01360}01360 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01361}01361         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_ae035a6546731164cb67fd607995d4279}{sc\_dsti}} == \mbox{\hyperlink{hifn7751var_8h_a396a284c2b765b87a6b26dd7087ef51c}{HIFN\_D\_DST\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01362}01362                 sc-\/>\mbox{\hyperlink{structhifn__softc_ae035a6546731164cb67fd607995d4279}{sc\_dsti}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01363}01363                 dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[\mbox{\hyperlink{hifn7751var_8h_a396a284c2b765b87a6b26dd7087ef51c}{HIFN\_D\_DST\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01364}01364                     \mbox{\hyperlink{hifn7751reg_8h_a1384c0bccb4d42695eed62ce16c86ca1}{HIFN\_D\_JUMP}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01365}01365                 \mbox{\hyperlink{hifn7751var_8h_a6207ec1e7228ce3f162034d8c43e870a}{HIFN\_DSTR\_SYNC}}(sc, \mbox{\hyperlink{hifn7751var_8h_a396a284c2b765b87a6b26dd7087ef51c}{HIFN\_D\_DST\_RSIZE}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01366}01366                     BUS\_DMASYNC\_PREWRITE | BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01367}01367         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01368}01368         *dstp = sc-\/>\mbox{\hyperlink{structhifn__softc_ae035a6546731164cb67fd607995d4279}{sc\_dsti}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01369}01369         sc-\/>\mbox{\hyperlink{structhifn__softc_ad366579c9b2e77d0135038f13dbaaaeb}{sc\_dstk}} = sc-\/>\mbox{\hyperlink{structhifn__softc_ae035a6546731164cb67fd607995d4279}{sc\_dsti}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01370}01370 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01371}01371         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}} == \mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01372}01372                 sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01373}01373                 dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[\mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01374}01374                     \mbox{\hyperlink{hifn7751reg_8h_a1384c0bccb4d42695eed62ce16c86ca1}{HIFN\_D\_JUMP}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01375}01375                 \mbox{\hyperlink{hifn7751var_8h_aeec3f818c4c174400383758ac6de2b29}{HIFN\_RESR\_SYNC}}(sc, \mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01376}01376                     BUS\_DMASYNC\_PREWRITE | BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01377}01377         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01378}01378         *resp = sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01379}01379         sc-\/>\mbox{\hyperlink{structhifn__softc_a000c64304a0de0c48fee6c043d6873c4}{sc\_resk}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01380}01380 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01381}01381 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01382}01382 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01383}\mbox{\hyperlink{hifn7751_8c_a47b07bf1f6f9aa634c50ecc6f88f5cb8}{01383}} \mbox{\hyperlink{hifn7751_8c_a47b07bf1f6f9aa634c50ecc6f88f5cb8}{hifn\_writeramaddr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keywordtype}{int} addr, u\_int8\_t *data)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01384}01384 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01385}01385         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01386}01386         \mbox{\hyperlink{structhifn__base__command}{hifn\_base\_command\_t}} wc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01387}01387         \textcolor{keyword}{const} u\_int32\_t masks = \mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_a39f72feb5bec64556f8a83500bc6db6c}{HIFN\_D\_LAST}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01388}01388         \textcolor{keywordtype}{int} r, cmdi, resi, srci, dsti;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01389}01389 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01390}01390         wc.\mbox{\hyperlink{structhifn__base__command_a32355a76f7ba54fa4ed4c7abfc669e3e}{masks}} = htole16(3 << 13);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01391}01391         wc.\mbox{\hyperlink{structhifn__base__command_aa2f7f8517d2d1b9c1c4d40df7850feef}{session\_num}} = htole16(addr >> 14);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01392}01392         wc.\mbox{\hyperlink{structhifn__base__command_a9e94cd32ea9aea84bb067410b14ff61e}{total\_source\_count}} = htole16(8);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01393}01393         wc.\mbox{\hyperlink{structhifn__base__command_a2afe2de895ea049101f995ed855bd199}{total\_dest\_count}} = htole16(addr \& 0x3fff);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01394}01394 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01395}01395         \mbox{\hyperlink{hifn7751_8c_a3a3d13791258f613ce4f7909590d4258}{hifn\_alloc\_slot}}(sc, \&cmdi, \&srci, \&dsti, \&resi);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01396}01396 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01397}01397         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01398}01398             \mbox{\hyperlink{hifn7751reg_8h_a9a4e8e4e9cd807d72271e07f55277b1f}{HIFN\_DMACSR\_C\_CTRL\_ENA}} | \mbox{\hyperlink{hifn7751reg_8h_a75b69e91b22793c8bd1f5ddfdea38346}{HIFN\_DMACSR\_S\_CTRL\_ENA}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01399}01399             \mbox{\hyperlink{hifn7751reg_8h_ab9568aafaa811df429e1b4c3c1211417}{HIFN\_DMACSR\_D\_CTRL\_ENA}} | \mbox{\hyperlink{hifn7751reg_8h_a892251ff7b6fabce5a2348217c669129}{HIFN\_DMACSR\_R\_CTRL\_ENA}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01400}01400 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01401}01401         \textcolor{comment}{/* build write command */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01402}01402         bzero(dma-\/>\mbox{\hyperlink{structhifn__dma_af146ebeda0ce000c07dd3cb24ede2d31}{command\_bufs}}[cmdi], \mbox{\hyperlink{hifn7751reg_8h_a3f1ed3546a7e4231f694b0d23b62679a}{HIFN\_MAX\_COMMAND}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01403}01403         *(\mbox{\hyperlink{structhifn__base__command}{hifn\_base\_command\_t}} *)dma-\/>\mbox{\hyperlink{structhifn__dma_af146ebeda0ce000c07dd3cb24ede2d31}{command\_bufs}}[cmdi] = wc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01404}01404         bcopy(data, \&dma-\/>\mbox{\hyperlink{structhifn__dma_a50a7cdb6500237d8202f267ffd9d45ba}{test\_src}}, \textcolor{keyword}{sizeof}(dma-\/>\mbox{\hyperlink{structhifn__dma_a50a7cdb6500237d8202f267ffd9d45ba}{test\_src}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01405}01405 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01406}01406         dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[srci].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01407}01407             + offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_a50a7cdb6500237d8202f267ffd9d45ba}{test\_src}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01408}01408         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[dsti].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01409}01409             + offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_aa1ced94c6692b606624af296cfc6e855}{test\_dst}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01410}01410 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01411}01411         dma-\/>\mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[cmdi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(16 | masks);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01412}01412         dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[srci].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(8 | masks);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01413}01413         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[dsti].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(4 | masks);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01414}01414         dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[resi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(4 | masks);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01415}01415 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01416}01416         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01417}01417             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01418}01418 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01419}01419         \textcolor{keywordflow}{for} (r = 10000; r >= 0; r-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01420}01420                 DELAY(10);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01421}01421                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01422}01422                     BUS\_DMASYNC\_POSTREAD | BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01423}01423                 \textcolor{keywordflow}{if} ((dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[resi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} \& htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}})) == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01424}01424                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01425}01425                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01426}01426                     BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01427}01427         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01428}01428         \textcolor{keywordflow}{if} (r == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01429}01429                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}writeramaddr -\/-\/ "{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01430}01430                     \textcolor{stringliteral}{"{}result[\%d](addr \%d) still valid\(\backslash\)n"{}}, resi, addr);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01431}01431                 r = -\/1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01432}01432                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01433}01433         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01434}01434                 r = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01435}01435 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01436}01436         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01437}01437             \mbox{\hyperlink{hifn7751reg_8h_a5d0566278c41f8958ecb928d08314cde}{HIFN\_DMACSR\_C\_CTRL\_DIS}} | \mbox{\hyperlink{hifn7751reg_8h_a6f23e20a8d783d7c0f552cc63a2e487f}{HIFN\_DMACSR\_S\_CTRL\_DIS}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01438}01438             \mbox{\hyperlink{hifn7751reg_8h_a732033d4199e8dbfa27aa8669f3077ff}{HIFN\_DMACSR\_D\_CTRL\_DIS}} | \mbox{\hyperlink{hifn7751reg_8h_aa4b40911890600e2f3183b53ed9d483e}{HIFN\_DMACSR\_R\_CTRL\_DIS}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01439}01439 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01440}01440         \textcolor{keywordflow}{return} (r);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01441}01441 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01442}01442 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01443}01443 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01444}\mbox{\hyperlink{hifn7751_8c_a0a1b763f64952472b539202990dd4a15}{01444}} \mbox{\hyperlink{hifn7751_8c_a0a1b763f64952472b539202990dd4a15}{hifn\_readramaddr}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keywordtype}{int} addr, u\_int8\_t *data)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01445}01445 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01446}01446         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01447}01447         \mbox{\hyperlink{structhifn__base__command}{hifn\_base\_command\_t}} rc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01448}01448         \textcolor{keyword}{const} u\_int32\_t masks = \mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_a39f72feb5bec64556f8a83500bc6db6c}{HIFN\_D\_LAST}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01449}01449         \textcolor{keywordtype}{int} r, cmdi, srci, dsti, resi;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01450}01450 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01451}01451         rc.\mbox{\hyperlink{structhifn__base__command_a32355a76f7ba54fa4ed4c7abfc669e3e}{masks}} = htole16(2 << 13);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01452}01452         rc.\mbox{\hyperlink{structhifn__base__command_aa2f7f8517d2d1b9c1c4d40df7850feef}{session\_num}} = htole16(addr >> 14);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01453}01453         rc.\mbox{\hyperlink{structhifn__base__command_a9e94cd32ea9aea84bb067410b14ff61e}{total\_source\_count}} = htole16(addr \& 0x3fff);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01454}01454         rc.\mbox{\hyperlink{structhifn__base__command_a2afe2de895ea049101f995ed855bd199}{total\_dest\_count}} = htole16(8);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01455}01455 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01456}01456         \mbox{\hyperlink{hifn7751_8c_a3a3d13791258f613ce4f7909590d4258}{hifn\_alloc\_slot}}(sc, \&cmdi, \&srci, \&dsti, \&resi);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01457}01457 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01458}01458         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01459}01459             \mbox{\hyperlink{hifn7751reg_8h_a9a4e8e4e9cd807d72271e07f55277b1f}{HIFN\_DMACSR\_C\_CTRL\_ENA}} | \mbox{\hyperlink{hifn7751reg_8h_a75b69e91b22793c8bd1f5ddfdea38346}{HIFN\_DMACSR\_S\_CTRL\_ENA}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01460}01460             \mbox{\hyperlink{hifn7751reg_8h_ab9568aafaa811df429e1b4c3c1211417}{HIFN\_DMACSR\_D\_CTRL\_ENA}} | \mbox{\hyperlink{hifn7751reg_8h_a892251ff7b6fabce5a2348217c669129}{HIFN\_DMACSR\_R\_CTRL\_ENA}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01461}01461 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01462}01462         bzero(dma-\/>\mbox{\hyperlink{structhifn__dma_af146ebeda0ce000c07dd3cb24ede2d31}{command\_bufs}}[cmdi], \mbox{\hyperlink{hifn7751reg_8h_a3f1ed3546a7e4231f694b0d23b62679a}{HIFN\_MAX\_COMMAND}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01463}01463         *(\mbox{\hyperlink{structhifn__base__command}{hifn\_base\_command\_t}} *)dma-\/>\mbox{\hyperlink{structhifn__dma_af146ebeda0ce000c07dd3cb24ede2d31}{command\_bufs}}[cmdi] = rc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01464}01464 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01465}01465         dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[srci].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01466}01466             offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_a50a7cdb6500237d8202f267ffd9d45ba}{test\_src}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01467}01467         dma-\/>\mbox{\hyperlink{structhifn__dma_a50a7cdb6500237d8202f267ffd9d45ba}{test\_src}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01468}01468         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[dsti].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} =  htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01469}01469             offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_aa1ced94c6692b606624af296cfc6e855}{test\_dst}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01470}01470         dma-\/>\mbox{\hyperlink{structhifn__dma_aa1ced94c6692b606624af296cfc6e855}{test\_dst}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01471}01471         dma-\/>\mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[cmdi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(8 | masks);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01472}01472         dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[srci].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(8 | masks);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01473}01473         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[dsti].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(8 | masks);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01474}01474         dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[resi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a06616a00deb7b133d98b158fe30ddb1e}{HIFN\_MAX\_RESULT}} | masks);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01475}01475 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01476}01476         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01477}01477             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01478}01478 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01479}01479         \textcolor{keywordflow}{for} (r = 10000; r >= 0; r-\/-\/) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01480}01480                 DELAY(10);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01481}01481                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01482}01482                     BUS\_DMASYNC\_POSTREAD | BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01483}01483                 \textcolor{keywordflow}{if} ((dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[resi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} \& htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}})) == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01484}01484                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01485}01485                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01486}01486                     BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01487}01487         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01488}01488         \textcolor{keywordflow}{if} (r == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01489}01489                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}readramaddr -\/-\/ "{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01490}01490                     \textcolor{stringliteral}{"{}result[\%d](addr \%d) still valid\(\backslash\)n"{}}, resi, addr);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01491}01491                 r = -\/1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01492}01492         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01493}01493                 r = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01494}01494                 bcopy(\&dma-\/>\mbox{\hyperlink{structhifn__dma_aa1ced94c6692b606624af296cfc6e855}{test\_dst}}, data, \textcolor{keyword}{sizeof}(dma-\/>\mbox{\hyperlink{structhifn__dma_aa1ced94c6692b606624af296cfc6e855}{test\_dst}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01495}01495         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01496}01496 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01497}01497         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01498}01498             \mbox{\hyperlink{hifn7751reg_8h_a5d0566278c41f8958ecb928d08314cde}{HIFN\_DMACSR\_C\_CTRL\_DIS}} | \mbox{\hyperlink{hifn7751reg_8h_a6f23e20a8d783d7c0f552cc63a2e487f}{HIFN\_DMACSR\_S\_CTRL\_DIS}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01499}01499             \mbox{\hyperlink{hifn7751reg_8h_a732033d4199e8dbfa27aa8669f3077ff}{HIFN\_DMACSR\_D\_CTRL\_DIS}} | \mbox{\hyperlink{hifn7751reg_8h_aa4b40911890600e2f3183b53ed9d483e}{HIFN\_DMACSR\_R\_CTRL\_DIS}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01500}01500 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01501}01501         \textcolor{keywordflow}{return} (r);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01502}01502 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01503}01503 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01504}01504 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01505}01505 \textcolor{comment}{ * Initialize the descriptor rings.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01506}01506 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01507}01507 \textcolor{keyword}{static} \textcolor{keywordtype}{void} }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01508}\mbox{\hyperlink{hifn7751_8c_aa14652c9bdd205405f8581c222fde517}{01508}} \mbox{\hyperlink{hifn7751_8c_aa14652c9bdd205405f8581c222fde517}{hifn\_init\_dma}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01509}01509 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01510}01510         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01511}01511         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01512}01512 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01513}01513         \mbox{\hyperlink{hifn7751_8c_ae9c98c2559aecf31de0592518d046e4b}{hifn\_set\_retry}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01514}01514 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01515}01515         \textcolor{comment}{/* initialize static pointer values */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01516}01516         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}}; i++)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01517}01517                 dma-\/>\mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[i].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01518}01518                     offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_af146ebeda0ce000c07dd3cb24ede2d31}{command\_bufs}}[i][0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01519}01519         \textcolor{keywordflow}{for} (i = 0; i < \mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}}; i++)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01520}01520                 dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[i].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01521}01521                     offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_a917268867231ff4a46240bcee9100b63}{result\_bufs}}[i][0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01522}01522 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01523}01523         dma-\/>\mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[\mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} =}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01524}01524             htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} + offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01525}01525         dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[\mbox{\hyperlink{hifn7751var_8h_af6b9447faa1e6b7e1ff31262114754e4}{HIFN\_D\_SRC\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} =}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01526}01526             htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} + offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01527}01527         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[\mbox{\hyperlink{hifn7751var_8h_a396a284c2b765b87a6b26dd7087ef51c}{HIFN\_D\_DST\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} =}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01528}01528             htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} + offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01529}01529         dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[\mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} =}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01530}01530             htole32(sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} + offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, \mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01531}01531 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01532}01532         sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} = sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}} = sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}} = sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01533}01533         sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}} = sc-\/>\mbox{\hyperlink{structhifn__softc_ae73faa9a7bf3a27de6fe007735758ffc}{sc\_srci}} = sc-\/>\mbox{\hyperlink{structhifn__softc_ae035a6546731164cb67fd607995d4279}{sc\_dsti}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01534}01534         sc-\/>\mbox{\hyperlink{structhifn__softc_ac5a5b513e2da6c3e4f482c71ffc89a12}{sc\_cmdk}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a29258460f1734f78fd202555d5c8aa82}{sc\_srck}} = sc-\/>\mbox{\hyperlink{structhifn__softc_ad366579c9b2e77d0135038f13dbaaaeb}{sc\_dstk}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a000c64304a0de0c48fee6c043d6873c4}{sc\_resk}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01535}01535 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01536}01536 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01537}01537 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01538}01538 \textcolor{comment}{ * Writes out the raw command buffer space.  Returns the}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01539}01539 \textcolor{comment}{ * command buffer size.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01540}01540 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01541}01541 \textcolor{keyword}{static} u\_int}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01542}\mbox{\hyperlink{hifn7751_8c_ac50d99c2de980fb096110efe06f2f6da}{01542}} \mbox{\hyperlink{hifn7751_8c_ac50d99c2de980fb096110efe06f2f6da}{hifn\_write\_command}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *cmd, u\_int8\_t *buf)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01543}01543 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01544}01544         \textcolor{keyword}{struct }cryptop *crp;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01545}01545         u\_int8\_t *buf\_pos;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01546}01546         \mbox{\hyperlink{structhifn__base__command}{hifn\_base\_command\_t}} *base\_cmd;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01547}01547         \mbox{\hyperlink{structhifn__mac__command}{hifn\_mac\_command\_t}} *mac\_cmd;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01548}01548         \mbox{\hyperlink{structhifn__crypt__command}{hifn\_crypt\_command\_t}} *cry\_cmd;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01549}01549         \textcolor{keywordtype}{int} using\_mac, using\_crypt, ivlen;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01550}01550         u\_int32\_t dlen, slen;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01551}01551 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01552}01552         crp = cmd-\/>\mbox{\hyperlink{structhifn__command_ab880eec82a7c2245a70f18b466de60a6}{crp}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01553}01553         buf\_pos = buf;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01554}01554         using\_mac = cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a4fac85eaa06486fce7d1696ee479e089}{HIFN\_BASE\_CMD\_MAC}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01555}01555         using\_crypt = cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a01848cf977e4be899e5b39834e0a95ba}{HIFN\_BASE\_CMD\_CRYPT}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01556}01556 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01557}01557         base\_cmd = (\mbox{\hyperlink{structhifn__base__command}{hifn\_base\_command\_t}} *)buf\_pos;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01558}01558         base\_cmd-\/>\mbox{\hyperlink{structhifn__base__command_a32355a76f7ba54fa4ed4c7abfc669e3e}{masks}} = htole16(cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01559}01559         slen = cmd-\/>src\_mapsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01560}01560         \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01561}01561                 dlen = cmd-\/>dst\_mapsize -\/ cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}} + \textcolor{keyword}{sizeof}(u\_int32\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01562}01562         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01563}01563                 dlen = cmd-\/>dst\_mapsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01564}01564         base\_cmd-\/>\mbox{\hyperlink{structhifn__base__command_a9e94cd32ea9aea84bb067410b14ff61e}{total\_source\_count}} = htole16(slen \& \mbox{\hyperlink{hifn7751reg_8h_ac5e776eb7ca5f8b0555f226392417bf7}{HIFN\_BASE\_CMD\_LENMASK\_LO}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01565}01565         base\_cmd-\/>\mbox{\hyperlink{structhifn__base__command_a2afe2de895ea049101f995ed855bd199}{total\_dest\_count}} = htole16(dlen \& \mbox{\hyperlink{hifn7751reg_8h_ac5e776eb7ca5f8b0555f226392417bf7}{HIFN\_BASE\_CMD\_LENMASK\_LO}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01566}01566         dlen >>= 16;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01567}01567         slen >>= 16;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01568}01568         base\_cmd-\/>\mbox{\hyperlink{structhifn__base__command_aa2f7f8517d2d1b9c1c4d40df7850feef}{session\_num}} = htole16(}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01569}01569             ((slen << \mbox{\hyperlink{hifn7751reg_8h_ab9d7a07e0676d20d938c026eb6d56655}{HIFN\_BASE\_CMD\_SRCLEN\_S}}) \& \mbox{\hyperlink{hifn7751reg_8h_a9e4498dbfb2dea96047333f4799d341c}{HIFN\_BASE\_CMD\_SRCLEN\_M}}) |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01570}01570             ((dlen << \mbox{\hyperlink{hifn7751reg_8h_a738b70ae1eccf87be2a44d8e7d07cc3e}{HIFN\_BASE\_CMD\_DSTLEN\_S}}) \& \mbox{\hyperlink{hifn7751reg_8h_a0574d208009a2bf0be4c10c9eed347c3}{HIFN\_BASE\_CMD\_DSTLEN\_M}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01571}01571         buf\_pos += \textcolor{keyword}{sizeof}(\mbox{\hyperlink{hifn7751reg_8h_a72cb2487139eae8e0e66b34863349a7b}{hifn\_base\_command\_t}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01572}01572 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01573}01573         \textcolor{keywordflow}{if} (using\_mac) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01574}01574                 mac\_cmd = (\mbox{\hyperlink{structhifn__mac__command}{hifn\_mac\_command\_t}} *)buf\_pos;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01575}01575                 dlen = crp-\/>crp\_aad\_length + crp-\/>crp\_payload\_length;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01576}01576                 mac\_cmd-\/>\mbox{\hyperlink{structhifn__mac__command_ad755514c0c34e80b98d01a58b7428d18}{source\_count}} = htole16(dlen \& 0xffff);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01577}01577                 dlen >>= 16;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01578}01578                 mac\_cmd-\/>\mbox{\hyperlink{structhifn__mac__command_a32f104683d81db63775b8fed3b476880}{masks}} = htole16(cmd-\/>\mbox{\hyperlink{structhifn__command_a848f4f2adea6aea2cebb0b70ed73e533}{mac\_masks}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01579}01579                     ((dlen << \mbox{\hyperlink{hifn7751reg_8h_a7e72f7d48ae51b6ca88c680bb56b372a}{HIFN\_MAC\_CMD\_SRCLEN\_S}}) \& \mbox{\hyperlink{hifn7751reg_8h_a11123e6654fdf29e7efea316bb5ab140}{HIFN\_MAC\_CMD\_SRCLEN\_M}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01580}01580                 \textcolor{keywordflow}{if} (crp-\/>crp\_aad\_length != 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01581}01581                         mac\_cmd-\/>\mbox{\hyperlink{structhifn__mac__command_a37a6536f887bc01fbf526b6cbd4b8f7d}{header\_skip}} = htole16(crp-\/>crp\_aad\_start);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01582}01582                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01583}01583                         mac\_cmd-\/>\mbox{\hyperlink{structhifn__mac__command_a37a6536f887bc01fbf526b6cbd4b8f7d}{header\_skip}} = htole16(crp-\/>crp\_payload\_start);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01584}01584                 mac\_cmd-\/>\mbox{\hyperlink{structhifn__mac__command_a069284ac0bea0b42b9dd0bbdfd227eed}{reserved}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01585}01585                 buf\_pos += \textcolor{keyword}{sizeof}(\mbox{\hyperlink{hifn7751reg_8h_a2c3c02e1ba474bcba48b23d6dc27cd8b}{hifn\_mac\_command\_t}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01586}01586         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01587}01587 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01588}01588         \textcolor{keywordflow}{if} (using\_crypt) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01589}01589                 cry\_cmd = (\mbox{\hyperlink{structhifn__crypt__command}{hifn\_crypt\_command\_t}} *)buf\_pos;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01590}01590                 dlen = crp-\/>crp\_payload\_length;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01591}01591                 cry\_cmd-\/>\mbox{\hyperlink{structhifn__crypt__command_aa5e1679e7deeedf1ea52eac414423410}{source\_count}} = htole16(dlen \& 0xffff);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01592}01592                 dlen >>= 16;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01593}01593                 cry\_cmd-\/>\mbox{\hyperlink{structhifn__crypt__command_a1b44ba4eeec561b96f029870c5c6b284}{masks}} = htole16(cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01594}01594                     ((dlen << \mbox{\hyperlink{hifn7751reg_8h_abf4a856fd409f8682d82f5a286c8067d}{HIFN\_CRYPT\_CMD\_SRCLEN\_S}}) \& \mbox{\hyperlink{hifn7751reg_8h_a1edb12dfbef83dc1d1ab1cc3dd6b3a7d}{HIFN\_CRYPT\_CMD\_SRCLEN\_M}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01595}01595                 cry\_cmd-\/>\mbox{\hyperlink{structhifn__crypt__command_a82bd0bc16ac6c1c0f09443c971b7b9e5}{header\_skip}} = htole16(crp-\/>crp\_payload\_length);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01596}01596                 cry\_cmd-\/>\mbox{\hyperlink{structhifn__crypt__command_aa81b8011245ff482339276239f97aced}{reserved}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01597}01597                 buf\_pos += \textcolor{keyword}{sizeof}(\mbox{\hyperlink{hifn7751reg_8h_add57600b97a231b8576a42ffb816cc0d}{hifn\_crypt\_command\_t}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01598}01598         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01599}01599 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01600}01600         \textcolor{keywordflow}{if} (using\_mac \&\& cmd-\/>\mbox{\hyperlink{structhifn__command_a848f4f2adea6aea2cebb0b70ed73e533}{mac\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a262ffc539ac54f7a05d5f891210f1ffb}{HIFN\_MAC\_CMD\_NEW\_KEY}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01601}01601                 bcopy(cmd-\/>\mbox{\hyperlink{structhifn__command_a5c32fe697076b7061d0ee03f07a64fa3}{mac}}, buf\_pos, \mbox{\hyperlink{hifn7751var_8h_a77a9b749fd5da42ebfe727ab092bfb55}{HIFN\_MAC\_KEY\_LENGTH}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01602}01602                 buf\_pos += \mbox{\hyperlink{hifn7751var_8h_a77a9b749fd5da42ebfe727ab092bfb55}{HIFN\_MAC\_KEY\_LENGTH}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01603}01603         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01604}01604 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01605}01605         \textcolor{keywordflow}{if} (using\_crypt \&\& cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a0ccaaf6dd2cff7cfebe963c8eb95f6f5}{HIFN\_CRYPT\_CMD\_NEW\_KEY}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01606}01606                 \textcolor{keywordflow}{switch} (cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a5d4f7b0eb1bb79f439be202bab72e8dc}{HIFN\_CRYPT\_CMD\_ALG\_MASK}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01607}01607                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a7bbd129319630aadcd2762c964cb4c5c}{HIFN\_CRYPT\_CMD\_ALG\_AES}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01608}01608                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01609}01609 \textcolor{comment}{                         * AES keys are variable 128, 192 and}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01610}01610 \textcolor{comment}{                         * 256 bits (16, 24 and 32 bytes).}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01611}01611 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01612}01612                         bcopy(cmd-\/>\mbox{\hyperlink{structhifn__command_aea145600bbc900fe25294cdf267d201c}{ck}}, buf\_pos, cmd-\/>\mbox{\hyperlink{structhifn__command_a35e10c02e0023b4fee16874a6505eb72}{cklen}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01613}01613                         buf\_pos += cmd-\/>\mbox{\hyperlink{structhifn__command_a35e10c02e0023b4fee16874a6505eb72}{cklen}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01614}01614                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01615}01615                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01616}01616         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01617}01617 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01618}01618         \textcolor{keywordflow}{if} (using\_crypt \&\& cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_abf489fad90ff3ec104e3e07b8049c4b9}{HIFN\_CRYPT\_CMD\_NEW\_IV}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01619}01619                 \textcolor{keywordflow}{switch} (cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a5d4f7b0eb1bb79f439be202bab72e8dc}{HIFN\_CRYPT\_CMD\_ALG\_MASK}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01620}01620                 \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a7bbd129319630aadcd2762c964cb4c5c}{HIFN\_CRYPT\_CMD\_ALG\_AES}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01621}01621                         ivlen = \mbox{\hyperlink{hifn7751var_8h_a920ebb792eec5990e5ed4d37ffba3f4f}{HIFN\_AES\_IV\_LENGTH}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01622}01622                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01623}01623                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01624}01624                         ivlen = \mbox{\hyperlink{hifn7751var_8h_ab4e4912616d5b30f05a2e0d255206747}{HIFN\_IV\_LENGTH}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01625}01625                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01626}01626                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01627}01627                 bcopy(cmd-\/>\mbox{\hyperlink{structhifn__command_ad7619f15daff8c57d60148442d1450ee}{iv}}, buf\_pos, ivlen);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01628}01628                 buf\_pos += ivlen;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01629}01629         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01630}01630 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01631}01631         \textcolor{keywordflow}{if} ((cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}} \& (\mbox{\hyperlink{hifn7751reg_8h_a4fac85eaa06486fce7d1696ee479e089}{HIFN\_BASE\_CMD\_MAC}}|\mbox{\hyperlink{hifn7751reg_8h_a01848cf977e4be899e5b39834e0a95ba}{HIFN\_BASE\_CMD\_CRYPT}})) == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01632}01632                 bzero(buf\_pos, 8);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01633}01633                 buf\_pos += 8;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01634}01634         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01635}01635 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01636}01636         \textcolor{keywordflow}{return} (buf\_pos -\/ buf);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01637}01637 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01638}01638 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01639}01639 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01640}\mbox{\hyperlink{hifn7751_8c_a520ec80778fadf1b70db0eeaa465901d}{01640}} \mbox{\hyperlink{hifn7751_8c_a520ec80778fadf1b70db0eeaa465901d}{hifn\_dmamap\_aligned}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__operand}{hifn\_operand}} *op)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01641}01641 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01642}01642         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01643}01643 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01644}01644         \textcolor{keywordflow}{for} (i = 0; i < op-\/>\mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}}; i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01645}01645                 \textcolor{keywordflow}{if} (op-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_addr \& 3)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01646}01646                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01647}01647                 \textcolor{keywordflow}{if} ((i != (op-\/>\mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}} -\/ 1)) \&\& (op-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_len \& 3))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01648}01648                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01649}01649         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01650}01650         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01651}01651 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01652}01652 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01653}01653 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01654}\mbox{\hyperlink{hifn7751_8c_afa307414e08bf65c4ac129e90215693e}{01654}} \mbox{\hyperlink{hifn7751_8c_afa307414e08bf65c4ac129e90215693e}{hifn\_dmamap\_dstwrap}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01655}01655 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01656}01656         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01657}01657 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01658}01658         \textcolor{keywordflow}{if} (++idx == \mbox{\hyperlink{hifn7751var_8h_a396a284c2b765b87a6b26dd7087ef51c}{HIFN\_D\_DST\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01659}01659                 dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[idx].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_a1384c0bccb4d42695eed62ce16c86ca1}{HIFN\_D\_JUMP}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01660}01660                     \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01661}01661                 \mbox{\hyperlink{hifn7751var_8h_a6207ec1e7228ce3f162034d8c43e870a}{HIFN\_DSTR\_SYNC}}(sc, idx,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01662}01662                     BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01663}01663                 idx = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01664}01664         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01665}01665         \textcolor{keywordflow}{return} (idx);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01666}01666 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01667}01667 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01668}01668 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01669}\mbox{\hyperlink{hifn7751_8c_ac87c6fdf4f589ed658b20b77995bbcc9}{01669}} \mbox{\hyperlink{hifn7751_8c_ac87c6fdf4f589ed658b20b77995bbcc9}{hifn\_dmamap\_load\_dst}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *cmd)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01670}01670 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01671}01671         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01672}01672         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__operand}{hifn\_operand}} *dst = \&cmd-\/>\mbox{\hyperlink{structhifn__command_a43aac7f8cf48554b0fd768653b98406b}{dst}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01673}01673         u\_int32\_t p, l;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01674}01674         \textcolor{keywordtype}{int} idx, used = 0, i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01675}01675 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01676}01676         idx = sc-\/>\mbox{\hyperlink{structhifn__softc_ae035a6546731164cb67fd607995d4279}{sc\_dsti}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01677}01677         \textcolor{keywordflow}{for} (i = 0; i < dst-\/>\mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}} -\/ 1; i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01678}01678                 dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[idx].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(dst-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_addr);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01679}01679                 dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[idx].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01680}01680                     \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}} | dst-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_len);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01681}01681                 \mbox{\hyperlink{hifn7751var_8h_a6207ec1e7228ce3f162034d8c43e870a}{HIFN\_DSTR\_SYNC}}(sc, idx,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01682}01682                     BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01683}01683                 used++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01684}01684 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01685}01685                 idx = \mbox{\hyperlink{hifn7751_8c_afa307414e08bf65c4ac129e90215693e}{hifn\_dmamap\_dstwrap}}(sc, idx);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01686}01686         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01687}01687 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01688}01688         \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}} == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01689}01689                 p = dst-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_addr;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01690}01690                 l = \mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}} | \mbox{\hyperlink{hifn7751reg_8h_a39f72feb5bec64556f8a83500bc6db6c}{HIFN\_D\_LAST}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01691}01691                     dst-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01692}01692         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01693}01693                 p = sc-\/>\mbox{\hyperlink{structhifn__softc_a5d83045e6a59f87e9b704bf863428ddf}{sc\_dma\_physaddr}} +}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01694}01694                     offsetof(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__dma}{hifn\_dma}}, slop[cmd-\/>\mbox{\hyperlink{structhifn__command_ad6eb9947bbfc4e28a6a0456ce6c0e023}{slopidx}}]);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01695}01695                 l = \mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}} | \mbox{\hyperlink{hifn7751reg_8h_a39f72feb5bec64556f8a83500bc6db6c}{HIFN\_D\_LAST}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01696}01696                     \textcolor{keyword}{sizeof}(u\_int32\_t);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01697}01697 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01698}01698                 \textcolor{keywordflow}{if} ((dst-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_len -\/ cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}}) != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01699}01699                         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[idx].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(dst-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_addr);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01700}01700                         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[idx].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01701}01701                             \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01702}01702                             (dst-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_len -\/ cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01703}01703                         \mbox{\hyperlink{hifn7751var_8h_a6207ec1e7228ce3f162034d8c43e870a}{HIFN\_DSTR\_SYNC}}(sc, idx,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01704}01704                             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01705}01705                         used++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01706}01706 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01707}01707                         idx = \mbox{\hyperlink{hifn7751_8c_afa307414e08bf65c4ac129e90215693e}{hifn\_dmamap\_dstwrap}}(sc, idx);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01708}01708                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01709}01709         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01710}01710         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[idx].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(p);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01711}01711         dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[idx].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(l);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01712}01712         \mbox{\hyperlink{hifn7751var_8h_a6207ec1e7228ce3f162034d8c43e870a}{HIFN\_DSTR\_SYNC}}(sc, idx, BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01713}01713         used++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01714}01714 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01715}01715         idx = \mbox{\hyperlink{hifn7751_8c_afa307414e08bf65c4ac129e90215693e}{hifn\_dmamap\_dstwrap}}(sc, idx);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01716}01716 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01717}01717         sc-\/>\mbox{\hyperlink{structhifn__softc_ae035a6546731164cb67fd607995d4279}{sc\_dsti}} = idx;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01718}01718         sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}} += used;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01719}01719         \textcolor{keywordflow}{return} (idx);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01720}01720 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01721}01721 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01722}01722 \textcolor{keyword}{static} \_\_inline \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01723}\mbox{\hyperlink{hifn7751_8c_a90ba79b2f5d2c44d47e0d58ee9b4f95f}{01723}} \mbox{\hyperlink{hifn7751_8c_a90ba79b2f5d2c44d47e0d58ee9b4f95f}{hifn\_dmamap\_srcwrap}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keywordtype}{int} idx)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01724}01724 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01725}01725         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01726}01726 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01727}01727         \textcolor{keywordflow}{if} (++idx == \mbox{\hyperlink{hifn7751var_8h_af6b9447faa1e6b7e1ff31262114754e4}{HIFN\_D\_SRC\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01728}01728                 dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[idx].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01729}01729                     \mbox{\hyperlink{hifn7751reg_8h_a1384c0bccb4d42695eed62ce16c86ca1}{HIFN\_D\_JUMP}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01730}01730                 \mbox{\hyperlink{hifn7751var_8h_a58d0cea76bd4e709130d8581a04fede0}{HIFN\_SRCR\_SYNC}}(sc, \mbox{\hyperlink{hifn7751var_8h_af6b9447faa1e6b7e1ff31262114754e4}{HIFN\_D\_SRC\_RSIZE}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01731}01731                     BUS\_DMASYNC\_PREWRITE | BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01732}01732                 idx = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01733}01733         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01734}01734         \textcolor{keywordflow}{return} (idx);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01735}01735 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01736}01736 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01737}01737 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01738}\mbox{\hyperlink{hifn7751_8c_a5b94630e8696abc18a2e7cb9329200ca}{01738}} \mbox{\hyperlink{hifn7751_8c_a5b94630e8696abc18a2e7cb9329200ca}{hifn\_dmamap\_load\_src}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *cmd)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01739}01739 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01740}01740         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01741}01741         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__operand}{hifn\_operand}} *src = \&cmd-\/>\mbox{\hyperlink{structhifn__command_a9a04cbec26cb770cf787d1664cb03909}{src}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01742}01742         \textcolor{keywordtype}{int} idx, i;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01743}01743         u\_int32\_t last = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01744}01744 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01745}01745         idx = sc-\/>\mbox{\hyperlink{structhifn__softc_ae73faa9a7bf3a27de6fe007735758ffc}{sc\_srci}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01746}01746         \textcolor{keywordflow}{for} (i = 0; i < src-\/>\mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}}; i++) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01747}01747                 \textcolor{keywordflow}{if} (i == src-\/>\mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}} -\/ 1)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01748}01748                         last = \mbox{\hyperlink{hifn7751reg_8h_a39f72feb5bec64556f8a83500bc6db6c}{HIFN\_D\_LAST}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01749}01749 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01750}01750                 dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[idx].\mbox{\hyperlink{structhifn__desc_a613913246776305bee3617e104235099}{p}} = htole32(src-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_addr);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01751}01751                 dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[idx].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(src-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}[i].ds\_len |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01752}01752                     \mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}} | last);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01753}01753                 \mbox{\hyperlink{hifn7751var_8h_a58d0cea76bd4e709130d8581a04fede0}{HIFN\_SRCR\_SYNC}}(sc, idx,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01754}01754                     BUS\_DMASYNC\_PREWRITE | BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01755}01755 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01756}01756                 idx = \mbox{\hyperlink{hifn7751_8c_a90ba79b2f5d2c44d47e0d58ee9b4f95f}{hifn\_dmamap\_srcwrap}}(sc, idx);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01757}01757         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01758}01758         sc-\/>\mbox{\hyperlink{structhifn__softc_ae73faa9a7bf3a27de6fe007735758ffc}{sc\_srci}} = idx;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01759}01759         sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}} += src-\/>\mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01760}01760         \textcolor{keywordflow}{return} (idx);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01761}01761 \} }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01762}01762 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01763}01763 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01764}\mbox{\hyperlink{hifn7751_8c_aa65420534ccb2d553f001df9382110f4}{01764}} \mbox{\hyperlink{hifn7751_8c_aa65420534ccb2d553f001df9382110f4}{hifn\_op\_cb}}(\textcolor{keywordtype}{void}* arg, bus\_dma\_segment\_t *seg, \textcolor{keywordtype}{int} \mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}}, \textcolor{keywordtype}{int} error)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01765}01765 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01766}01766         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__operand}{hifn\_operand}} *op = arg;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01767}01767 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01768}01768         KASSERT(\mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}} <= \mbox{\hyperlink{hifn7751var_8h_a4dfc304917c2b88a1ffca6681de540a0}{MAX\_SCATTER}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01769}01769                 (\textcolor{stringliteral}{"{}hifn\_op\_cb: too many DMA segments (\%u > \%u) "{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01770}01770                  \textcolor{stringliteral}{"{}returned when mapping operand"{}}, \mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}}, \mbox{\hyperlink{hifn7751var_8h_a4dfc304917c2b88a1ffca6681de540a0}{MAX\_SCATTER}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01771}01771         op-\/>\mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}} = \mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01772}01772         bcopy(seg, op-\/>\mbox{\hyperlink{structhifn__operand_ac03f6224fd07074876aa4b541dc98b74}{segs}}, \mbox{\hyperlink{structhifn__operand_ab4cf65bf189166d2a28412622aa2dea3}{nsegs}} * sizeof (seg[0]));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01773}01773 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01774}01774 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01775}01775 \textcolor{keyword}{static} \textcolor{keywordtype}{int} }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01776}\mbox{\hyperlink{hifn7751_8c_a808d5a8facede620b7138c29745b6a3c}{01776}} \mbox{\hyperlink{hifn7751_8c_a808d5a8facede620b7138c29745b6a3c}{hifn\_crypto}}(}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01777}01777         \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01778}01778         \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *cmd,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01779}01779         \textcolor{keyword}{struct} cryptop *crp,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01780}01780         \textcolor{keywordtype}{int} hint)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01781}01781 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01782}01782         \textcolor{keyword}{struct  }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01783}01783         u\_int32\_t cmdlen, csr;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01784}01784         \textcolor{keywordtype}{int} cmdi, resi, err = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01785}01785 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01786}01786         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01787}01787 \textcolor{comment}{         * need 1 cmd, and 1 res}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01788}01788 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01789}01789 \textcolor{comment}{         * NB: check this first since it's easy.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01790}01790 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01791}01791         \mbox{\hyperlink{hifn7751var_8h_a37421bdd57949831d6f7d856d1f90832}{HIFN\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01792}01792         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} + 1) > \mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01793}01793             (sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}} + 1) > \mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01794}01794 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01795}01795                 \textcolor{keywordflow}{if} (hifn\_debug) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01796}01796                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01797}01797                                 \textcolor{stringliteral}{"{}cmd/result exhaustion, cmdu \%u resu \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01798}01798                                 sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01799}01799                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01800}01800 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01801}01801                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a6e6edceb26375104f7d62b65e65ed174}{hst\_nomem\_cr}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01802}01802                 \mbox{\hyperlink{hifn7751var_8h_af056255d058474b0a91b177df5d1c660}{HIFN\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01803}01803                 \textcolor{keywordflow}{return} (ERESTART);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01804}01804         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01805}01805 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01806}01806         \textcolor{keywordflow}{if} (bus\_dmamap\_create(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, BUS\_DMA\_NOWAIT, \&cmd-\/>src\_map)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01807}01807                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a9d8c79f7a00705848dbb273d7b2d3665}{hst\_nomem\_map}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01808}01808                 \mbox{\hyperlink{hifn7751var_8h_af056255d058474b0a91b177df5d1c660}{HIFN\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01809}01809                 \textcolor{keywordflow}{return} (ENOMEM);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01810}01810         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01811}01811 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01812}01812         \textcolor{keywordflow}{if} (bus\_dmamap\_load\_crp(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map, crp, \mbox{\hyperlink{hifn7751_8c_aa65420534ccb2d553f001df9382110f4}{hifn\_op\_cb}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01813}01813             \&cmd-\/>\mbox{\hyperlink{structhifn__command_a9a04cbec26cb770cf787d1664cb03909}{src}}, BUS\_DMA\_NOWAIT)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01814}01814                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_ac6cf52053f064b7253f4dc34bde9fe02}{hst\_nomem\_load}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01815}01815                 err = ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01816}01816                 \textcolor{keywordflow}{goto} err\_srcmap1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01817}01817         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01818}01818         cmd-\/>src\_mapsize = crypto\_buffer\_len(\&crp-\/>crp\_buf);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01819}01819 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01820}01820         \textcolor{keywordflow}{if} (\mbox{\hyperlink{hifn7751_8c_a520ec80778fadf1b70db0eeaa465901d}{hifn\_dmamap\_aligned}}(\&cmd-\/>\mbox{\hyperlink{structhifn__command_a9a04cbec26cb770cf787d1664cb03909}{src}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01821}01821                 cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}} = cmd-\/>src\_mapsize \& 3;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01822}01822                 cmd-\/>\mbox{\hyperlink{structhifn__command_a43aac7f8cf48554b0fd768653b98406b}{dst}} = cmd-\/>\mbox{\hyperlink{structhifn__command_a9a04cbec26cb770cf787d1664cb03909}{src}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01823}01823         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (crp-\/>crp\_buf.cb\_type == CRYPTO\_BUF\_MBUF) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01824}01824                 \textcolor{keywordtype}{int} totlen, len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01825}01825                 \textcolor{keyword}{struct }mbuf *m, *m0, *mlast;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01826}01826 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01827}01827                 KASSERT(cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}} == NULL,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01828}01828                     (\textcolor{stringliteral}{"{}hifn\_crypto: dst\_m initialized improperly"{}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01829}01829                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a00d14d0b21f1d6cc8e80736deed23acf}{hst\_unaligned}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01830}01830 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01831}01831                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01832}01832 \textcolor{comment}{                 * Source is not aligned on a longword boundary.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01833}01833 \textcolor{comment}{                 * Copy the data to insure alignment.  If we fail}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01834}01834 \textcolor{comment}{                 * to allocate mbufs or clusters while doing this}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01835}01835 \textcolor{comment}{                 * we return ERESTART so the operation is requeued}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01836}01836 \textcolor{comment}{                 * at the crypto later, but only if there are}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01837}01837 \textcolor{comment}{                 * ops already posted to the hardware; otherwise we}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01838}01838 \textcolor{comment}{                 * have no guarantee that we'll be re-\/entered.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01839}01839 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01840}01840                 totlen = cmd-\/>src\_mapsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01841}01841                 \textcolor{keywordflow}{if} (crp-\/>crp\_buf.cb\_mbuf-\/>m\_flags \& M\_PKTHDR) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01842}01842                         len = MHLEN;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01843}01843                         MGETHDR(m0, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01844}01844                         \textcolor{keywordflow}{if} (m0 \&\& !m\_dup\_pkthdr(m0, crp-\/>crp\_buf.cb\_mbuf,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01845}01845                             M\_NOWAIT)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01846}01846                                 m\_free(m0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01847}01847                                 m0 = NULL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01848}01848                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01849}01849                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01850}01850                         len = MLEN;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01851}01851                         MGET(m0, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01852}01852                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01853}01853                 \textcolor{keywordflow}{if} (m0 == NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01854}01854                         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_aebe794bd702c6d76d1f1bac2f7a735fa}{hst\_nomem\_mbuf}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01855}01855                         err = sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} ? ERESTART : ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01856}01856                         \textcolor{keywordflow}{goto} err\_srcmap;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01857}01857                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01858}01858                 \textcolor{keywordflow}{if} (totlen >= MINCLSIZE) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01859}01859                         \textcolor{keywordflow}{if} (!(MCLGET(m0, M\_NOWAIT))) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01860}01860                                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a7aae19e8d62f6c3a29e2ba8601228af9}{hst\_nomem\_mcl}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01861}01861                                 err = sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} ? ERESTART : ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01862}01862                                 m\_freem(m0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01863}01863                                 \textcolor{keywordflow}{goto} err\_srcmap;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01864}01864                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01865}01865                         len = MCLBYTES;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01866}01866                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01867}01867                 totlen -\/= len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01868}01868                 m0-\/>m\_pkthdr.len = m0-\/>m\_len = len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01869}01869                 mlast = m0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01870}01870 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01871}01871                 \textcolor{keywordflow}{while} (totlen > 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01872}01872                         MGET(m, M\_NOWAIT, MT\_DATA);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01873}01873                         \textcolor{keywordflow}{if} (m == NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01874}01874                                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_aebe794bd702c6d76d1f1bac2f7a735fa}{hst\_nomem\_mbuf}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01875}01875                                 err = sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} ? ERESTART : ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01876}01876                                 m\_freem(m0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01877}01877                                 \textcolor{keywordflow}{goto} err\_srcmap;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01878}01878                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01879}01879                         len = MLEN;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01880}01880                         \textcolor{keywordflow}{if} (totlen >= MINCLSIZE) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01881}01881                                 \textcolor{keywordflow}{if} (!(MCLGET(m, M\_NOWAIT))) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01882}01882                                         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a7aae19e8d62f6c3a29e2ba8601228af9}{hst\_nomem\_mcl}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01883}01883                                         err = sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} ? ERESTART : ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01884}01884                                         mlast-\/>m\_next = m;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01885}01885                                         m\_freem(m0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01886}01886                                         \textcolor{keywordflow}{goto} err\_srcmap;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01887}01887                                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01888}01888                                 len = MCLBYTES;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01889}01889                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01890}01890 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01891}01891                         m-\/>m\_len = len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01892}01892                         m0-\/>m\_pkthdr.len += len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01893}01893                         totlen -\/= len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01894}01894 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01895}01895                         mlast-\/>m\_next = m;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01896}01896                         mlast = m;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01897}01897                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01898}01898                 cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}} = m0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01899}01899 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01900}01900                 \textcolor{keywordflow}{if} (bus\_dmamap\_create(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, BUS\_DMA\_NOWAIT,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01901}01901                     \&cmd-\/>dst\_map)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01902}01902                         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a9d8c79f7a00705848dbb273d7b2d3665}{hst\_nomem\_map}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01903}01903                         err = ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01904}01904                         \textcolor{keywordflow}{goto} err\_srcmap;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01905}01905                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01906}01906 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01907}01907                 \textcolor{keywordflow}{if} (bus\_dmamap\_load\_mbuf\_sg(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map, m0,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01908}01908                     cmd-\/>dst\_segs, \&cmd-\/>dst\_nsegs, 0)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01909}01909                         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a9d8c79f7a00705848dbb273d7b2d3665}{hst\_nomem\_map}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01910}01910                         err = ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01911}01911                         \textcolor{keywordflow}{goto} err\_dstmap1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01912}01912                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01913}01913                 cmd-\/>dst\_mapsize = m0-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01914}01914         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01915}01915                 err = EINVAL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01916}01916                 \textcolor{keywordflow}{goto} err\_srcmap;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01917}01917         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01918}01918 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01919}01919 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01920}01920         \textcolor{keywordflow}{if} (hifn\_debug) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01921}01921                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01922}01922                     \textcolor{stringliteral}{"{}Entering cmd: stat \%8x ien \%8x u \%d/\%d/\%d/\%d n \%d/\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01923}01923                     \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01924}01924                     \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aafdcca42c86f7cb0ddb01c5a0cc4abc9}{HIFN\_1\_DMA\_IER}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01925}01925                     sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01926}01926                     cmd-\/>src\_nsegs, cmd-\/>dst\_nsegs);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01927}01927         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01928}01928 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01929}01929 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01930}01930         \textcolor{keywordflow}{if} (cmd-\/>src\_map == cmd-\/>dst\_map) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01931}01931                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01932}01932                     BUS\_DMASYNC\_PREWRITE|BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01933}01933         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01934}01934                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01935}01935                     BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01936}01936                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01937}01937                     BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01938}01938         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01939}01939 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01940}01940         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01941}01941 \textcolor{comment}{         * need N src, and N dst}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01942}01942 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01943}01943         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}} + cmd-\/>src\_nsegs) > \mbox{\hyperlink{hifn7751var_8h_af6b9447faa1e6b7e1ff31262114754e4}{HIFN\_D\_SRC\_RSIZE}} ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01944}01944             (sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}} + cmd-\/>dst\_nsegs + 1) > \mbox{\hyperlink{hifn7751var_8h_a396a284c2b765b87a6b26dd7087ef51c}{HIFN\_D\_DST\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01945}01945 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01946}01946                 \textcolor{keywordflow}{if} (hifn\_debug) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01947}01947                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01948}01948                                 \textcolor{stringliteral}{"{}src/dst exhaustion, srcu \%u+\%u dstu \%u+\%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01949}01949                                 sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}}, cmd-\/>src\_nsegs,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01950}01950                                 sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}}, cmd-\/>dst\_nsegs);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01951}01951                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01952}01952 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01953}01953                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_abe2c5048f5f190f1b62300cb5386d90d}{hst\_nomem\_sd}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01954}01954                 err = ERESTART;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01955}01955                 \textcolor{keywordflow}{goto} err\_dstmap;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01956}01956         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01957}01957 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01958}01958         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}} == \mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01959}01959                 sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01960}01960                 dma-\/>\mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[\mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01961}01961                     \mbox{\hyperlink{hifn7751reg_8h_a1384c0bccb4d42695eed62ce16c86ca1}{HIFN\_D\_JUMP}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01962}01962                 \mbox{\hyperlink{hifn7751var_8h_af150a4c532dcc797db19d55401b5533a}{HIFN\_CMDR\_SYNC}}(sc, \mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01963}01963                     BUS\_DMASYNC\_PREWRITE | BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01964}01964         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01965}01965         cmdi = sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01966}01966         cmdlen = \mbox{\hyperlink{hifn7751_8c_ac50d99c2de980fb096110efe06f2f6da}{hifn\_write\_command}}(cmd, dma-\/>\mbox{\hyperlink{structhifn__dma_af146ebeda0ce000c07dd3cb24ede2d31}{command\_bufs}}[cmdi]);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01967}01967         \mbox{\hyperlink{hifn7751var_8h_aa6158501c725a51541d6806f57d1494d}{HIFN\_CMD\_SYNC}}(sc, cmdi, BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01968}01968 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01969}01969         \textcolor{comment}{/* .p for command/result already set */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01970}01970         dma-\/>\mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[cmdi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(cmdlen | \mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_a39f72feb5bec64556f8a83500bc6db6c}{HIFN\_D\_LAST}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01971}01971             \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01972}01972         \mbox{\hyperlink{hifn7751var_8h_af150a4c532dcc797db19d55401b5533a}{HIFN\_CMDR\_SYNC}}(sc, cmdi,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01973}01973             BUS\_DMASYNC\_PREWRITE | BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01974}01974         sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01975}01975 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01976}01976         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01977}01977 \textcolor{comment}{         * We don't worry about missing an interrupt (which a "{}command wait"{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01978}01978 \textcolor{comment}{         * interrupt salvages us from), unless there is more than one command}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01979}01979 \textcolor{comment}{         * in the queue.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01980}01980 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01981}01981         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} > 1) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01982}01982                 sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}} |= \mbox{\hyperlink{hifn7751reg_8h_aa56770444619e2d491f96e12b94ee3d7}{HIFN\_DMAIER\_C\_WAIT}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01983}01983                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aafdcca42c86f7cb0ddb01c5a0cc4abc9}{HIFN\_1\_DMA\_IER}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01984}01984         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01985}01985 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01986}01986         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_ad080dd21e4e29d8b35067447582991d1}{hst\_ipackets}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01987}01987         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a01ae96a9278b4cfec82897ce840682b6}{hst\_ibytes}} += cmd-\/>src\_mapsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01988}01988 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01989}01989         \mbox{\hyperlink{hifn7751_8c_a5b94630e8696abc18a2e7cb9329200ca}{hifn\_dmamap\_load\_src}}(sc, cmd);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01990}01990 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01991}01991         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01992}01992 \textcolor{comment}{         * Unlike other descriptors, we don't mask done interrupt from}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01993}01993 \textcolor{comment}{         * result descriptor.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01994}01994 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01995}01995 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01996}01996         \textcolor{keywordflow}{if} (hifn\_debug)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01997}01997                 printf(\textcolor{stringliteral}{"{}load res\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01998}01998 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l01999}01999         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}} == \mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02000}02000                 sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02001}02001                 dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[\mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}}].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02002}02002                     \mbox{\hyperlink{hifn7751reg_8h_a1384c0bccb4d42695eed62ce16c86ca1}{HIFN\_D\_JUMP}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02003}02003                 \mbox{\hyperlink{hifn7751var_8h_aeec3f818c4c174400383758ac6de2b29}{HIFN\_RESR\_SYNC}}(sc, \mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02004}02004                     BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02005}02005         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02006}02006         resi = sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02007}02007         KASSERT(sc-\/>\mbox{\hyperlink{structhifn__softc_a0cd5758865297a0af0a6d951c9a29330}{sc\_hifn\_commands}}[resi] == NULL,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02008}02008                 (\textcolor{stringliteral}{"{}hifn\_crypto: command slot \%u busy"{}}, resi));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02009}02009         sc-\/>\mbox{\hyperlink{structhifn__softc_a0cd5758865297a0af0a6d951c9a29330}{sc\_hifn\_commands}}[resi] = cmd;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02010}02010         \mbox{\hyperlink{hifn7751var_8h_acc3470ce9e2a2d9a58d315a43bc4b0fa}{HIFN\_RES\_SYNC}}(sc, resi, BUS\_DMASYNC\_PREREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02011}02011         \textcolor{keywordflow}{if} ((hint \& CRYPTO\_HINT\_MORE) \&\& sc-\/>\mbox{\hyperlink{structhifn__softc_a6c246e86652f2a05250a12416b795190}{sc\_curbatch}} < \mbox{\hyperlink{hifn7751_8c_af0660575e36ca7c8238fe25ccd4c7d9a}{hifn\_maxbatch}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02012}02012                 dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[resi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a06616a00deb7b133d98b158fe30ddb1e}{HIFN\_MAX\_RESULT}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02013}02013                     \mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_a39f72feb5bec64556f8a83500bc6db6c}{HIFN\_D\_LAST}} | \mbox{\hyperlink{hifn7751reg_8h_ad36ff64ede2a44501114d8e955de84d9}{HIFN\_D\_MASKDONEIRQ}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02014}02014                 sc-\/>\mbox{\hyperlink{structhifn__softc_a6c246e86652f2a05250a12416b795190}{sc\_curbatch}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02015}02015                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a6c246e86652f2a05250a12416b795190}{sc\_curbatch}} > \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a40d31e798d95c9764c6576199154f1aa}{hst\_maxbatch}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02016}02016                         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a40d31e798d95c9764c6576199154f1aa}{hst\_maxbatch}} = sc-\/>\mbox{\hyperlink{structhifn__softc_a6c246e86652f2a05250a12416b795190}{sc\_curbatch}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02017}02017                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_ad4fd90c6699ecd4a54d6e7a367136804}{hst\_totbatch}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02018}02018         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02019}02019                 dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[resi].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} = htole32(\mbox{\hyperlink{hifn7751reg_8h_a06616a00deb7b133d98b158fe30ddb1e}{HIFN\_MAX\_RESULT}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02020}02020                     \mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}} | \mbox{\hyperlink{hifn7751reg_8h_a39f72feb5bec64556f8a83500bc6db6c}{HIFN\_D\_LAST}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02021}02021                 sc-\/>\mbox{\hyperlink{structhifn__softc_a6c246e86652f2a05250a12416b795190}{sc\_curbatch}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02022}02022         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02023}02023         \mbox{\hyperlink{hifn7751var_8h_aeec3f818c4c174400383758ac6de2b29}{HIFN\_RESR\_SYNC}}(sc, resi,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02024}02024             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02025}02025         sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02026}02026 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02027}02027         \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02028}02028                 cmd-\/>\mbox{\hyperlink{structhifn__command_ad6eb9947bbfc4e28a6a0456ce6c0e023}{slopidx}} = resi;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02029}02029 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02030}02030         \mbox{\hyperlink{hifn7751_8c_ac87c6fdf4f589ed658b20b77995bbcc9}{hifn\_dmamap\_load\_dst}}(sc, cmd);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02031}02031 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02032}02032         csr = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02033}02033         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a5dcbd2360055d34c3cc0dca48f78f119}{sc\_c\_busy}} == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02034}02034                 csr |= \mbox{\hyperlink{hifn7751reg_8h_a9a4e8e4e9cd807d72271e07f55277b1f}{HIFN\_DMACSR\_C\_CTRL\_ENA}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02035}02035                 sc-\/>\mbox{\hyperlink{structhifn__softc_a5dcbd2360055d34c3cc0dca48f78f119}{sc\_c\_busy}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02036}02036         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02037}02037         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a3a34b0e9358cdcb3bc8c26ce81941384}{sc\_s\_busy}} == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02038}02038                 csr |= \mbox{\hyperlink{hifn7751reg_8h_a75b69e91b22793c8bd1f5ddfdea38346}{HIFN\_DMACSR\_S\_CTRL\_ENA}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02039}02039                 sc-\/>\mbox{\hyperlink{structhifn__softc_a3a34b0e9358cdcb3bc8c26ce81941384}{sc\_s\_busy}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02040}02040         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02041}02041         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c0b5d1999596e60f507c9f2d1290f3b}{sc\_r\_busy}} == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02042}02042                 csr |= \mbox{\hyperlink{hifn7751reg_8h_a892251ff7b6fabce5a2348217c669129}{HIFN\_DMACSR\_R\_CTRL\_ENA}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02043}02043                 sc-\/>\mbox{\hyperlink{structhifn__softc_a2c0b5d1999596e60f507c9f2d1290f3b}{sc\_r\_busy}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02044}02044         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02045}02045         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a7514fe950d3d396c918487463c6a2d86}{sc\_d\_busy}} == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02046}02046                 csr |= \mbox{\hyperlink{hifn7751reg_8h_ab9568aafaa811df429e1b4c3c1211417}{HIFN\_DMACSR\_D\_CTRL\_ENA}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02047}02047                 sc-\/>\mbox{\hyperlink{structhifn__softc_a7514fe950d3d396c918487463c6a2d86}{sc\_d\_busy}} = 1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02048}02048         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02049}02049         \textcolor{keywordflow}{if} (csr)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02050}02050                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}}, csr);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02051}02051 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02052}02052 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02053}02053         \textcolor{keywordflow}{if} (hifn\_debug) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02054}02054                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}command: stat \%8x ier \%8x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02055}02055                     \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}}),}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02056}02056                     \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aafdcca42c86f7cb0ddb01c5a0cc4abc9}{HIFN\_1\_DMA\_IER}}));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02057}02057         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02058}02058 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02059}02059 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02060}02060         sc-\/>\mbox{\hyperlink{structhifn__softc_a5f679da1d5dc0e94f86ec06adec3fb57}{sc\_active}} = 5;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02061}02061         \mbox{\hyperlink{hifn7751var_8h_af056255d058474b0a91b177df5d1c660}{HIFN\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02062}02062         KASSERT(err == 0, (\textcolor{stringliteral}{"{}hifn\_crypto: success with error \%u"{}}, err));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02063}02063         \textcolor{keywordflow}{return} (err);           \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02064}02064 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02065}02065 err\_dstmap:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02066}02066         \textcolor{keywordflow}{if} (cmd-\/>src\_map != cmd-\/>dst\_map)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02067}02067                 bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02068}02068 err\_dstmap1:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02069}02069         \textcolor{keywordflow}{if} (cmd-\/>src\_map != cmd-\/>dst\_map)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02070}02070                 bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02071}02071 err\_srcmap:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02072}02072         \textcolor{keywordflow}{if} (crp-\/>crp\_buf.cb\_type == CRYPTO\_BUF\_MBUF) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02073}02073                 \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}} != NULL)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02074}02074                         m\_freem(cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02075}02075         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02076}02076         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02077}02077 err\_srcmap1:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02078}02078         bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02079}02079         \mbox{\hyperlink{hifn7751var_8h_af056255d058474b0a91b177df5d1c660}{HIFN\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02080}02080         \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02081}02081 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02082}02082 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02083}02083 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02084}\mbox{\hyperlink{hifn7751_8c_af7de08206bc84abf506bb668c78113c3}{02084}} \mbox{\hyperlink{hifn7751_8c_af7de08206bc84abf506bb668c78113c3}{hifn\_tick}}(\textcolor{keywordtype}{void}* vsc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02085}02085 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02086}02086         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc = vsc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02087}02087 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02088}02088         \mbox{\hyperlink{hifn7751var_8h_a37421bdd57949831d6f7d856d1f90832}{HIFN\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02089}02089         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a5f679da1d5dc0e94f86ec06adec3fb57}{sc\_active}} == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02090}02090                 u\_int32\_t r = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02091}02091 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02092}02092                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} == 0 \&\& sc-\/>\mbox{\hyperlink{structhifn__softc_a5dcbd2360055d34c3cc0dca48f78f119}{sc\_c\_busy}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02093}02093                         sc-\/>\mbox{\hyperlink{structhifn__softc_a5dcbd2360055d34c3cc0dca48f78f119}{sc\_c\_busy}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02094}02094                         r |= \mbox{\hyperlink{hifn7751reg_8h_a5d0566278c41f8958ecb928d08314cde}{HIFN\_DMACSR\_C\_CTRL\_DIS}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02095}02095                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02096}02096                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}} == 0 \&\& sc-\/>\mbox{\hyperlink{structhifn__softc_a3a34b0e9358cdcb3bc8c26ce81941384}{sc\_s\_busy}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02097}02097                         sc-\/>\mbox{\hyperlink{structhifn__softc_a3a34b0e9358cdcb3bc8c26ce81941384}{sc\_s\_busy}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02098}02098                         r |= \mbox{\hyperlink{hifn7751reg_8h_a6f23e20a8d783d7c0f552cc63a2e487f}{HIFN\_DMACSR\_S\_CTRL\_DIS}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02099}02099                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02100}02100                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}} == 0 \&\& sc-\/>\mbox{\hyperlink{structhifn__softc_a7514fe950d3d396c918487463c6a2d86}{sc\_d\_busy}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02101}02101                         sc-\/>\mbox{\hyperlink{structhifn__softc_a7514fe950d3d396c918487463c6a2d86}{sc\_d\_busy}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02102}02102                         r |= \mbox{\hyperlink{hifn7751reg_8h_a732033d4199e8dbfa27aa8669f3077ff}{HIFN\_DMACSR\_D\_CTRL\_DIS}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02103}02103                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02104}02104                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}} == 0 \&\& sc-\/>\mbox{\hyperlink{structhifn__softc_a2c0b5d1999596e60f507c9f2d1290f3b}{sc\_r\_busy}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02105}02105                         sc-\/>\mbox{\hyperlink{structhifn__softc_a2c0b5d1999596e60f507c9f2d1290f3b}{sc\_r\_busy}} = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02106}02106                         r |= \mbox{\hyperlink{hifn7751reg_8h_aa4b40911890600e2f3183b53ed9d483e}{HIFN\_DMACSR\_R\_CTRL\_DIS}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02107}02107                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02108}02108                 \textcolor{keywordflow}{if} (r)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02109}02109                         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}}, r);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02110}02110         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02111}02111                 sc-\/>\mbox{\hyperlink{structhifn__softc_a5f679da1d5dc0e94f86ec06adec3fb57}{sc\_active}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02112}02112         \mbox{\hyperlink{hifn7751var_8h_af056255d058474b0a91b177df5d1c660}{HIFN\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02113}02113         callout\_reset(\&sc-\/>\mbox{\hyperlink{structhifn__softc_a848a093614a153dd76498bb6a160fe48}{sc\_tickto}}, hz, \mbox{\hyperlink{hifn7751_8c_af7de08206bc84abf506bb668c78113c3}{hifn\_tick}}, sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02114}02114 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02115}02115 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02116}02116 \textcolor{keyword}{static} \textcolor{keywordtype}{void} }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02117}\mbox{\hyperlink{hifn7751_8c_a64a879aa44af33b500fb8d8aa14d0354}{02117}} \mbox{\hyperlink{hifn7751_8c_a64a879aa44af33b500fb8d8aa14d0354}{hifn\_intr}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02118}02118 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02119}02119         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc = arg;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02120}02120         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02121}02121         u\_int32\_t dmacsr, restart;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02122}02122         \textcolor{keywordtype}{int} i, u;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02123}02123 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02124}02124         dmacsr = \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02125}02125 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02126}02126         \textcolor{comment}{/* Nothing in the DMA unit interrupted */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02127}02127         \textcolor{keywordflow}{if} ((dmacsr \& sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}}) == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02128}02128                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02129}02129 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02130}02130         \mbox{\hyperlink{hifn7751var_8h_a37421bdd57949831d6f7d856d1f90832}{HIFN\_LOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02131}02131 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02132}02132         dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02133}02133 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02134}02134 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02135}02135         \textcolor{keywordflow}{if} (hifn\_debug) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02136}02136                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02137}02137                     \textcolor{stringliteral}{"{}irq: stat \%08x ien \%08x damier \%08x i \%d/\%d/\%d/\%d k \%d/\%d/\%d/\%d u \%d/\%d/\%d/\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02138}02138                     dmacsr, \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aafdcca42c86f7cb0ddb01c5a0cc4abc9}{HIFN\_1\_DMA\_IER}}), sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02139}02139                     sc-\/>\mbox{\hyperlink{structhifn__softc_a6a3c4704031c07b3a8309ef88c4aabcc}{sc\_cmdi}}, sc-\/>\mbox{\hyperlink{structhifn__softc_ae73faa9a7bf3a27de6fe007735758ffc}{sc\_srci}}, sc-\/>\mbox{\hyperlink{structhifn__softc_ae035a6546731164cb67fd607995d4279}{sc\_dsti}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a76025c45394050dec8a1bfe135e20a56}{sc\_resi}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02140}02140                     sc-\/>\mbox{\hyperlink{structhifn__softc_ac5a5b513e2da6c3e4f482c71ffc89a12}{sc\_cmdk}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a29258460f1734f78fd202555d5c8aa82}{sc\_srck}}, sc-\/>\mbox{\hyperlink{structhifn__softc_ad366579c9b2e77d0135038f13dbaaaeb}{sc\_dstk}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a000c64304a0de0c48fee6c043d6873c4}{sc\_resk}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02141}02141                     sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02142}02142         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02143}02143 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02144}02144 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02145}02145         \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a2de0aca4ded4099f8448a2eaaed76d75}{HIFN\_1\_DMA\_CSR}}, dmacsr \& sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02146}02146 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02147}02147         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a1e2651b6242cc07fb2e772b5d55eefbd}{HIFN\_HAS\_PUBLIC}}) \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02148}02148             (dmacsr \& \mbox{\hyperlink{hifn7751reg_8h_a918d01773e775f0d56ff45ea733d1424}{HIFN\_DMACSR\_PUBDONE}}))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02149}02149                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a6d3f834f5474a2318894586a098a4c2f}{HIFN\_1\_PUB\_STATUS}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02150}02150                     \mbox{\hyperlink{hifn7751_8c_af6d32d3905d3e9ced3fae4d48d82618f}{READ\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_a6d3f834f5474a2318894586a098a4c2f}{HIFN\_1\_PUB\_STATUS}}) | \mbox{\hyperlink{hifn7751reg_8h_aad3c8ad793466e5b3fbd86c374bc07a9}{HIFN\_PUBSTS\_DONE}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02151}02151 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02152}02152         restart = dmacsr \& (\mbox{\hyperlink{hifn7751reg_8h_acd03d214548ae5b4231b49a7e1d05f07}{HIFN\_DMACSR\_D\_OVER}} | \mbox{\hyperlink{hifn7751reg_8h_a56ba8cc5f651408015d920c9b1149383}{HIFN\_DMACSR\_R\_OVER}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02153}02153         \textcolor{keywordflow}{if} (restart)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02154}02154                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}overrun \%x\(\backslash\)n"{}}, dmacsr);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02155}02155 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02156}02156         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02157}02157                 \textcolor{keywordflow}{if} (dmacsr \& \mbox{\hyperlink{hifn7751reg_8h_ab81cb8ae1838d7d16026a277820daaf1}{HIFN\_DMACSR\_ILLR}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02158}02158                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}illegal read\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02159}02159                 \textcolor{keywordflow}{if} (dmacsr \& \mbox{\hyperlink{hifn7751reg_8h_abc051d8ab61048cfdf5a836edc836c01}{HIFN\_DMACSR\_ILLW}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02160}02160                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}illegal write\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02161}02161         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02162}02162 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02163}02163         restart = dmacsr \& (\mbox{\hyperlink{hifn7751reg_8h_a89d9bb4f52507e0480d671a35470a224}{HIFN\_DMACSR\_C\_ABORT}} | \mbox{\hyperlink{hifn7751reg_8h_af9cb246cbb877dc2f50333181e804e61}{HIFN\_DMACSR\_S\_ABORT}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02164}02164             \mbox{\hyperlink{hifn7751reg_8h_a43faa68af12666cc25c2546a7dc20ad5}{HIFN\_DMACSR\_D\_ABORT}} | \mbox{\hyperlink{hifn7751reg_8h_aa89fc126fd3a348d2c0901435bba0b8b}{HIFN\_DMACSR\_R\_ABORT}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02165}02165         \textcolor{keywordflow}{if} (restart) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02166}02166                 device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}abort, resetting.\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02167}02167                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_acd1d09b3bdc6da8cf469b574589e5af9}{hst\_abort}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02168}02168                 \mbox{\hyperlink{hifn7751_8c_a532751a6fec82e34539231800d783195}{hifn\_abort}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02169}02169                 \mbox{\hyperlink{hifn7751var_8h_af056255d058474b0a91b177df5d1c660}{HIFN\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02170}02170                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02171}02171         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02172}02172 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02173}02173         \textcolor{keywordflow}{if} ((dmacsr \& \mbox{\hyperlink{hifn7751reg_8h_a57bfdfae942a72d5616c6494cc04b297}{HIFN\_DMACSR\_C\_WAIT}}) \&\& (sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} == 0)) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02174}02174                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02175}02175 \textcolor{comment}{                 * If no slots to process and we receive a "{}waiting on}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02176}02176 \textcolor{comment}{                 * command"{} interrupt, we disable the "{}waiting on command"{}}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02177}02177 \textcolor{comment}{                 * (by clearing it).}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02178}02178 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02179}02179                 sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}} \&= \string~HIFN\_DMAIER\_C\_WAIT;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02180}02180                 \mbox{\hyperlink{hifn7751_8c_a3ef7d102c1a2e44cee2f8a0ad8497485}{WRITE\_REG\_1}}(sc, \mbox{\hyperlink{hifn7751reg_8h_aafdcca42c86f7cb0ddb01c5a0cc4abc9}{HIFN\_1\_DMA\_IER}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a31e57c691c161b1957ddbe58e0e09d70}{sc\_dmaier}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02181}02181         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02182}02182 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02183}02183         \textcolor{comment}{/* clear the rings */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02184}02184         i = sc-\/>\mbox{\hyperlink{structhifn__softc_a000c64304a0de0c48fee6c043d6873c4}{sc\_resk}}; u = sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02185}02185         \textcolor{keywordflow}{while} (u != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02186}02186                 \mbox{\hyperlink{hifn7751var_8h_aeec3f818c4c174400383758ac6de2b29}{HIFN\_RESR\_SYNC}}(sc, i,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02187}02187                     BUS\_DMASYNC\_POSTREAD | BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02188}02188                 \textcolor{keywordflow}{if} (dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[i].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} \& htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02189}02189                         \mbox{\hyperlink{hifn7751var_8h_aeec3f818c4c174400383758ac6de2b29}{HIFN\_RESR\_SYNC}}(sc, i,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02190}02190                             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02191}02191                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02192}02192                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02193}02193 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02194}02194                 \textcolor{keywordflow}{if} (i != \mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02195}02195                         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__command}{hifn\_command}} *cmd;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02196}02196                         u\_int8\_t *macbuf = NULL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02197}02197 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02198}02198                         \mbox{\hyperlink{hifn7751var_8h_acc3470ce9e2a2d9a58d315a43bc4b0fa}{HIFN\_RES\_SYNC}}(sc, i, BUS\_DMASYNC\_POSTREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02199}02199                         cmd = sc-\/>\mbox{\hyperlink{structhifn__softc_a0cd5758865297a0af0a6d951c9a29330}{sc\_hifn\_commands}}[i];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02200}02200                         KASSERT(cmd != NULL,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02201}02201                                 (\textcolor{stringliteral}{"{}hifn\_intr: null command slot \%u"{}}, i));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02202}02202                         sc-\/>\mbox{\hyperlink{structhifn__softc_a0cd5758865297a0af0a6d951c9a29330}{sc\_hifn\_commands}}[i] = NULL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02203}02203 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02204}02204                         \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a4fac85eaa06486fce7d1696ee479e089}{HIFN\_BASE\_CMD\_MAC}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02205}02205                                 macbuf = dma-\/>\mbox{\hyperlink{structhifn__dma_a917268867231ff4a46240bcee9100b63}{result\_bufs}}[i];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02206}02206                                 macbuf += 12;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02207}02207                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02208}02208 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02209}02209                         \mbox{\hyperlink{hifn7751_8c_af62302409d3e9339e5bf98a2788700d1}{hifn\_callback}}(sc, cmd, macbuf);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02210}02210                         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_af84252006280668e2c09f454a7c38363}{hst\_opackets}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02211}02211                         u-\/-\/;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02212}02212                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02213}02213 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02214}02214                 \textcolor{keywordflow}{if} (++i == (\mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}} + 1))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02215}02215                         i = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02216}02216         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02217}02217         sc-\/>\mbox{\hyperlink{structhifn__softc_a000c64304a0de0c48fee6c043d6873c4}{sc\_resk}} = i; sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}} = u;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02218}02218 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02219}02219         i = sc-\/>\mbox{\hyperlink{structhifn__softc_a29258460f1734f78fd202555d5c8aa82}{sc\_srck}}; u = sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02220}02220         \textcolor{keywordflow}{while} (u != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02221}02221                 \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{hifn7751var_8h_af6b9447faa1e6b7e1ff31262114754e4}{HIFN\_D\_SRC\_RSIZE}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02222}02222                         i = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02223}02223                 \mbox{\hyperlink{hifn7751var_8h_a58d0cea76bd4e709130d8581a04fede0}{HIFN\_SRCR\_SYNC}}(sc, i,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02224}02224                     BUS\_DMASYNC\_POSTREAD | BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02225}02225                 \textcolor{keywordflow}{if} (dma-\/>\mbox{\hyperlink{structhifn__dma_a638466f5cd8c40c389175b357ff55861}{srcr}}[i].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} \& htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02226}02226                         \mbox{\hyperlink{hifn7751var_8h_a58d0cea76bd4e709130d8581a04fede0}{HIFN\_SRCR\_SYNC}}(sc, i,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02227}02227                             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02228}02228                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02229}02229                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02230}02230                 i++, u-\/-\/;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02231}02231         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02232}02232         sc-\/>\mbox{\hyperlink{structhifn__softc_a29258460f1734f78fd202555d5c8aa82}{sc\_srck}} = i; sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}} = u;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02233}02233 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02234}02234         i = sc-\/>\mbox{\hyperlink{structhifn__softc_ac5a5b513e2da6c3e4f482c71ffc89a12}{sc\_cmdk}}; u = sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02235}02235         \textcolor{keywordflow}{while} (u != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02236}02236                 \mbox{\hyperlink{hifn7751var_8h_af150a4c532dcc797db19d55401b5533a}{HIFN\_CMDR\_SYNC}}(sc, i,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02237}02237                     BUS\_DMASYNC\_POSTREAD | BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02238}02238                 \textcolor{keywordflow}{if} (dma-\/>\mbox{\hyperlink{structhifn__dma_aac93403b6a5ebf9d0f632fba7971202b}{cmdr}}[i].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} \& htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02239}02239                         \mbox{\hyperlink{hifn7751var_8h_af150a4c532dcc797db19d55401b5533a}{HIFN\_CMDR\_SYNC}}(sc, i,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02240}02240                             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02241}02241                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02242}02242                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02243}02243                 \textcolor{keywordflow}{if} (i != \mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02244}02244                         u-\/-\/;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02245}02245                         \mbox{\hyperlink{hifn7751var_8h_aa6158501c725a51541d6806f57d1494d}{HIFN\_CMD\_SYNC}}(sc, i, BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02246}02246                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02247}02247                 \textcolor{keywordflow}{if} (++i == (\mbox{\hyperlink{hifn7751var_8h_afef23a0adb033edc0c6ebeda613c611c}{HIFN\_D\_CMD\_RSIZE}} + 1))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02248}02248                         i = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02249}02249         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02250}02250         sc-\/>\mbox{\hyperlink{structhifn__softc_ac5a5b513e2da6c3e4f482c71ffc89a12}{sc\_cmdk}} = i; sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}} = u;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02251}02251 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02252}02252         \mbox{\hyperlink{hifn7751var_8h_af056255d058474b0a91b177df5d1c660}{HIFN\_UNLOCK}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02253}02253 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02254}02254         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a36e13188f1be897a31fa96bafbf86420}{sc\_needwakeup}}) \{           \textcolor{comment}{/* XXX check high watermark */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02255}02255                 \textcolor{keywordtype}{int} wakeup = sc-\/>\mbox{\hyperlink{structhifn__softc_a36e13188f1be897a31fa96bafbf86420}{sc\_needwakeup}} \& CRYPTO\_SYMQ;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02256}02256 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02257}02257                 \textcolor{keywordflow}{if} (hifn\_debug)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02258}02258                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02259}02259                                 \textcolor{stringliteral}{"{}wakeup crypto (\%x) u \%d/\%d/\%d/\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02260}02260                                 sc-\/>\mbox{\hyperlink{structhifn__softc_a36e13188f1be897a31fa96bafbf86420}{sc\_needwakeup}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02261}02261                                 sc-\/>\mbox{\hyperlink{structhifn__softc_a09d2c068003e283439aef7a2cba00d23}{sc\_cmdu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aba0b9e26699a8ab8be6edb2683fc2a2a}{sc\_srcu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}}, sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02262}02262 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02263}02263                 sc-\/>\mbox{\hyperlink{structhifn__softc_a36e13188f1be897a31fa96bafbf86420}{sc\_needwakeup}} \&= \string~wakeup;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02264}02264                 crypto\_unblock(sc-\/>\mbox{\hyperlink{structhifn__softc_adab72b54430de648b44d93e61d68ba90}{sc\_cid}}, wakeup);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02265}02265         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02266}02266 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02267}02267 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02268}02268 \textcolor{keyword}{static} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02269}\mbox{\hyperlink{hifn7751_8c_afcde682e0302c740fff061aa3186c362}{02269}} \mbox{\hyperlink{hifn7751_8c_afcde682e0302c740fff061aa3186c362}{hifn\_auth\_supported}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02270}02270     \textcolor{keyword}{const} \textcolor{keyword}{struct} crypto\_session\_params *csp)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02271}02271 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02272}02272 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02273}02273         \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structhifn__softc_aa2fdea2d407548757dea5e8fb398ef91}{sc\_ena}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02274}02274         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a86f5c652fe99fe432b6e5721039fbf73}{HIFN\_PUSTAT\_ENA\_2}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02275}02275         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a6353fcc34fd7787036abaf0a68beb675}{HIFN\_PUSTAT\_ENA\_1}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02276}02276                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02277}02277         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02278}02278                 \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02279}02279         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02280}02280                 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02281}02281         \textcolor{keywordflow}{switch} (csp-\/>csp\_auth\_alg) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02282}02282         \textcolor{keywordflow}{case} CRYPTO\_SHA1:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02283}02283                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02284}02284         \textcolor{keywordflow}{case} CRYPTO\_SHA1\_HMAC:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02285}02285                 \textcolor{keywordflow}{if} (csp-\/>csp\_auth\_klen > \mbox{\hyperlink{hifn7751var_8h_a77a9b749fd5da42ebfe727ab092bfb55}{HIFN\_MAC\_KEY\_LENGTH}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02286}02286                         \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02287}02287                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02288}02288         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02289}02289                 \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02290}02290         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02291}02291 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02292}02292         \textcolor{keywordflow}{return} (\textcolor{keyword}{true});  }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02293}02293 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02294}02294 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02295}02295 \textcolor{keyword}{static} \textcolor{keywordtype}{bool}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02296}\mbox{\hyperlink{hifn7751_8c_af1d8ae3864c25e703c5be95ebcda7bfd}{02296}} \mbox{\hyperlink{hifn7751_8c_af1d8ae3864c25e703c5be95ebcda7bfd}{hifn\_cipher\_supported}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02297}02297     \textcolor{keyword}{const} \textcolor{keyword}{struct} crypto\_session\_params *csp)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02298}02298 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02299}02299 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02300}02300         \textcolor{keywordflow}{if} (csp-\/>csp\_cipher\_klen == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02301}02301                 \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02302}02302         \textcolor{keywordflow}{if} (csp-\/>csp\_ivlen > \mbox{\hyperlink{hifn7751var_8h_aada9bf879e51644e5aa8e8dbdc1ed154}{HIFN\_MAX\_IV\_LENGTH}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02303}02303                 \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02304}02304         \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structhifn__softc_aa2fdea2d407548757dea5e8fb398ef91}{sc\_ena}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02305}02305         \textcolor{keywordflow}{case} \mbox{\hyperlink{hifn7751reg_8h_a86f5c652fe99fe432b6e5721039fbf73}{HIFN\_PUSTAT\_ENA\_2}}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02306}02306                 \textcolor{keywordflow}{switch} (csp-\/>csp\_cipher\_alg) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02307}02307                 \textcolor{keywordflow}{case} CRYPTO\_AES\_CBC:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02308}02308                         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_a674b1c60894c6090cd8cfcbabb53f8e3}{HIFN\_HAS\_AES}}) == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02309}02309                                 \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02310}02310                         \textcolor{keywordflow}{switch} (csp-\/>csp\_cipher\_klen) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02311}02311                         \textcolor{keywordflow}{case} 128:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02312}02312                         \textcolor{keywordflow}{case} 192:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02313}02313                         \textcolor{keywordflow}{case} 256:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02314}02314                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02315}02315                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02316}02316                                 \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02317}02317                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02318}02318                         \textcolor{keywordflow}{return} (\textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02319}02319                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02320}02320         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02321}02321         \textcolor{keywordflow}{return} (\textcolor{keyword}{false});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02322}02322 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02323}02323 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02324}02324 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02325}\mbox{\hyperlink{hifn7751_8c_a262d5ab62fabd5c79d610656fab95297}{02325}} \mbox{\hyperlink{hifn7751_8c_a262d5ab62fabd5c79d610656fab95297}{hifn\_probesession}}(device\_t dev, \textcolor{keyword}{const} \textcolor{keyword}{struct} crypto\_session\_params *csp)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02326}02326 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02327}02327         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02328}02328 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02329}02329         sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02330}02330         \textcolor{keywordflow}{if} (csp-\/>csp\_flags != 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02331}02331                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02332}02332         \textcolor{keywordflow}{switch} (csp-\/>csp\_mode) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02333}02333         \textcolor{keywordflow}{case} CSP\_MODE\_DIGEST:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02334}02334                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{hifn7751_8c_afcde682e0302c740fff061aa3186c362}{hifn\_auth\_supported}}(sc, csp))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02335}02335                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02336}02336                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02337}02337         \textcolor{keywordflow}{case} CSP\_MODE\_CIPHER:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02338}02338                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{hifn7751_8c_af1d8ae3864c25e703c5be95ebcda7bfd}{hifn\_cipher\_supported}}(sc, csp))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02339}02339                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02340}02340                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02341}02341         \textcolor{keywordflow}{case} CSP\_MODE\_ETA:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02342}02342                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{hifn7751_8c_afcde682e0302c740fff061aa3186c362}{hifn\_auth\_supported}}(sc, csp) ||}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02343}02343                     !\mbox{\hyperlink{hifn7751_8c_af1d8ae3864c25e703c5be95ebcda7bfd}{hifn\_cipher\_supported}}(sc, csp))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02344}02344                         \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02345}02345                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02346}02346         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02347}02347                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02348}02348         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02349}02349 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02350}02350         \textcolor{keywordflow}{return} (CRYPTODEV\_PROBE\_HARDWARE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02351}02351 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02352}02352 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02353}02353 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02354}02354 \textcolor{comment}{ * Allocate a new 'session'.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02355}02355 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02356}02356 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02357}\mbox{\hyperlink{hifn7751_8c_af2d9da0302576127fb08342ff73865ad}{02357}} \mbox{\hyperlink{hifn7751_8c_af2d9da0302576127fb08342ff73865ad}{hifn\_newsession}}(device\_t dev, crypto\_session\_t cses,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02358}02358     \textcolor{keyword}{const} \textcolor{keyword}{struct} crypto\_session\_params *csp)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02359}02359 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02360}02360         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__session}{hifn\_session}} *ses;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02361}02361 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02362}02362         ses = crypto\_get\_driver\_session(cses);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02363}02363 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02364}02364         \textcolor{keywordflow}{if} (csp-\/>csp\_auth\_alg != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02365}02365                 \textcolor{keywordflow}{if} (csp-\/>csp\_auth\_mlen == 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02366}02366                         ses-\/>\mbox{\hyperlink{structhifn__session_a3b1747ae54d0e8b8548e5fa4bfbe6efa}{hs\_mlen}} = crypto\_auth\_hash(csp)-\/>hashsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02367}02367                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02368}02368                         ses-\/>\mbox{\hyperlink{structhifn__session_a3b1747ae54d0e8b8548e5fa4bfbe6efa}{hs\_mlen}} = csp-\/>csp\_auth\_mlen;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02369}02369         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02370}02370 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02371}02371         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02372}02372 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02373}02373 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02374}02374 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02375}02375 \textcolor{comment}{ * XXX freesession routine should run a zero'd mac/encrypt key into context}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02376}02376 \textcolor{comment}{ * ram.  to blow away any keys already stored there.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02377}02377 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02378}02378 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02379}02379 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02380}\mbox{\hyperlink{hifn7751_8c_afff96704740907d759b04caa42eaff14}{02380}} \mbox{\hyperlink{hifn7751_8c_afff96704740907d759b04caa42eaff14}{hifn\_process}}(device\_t dev, \textcolor{keyword}{struct} cryptop *crp, \textcolor{keywordtype}{int} hint)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02381}02381 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02382}02382         \textcolor{keyword}{const} \textcolor{keyword}{struct }crypto\_session\_params *csp;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02383}02383         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02384}02384         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__command}{hifn\_command}} *cmd = NULL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02385}02385         \textcolor{keyword}{const} \textcolor{keywordtype}{void} *mackey;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02386}02386         \textcolor{keywordtype}{int} err, keylen;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02387}02387         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__session}{hifn\_session}} *ses;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02388}02388 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02389}02389         ses = crypto\_get\_driver\_session(crp-\/>crp\_session);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02390}02390 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02391}02391         cmd = malloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}}), M\_DEVBUF, M\_NOWAIT | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02392}02392         \textcolor{keywordflow}{if} (cmd == NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02393}02393                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a4c13d4d48a2c0f95b94b563a68fa4e28}{hst\_nomem}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02394}02394                 err = ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02395}02395                 \textcolor{keywordflow}{goto} errout;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02396}02396         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02397}02397 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02398}02398         csp = crypto\_get\_params(crp-\/>crp\_session);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02399}02399 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02400}02400         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02401}02401 \textcolor{comment}{         * The driver only supports ETA requests where there is no}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02402}02402 \textcolor{comment}{         * gap between the AAD and payload.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02403}02403 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02404}02404         \textcolor{keywordflow}{if} (csp-\/>csp\_mode == CSP\_MODE\_ETA \&\& crp-\/>crp\_aad\_length != 0 \&\&}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02405}02405             crp-\/>crp\_aad\_start + crp-\/>crp\_aad\_length !=}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02406}02406             crp-\/>crp\_payload\_start) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02407}02407                 err = EINVAL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02408}02408                 \textcolor{keywordflow}{goto} errout;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02409}02409         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02410}02410 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02411}02411         \textcolor{keywordflow}{switch} (csp-\/>csp\_mode) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02412}02412         \textcolor{keywordflow}{case} CSP\_MODE\_CIPHER:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02413}02413         \textcolor{keywordflow}{case} CSP\_MODE\_ETA:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02414}02414                 \textcolor{keywordflow}{if} (!CRYPTO\_OP\_IS\_ENCRYPT(crp-\/>crp\_op))}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02415}02415                         cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_adc8e364a761e788b91b211ca3c75736b}{HIFN\_BASE\_CMD\_DECODE}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02416}02416                 cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a01848cf977e4be899e5b39834e0a95ba}{HIFN\_BASE\_CMD\_CRYPT}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02417}02417                 \textcolor{keywordflow}{switch} (csp-\/>csp\_cipher\_alg) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02418}02418                 \textcolor{keywordflow}{case} CRYPTO\_AES\_CBC:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02419}02419                         cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a7bbd129319630aadcd2762c964cb4c5c}{HIFN\_CRYPT\_CMD\_ALG\_AES}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02420}02420                             \mbox{\hyperlink{hifn7751reg_8h_a058e0ab541c8d5b23300cc60e53553ef}{HIFN\_CRYPT\_CMD\_MODE\_CBC}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02421}02421                             \mbox{\hyperlink{hifn7751reg_8h_abf489fad90ff3ec104e3e07b8049c4b9}{HIFN\_CRYPT\_CMD\_NEW\_IV}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02422}02422                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02423}02423                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02424}02424                         err = EINVAL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02425}02425                         \textcolor{keywordflow}{goto} errout;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02426}02426                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02427}02427                 crypto\_read\_iv(crp, cmd-\/>\mbox{\hyperlink{structhifn__command_ad7619f15daff8c57d60148442d1450ee}{iv}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02428}02428 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02429}02429                 \textcolor{keywordflow}{if} (crp-\/>crp\_cipher\_key != NULL)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02430}02430                         cmd-\/>\mbox{\hyperlink{structhifn__command_aea145600bbc900fe25294cdf267d201c}{ck}} = crp-\/>crp\_cipher\_key;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02431}02431                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02432}02432                         cmd-\/>\mbox{\hyperlink{structhifn__command_aea145600bbc900fe25294cdf267d201c}{ck}} = csp-\/>csp\_cipher\_key;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02433}02433                 cmd-\/>\mbox{\hyperlink{structhifn__command_a35e10c02e0023b4fee16874a6505eb72}{cklen}} = csp-\/>csp\_cipher\_klen;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02434}02434                 cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a0ccaaf6dd2cff7cfebe963c8eb95f6f5}{HIFN\_CRYPT\_CMD\_NEW\_KEY}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02435}02435 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02436}02436                 \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02437}02437 \textcolor{comment}{                 * Need to specify the size for the AES key in the masks.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02438}02438 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02439}02439                 \textcolor{keywordflow}{if} ((cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a5d4f7b0eb1bb79f439be202bab72e8dc}{HIFN\_CRYPT\_CMD\_ALG\_MASK}}) ==}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02440}02440                     \mbox{\hyperlink{hifn7751reg_8h_a7bbd129319630aadcd2762c964cb4c5c}{HIFN\_CRYPT\_CMD\_ALG\_AES}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02441}02441                         \textcolor{keywordflow}{switch} (cmd-\/>\mbox{\hyperlink{structhifn__command_a35e10c02e0023b4fee16874a6505eb72}{cklen}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02442}02442                         \textcolor{keywordflow}{case} 16:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02443}02443                                 cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a0d6e4391ea5890b97411795d7c33a214}{HIFN\_CRYPT\_CMD\_KSZ\_128}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02444}02444                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02445}02445                         \textcolor{keywordflow}{case} 24:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02446}02446                                 cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_aef2fa89d211c85716a3cd2c42e6cb028}{HIFN\_CRYPT\_CMD\_KSZ\_192}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02447}02447                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02448}02448                         \textcolor{keywordflow}{case} 32:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02449}02449                                 cmd-\/>\mbox{\hyperlink{structhifn__command_a433e447cd908cf75e6e63611bfbbf821}{cry\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a8420dabdbd5c2696c77f889782aa6b28}{HIFN\_CRYPT\_CMD\_KSZ\_256}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02450}02450                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02451}02451                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02452}02452                                 err = EINVAL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02453}02453                                 \textcolor{keywordflow}{goto} errout;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02454}02454                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02455}02455                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02456}02456                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02457}02457         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02458}02458 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02459}02459         \textcolor{keywordflow}{switch} (csp-\/>csp\_mode) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02460}02460         \textcolor{keywordflow}{case} CSP\_MODE\_DIGEST:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02461}02461         \textcolor{keywordflow}{case} CSP\_MODE\_ETA:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02462}02462                 cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a4fac85eaa06486fce7d1696ee479e089}{HIFN\_BASE\_CMD\_MAC}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02463}02463 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02464}02464                 \textcolor{keywordflow}{switch} (csp-\/>csp\_auth\_alg) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02465}02465                 \textcolor{keywordflow}{case} CRYPTO\_SHA1:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02466}02466                         cmd-\/>\mbox{\hyperlink{structhifn__command_a848f4f2adea6aea2cebb0b70ed73e533}{mac\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a4a1eb1053344f499b256821682fa13a9}{HIFN\_MAC\_CMD\_ALG\_SHA1}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02467}02467                             \mbox{\hyperlink{hifn7751reg_8h_a5925ba5a037edc91ca7d69716054b5f6}{HIFN\_MAC\_CMD\_RESULT}} | \mbox{\hyperlink{hifn7751reg_8h_a1bc01db51e91fe01d1711feef270bace}{HIFN\_MAC\_CMD\_MODE\_HASH}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02468}02468                             \mbox{\hyperlink{hifn7751reg_8h_a56e59b9f2282039c441aa643c0ce0a59}{HIFN\_MAC\_CMD\_POS\_IPSEC}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02469}02469                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02470}02470                 \textcolor{keywordflow}{case} CRYPTO\_SHA1\_HMAC:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02471}02471                         cmd-\/>\mbox{\hyperlink{structhifn__command_a848f4f2adea6aea2cebb0b70ed73e533}{mac\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a4a1eb1053344f499b256821682fa13a9}{HIFN\_MAC\_CMD\_ALG\_SHA1}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02472}02472                             \mbox{\hyperlink{hifn7751reg_8h_a5925ba5a037edc91ca7d69716054b5f6}{HIFN\_MAC\_CMD\_RESULT}} | \mbox{\hyperlink{hifn7751reg_8h_a1a5e0ed679adb8a69d0d4f90639abfa7}{HIFN\_MAC\_CMD\_MODE\_HMAC}} |}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02473}02473                             \mbox{\hyperlink{hifn7751reg_8h_a56e59b9f2282039c441aa643c0ce0a59}{HIFN\_MAC\_CMD\_POS\_IPSEC}} | \mbox{\hyperlink{hifn7751reg_8h_ad2e4752fca88080ae2169acd77e7e8ba}{HIFN\_MAC\_CMD\_TRUNC}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02474}02474                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02475}02475                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02476}02476 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02477}02477                 \textcolor{keywordflow}{if} (csp-\/>csp\_auth\_alg == CRYPTO\_SHA1\_HMAC) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02478}02478                         cmd-\/>\mbox{\hyperlink{structhifn__command_a848f4f2adea6aea2cebb0b70ed73e533}{mac\_masks}} |= \mbox{\hyperlink{hifn7751reg_8h_a262ffc539ac54f7a05d5f891210f1ffb}{HIFN\_MAC\_CMD\_NEW\_KEY}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02479}02479                         \textcolor{keywordflow}{if} (crp-\/>crp\_auth\_key != NULL)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02480}02480                                 mackey = crp-\/>crp\_auth\_key;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02481}02481                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02482}02482                                 mackey = csp-\/>csp\_auth\_key;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02483}02483                         keylen = csp-\/>csp\_auth\_klen;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02484}02484                         bcopy(mackey, cmd-\/>\mbox{\hyperlink{structhifn__command_a5c32fe697076b7061d0ee03f07a64fa3}{mac}}, keylen);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02485}02485                         bzero(cmd-\/>\mbox{\hyperlink{structhifn__command_a5c32fe697076b7061d0ee03f07a64fa3}{mac}} + keylen, \mbox{\hyperlink{hifn7751var_8h_a77a9b749fd5da42ebfe727ab092bfb55}{HIFN\_MAC\_KEY\_LENGTH}} -\/ keylen);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02486}02486                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02487}02487         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02488}02488 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02489}02489         cmd-\/>\mbox{\hyperlink{structhifn__command_ab880eec82a7c2245a70f18b466de60a6}{crp}} = crp;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02490}02490         cmd-\/>\mbox{\hyperlink{structhifn__command_a7b1649fcd576a335b6a4333f37ec01d5}{session}} = ses;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02491}02491         cmd-\/>\mbox{\hyperlink{structhifn__command_ad09a26c250f9a7c918b1d0364fc7de00}{softc}} = sc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02492}02492 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02493}02493         err = \mbox{\hyperlink{hifn7751_8c_a808d5a8facede620b7138c29745b6a3c}{hifn\_crypto}}(sc, cmd, crp, hint);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02494}02494         \textcolor{keywordflow}{if} (!err) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02495}02495                 \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02496}02496         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (err == ERESTART) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02497}02497                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02498}02498 \textcolor{comment}{                 * There weren't enough resources to dispatch the request}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02499}02499 \textcolor{comment}{                 * to the part.  Notify the caller so they'll requeue this}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02500}02500 \textcolor{comment}{                 * request and resubmit it again soon.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02501}02501 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02502}02502 \textcolor{preprocessor}{\#ifdef HIFN\_DEBUG}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02503}02503                 \textcolor{keywordflow}{if} (hifn\_debug)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02504}02504                         device\_printf(sc-\/>\mbox{\hyperlink{structhifn__softc_aa0a4bce863fd7b63c34aed06b5fa6ceb}{sc\_dev}}, \textcolor{stringliteral}{"{}requeue request\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02505}02505 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02506}02506                 free(cmd, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02507}02507                 sc-\/>\mbox{\hyperlink{structhifn__softc_a36e13188f1be897a31fa96bafbf86420}{sc\_needwakeup}} |= CRYPTO\_SYMQ;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02508}02508                 \textcolor{keywordflow}{return} (err);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02509}02509         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02510}02510 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02511}02511 errout:}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02512}02512         \textcolor{keywordflow}{if} (cmd != NULL)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02513}02513                 free(cmd, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02514}02514         \textcolor{keywordflow}{if} (err == EINVAL)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02515}02515                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a0ebd060d5ecbad73c0641f6837fe55d3}{hst\_invalid}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02516}02516         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02517}02517                 \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a4c13d4d48a2c0f95b94b563a68fa4e28}{hst\_nomem}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02518}02518         crp-\/>crp\_etype = err;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02519}02519         crypto\_done(crp);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02520}02520         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02521}02521 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02522}02522 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02523}02523 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02524}\mbox{\hyperlink{hifn7751_8c_a532751a6fec82e34539231800d783195}{02524}} \mbox{\hyperlink{hifn7751_8c_a532751a6fec82e34539231800d783195}{hifn\_abort}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02525}02525 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02526}02526         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02527}02527         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__command}{hifn\_command}} *cmd;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02528}02528         \textcolor{keyword}{struct }cryptop *crp;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02529}02529         \textcolor{keywordtype}{int} i, u;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02530}02530 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02531}02531         i = sc-\/>\mbox{\hyperlink{structhifn__softc_a000c64304a0de0c48fee6c043d6873c4}{sc\_resk}}; u = sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02532}02532         \textcolor{keywordflow}{while} (u != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02533}02533                 cmd = sc-\/>\mbox{\hyperlink{structhifn__softc_a0cd5758865297a0af0a6d951c9a29330}{sc\_hifn\_commands}}[i];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02534}02534                 KASSERT(cmd != NULL, (\textcolor{stringliteral}{"{}hifn\_abort: null command slot \%u"{}}, i));}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02535}02535                 sc-\/>\mbox{\hyperlink{structhifn__softc_a0cd5758865297a0af0a6d951c9a29330}{sc\_hifn\_commands}}[i] = NULL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02536}02536                 crp = cmd-\/>\mbox{\hyperlink{structhifn__command_ab880eec82a7c2245a70f18b466de60a6}{crp}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02537}02537 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02538}02538                 \textcolor{keywordflow}{if} ((dma-\/>\mbox{\hyperlink{structhifn__dma_adfbcbb814691bc67aa7da74ad9517f63}{resr}}[i].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} \& htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}})) == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02539}02539                         \textcolor{comment}{/* Salvage what we can. */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02540}02540                         u\_int8\_t *macbuf;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02541}02541 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02542}02542                         \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a4d7a900d7b4ef251e977fa58e39a06ed}{base\_masks}} \& \mbox{\hyperlink{hifn7751reg_8h_a4fac85eaa06486fce7d1696ee479e089}{HIFN\_BASE\_CMD\_MAC}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02543}02543                                 macbuf = dma-\/>\mbox{\hyperlink{structhifn__dma_a917268867231ff4a46240bcee9100b63}{result\_bufs}}[i];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02544}02544                                 macbuf += 12;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02545}02545                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02546}02546                                 macbuf = NULL;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02547}02547                         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_af84252006280668e2c09f454a7c38363}{hst\_opackets}}++;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02548}02548                         \mbox{\hyperlink{hifn7751_8c_af62302409d3e9339e5bf98a2788700d1}{hifn\_callback}}(sc, cmd, macbuf);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02549}02549                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02550}02550                         \textcolor{keywordflow}{if} (cmd-\/>src\_map == cmd-\/>dst\_map) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02551}02551                                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02552}02552                                     BUS\_DMASYNC\_POSTREAD|BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02553}02553                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02554}02554                                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02555}02555                                     BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02556}02556                                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02557}02557                                     BUS\_DMASYNC\_POSTREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02558}02558                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02559}02559 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02560}02560                         \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02561}02561                                 m\_freem(cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02562}02562                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02563}02563 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02564}02564                         \textcolor{comment}{/* non-\/shared buffers cannot be restarted */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02565}02565                         \textcolor{keywordflow}{if} (cmd-\/>src\_map != cmd-\/>dst\_map) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02566}02566                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02567}02567 \textcolor{comment}{                                 * XXX should be EAGAIN, delayed until}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02568}02568 \textcolor{comment}{                                 * after the reset.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02569}02569 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02570}02570                                 crp-\/>crp\_etype = ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02571}02571                                 bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02572}02572                                 bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02573}02573                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02574}02574                                 crp-\/>crp\_etype = ENOMEM;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02575}02575 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02576}02576                         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02577}02577                         bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02578}02578 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02579}02579                         free(cmd, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02580}02580                         \textcolor{keywordflow}{if} (crp-\/>crp\_etype != EAGAIN)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02581}02581                                 crypto\_done(crp);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02582}02582                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02583}02583 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02584}02584                 \textcolor{keywordflow}{if} (++i == \mbox{\hyperlink{hifn7751var_8h_a7a73ac99da8f9a79a3eaf6a65379935e}{HIFN\_D\_RES\_RSIZE}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02585}02585                         i = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02586}02586                 u-\/-\/;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02587}02587         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02588}02588         sc-\/>\mbox{\hyperlink{structhifn__softc_a000c64304a0de0c48fee6c043d6873c4}{sc\_resk}} = i; sc-\/>\mbox{\hyperlink{structhifn__softc_afc317d83cfbb2f691d9a1e5d71300e72}{sc\_resu}} = u;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02589}02589 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02590}02590         \mbox{\hyperlink{hifn7751_8c_a71599fa17dcb8905a389dc3a179160c1}{hifn\_reset\_board}}(sc, 1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02591}02591         \mbox{\hyperlink{hifn7751_8c_aa14652c9bdd205405f8581c222fde517}{hifn\_init\_dma}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02592}02592         \mbox{\hyperlink{hifn7751_8c_a62f6d9df338d7da9f3e2a5d61d5d8187}{hifn\_init\_pci\_registers}}(sc);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02593}02593 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02594}02594 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02595}02595 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02596}\mbox{\hyperlink{hifn7751_8c_af62302409d3e9339e5bf98a2788700d1}{02596}} \mbox{\hyperlink{hifn7751_8c_af62302409d3e9339e5bf98a2788700d1}{hifn\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, \textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__command}{hifn\_command}} *cmd, u\_int8\_t *macbuf)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02597}02597 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02598}02598         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__dma}{hifn\_dma}} *dma = sc-\/>\mbox{\hyperlink{structhifn__softc_aa9ad2f9e23f1f65f6bf25b4709f96428}{sc\_dma}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02599}02599         \textcolor{keyword}{struct }cryptop *crp = cmd-\/>\mbox{\hyperlink{structhifn__command_ab880eec82a7c2245a70f18b466de60a6}{crp}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02600}02600         uint8\_t macbuf2[SHA1\_HASH\_LEN];}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02601}02601         \textcolor{keyword}{struct }mbuf *m;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02602}02602         \textcolor{keywordtype}{int} totlen, i, u;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02603}02603 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02604}02604         \textcolor{keywordflow}{if} (cmd-\/>src\_map == cmd-\/>dst\_map) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02605}02605                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02606}02606                     BUS\_DMASYNC\_POSTWRITE | BUS\_DMASYNC\_POSTREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02607}02607         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02608}02608                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02609}02609                     BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02610}02610                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02611}02611                     BUS\_DMASYNC\_POSTREAD);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02612}02612         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02613}02613 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02614}02614         \textcolor{keywordflow}{if} (crp-\/>crp\_buf.cb\_type == CRYPTO\_BUF\_MBUF) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02615}02615                 \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}} != NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02616}02616                         totlen = cmd-\/>src\_mapsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02617}02617                         \textcolor{keywordflow}{for} (m = cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}}; m != NULL; m = m-\/>m\_next) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02618}02618                                 \textcolor{keywordflow}{if} (totlen < m-\/>m\_len) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02619}02619                                         m-\/>m\_len = totlen;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02620}02620                                         totlen = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02621}02621                                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02622}02622                                         totlen -\/= m-\/>m\_len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02623}02623                         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02624}02624                         cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}}-\/>m\_pkthdr.len =}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02625}02625                             crp-\/>crp\_buf.cb\_mbuf-\/>m\_pkthdr.len;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02626}02626                         m\_freem(crp-\/>crp\_buf.cb\_mbuf);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02627}02627                         crp-\/>crp\_buf.cb\_mbuf = cmd-\/>\mbox{\hyperlink{structhifn__command_a60ea4be42fd24e86db0362eed2f4040d}{dst\_m}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02628}02628                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02629}02629         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02630}02630 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02631}02631         \textcolor{keywordflow}{if} (cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}} != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02632}02632                 crypto\_copyback(crp, cmd-\/>src\_mapsize -\/ cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02633}02633                     cmd-\/>\mbox{\hyperlink{structhifn__command_a8be684f70e468fa9e18903a77dd845f9}{sloplen}}, \&dma-\/>\mbox{\hyperlink{structhifn__dma_ab012de1a9dac08e25c908c7e8404d613}{slop}}[cmd-\/>\mbox{\hyperlink{structhifn__command_ad6eb9947bbfc4e28a6a0456ce6c0e023}{slopidx}}]);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02634}02634         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02635}02635 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02636}02636         i = sc-\/>\mbox{\hyperlink{structhifn__softc_ad366579c9b2e77d0135038f13dbaaaeb}{sc\_dstk}}; u = sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02637}02637         \textcolor{keywordflow}{while} (u != 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02638}02638                 \textcolor{keywordflow}{if} (i == \mbox{\hyperlink{hifn7751var_8h_a396a284c2b765b87a6b26dd7087ef51c}{HIFN\_D\_DST\_RSIZE}})}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02639}02639                         i = 0;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02640}02640                 bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02641}02641                     BUS\_DMASYNC\_POSTREAD | BUS\_DMASYNC\_POSTWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02642}02642                 \textcolor{keywordflow}{if} (dma-\/>\mbox{\hyperlink{structhifn__dma_a87e775295fe5026d0e1643992d68fced}{dstr}}[i].\mbox{\hyperlink{structhifn__desc_a8d7fa6aa3979b1fd05d8cb772288bd98}{l}} \& htole32(\mbox{\hyperlink{hifn7751reg_8h_a6b94accd4b5ccf1d690ebbb52c3d51ed}{HIFN\_D\_VALID}})) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02643}02643                         bus\_dmamap\_sync(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, sc-\/>\mbox{\hyperlink{structhifn__softc_aedd0eb99507ae8e0a60bc3745d2a65fc}{sc\_dmamap}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02644}02644                             BUS\_DMASYNC\_PREREAD | BUS\_DMASYNC\_PREWRITE);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02645}02645                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02646}02646                 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02647}02647                 i++, u-\/-\/;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02648}02648         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02649}02649         sc-\/>\mbox{\hyperlink{structhifn__softc_ad366579c9b2e77d0135038f13dbaaaeb}{sc\_dstk}} = i; sc-\/>\mbox{\hyperlink{structhifn__softc_aa486b70ae7876298a250085eef65bba9}{sc\_dstu}} = u;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02650}02650 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02651}02651         \mbox{\hyperlink{hifn7751_8c_ac17bfd0ec94f9a45f3d03a9d2ed7f603}{hifnstats}}.\mbox{\hyperlink{structhifn__stats_a5283cc37737422eacbb46320cacdab4a}{hst\_obytes}} += cmd-\/>dst\_mapsize;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02652}02652 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02653}02653         \textcolor{keywordflow}{if} (macbuf != NULL) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02654}02654                 \textcolor{keywordflow}{if} (crp-\/>crp\_op \& CRYPTO\_OP\_VERIFY\_DIGEST) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02655}02655                         crypto\_copydata(crp, crp-\/>crp\_digest\_start,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02656}02656                             cmd-\/>\mbox{\hyperlink{structhifn__command_a7b1649fcd576a335b6a4333f37ec01d5}{session}}-\/>\mbox{\hyperlink{structhifn__session_a3b1747ae54d0e8b8548e5fa4bfbe6efa}{hs\_mlen}}, macbuf2);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02657}02657                         \textcolor{keywordflow}{if} (timingsafe\_bcmp(macbuf, macbuf2,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02658}02658                             cmd-\/>\mbox{\hyperlink{structhifn__command_a7b1649fcd576a335b6a4333f37ec01d5}{session}}-\/>\mbox{\hyperlink{structhifn__session_a3b1747ae54d0e8b8548e5fa4bfbe6efa}{hs\_mlen}}) != 0)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02659}02659                                 crp-\/>crp\_etype = EBADMSG;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02660}02660                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02661}02661                         crypto\_copyback(crp, crp-\/>crp\_digest\_start,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02662}02662                             cmd-\/>\mbox{\hyperlink{structhifn__command_a7b1649fcd576a335b6a4333f37ec01d5}{session}}-\/>\mbox{\hyperlink{structhifn__session_a3b1747ae54d0e8b8548e5fa4bfbe6efa}{hs\_mlen}}, macbuf);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02663}02663         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02664}02664 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02665}02665         \textcolor{keywordflow}{if} (cmd-\/>src\_map != cmd-\/>dst\_map) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02666}02666                 bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02667}02667                 bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>dst\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02668}02668         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02669}02669         bus\_dmamap\_unload(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02670}02670         bus\_dmamap\_destroy(sc-\/>\mbox{\hyperlink{structhifn__softc_a6b736e987f9675303b13a7e48adc9af9}{sc\_dmat}}, cmd-\/>src\_map);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02671}02671         free(cmd, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02672}02672         crypto\_done(crp);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02673}02673 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02674}02674 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02675}02675 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02676}02676 \textcolor{comment}{ * 7811 PB3 rev/2 parts lock-\/up on burst writes to Group 0}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02677}02677 \textcolor{comment}{ * and Group 1 registers; avoid conditions that could create}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02678}02678 \textcolor{comment}{ * burst writes by doing a read in between the writes.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02679}02679 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02680}02680 \textcolor{comment}{ * NB: The read we interpose is always to the same register;}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02681}02681 \textcolor{comment}{ *     we do this because reading from an arbitrary (e.g. last)}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02682}02682 \textcolor{comment}{ *     register may not always work.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02683}02683 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02684}02684 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02685}\mbox{\hyperlink{hifn7751_8c_a742b07283a021779b8b9a74fba4773e5}{02685}} \mbox{\hyperlink{hifn7751_8c_a742b07283a021779b8b9a74fba4773e5}{hifn\_write\_reg\_0}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, bus\_size\_t reg, u\_int32\_t val)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02686}02686 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02687}02687         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02688}02688                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a46ab41553cde8385c2f79bdf586eeb75}{sc\_bar0\_lastreg}} == reg -\/ 4)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02689}02689                         bus\_space\_read\_4(sc-\/>\mbox{\hyperlink{structhifn__softc_a4bea2ff7a49ab9af07070a428a48727e}{sc\_st0}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a545d6fb19a481446f0053c352deea59b}{sc\_sh0}}, \mbox{\hyperlink{hifn7751reg_8h_ae36ff76c70300f3e7f6d03975a3d9bc2}{HIFN\_0\_PUCNFG}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02690}02690                 sc-\/>\mbox{\hyperlink{structhifn__softc_a46ab41553cde8385c2f79bdf586eeb75}{sc\_bar0\_lastreg}} = reg;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02691}02691         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02692}02692         bus\_space\_write\_4(sc-\/>\mbox{\hyperlink{structhifn__softc_a4bea2ff7a49ab9af07070a428a48727e}{sc\_st0}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a545d6fb19a481446f0053c352deea59b}{sc\_sh0}}, reg, val);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02693}02693 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02694}02694 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02695}02695 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02696}\mbox{\hyperlink{hifn7751_8c_aaaecdf8927790231b663b101be25ce06}{02696}} \mbox{\hyperlink{hifn7751_8c_aaaecdf8927790231b663b101be25ce06}{hifn\_write\_reg\_1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc, bus\_size\_t reg, u\_int32\_t val)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02697}02697 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02698}02698         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a2c006877a361444d34a5bc876836aa6a}{sc\_flags}} \& \mbox{\hyperlink{hifn7751var_8h_ae9406675b659e72e5f67fdfcd3ba2908}{HIFN\_IS\_7811}}) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02699}02699                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structhifn__softc_a73de5e38577f4d36ebed531f4211bf29}{sc\_bar1\_lastreg}} == reg -\/ 4)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02700}02700                         bus\_space\_read\_4(sc-\/>\mbox{\hyperlink{structhifn__softc_adfc3566b4313401fe0782634481192c0}{sc\_st1}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a179bfb917f559eb2b9a37623a7a276d9}{sc\_sh1}}, \mbox{\hyperlink{hifn7751reg_8h_af2577fe937c7b1db041e1b3a4ae9aca4}{HIFN\_1\_REVID}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02701}02701                 sc-\/>\mbox{\hyperlink{structhifn__softc_a73de5e38577f4d36ebed531f4211bf29}{sc\_bar1\_lastreg}} = reg;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02702}02702         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02703}02703         bus\_space\_write\_4(sc-\/>\mbox{\hyperlink{structhifn__softc_adfc3566b4313401fe0782634481192c0}{sc\_st1}}, sc-\/>\mbox{\hyperlink{structhifn__softc_a179bfb917f559eb2b9a37623a7a276d9}{sc\_sh1}}, reg, val);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02704}02704 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02705}02705 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02706}02706 \textcolor{preprocessor}{\#ifdef HIFN\_VULCANDEV}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02707}02707 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02708}02708 \textcolor{comment}{ * this code provides support for mapping the PK engine's register}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02709}02709 \textcolor{comment}{ * into a userspace program.}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02710}02710 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02711}02711 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02712}02712 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02713}02713 vulcanpk\_mmap(\textcolor{keyword}{struct} cdev *dev, vm\_ooffset\_t offset,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02714}02714               vm\_paddr\_t *paddr, \textcolor{keywordtype}{int} nprot, vm\_memattr\_t *memattr)}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02715}02715 \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02716}02716         \textcolor{keyword}{struct }\mbox{\hyperlink{structhifn__softc}{hifn\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02717}02717         vm\_paddr\_t pd;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02718}02718         \textcolor{keywordtype}{void} *b;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02719}02719 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02720}02720         sc = dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02721}02721 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02722}02722         pd = rman\_get\_start(sc-\/>\mbox{\hyperlink{structhifn__softc_a44f1ec98e8e93ce8e6ea684952f93e15}{sc\_bar1res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02723}02723         b = rman\_get\_virtual(sc-\/>\mbox{\hyperlink{structhifn__softc_a44f1ec98e8e93ce8e6ea684952f93e15}{sc\_bar1res}});}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02724}02724 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02725}02725 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02726}02726         printf(\textcolor{stringliteral}{"{}vpk mmap: \%p(\%016llx) offset=\%lld\(\backslash\)n"{}}, b,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02727}02727             (\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{long} \textcolor{keywordtype}{long})pd, offset);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02728}02728         hexdump(b, \mbox{\hyperlink{hifn7751reg_8h_a530ecc3b591371c778b9286f3e007e33}{HIFN\_1\_PUB\_MEMEND}}, \textcolor{stringliteral}{"{}vpk"{}}, 0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02729}02729 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02730}02730 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02731}02731         \textcolor{keywordflow}{if} (offset == 0) \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02732}02732                 *paddr = pd;}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02733}02733                 \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02734}02734         \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02735}02735         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02736}02736 \}}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02737}02737 }
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02738}02738 \textcolor{keyword}{static} \textcolor{keyword}{struct }cdevsw vulcanpk\_cdevsw = \{}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02739}02739         .d\_version =    D\_VERSION,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02740}02740         .d\_mmap =       vulcanpk\_mmap,}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02741}02741         .d\_name =       \textcolor{stringliteral}{"{}vulcanpk"{}},}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02742}02742 \};}
\DoxyCodeLine{\Hypertarget{hifn7751_8c_source_l02743}02743 \textcolor{preprocessor}{\#endif }\textcolor{comment}{/* HIFN\_VULCANDEV */}\textcolor{preprocessor}{}}

\end{DoxyCode}
