\hypertarget{ida__disk_8c_source}{}\doxysection{ida\+\_\+disk.\+c}
\label{ida__disk_8c_source}\index{dev/ida/ida\_disk.c@{dev/ida/ida\_disk.c}}
\mbox{\hyperlink{ida__disk_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 1999,2000 Jonathan Lemon}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00027}00027 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00028}00028 \textcolor{comment}{ * \$FreeBSD\$}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00029}00029 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00031}00031 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00032}00032 \textcolor{comment}{ * Disk driver for Compaq SMART RAID adapters.}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00034}00034 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/cons.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00046}00046 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/rman.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <vm/vm.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <vm/pmap.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <machine/md\_var.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00053}00053 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <geom/geom\_disk.h>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{idareg_8h}{dev/ida/idareg.h}}>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{idavar_8h}{dev/ida/idavar.h}}>}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00059}00059 \textcolor{comment}{/* prototypes */}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00060}00060 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ida__disk_8c_ab769b07cb5feb39515da8ddcaf3764c3}{idad\_probe}}(device\_t dev);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00061}00061 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ida__disk_8c_a8e56080175288f4482992267f9262bb2}{idad\_attach}}(device\_t dev);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00062}00062 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ida__disk_8c_a3e3cd45a9bbbd67019baee319c965b59}{idad\_detach}}(device\_t dev);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00064}\mbox{\hyperlink{ida__disk_8c_a185d45fae176d8227b7159858cece609}{00064}} \textcolor{keyword}{static}  d\_strategy\_t    \mbox{\hyperlink{ida__disk_8c_a185d45fae176d8227b7159858cece609}{idad\_strategy}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00065}\mbox{\hyperlink{ida__disk_8c_aef614818621223c562de38cfb9c6590a}{00065}} \textcolor{keyword}{static}  dumper\_t        \mbox{\hyperlink{ida__disk_8c_aef614818621223c562de38cfb9c6590a}{idad\_dump}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00066}00066 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00067}\mbox{\hyperlink{ida__disk_8c_a834d17933eab1933009145a5a5471bb8}{00067}} \textcolor{keyword}{static} devclass\_t       \mbox{\hyperlink{ida__disk_8c_a834d17933eab1933009145a5a5471bb8}{idad\_devclass}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00069}\mbox{\hyperlink{ida__disk_8c_a853fd71eb7d4aba4c5c1c6902594f491}{00069}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{ida__disk_8c_a853fd71eb7d4aba4c5c1c6902594f491}{idad\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00070}00070         DEVMETHOD(device\_probe,         \mbox{\hyperlink{ida__disk_8c_ab769b07cb5feb39515da8ddcaf3764c3}{idad\_probe}}),}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00071}00071         DEVMETHOD(device\_attach,        \mbox{\hyperlink{ida__disk_8c_a8e56080175288f4482992267f9262bb2}{idad\_attach}}),}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00072}00072         DEVMETHOD(device\_detach,        \mbox{\hyperlink{ida__disk_8c_a3e3cd45a9bbbd67019baee319c965b59}{idad\_detach}}),}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00073}00073         \{ 0, 0 \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00074}00074 \};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00076}\mbox{\hyperlink{ida__disk_8c_a4fcc004f8c823660960a03d132a41d23}{00076}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{ida__disk_8c_a4fcc004f8c823660960a03d132a41d23}{idad\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00077}00077         \textcolor{stringliteral}{"{}idad"{}},}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00078}00078         \mbox{\hyperlink{ida__disk_8c_a853fd71eb7d4aba4c5c1c6902594f491}{idad\_methods}},}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00079}00079         \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structidad__softc}{idad\_softc}})}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00080}00080 \};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00081}00081 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00082}\mbox{\hyperlink{ida__disk_8c_ae495f3f443bc66e75c60dd425b344178}{00082}} \mbox{\hyperlink{ida__disk_8c_ae495f3f443bc66e75c60dd425b344178}{DRIVER\_MODULE}}(idad, ida, \mbox{\hyperlink{ida__disk_8c_a4fcc004f8c823660960a03d132a41d23}{idad\_driver}}, \mbox{\hyperlink{ida__disk_8c_a834d17933eab1933009145a5a5471bb8}{idad\_devclass}}, 0, 0);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00084}00084 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00085}00085 \textcolor{comment}{ * Read/write routine for a buffer.  Finds the proper unit, range checks}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00086}00086 \textcolor{comment}{ * arguments, and schedules the transfer.  Does not wait for the transfer}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00087}00087 \textcolor{comment}{ * to complete.  Multi-\/page transfers are supported.  All I/O requests must}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00088}00088 \textcolor{comment}{ * be a multiple of a sector in length.}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00089}00089 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00090}00090 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00091}\mbox{\hyperlink{ida__disk_8c_a198895624c25951c881afd90e1742d74}{00091}} \mbox{\hyperlink{ida__disk_8c_a185d45fae176d8227b7159858cece609}{idad\_strategy}}(\textcolor{keyword}{struct} bio *bp)}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00092}00092 \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00093}00093         \textcolor{keyword}{struct }\mbox{\hyperlink{structidad__softc}{idad\_softc}} *drv;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00095}00095         drv = bp-\/>bio\_disk-\/>d\_drv1;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00096}00096         \textcolor{keywordflow}{if} (drv == NULL) \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00097}00097                 bp-\/>bio\_error = EINVAL;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00098}00098                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00099}00099         \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00100}00100 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00101}00101         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00102}00102 \textcolor{comment}{         * software write protect check}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00103}00103 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00104}00104         \textcolor{keywordflow}{if} (drv-\/>\mbox{\hyperlink{structidad__softc_a1ccfb4fa1aba7778e626cdd464daeea3}{flags}} \& \mbox{\hyperlink{idavar_8h_a6feeccb7506562fc8c50c355a5ff67e6}{DRV\_WRITEPROT}} \&\& (bp-\/>bio\_cmd == BIO\_WRITE)) \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00105}00105                 bp-\/>bio\_error = EROFS;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00106}00106                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00107}00107         \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00108}00108 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00109}00109         \textcolor{keywordflow}{if} ((bp-\/>bio\_cmd != BIO\_READ) \&\& (bp-\/>bio\_cmd != BIO\_WRITE)) \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00110}00110                 bp-\/>bio\_error = EOPNOTSUPP;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00111}00111                 \textcolor{keywordflow}{goto} bad;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00112}00112         \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00114}00114         bp-\/>bio\_driver1 = drv;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00115}00115         \mbox{\hyperlink{ida_8c_a94efb487e35ec93fdfb50f60ae4aafd8}{ida\_submit\_buf}}(drv-\/>\mbox{\hyperlink{structidad__softc_aee1f3f7d435424a48548840ae89c1194}{controller}}, bp);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00116}00116         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00118}00118 bad:}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00119}00119         bp-\/>bio\_flags |= BIO\_ERROR;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00120}00120 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00121}00121         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00122}00122 \textcolor{comment}{         * Correctly set the buf to indicate a completed transfer}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00123}00123 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00124}00124         bp-\/>bio\_resid = bp-\/>bio\_bcount;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00125}00125         biodone(bp);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00126}00126         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00127}00127 \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00128}00128 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00129}00129 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00130}\mbox{\hyperlink{ida__disk_8c_a17134a96b7e482cde9951ad6ba10d964}{00130}} \mbox{\hyperlink{ida__disk_8c_aef614818621223c562de38cfb9c6590a}{idad\_dump}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{void} *\textcolor{keyword}{virtual}, vm\_offset\_t physical, off\_t offset, \textcolor{keywordtype}{size\_t} length)}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00131}00131 \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00133}00133         \textcolor{keyword}{struct }\mbox{\hyperlink{structidad__softc}{idad\_softc}} *drv;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00134}00134         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00135}00135         \textcolor{keyword}{struct }disk *dp;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00136}00136 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00137}00137         dp = arg;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00138}00138         drv = dp-\/>d\_drv1;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00139}00139         \textcolor{keywordflow}{if} (drv == NULL)}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00140}00140                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00142}00142         drv-\/>\mbox{\hyperlink{structidad__softc_aee1f3f7d435424a48548840ae89c1194}{controller}}-\/>\mbox{\hyperlink{structida__softc_a40496d7e7a31375fc3d8708d856e9a9e}{flags}} \&= \string~IDA\_INTERRUPTS;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00144}00144         \textcolor{keywordflow}{if} (length > 0) \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00145}00145                 error = \mbox{\hyperlink{ida_8c_a38728cba9005a0075ef9780c3444134e}{ida\_command}}(drv-\/>\mbox{\hyperlink{structidad__softc_aee1f3f7d435424a48548840ae89c1194}{controller}}, \mbox{\hyperlink{idareg_8h_a7391deb9c3a262ded3e186e94eb884e2}{CMD\_WRITE}}, \textcolor{keyword}{virtual},}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00146}00146                     length, drv-\/>\mbox{\hyperlink{structidad__softc_a9eef2c8e512d21dff585a59370f7c26c}{drive}}, offset / DEV\_BSIZE, \mbox{\hyperlink{idavar_8h_af0ffd4860b0c87320e47e2d490003194}{DMA\_DATA\_OUT}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00147}00147         \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00148}00148         drv-\/>\mbox{\hyperlink{structidad__softc_aee1f3f7d435424a48548840ae89c1194}{controller}}-\/>\mbox{\hyperlink{structida__softc_a40496d7e7a31375fc3d8708d856e9a9e}{flags}} |= \mbox{\hyperlink{idavar_8h_af3e623e2c2b78dbedd61396474573459}{IDA\_INTERRUPTS}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00149}00149         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00150}00150 \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00152}00152 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00153}\mbox{\hyperlink{ida__disk_8c_a844e460143dbbef33bd4311aff60d27a}{00153}} \mbox{\hyperlink{ida__disk_8c_a844e460143dbbef33bd4311aff60d27a}{idad\_intr}}(\textcolor{keyword}{struct} bio *bp)}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00154}00154 \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00155}00155 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00156}00156         \textcolor{keywordflow}{if} (bp-\/>bio\_flags \& BIO\_ERROR)}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00157}00157                 bp-\/>bio\_error = EIO;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00158}00158         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00159}00159                 bp-\/>bio\_resid = 0;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00161}00161         biodone(bp);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00162}00162 \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00163}00163 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00164}00164 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00165}\mbox{\hyperlink{ida__disk_8c_ab769b07cb5feb39515da8ddcaf3764c3}{00165}} \mbox{\hyperlink{ida__disk_8c_ab769b07cb5feb39515da8ddcaf3764c3}{idad\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00166}00166 \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00168}00168         device\_set\_desc(dev, \textcolor{stringliteral}{"{}Compaq Logical Drive"{}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00169}00169         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00170}00170 \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00172}00172 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00173}\mbox{\hyperlink{ida__disk_8c_a8e56080175288f4482992267f9262bb2}{00173}} \mbox{\hyperlink{ida__disk_8c_a8e56080175288f4482992267f9262bb2}{idad\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00174}00174 \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00175}00175         \textcolor{keyword}{struct }\mbox{\hyperlink{structida__drive__info}{ida\_drive\_info}} dinfo;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00176}00176         \textcolor{keyword}{struct }\mbox{\hyperlink{structidad__softc}{idad\_softc}} *drv;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00177}00177         device\_t parent;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00178}00178         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00180}00180         drv = (\textcolor{keyword}{struct }\mbox{\hyperlink{structidad__softc}{idad\_softc}} *)device\_get\_softc(\mbox{\hyperlink{structidad__softc_a0273780e263a04cf8e376eab6ab68694}{dev}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00181}00181         parent = device\_get\_parent(\mbox{\hyperlink{structidad__softc_a0273780e263a04cf8e376eab6ab68694}{dev}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00182}00182         drv-\/>\mbox{\hyperlink{structidad__softc_a0273780e263a04cf8e376eab6ab68694}{dev}} = \mbox{\hyperlink{structidad__softc_a0273780e263a04cf8e376eab6ab68694}{dev}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00183}00183         drv-\/>\mbox{\hyperlink{structidad__softc_aee1f3f7d435424a48548840ae89c1194}{controller}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structida__softc}{ida\_softc}} *)device\_get\_softc(parent);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00184}00184         drv-\/>\mbox{\hyperlink{structidad__softc_acdaf5e2e9fc080a912c6638f4ab54dc9}{unit}} = device\_get\_unit(\mbox{\hyperlink{structida__softc_a93c7e7f8dc663b4df75dec7934f8fe53}{dev}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00185}00185         drv-\/>\mbox{\hyperlink{structidad__softc_a9eef2c8e512d21dff585a59370f7c26c}{drive}} = (intptr\_t)device\_get\_ivars(\mbox{\hyperlink{structida__softc_a93c7e7f8dc663b4df75dec7934f8fe53}{dev}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00186}00186 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00187}00187         mtx\_lock(\&drv-\/>\mbox{\hyperlink{structidad__softc_aee1f3f7d435424a48548840ae89c1194}{controller}}-\/>\mbox{\hyperlink{structida__softc_a4588f3f3619bb8c1dcd5d3c69f0e5374}{lock}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00188}00188         error = \mbox{\hyperlink{ida_8c_a38728cba9005a0075ef9780c3444134e}{ida\_command}}(drv-\/>\mbox{\hyperlink{structidad__softc_aee1f3f7d435424a48548840ae89c1194}{controller}}, \mbox{\hyperlink{idareg_8h_aeb469cd582df629ba77aa9b2c7f21b42}{CMD\_GET\_LOG\_DRV\_INFO}},}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00189}00189             \&dinfo, \textcolor{keyword}{sizeof}(dinfo), drv-\/>\mbox{\hyperlink{structidad__softc_a9eef2c8e512d21dff585a59370f7c26c}{drive}}, 0, \mbox{\hyperlink{idavar_8h_aaa7ccf7c348f7621e1b99f2f78a5125c}{DMA\_DATA\_IN}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00190}00190         mtx\_unlock(\&drv-\/>\mbox{\hyperlink{structidad__softc_aee1f3f7d435424a48548840ae89c1194}{controller}}-\/>\mbox{\hyperlink{structida__softc_a4588f3f3619bb8c1dcd5d3c69f0e5374}{lock}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00191}00191         \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00192}00192                 device\_printf(\mbox{\hyperlink{structida__softc_a93c7e7f8dc663b4df75dec7934f8fe53}{dev}}, \textcolor{stringliteral}{"{}CMD\_GET\_LOG\_DRV\_INFO failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00193}00193                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00194}00194         \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00195}00195 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00196}00196         drv-\/>\mbox{\hyperlink{structidad__softc_a79034841d017e6fd115ffd99999ed28a}{cylinders}} = dinfo.\mbox{\hyperlink{structida__drive__info_a1edf1548fea7e622bcbebe53d1c397e3}{dp}}.\mbox{\hyperlink{structida__drive__param_ab672b69d28ae6596c70640d3faa103dd}{ncylinders}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00197}00197         drv-\/>\mbox{\hyperlink{structidad__softc_ad6ded61406eda58f964ad99cdc5a2f5a}{heads}} = dinfo.\mbox{\hyperlink{structida__drive__info_a1edf1548fea7e622bcbebe53d1c397e3}{dp}}.\mbox{\hyperlink{structida__drive__param_ac00f1cd58de192b6480760c984d60610}{nheads}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00198}00198         drv-\/>\mbox{\hyperlink{structidad__softc_a87317544802f16d8744a78873978adf5}{sectors}} = dinfo.\mbox{\hyperlink{structida__drive__info_a1edf1548fea7e622bcbebe53d1c397e3}{dp}}.\mbox{\hyperlink{structida__drive__param_a380dd79a526a03c1450ff3601d7965d4}{nsectors}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00199}00199         drv-\/>\mbox{\hyperlink{structidad__softc_a610ffb2db151cc98e437d702d9b97bf0}{secsize}} = dinfo.\mbox{\hyperlink{structida__drive__info_a4c8e4e17c326ea42cb5109be454bb8b4}{secsize}} == 0 ? 512 : dinfo.\mbox{\hyperlink{structida__drive__info_a4c8e4e17c326ea42cb5109be454bb8b4}{secsize}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00200}00200         drv-\/>\mbox{\hyperlink{structidad__softc_af5ae078c4e04fe679ee55b29558f783a}{secperunit}} = dinfo.\mbox{\hyperlink{structida__drive__info_a95f082d0ffe15d4bb957d6bcff9a3ba6}{secperunit}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00201}00201 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00202}00202         \textcolor{comment}{/* XXX}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00203}00203 \textcolor{comment}{         * other initialization}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00204}00204 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00205}00205         device\_printf(\mbox{\hyperlink{structida__softc_a93c7e7f8dc663b4df75dec7934f8fe53}{dev}}, \textcolor{stringliteral}{"{}\%uMB (\%u sectors), blocksize=\%d\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00206}00206             drv-\/>\mbox{\hyperlink{structidad__softc_af5ae078c4e04fe679ee55b29558f783a}{secperunit}} / ((1024 * 1024) / drv-\/>\mbox{\hyperlink{structidad__softc_a610ffb2db151cc98e437d702d9b97bf0}{secsize}}),}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00207}00207             drv-\/>\mbox{\hyperlink{structidad__softc_af5ae078c4e04fe679ee55b29558f783a}{secperunit}}, drv-\/>\mbox{\hyperlink{structidad__softc_a610ffb2db151cc98e437d702d9b97bf0}{secsize}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00209}00209         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}} = disk\_alloc();}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00210}00210         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_strategy = \mbox{\hyperlink{ida__disk_8c_a185d45fae176d8227b7159858cece609}{idad\_strategy}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00211}00211         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_name = \textcolor{stringliteral}{"{}idad"{}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00212}00212         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_dump = \mbox{\hyperlink{ida__disk_8c_aef614818621223c562de38cfb9c6590a}{idad\_dump}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00213}00213         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_sectorsize = drv-\/>\mbox{\hyperlink{structidad__softc_a610ffb2db151cc98e437d702d9b97bf0}{secsize}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00214}00214         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_mediasize = (off\_t)drv-\/>\mbox{\hyperlink{structidad__softc_af5ae078c4e04fe679ee55b29558f783a}{secperunit}} * drv-\/>\mbox{\hyperlink{structidad__softc_a610ffb2db151cc98e437d702d9b97bf0}{secsize}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00215}00215         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_fwsectors = drv-\/>\mbox{\hyperlink{structidad__softc_a87317544802f16d8744a78873978adf5}{sectors}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00216}00216         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_fwheads = drv-\/>\mbox{\hyperlink{structidad__softc_ad6ded61406eda58f964ad99cdc5a2f5a}{heads}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00217}00217         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_drv1 = drv;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00218}00218         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_maxsize = DFLTPHYS;            \textcolor{comment}{/* XXX guess? */}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00219}00219         drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}-\/>d\_unit = drv-\/>\mbox{\hyperlink{structidad__softc_acdaf5e2e9fc080a912c6638f4ab54dc9}{unit}};}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00220}00220         disk\_create(drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}}, DISK\_VERSION);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00222}00222         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00223}00223 \}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00224}00224 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00225}00225 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00226}\mbox{\hyperlink{ida__disk_8c_a3e3cd45a9bbbd67019baee319c965b59}{00226}} \mbox{\hyperlink{ida__disk_8c_a3e3cd45a9bbbd67019baee319c965b59}{idad\_detach}}(device\_t \mbox{\hyperlink{structida__softc_a93c7e7f8dc663b4df75dec7934f8fe53}{dev}})}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00227}00227 \{}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00228}00228         \textcolor{keyword}{struct }\mbox{\hyperlink{structidad__softc}{idad\_softc}} *drv;}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00229}00229 }
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00230}00230         drv = (\textcolor{keyword}{struct }\mbox{\hyperlink{structidad__softc}{idad\_softc}} *)device\_get\_softc(\mbox{\hyperlink{structidad__softc_a0273780e263a04cf8e376eab6ab68694}{dev}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00231}00231         disk\_destroy(drv-\/>\mbox{\hyperlink{structidad__softc_a68fad4e62052d9ba361e1f6b35ed0f9c}{disk}});}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00232}00232         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ida__disk_8c_source_l00233}00233 \}}

\end{DoxyCode}
