\hypertarget{scsi__pt_8c_source}{}\doxysection{scsi\+\_\+pt.\+c}
\label{scsi__pt_8c_source}\index{cam/scsi/scsi\_pt.c@{cam/scsi/scsi\_pt.c}}
\mbox{\hyperlink{scsi__pt_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00004}00004 \textcolor{comment}{ * Implementation of SCSI Processor Target Peripheral driver for CAM.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00005}00005 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 1998 Justin T. Gibbs.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00007}00007 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00008}00008 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00009}00009 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00010}00010 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00011}00011 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00012}00012 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions, and the following disclaimer,}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00014}00014 \textcolor{comment}{ *    without modification, immediately at the beginning of the file.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00015}00015 \textcolor{comment}{ * 2. The name of the author may not be used to endorse or promote products}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00016}00016 \textcolor{comment}{ *    derived from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00017}00017 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00018}00018 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00019}00019 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00020}00020 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00021}00021 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00022}00022 \textcolor{comment}{ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00023}00023 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00024}00024 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00025}00025 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00026}00026 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00027}00027 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00028}00028 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00029}00029 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00030}00030 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00032}\mbox{\hyperlink{scsi__pt_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00032}} \mbox{\hyperlink{scsi__pt_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00033}00033 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/devicestat.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/ptio.h>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00044}00044 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam_8h}{cam/cam.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__ccb_8h}{cam/cam\_ccb.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__periph_8h}{cam/cam\_periph.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__xpt__periph_8h}{cam/cam\_xpt\_periph.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__debug_8h}{cam/cam\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00050}00050 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__all_8h}{cam/scsi/scsi\_all.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__message_8h}{cam/scsi/scsi\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__pt_8h}{cam/scsi/scsi\_pt.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00055}00055 \textcolor{preprocessor}{\#include "{}opt\_pt.h"{}}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00056}00056 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00057}\mbox{\hyperlink{scsi__pt_8c_a72645ae190eab5bdf7d153c1ef38f238}{00057}} \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00058}\mbox{\hyperlink{scsi__pt_8c_a72645ae190eab5bdf7d153c1ef38f238a53dec5016fde19771ab326a7853d5c67}{00058}}         \mbox{\hyperlink{scsi__pt_8c_a72645ae190eab5bdf7d153c1ef38f238a53dec5016fde19771ab326a7853d5c67}{PT\_STATE\_PROBE}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00059}00059         \mbox{\hyperlink{scsi__pt_8c_a72645ae190eab5bdf7d153c1ef38f238aab7f9066799b33a68afcace833fdc845}{PT\_STATE\_NORMAL}}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00060}\mbox{\hyperlink{scsi__pt_8c_a72645ae190eab5bdf7d153c1ef38f238aab7f9066799b33a68afcace833fdc845}{00060}} \} \mbox{\hyperlink{scsi__pt_8c_a72645ae190eab5bdf7d153c1ef38f238}{pt\_state}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00061}00061 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00062}\mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15}{00062}} \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00063}\mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a0853e60097d7bf147a1d14ffabfb4a32}{00063}}         \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a0853e60097d7bf147a1d14ffabfb4a32}{PT\_FLAG\_NONE}}                = 0x00,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00064}\mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a2fe70fadf92d359997f3e00b73301a04}{00064}}         \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a2fe70fadf92d359997f3e00b73301a04}{PT\_FLAG\_OPEN}}                = 0x01,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00065}\mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a0e5a6c2e166d2ded22f503feb2a83ae7}{00065}}         \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a0e5a6c2e166d2ded22f503feb2a83ae7}{PT\_FLAG\_DEVICE\_INVALID}}    = 0x02,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00066}00066         \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a94e7cbbea7ecbd5dad004dd9d30b1091}{PT\_FLAG\_RETRY\_UA}}        = 0x04}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00067}\mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a94e7cbbea7ecbd5dad004dd9d30b1091}{00067}} \} \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15}{pt\_flags}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00068}00068 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00069}\mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aac}{00069}} \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00070}\mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca87c99dbc46ee97ff28cbbd62531ec1a6}{00070}}         \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca87c99dbc46ee97ff28cbbd62531ec1a6}{PT\_CCB\_BUFFER\_IO}}        = 0x01,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00071}\mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca527b879e9a079dd6fa27901299d59011}{00071}}         \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca527b879e9a079dd6fa27901299d59011}{PT\_CCB\_RETRY\_UA}}          = 0x04,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00072}00072         \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aacaeb92225c2d63c25d6a0741ea00312eba}{PT\_CCB\_BUFFER\_IO\_UA}}  = \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca87c99dbc46ee97ff28cbbd62531ec1a6}{PT\_CCB\_BUFFER\_IO}}|\mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca527b879e9a079dd6fa27901299d59011}{PT\_CCB\_RETRY\_UA}}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00073}\mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aacaeb92225c2d63c25d6a0741ea00312eba}{00073}} \} \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aac}{pt\_ccb\_state}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00075}00075 \textcolor{comment}{/* Offsets into our private area for storing information */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00076}\mbox{\hyperlink{scsi__pt_8c_a06847d962f339e20fc5fbd8549006344}{00076}} \textcolor{preprocessor}{\#define ccb\_state       ppriv\_field0}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00077}\mbox{\hyperlink{scsi__pt_8c_aa8cbccb0f9744ba58c6df5ddc2e8b35a}{00077}} \textcolor{preprocessor}{\#define ccb\_bp          ppriv\_ptr1}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00079}\mbox{\hyperlink{structpt__softc}{00079}} \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00080}\mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{00080}}         \textcolor{keyword}{struct   }bio\_queue\_head \mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{bio\_queue}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00081}\mbox{\hyperlink{structpt__softc_aaf2d159e0edbefeaac3403c8cd1578ca}{00081}}         \textcolor{keyword}{struct   }devstat *\mbox{\hyperlink{structpt__softc_aaf2d159e0edbefeaac3403c8cd1578ca}{device\_stats}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00082}00082         \mbox{\hyperlink{cam__queue_8h_ad2c903b0c9101edfb41bab23a66f13b2}{LIST\_HEAD}}(, \mbox{\hyperlink{structccb__hdr}{ccb\_hdr}}) pending\_ccbs;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00083}00083         \mbox{\hyperlink{scsi__pt_8c_a72645ae190eab5bdf7d153c1ef38f238}{pt\_state}} state;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00084}00084         \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15}{pt\_flags}} flags; }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00085}00085         \textcolor{keywordtype}{int}      io\_timeout;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00086}00086         \textcolor{keyword}{struct }cdev *dev;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00087}00087 \};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00089}\mbox{\hyperlink{scsi__pt_8c_aea116981be7b10e2ec1354141387eafc}{00089}} \textcolor{keyword}{static}  d\_open\_t        \mbox{\hyperlink{scsi__pt_8c_aea116981be7b10e2ec1354141387eafc}{ptopen}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00090}\mbox{\hyperlink{scsi__pt_8c_a6d3487c630f07ae2911375460ddef2c2}{00090}} \textcolor{keyword}{static}  d\_close\_t       \mbox{\hyperlink{scsi__pt_8c_a6d3487c630f07ae2911375460ddef2c2}{ptclose}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00091}\mbox{\hyperlink{scsi__pt_8c_acf603cab1346369b3a1b6d6466c63c62}{00091}} \textcolor{keyword}{static}  d\_strategy\_t    \mbox{\hyperlink{scsi__pt_8c_acf603cab1346369b3a1b6d6466c63c62}{ptstrategy}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00092}\mbox{\hyperlink{scsi__pt_8c_a84c04c53063468ba173a8885cbbb8dfe}{00092}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_ae8635482322b2513ab2f662535250ac0}{periph\_init\_t}}      \mbox{\hyperlink{scsi__pt_8c_a84c04c53063468ba173a8885cbbb8dfe}{ptinit}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00093}00093 \textcolor{keyword}{static}  \textcolor{keywordtype}{void}            \mbox{\hyperlink{scsi__pt_8c_af1d70440ac54785a42e23b199bff3fc5}{ptasync}}(\textcolor{keywordtype}{void} *callback\_arg, u\_int32\_t code,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00094}00094                                 \textcolor{keyword}{struct} \mbox{\hyperlink{structcam__path}{cam\_path}} *path, \textcolor{keywordtype}{void} *arg);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00095}\mbox{\hyperlink{scsi__pt_8c_a36a886e53bf79f984f68cc22f0a03da0}{00095}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_a0134746116b0c19d248d1342a16aab04}{periph\_ctor\_t}}      \mbox{\hyperlink{scsi__pt_8c_a36a886e53bf79f984f68cc22f0a03da0}{ptctor}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00096}\mbox{\hyperlink{scsi__pt_8c_a816d8a78bd57b0f3497291f860febb64}{00096}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_a14602bb3ac9272ea2209d63f1e618fca}{periph\_oninv\_t}}    \mbox{\hyperlink{scsi__pt_8c_a816d8a78bd57b0f3497291f860febb64}{ptoninvalidate}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00097}\mbox{\hyperlink{scsi__pt_8c_ae481e0093e599e5130dc766d3e151a2e}{00097}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_a8d863e438ef46ba796fbf3e77340b3e3}{periph\_dtor\_t}}      \mbox{\hyperlink{scsi__pt_8c_ae481e0093e599e5130dc766d3e151a2e}{ptdtor}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00098}\mbox{\hyperlink{scsi__pt_8c_a81cf1a4c3affec145261299002e5a950}{00098}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_ab04cb4cf3fd8f8a44ce312952af7cb7f}{periph\_start\_t}}    \mbox{\hyperlink{scsi__pt_8c_a81cf1a4c3affec145261299002e5a950}{ptstart}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00099}00099 \textcolor{keyword}{static}  \textcolor{keywordtype}{void}            \mbox{\hyperlink{scsi__pt_8c_a558c33c9994ff8cd6e80089422923a97}{ptdone}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00100}00100                                \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *done\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00101}\mbox{\hyperlink{scsi__pt_8c_aae1d899038dd0b21a3e495c7017d6094}{00101}} \textcolor{keyword}{static}  d\_ioctl\_t       \mbox{\hyperlink{scsi__pt_8c_aae1d899038dd0b21a3e495c7017d6094}{ptioctl}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00102}00102 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__pt_8c_a4fb636d42a1011f7ad84dfdd3de527d3}{pterror}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{unionccb}{ccb}}, u\_int32\_t \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316}{cam\_flags}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00103}00103                                 u\_int32\_t sense\_flags);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00105}00105 \textcolor{keywordtype}{void}    \mbox{\hyperlink{scsi__pt_8c_a44f5b13064c260742de62218fa72726b}{scsi\_send\_receive}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio, u\_int32\_t retries,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00106}00106                           \textcolor{keywordtype}{void} (*cbfcnp)(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *),}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00107}00107                           u\_int tag\_action, \textcolor{keywordtype}{int} readop, u\_int byte2,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00108}00108                           u\_int32\_t xfer\_len, u\_int8\_t *data\_ptr,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00109}00109                           u\_int8\_t sense\_len, u\_int32\_t timeout);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00111}\mbox{\hyperlink{scsi__pt_8c_a76be9ff99751711b91ccf872ef2320e8}{00111}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structperiph__driver}{periph\_driver}} \mbox{\hyperlink{scsi__pt_8c_a76be9ff99751711b91ccf872ef2320e8}{ptdriver}} =}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00112}00112 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00113}00113         \mbox{\hyperlink{scsi__pt_8c_a84c04c53063468ba173a8885cbbb8dfe}{ptinit}}, \textcolor{stringliteral}{"{}pt"{}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00114}00114         TAILQ\_HEAD\_INITIALIZER(\mbox{\hyperlink{scsi__pt_8c_a76be9ff99751711b91ccf872ef2320e8}{ptdriver}}.units), \textcolor{comment}{/* generation */} 0}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00115}00115 \};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00116}00116 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00117}\mbox{\hyperlink{scsi__pt_8c_acb269f37219b85c7bddb5ba5e288b00c}{00117}} \mbox{\hyperlink{scsi__pt_8c_acb269f37219b85c7bddb5ba5e288b00c}{PERIPHDRIVER\_DECLARE}}(pt, \mbox{\hyperlink{scsi__pt_8c_a76be9ff99751711b91ccf872ef2320e8}{ptdriver}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00118}00118 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00119}\mbox{\hyperlink{scsi__pt_8c_ac18d60dfb5f7d96181d5391b3ed42888}{00119}} \textcolor{keyword}{static} \textcolor{keyword}{struct }cdevsw \mbox{\hyperlink{scsi__pt_8c_ac18d60dfb5f7d96181d5391b3ed42888}{pt\_cdevsw}} = \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00120}00120         .d\_version =    D\_VERSION,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00121}00121         .d\_flags =      0,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00122}00122         .d\_open =       \mbox{\hyperlink{scsi__pt_8c_aea116981be7b10e2ec1354141387eafc}{ptopen}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00123}00123         .d\_close =      \mbox{\hyperlink{scsi__pt_8c_a6d3487c630f07ae2911375460ddef2c2}{ptclose}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00124}00124         .d\_read =       physread,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00125}00125         .d\_write =      physwrite,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00126}00126         .d\_ioctl =      \mbox{\hyperlink{scsi__pt_8c_aae1d899038dd0b21a3e495c7017d6094}{ptioctl}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00127}00127         .d\_strategy =   \mbox{\hyperlink{scsi__pt_8c_acf603cab1346369b3a1b6d6466c63c62}{ptstrategy}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00128}00128         .d\_name =       \textcolor{stringliteral}{"{}pt"{}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00129}00129 \};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00131}00131 \textcolor{preprocessor}{\#ifndef SCSI\_PT\_DEFAULT\_TIMEOUT}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00132}\mbox{\hyperlink{scsi__pt_8c_ac4a578cbbde136252b5fc20c9d78e12d}{00132}} \textcolor{preprocessor}{\#define SCSI\_PT\_DEFAULT\_TIMEOUT         60}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00133}00133 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00135}00135 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00136}\mbox{\hyperlink{scsi__pt_8c_ab87d2bed048dfb256344af9eebd565e7}{00136}} \mbox{\hyperlink{scsi__pt_8c_aea116981be7b10e2ec1354141387eafc}{ptopen}}(\textcolor{keyword}{struct} cdev *dev, \textcolor{keywordtype}{int} flags, \textcolor{keywordtype}{int} fmt, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00137}00137 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00138}00138         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00139}00139         \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00140}00140         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00141}00141 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00142}00142         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00143}00143         if (\mbox{\hyperlink{cam__periph_8c_a5b3dbda06d83cc62f5ba1be9622efa4b}{cam\_periph\_acquire}}(periph) != 0)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00144}00144                 \textcolor{keywordflow}{return} (ENXIO); }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00146}00146         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00148}00148         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00149}00149         \textcolor{keywordflow}{if} (softc-\/>flags \& \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a0e5a6c2e166d2ded22f503feb2a83ae7}{PT\_FLAG\_DEVICE\_INVALID}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00150}00150                 \mbox{\hyperlink{cam__periph_8c_a06741cfe8f484a9dad6f9607a233908c}{cam\_periph\_release\_locked}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00151}00151                 \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00152}00152                 \textcolor{keywordflow}{return}(ENXIO);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00153}00153         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00155}00155         \textcolor{keywordflow}{if} ((softc-\/>flags \& \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a2fe70fadf92d359997f3e00b73301a04}{PT\_FLAG\_OPEN}}) == 0)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00156}00156                 softc-\/>flags |= \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a2fe70fadf92d359997f3e00b73301a04}{PT\_FLAG\_OPEN}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00157}00157         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00158}00158                 error = EBUSY;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00159}00159                 \mbox{\hyperlink{cam__periph_8c_a7b495eee22da0818e6aec8aa176843b7}{cam\_periph\_release}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00160}00160         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00162}00162         \mbox{\hyperlink{cam__debug_8h_ae79c3c2e46f2d9fca388152c3ad38ef0}{CAM\_DEBUG}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}}, \mbox{\hyperlink{cam__debug_8h_ae330349135d2d26f45cdf3cc67b2b369a079361ad1b93ba7c851ca5ca4762ecd1}{CAM\_DEBUG\_TRACE}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00163}00163             (\textcolor{stringliteral}{"{}ptopen: dev=\%s\(\backslash\)n"{}}, devtoname(dev)));}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00164}00164 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00165}00165         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00166}00166         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00167}00167 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00168}00168 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00169}00169 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00170}\mbox{\hyperlink{scsi__pt_8c_aa1297648ec183861617a1df9c0a7d20d}{00170}} \mbox{\hyperlink{scsi__pt_8c_a6d3487c630f07ae2911375460ddef2c2}{ptclose}}(\textcolor{keyword}{struct} cdev *dev, \textcolor{keywordtype}{int} flag, \textcolor{keywordtype}{int} fmt, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00171}00171 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00172}00172         \textcolor{keyword}{struct  }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00173}00173         \textcolor{keyword}{struct  }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00175}00175         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00176}00176         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = (\textcolor{keyword}{struct} \mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00178}00178         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00180}00180         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}}-\/>flags \&= \string~PT\_FLAG\_OPEN;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00181}00181         \mbox{\hyperlink{cam__periph_8c_a06741cfe8f484a9dad6f9607a233908c}{cam\_periph\_release\_locked}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00182}00182         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00183}00183         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00184}00184 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00186}00186 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00187}00187 \textcolor{comment}{ * Actually translate the requested transfer into one the physical driver}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00188}00188 \textcolor{comment}{ * can understand.  The transfer is described by a buf and will include}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00189}00189 \textcolor{comment}{ * only one physical transfer.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00190}00190 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00191}00191 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00192}\mbox{\hyperlink{scsi__pt_8c_aab5e812baebe9237861a05d0b869517b}{00192}} \mbox{\hyperlink{scsi__pt_8c_acf603cab1346369b3a1b6d6466c63c62}{ptstrategy}}(\textcolor{keyword}{struct} bio *bp)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00193}00193 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00194}00194         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00195}00195         \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00197}00197         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)bp-\/>bio\_dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00198}00198         bp-\/>bio\_resid = bp-\/>bio\_bcount;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00199}00199         if (periph == NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00200}00200                 biofinish(bp, NULL, ENXIO);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00201}00201                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00202}00202         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00203}00203         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00204}00204         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00206}00206         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00207}00207 \textcolor{comment}{         * If the device has been made invalid, error out}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00208}00208 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00209}00209         if ((softc-\/>flags \& \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a0e5a6c2e166d2ded22f503feb2a83ae7}{PT\_FLAG\_DEVICE\_INVALID}})) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00210}00210                 \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00211}00211                 biofinish(bp, NULL, ENXIO);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00212}00212                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00213}00213         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00215}00215         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00216}00216 \textcolor{comment}{         * Place it in the queue of disk activities for this disk}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00217}00217 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00218}00218         bioq\_insert\_tail(\&softc-\/>\mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{bio\_queue}}, bp);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00220}00220         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00221}00221 \textcolor{comment}{         * Schedule ourselves for performing the work.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00222}00222 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00223}00223         \mbox{\hyperlink{cam__xpt_8c_a26e646d0732b4acab4667d28f24d026e}{xpt\_schedule}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00224}00224         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00226}00226         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00227}00227 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00229}00229 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00230}00230 \mbox{\hyperlink{scsi__pt_8c_a84c04c53063468ba173a8885cbbb8dfe}{ptinit}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00231}00231 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00232}00232         \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3}{cam\_status}} status;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00234}00234         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00235}00235 \textcolor{comment}{         * Install a global async callback.  This callback will}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00236}00236 \textcolor{comment}{         * receive async callbacks like "{}new device found"{}.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00237}00237 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00238}00238         status = \mbox{\hyperlink{cam__xpt_8c_a8307586c12fb4774768a25a1fa4e6388}{xpt\_register\_async}}(\mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0a04183843e65dd16d378d105270a6debd}{AC\_FOUND\_DEVICE}}, \mbox{\hyperlink{scsi__pt_8c_af1d70440ac54785a42e23b199bff3fc5}{ptasync}}, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00239}00239 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00240}00240         \textcolor{keywordflow}{if} (status != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00241}00241                 printf(\textcolor{stringliteral}{"{}pt: Failed to attach master async callback "{}}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00242}00242                        \textcolor{stringliteral}{"{}due to status 0x\%x!\(\backslash\)n"{}}, status);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00243}00243         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00244}00244 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00245}00245 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00246}00246 \textcolor{keyword}{static} \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3}{cam\_status}}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00247}\mbox{\hyperlink{scsi__pt_8c_a1386a576f062eb8f5baa8ded9f6f6300}{00247}} \mbox{\hyperlink{scsi__pt_8c_a36a886e53bf79f984f68cc22f0a03da0}{ptctor}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00248}00248 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00249}00249         \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00250}00250         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *cgd;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00251}00251         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__pathinq}{ccb\_pathinq}} cpi;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00252}00252         \textcolor{keyword}{struct }make\_dev\_args args;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00253}00253         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00254}00254 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00255}00255         cgd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *)arg;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00256}00256         \textcolor{keywordflow}{if} (cgd == NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00257}00257                 printf(\textcolor{stringliteral}{"{}ptregister: no getdev CCB, can't register device\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00258}00258                 \textcolor{keywordflow}{return}(\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a7c519e8cfabb5fd17f4d518c82c17692}{CAM\_REQ\_CMP\_ERR}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00259}00259         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00260}00260 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00261}00261         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *)malloc(\textcolor{keyword}{sizeof}(*softc),M\_DEVBUF,M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00263}00263         \textcolor{keywordflow}{if} (softc == NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00264}00264                 printf(\textcolor{stringliteral}{"{}daregister: Unable to probe new device. "{}}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00265}00265                        \textcolor{stringliteral}{"{}Unable to allocate softc\(\backslash\)n"{}});                           }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00266}00266                 \textcolor{keywordflow}{return}(\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a7c519e8cfabb5fd17f4d518c82c17692}{CAM\_REQ\_CMP\_ERR}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00267}00267         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00269}00269         bzero(softc, \textcolor{keyword}{sizeof}(*softc));}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00270}00270         LIST\_INIT(\&softc-\/>pending\_ccbs);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00271}00271         softc-\/>state = \mbox{\hyperlink{scsi__pt_8c_a72645ae190eab5bdf7d153c1ef38f238aab7f9066799b33a68afcace833fdc845}{PT\_STATE\_NORMAL}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00272}00272         bioq\_init(\&softc-\/>\mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{bio\_queue}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00273}00273 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00274}00274         softc-\/>io\_timeout = \mbox{\hyperlink{scsi__pt_8c_ac4a578cbbde136252b5fc20c9d78e12d}{SCSI\_PT\_DEFAULT\_TIMEOUT}} * 1000;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00275}00275 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00276}00276         periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00278}00278         \mbox{\hyperlink{cam__xpt_8h_ae111c3fbe95a53d1bdb2f112d86b929b}{xpt\_path\_inq}}(\&cpi, periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00279}00279 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00280}00280         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00281}00281 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00282}00282         make\_dev\_args\_init(\&args);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00283}00283         args.mda\_devsw = \&\mbox{\hyperlink{scsi__pt_8c_ac18d60dfb5f7d96181d5391b3ed42888}{pt\_cdevsw}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00284}00284         args.mda\_unit = periph-\/>\mbox{\hyperlink{structcam__periph_a2b4a50e233de9e726afe3e7e85e63960}{unit\_number}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00285}00285         args.mda\_uid = UID\_ROOT;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00286}00286         args.mda\_gid = GID\_OPERATOR;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00287}00287         args.mda\_mode = 0600;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00288}00288         args.mda\_si\_drv1 = periph;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00289}00289         error = make\_dev\_s(\&args, \&softc-\/>dev, \textcolor{stringliteral}{"{}\%s\%d"{}}, periph-\/>\mbox{\hyperlink{structcam__periph_a12b5871a0ccca32fa359b1512d5dabad}{periph\_name}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00290}00290             periph-\/>\mbox{\hyperlink{structcam__periph_a2b4a50e233de9e726afe3e7e85e63960}{unit\_number}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00291}00291         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00292}00292                 \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00293}00293                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a7c519e8cfabb5fd17f4d518c82c17692}{CAM\_REQ\_CMP\_ERR}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00294}00294         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00295}00295 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00296}00296         softc-\/>\mbox{\hyperlink{structpt__softc_aaf2d159e0edbefeaac3403c8cd1578ca}{device\_stats}} = devstat\_new\_entry(\textcolor{stringliteral}{"{}pt"{}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00297}00297                           periph-\/>\mbox{\hyperlink{structcam__periph_a2b4a50e233de9e726afe3e7e85e63960}{unit\_number}}, 0,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00298}00298                           DEVSTAT\_NO\_BLOCKSIZE,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00299}00299                           \mbox{\hyperlink{scsi__all_8h_aaf542baf40a444b689af23b271bfbebd}{SID\_TYPE}}(\&cgd-\/>\mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}}) |}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00300}00300                           \mbox{\hyperlink{cam__ccb_8h_ab208430ee4ee01798ab512f38fc0cc7b}{XPORT\_DEVSTAT\_TYPE}}(cpi.\mbox{\hyperlink{structccb__pathinq_aaef7c0420017996140ae4bdede6a8152}{transport}}),}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00301}00301                           DEVSTAT\_PRIORITY\_OTHER);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00302}00302 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00303}00303         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00305}00305         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00306}00306 \textcolor{comment}{         * Add async callbacks for bus reset and}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00307}00307 \textcolor{comment}{         * bus device reset calls.  I don't bother}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00308}00308 \textcolor{comment}{         * checking if this fails as, in most cases,}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00309}00309 \textcolor{comment}{         * the system will function just fine without}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00310}00310 \textcolor{comment}{         * them and the only alternative would be to}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00311}00311 \textcolor{comment}{         * not attach the device on failure.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00312}00312 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00313}00313         \mbox{\hyperlink{cam__xpt_8c_a8307586c12fb4774768a25a1fa4e6388}{xpt\_register\_async}}(\mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0adf2dfbe2cd14380823c3b1e7544021e8}{AC\_SENT\_BDR}} | \mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0a562d924fbe74236d4f5403ef2fdbb94d}{AC\_BUS\_RESET}} | \mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0ac3008f99f93ca1448f9c8705b1653da5}{AC\_LOST\_DEVICE}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00314}00314                            \mbox{\hyperlink{scsi__pt_8c_af1d70440ac54785a42e23b199bff3fc5}{ptasync}}, periph, periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00315}00315 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00316}00316         \textcolor{comment}{/* Tell the user we've attached to the device */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00317}00317         \mbox{\hyperlink{cam__xpt_8c_a62eab2d96b6a86a325df1d826c201746}{xpt\_announce\_periph}}(periph, NULL);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00318}00318 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00319}00319         \textcolor{keywordflow}{return}(\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00320}00320 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00322}00322 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00323}\mbox{\hyperlink{scsi__pt_8c_a340b8c3581acde5257ed5567fcbd1363}{00323}} \mbox{\hyperlink{scsi__pt_8c_a816d8a78bd57b0f3497291f860febb64}{ptoninvalidate}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00324}00324 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00325}00325         \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00326}00326 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00327}00327         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00328}00328 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00329}00329         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00330}00330 \textcolor{comment}{         * De-\/register any async callbacks.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00331}00331 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00332}00332         \mbox{\hyperlink{cam__xpt_8c_a8307586c12fb4774768a25a1fa4e6388}{xpt\_register\_async}}(0, \mbox{\hyperlink{scsi__pt_8c_af1d70440ac54785a42e23b199bff3fc5}{ptasync}}, periph, periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00333}00333 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00334}00334         softc-\/>flags |= \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a0e5a6c2e166d2ded22f503feb2a83ae7}{PT\_FLAG\_DEVICE\_INVALID}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00336}00336         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00337}00337 \textcolor{comment}{         * Return all queued I/O with ENXIO.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00338}00338 \textcolor{comment}{         * XXX Handle any transactions queued to the card}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00339}00339 \textcolor{comment}{         *     with XPT\_ABORT\_CCB.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00340}00340 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00341}00341         bioq\_flush(\&softc-\/>\mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{bio\_queue}}, NULL, ENXIO);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00342}00342 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00344}00344 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00345}\mbox{\hyperlink{scsi__pt_8c_a261779ed07afe9e6ee4ec6d995a81b78}{00345}} \mbox{\hyperlink{scsi__pt_8c_ae481e0093e599e5130dc766d3e151a2e}{ptdtor}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00346}00346 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00347}00347         \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00348}00348 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00349}00349         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00350}00350 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00351}00351         devstat\_remove\_entry(softc-\/>\mbox{\hyperlink{structpt__softc_aaf2d159e0edbefeaac3403c8cd1578ca}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00352}00352         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00353}00353         destroy\_dev(softc-\/>dev);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00354}00354         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00355}00355         free(softc, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00356}00356 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00357}00357 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00358}00358 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00359}\mbox{\hyperlink{scsi__pt_8c_af1d70440ac54785a42e23b199bff3fc5}{00359}} \mbox{\hyperlink{scsi__pt_8c_af1d70440ac54785a42e23b199bff3fc5}{ptasync}}(\textcolor{keywordtype}{void} *callback\_arg, u\_int32\_t code, \textcolor{keyword}{struct} \mbox{\hyperlink{structcam__path}{cam\_path}} *path, \textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00360}00360 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00361}00361         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00363}00363         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)callback\_arg;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00364}00364         \textcolor{keywordflow}{switch} (code) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00365}00365         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0a04183843e65dd16d378d105270a6debd}{AC\_FOUND\_DEVICE}}:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00366}00366         \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00367}00367                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *cgd;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00368}00368                 \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3}{cam\_status}} status;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00369}00369 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00370}00370                 cgd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *)arg;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00371}00371                 \textcolor{keywordflow}{if} (cgd == NULL)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00372}00372                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00374}00374                 \textcolor{keywordflow}{if} (cgd-\/>\mbox{\hyperlink{structccb__getdev_a019f53feca9e4c09b563eef64e19c1fd}{protocol}} != \mbox{\hyperlink{cam__ccb_8h_a283e001579038402a95e23bef57107e8a47dbcda94a42ad1914fddef379cb08ce}{PROTO\_SCSI}})}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00375}00375                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00376}00376                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{scsi__all_8h_ad67bf2d750c3d9079227da83ddd59320}{SID\_QUAL}}(\&cgd-\/>\mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}}) != \mbox{\hyperlink{scsi__all_8h_a8a4bc5643529b38b5a6b9a8fe867af90}{SID\_QUAL\_LU\_CONNECTED}})}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00377}00377                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00378}00378                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{scsi__all_8h_aaf542baf40a444b689af23b271bfbebd}{SID\_TYPE}}(\&cgd-\/>\mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}}) != \mbox{\hyperlink{scsi__all_8h_a844974d372c0264b414188ee6d8fe185}{T\_PROCESSOR}})}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00379}00379                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00380}00380 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00381}00381                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00382}00382 \textcolor{comment}{                 * Allocate a peripheral instance for}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00383}00383 \textcolor{comment}{                 * this device and start the probe}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00384}00384 \textcolor{comment}{                 * process.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00385}00385 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00386}00386                 status = \mbox{\hyperlink{cam__periph_8c_ad5e57f86a941e5a4021b0b026851e445}{cam\_periph\_alloc}}(\mbox{\hyperlink{scsi__pt_8c_a36a886e53bf79f984f68cc22f0a03da0}{ptctor}}, \mbox{\hyperlink{scsi__pt_8c_a816d8a78bd57b0f3497291f860febb64}{ptoninvalidate}}, \mbox{\hyperlink{scsi__pt_8c_ae481e0093e599e5130dc766d3e151a2e}{ptdtor}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00387}00387                                           \mbox{\hyperlink{scsi__pt_8c_a81cf1a4c3affec145261299002e5a950}{ptstart}}, \textcolor{stringliteral}{"{}pt"{}}, \mbox{\hyperlink{cam__periph_8h_ae648b142a75d7546562342a7b7961e6cada5282ff3d485d68259bc309db51476b}{CAM\_PERIPH\_BIO}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00388}00388                                           path, \mbox{\hyperlink{scsi__pt_8c_af1d70440ac54785a42e23b199bff3fc5}{ptasync}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00389}00389                                           \mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0a04183843e65dd16d378d105270a6debd}{AC\_FOUND\_DEVICE}}, cgd);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00390}00390 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00391}00391                 \textcolor{keywordflow}{if} (status != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00392}00392                  \&\& status != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a167c9bce81d6e65c16734d3e0d59fe24}{CAM\_REQ\_INPROG}})}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00393}00393                         printf(\textcolor{stringliteral}{"{}ptasync: Unable to attach to new device "{}}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00394}00394                                 \textcolor{stringliteral}{"{}due to status 0x\%x\(\backslash\)n"{}}, status);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00395}00395                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00396}00396         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00397}00397         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0adf2dfbe2cd14380823c3b1e7544021e8}{AC\_SENT\_BDR}}:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00398}00398         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0a562d924fbe74236d4f5403ef2fdbb94d}{AC\_BUS\_RESET}}:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00399}00399         \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00400}00400                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00401}00401                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__hdr}{ccb\_hdr}} *ccbh;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00403}00403                 softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00404}00404                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00405}00405 \textcolor{comment}{                 * Don't fail on the expected unit attention}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00406}00406 \textcolor{comment}{                 * that will occur.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00407}00407 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00408}00408                 softc-\/>flags |= \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a94e7cbbea7ecbd5dad004dd9d30b1091}{PT\_FLAG\_RETRY\_UA}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00409}00409                 LIST\_FOREACH(ccbh, \&softc-\/>pending\_ccbs, periph\_links.le)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00410}00410                         ccbh-\/>ccb\_state |= \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca527b879e9a079dd6fa27901299d59011}{PT\_CCB\_RETRY\_UA}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00411}00411         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00412}00412         \textcolor{comment}{/* FALLTHROUGH */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00413}00413         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00414}00414                 \mbox{\hyperlink{cam__periph_8c_a75ca97e267b2b0a98d4c146ec1967bdc}{cam\_periph\_async}}(periph, code, path, arg);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00415}00415                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00416}00416         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00417}00417 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00418}00418 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00419}00419 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00420}\mbox{\hyperlink{scsi__pt_8c_ae541ed8bc6bd745e9b3361fa4c9a7204}{00420}} \mbox{\hyperlink{scsi__pt_8c_a81cf1a4c3affec145261299002e5a950}{ptstart}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *start\_ccb)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00421}00421 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00422}00422         \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00423}00423         \textcolor{keyword}{struct }bio *bp;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00424}00424 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00425}00425         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00426}00426 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00427}00427         \mbox{\hyperlink{cam__debug_8h_ae79c3c2e46f2d9fca388152c3ad38ef0}{CAM\_DEBUG}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}}, \mbox{\hyperlink{cam__debug_8h_ae330349135d2d26f45cdf3cc67b2b369a079361ad1b93ba7c851ca5ca4762ecd1}{CAM\_DEBUG\_TRACE}}, (\textcolor{stringliteral}{"{}ptstart\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00428}00428 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00429}00429         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00430}00430 \textcolor{comment}{         * See if there is a buf with work for us to do..}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00431}00431 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00432}00432         bp = bioq\_first(\&softc-\/>\mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{bio\_queue}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00433}00433         \textcolor{keywordflow}{if} (bp == NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00434}00434                 \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(start\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00435}00435         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00436}00436                 bioq\_remove(\&softc-\/>\mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{bio\_queue}}, bp);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00437}00437 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00438}00438                 devstat\_start\_transaction\_bio(softc-\/>\mbox{\hyperlink{structpt__softc_aaf2d159e0edbefeaac3403c8cd1578ca}{device\_stats}}, bp);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00440}00440                 \mbox{\hyperlink{scsi__pt_8c_a44f5b13064c260742de62218fa72726b}{scsi\_send\_receive}}(\&start\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00441}00441                                   \textcolor{comment}{/*retries*/}4,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00442}00442                                   \mbox{\hyperlink{scsi__pt_8c_a558c33c9994ff8cd6e80089422923a97}{ptdone}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00443}00443                                   \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00444}00444                                   bp-\/>bio\_cmd == BIO\_READ,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00445}00445                                   \textcolor{comment}{/*byte2*/}0,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00446}00446                                   bp-\/>bio\_bcount,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00447}00447                                   bp-\/>bio\_data,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00448}00448                                   \textcolor{comment}{/*sense\_len*/}\mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00449}00449                                   \textcolor{comment}{/*timeout*/}softc-\/>io\_timeout);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00450}00450 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00451}00451                 start\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.ccb\_state = \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aacaeb92225c2d63c25d6a0741ea00312eba}{PT\_CCB\_BUFFER\_IO\_UA}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00452}00452 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00453}00453                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00454}00454 \textcolor{comment}{                 * Block out any asynchronous callbacks}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00455}00455 \textcolor{comment}{                 * while we touch the pending ccb list.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00456}00456 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00457}00457                 LIST\_INSERT\_HEAD(\&softc-\/>pending\_ccbs, \&start\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00458}00458                                  periph\_links.le);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00459}00459 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00460}00460                 start\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.ccb\_bp = bp;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00461}00461                 bp = bioq\_first(\&softc-\/>\mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{bio\_queue}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00462}00462 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00463}00463                 \mbox{\hyperlink{cam__xpt_8c_a6ef97382f5b1590b4d2d138516a63bcc}{xpt\_action}}(start\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00464}00464                 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00465}00465                 \textcolor{keywordflow}{if} (bp != NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00466}00466                         \textcolor{comment}{/* Have more work to do, so ensure we stay scheduled */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00467}00467                         \mbox{\hyperlink{cam__xpt_8c_a26e646d0732b4acab4667d28f24d026e}{xpt\_schedule}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00468}00468                 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00469}00469         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00470}00470 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00472}00472 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00473}\mbox{\hyperlink{scsi__pt_8c_a558c33c9994ff8cd6e80089422923a97}{00473}} \mbox{\hyperlink{scsi__pt_8c_a558c33c9994ff8cd6e80089422923a97}{ptdone}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *done\_ccb)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00474}00474 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00475}00475         \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00476}00476         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00477}00477 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00478}00478         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00479}00479 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00480}00480         \mbox{\hyperlink{cam__debug_8h_ae79c3c2e46f2d9fca388152c3ad38ef0}{CAM\_DEBUG}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}}, \mbox{\hyperlink{cam__debug_8h_ae330349135d2d26f45cdf3cc67b2b369a079361ad1b93ba7c851ca5ca4762ecd1}{CAM\_DEBUG\_TRACE}}, (\textcolor{stringliteral}{"{}ptdone\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00481}00481 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00482}00482         csio = \&done\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00483}00483         \textcolor{keywordflow}{switch} (csio-\/>\mbox{\hyperlink{structccb__scsiio_a267ba491b17e3e5820fdf56425a635b1}{ccb\_h}}.ccb\_state) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00484}00484         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca87c99dbc46ee97ff28cbbd62531ec1a6}{PT\_CCB\_BUFFER\_IO}}:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00485}00485         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aacaeb92225c2d63c25d6a0741ea00312eba}{PT\_CCB\_BUFFER\_IO\_UA}}:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00486}00486         \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00487}00487                 \textcolor{keyword}{struct }bio *bp;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00489}00489                 bp = (\textcolor{keyword}{struct }bio *)done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.ccb\_bp;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00490}00490                 if ((done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} \& \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a82f0d57eda0654067dc2db0c2a218caa}{CAM\_STATUS\_MASK}}) != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00491}00491                         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00492}00492                         \textcolor{keywordtype}{int} sf;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00493}00493                         }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00494}00494                         \textcolor{keywordflow}{if} ((csio-\/>\mbox{\hyperlink{structccb__scsiio_a267ba491b17e3e5820fdf56425a635b1}{ccb\_h}}.ccb\_state \& \mbox{\hyperlink{scsi__pt_8c_a24484a9d2282afbc3c167de4ff8f1aaca527b879e9a079dd6fa27901299d59011}{PT\_CCB\_RETRY\_UA}}) != 0)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00495}00495                                 sf = \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00496}00496                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00497}00497                                 sf = 0;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00498}00498 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00499}00499                         error = \mbox{\hyperlink{scsi__pt_8c_a4fb636d42a1011f7ad84dfdd3de527d3}{pterror}}(done\_ccb, \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}}, sf);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00500}00500                         \textcolor{keywordflow}{if} (error == ERESTART) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00501}00501                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00502}00502 \textcolor{comment}{                                 * A retry was scheuled, so}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00503}00503 \textcolor{comment}{                                 * just return.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00504}00504 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00505}00505                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00506}00506                         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00507}00507                         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00508}00508                                 \textcolor{keywordflow}{if} (error == ENXIO) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00509}00509                                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00510}00510 \textcolor{comment}{                                         * Catastrophic error.  Mark our device}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00511}00511 \textcolor{comment}{                                         * as invalid.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00512}00512 \textcolor{comment}{                                         */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00513}00513                                         \mbox{\hyperlink{cam__xpt_8c_a342b8e2ed77d0b7a12ae7bc49dd2beac}{xpt\_print}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00514}00514                                             \textcolor{stringliteral}{"{}Invalidating device\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00515}00515                                         softc-\/>flags |= \mbox{\hyperlink{scsi__pt_8c_a598f2f4b4f1b826b477a3f557ff0ce15a0e5a6c2e166d2ded22f503feb2a83ae7}{PT\_FLAG\_DEVICE\_INVALID}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00516}00516                                 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00517}00517 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00518}00518                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00519}00519 \textcolor{comment}{                                 * return all queued I/O with EIO, so that}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00520}00520 \textcolor{comment}{                                 * the client can retry these I/Os in the}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00521}00521 \textcolor{comment}{                                 * proper order should it attempt to recover.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00522}00522 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00523}00523                                 bioq\_flush(\&softc-\/>\mbox{\hyperlink{structpt__softc_abb9bc355dcd13183203d96242b4823ab}{bio\_queue}}, NULL, EIO);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00524}00524                                 bp-\/>bio\_error = error;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00525}00525                                 bp-\/>bio\_resid = bp-\/>bio\_bcount;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00526}00526                                 bp-\/>bio\_flags |= BIO\_ERROR;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00527}00527                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00528}00528                                 bp-\/>bio\_resid = csio-\/>\mbox{\hyperlink{structccb__scsiio_aeb974c780ab5470ba5a8ef184b224c0f}{resid}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00529}00529                                 bp-\/>bio\_error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00530}00530                                 \textcolor{keywordflow}{if} (bp-\/>bio\_resid != 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00531}00531                                         \textcolor{comment}{/* Short transfer ??? */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00532}00532                                         bp-\/>bio\_flags |= BIO\_ERROR;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00533}00533                                 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00534}00534                         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00535}00535                         \textcolor{keywordflow}{if} ((done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} \& \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3afe5c2fa0edb1c8fea0119515430d223e}{CAM\_DEV\_QFRZN}}) != 0)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00536}00536                                 \mbox{\hyperlink{cam__periph_8c_a31248ce4d1951e8325b42cf2c309481d}{cam\_release\_devq}}(done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a47763149d044e13fcc06abfb3ddc941f}{path}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00537}00537                                                  \textcolor{comment}{/*relsim\_flags*/}0,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00538}00538                                                  \textcolor{comment}{/*reduction*/}0,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00539}00539                                                  \textcolor{comment}{/*timeout*/}0,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00540}00540                                                  \textcolor{comment}{/*getcount\_only*/}0);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00541}00541                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00542}00542                         bp-\/>bio\_resid = csio-\/>\mbox{\hyperlink{structccb__scsiio_aeb974c780ab5470ba5a8ef184b224c0f}{resid}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00543}00543                         \textcolor{keywordflow}{if} (bp-\/>bio\_resid != 0)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00544}00544                                 bp-\/>bio\_flags |= BIO\_ERROR;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00545}00545                 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00546}00546 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00547}00547                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00548}00548 \textcolor{comment}{                 * Block out any asynchronous callbacks}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00549}00549 \textcolor{comment}{                 * while we touch the pending ccb list.}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00550}00550 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00551}00551                 LIST\_REMOVE(\&done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}, periph\_links.le);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00553}00553                 biofinish(bp, softc-\/>\mbox{\hyperlink{structpt__softc_aaf2d159e0edbefeaac3403c8cd1578ca}{device\_stats}}, 0);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00554}00554                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00555}00555         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00556}00556         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00557}00557         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(done\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00558}00558 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00559}00559 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00560}00560 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00561}\mbox{\hyperlink{scsi__pt_8c_a4fb636d42a1011f7ad84dfdd3de527d3}{00561}} \mbox{\hyperlink{scsi__pt_8c_a4fb636d42a1011f7ad84dfdd3de527d3}{pterror}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{unionccb}{ccb}}, u\_int32\_t \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316}{cam\_flags}}, u\_int32\_t sense\_flags)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00562}00562 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00563}00563 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00564}00564         \textcolor{keywordflow}{return}(\mbox{\hyperlink{cam__periph_8c_ac2010c1d05ec8dff4d1c03f3ec0be8c4}{cam\_periph\_error}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316}{cam\_flags}}, sense\_flags));}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00565}00565 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00566}00566 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00567}00567 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00568}\mbox{\hyperlink{scsi__pt_8c_a228dcc3cefe907e69deaa96832e3b078}{00568}} \mbox{\hyperlink{scsi__pt_8c_aae1d899038dd0b21a3e495c7017d6094}{ptioctl}}(\textcolor{keyword}{struct} cdev *dev, u\_long cmd, caddr\_t addr, \textcolor{keywordtype}{int} flag, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00569}00569 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00570}00570         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00571}00571         \textcolor{keyword}{struct }\mbox{\hyperlink{structpt__softc}{pt\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00572}00572         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00573}00573 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00574}00574         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00575}00575         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = (\textcolor{keyword}{struct} \mbox{\hyperlink{structpt__softc}{pt\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00576}00576 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00577}00577         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00578}00578 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00579}00579         \textcolor{keywordflow}{switch}(cmd) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00580}00580         \textcolor{keywordflow}{case} PTIOCGETTIMEOUT:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00581}00581                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}}-\/>io\_timeout >= 1000)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00582}00582                         *(\textcolor{keywordtype}{int} *)addr = \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}}-\/>io\_timeout / 1000;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00583}00583                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00584}00584                         *(\textcolor{keywordtype}{int} *)addr = 0;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00585}00585                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00586}00586         \textcolor{keywordflow}{case} PTIOCSETTIMEOUT:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00587}00587                 \textcolor{keywordflow}{if} (*(\textcolor{keywordtype}{int} *)addr < 1) \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00588}00588                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00589}00589                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00590}00590                 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00591}00591 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00592}00592                 \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}}-\/>io\_timeout = *(\textcolor{keywordtype}{int} *)addr * 1000;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00593}00593 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00594}00594                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00595}00595         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00596}00596                 error = \mbox{\hyperlink{cam__periph_8c_ac87854e887a6602529ea8cafa66dbdac}{cam\_periph\_ioctl}}(periph, cmd, addr, \mbox{\hyperlink{scsi__pt_8c_a4fb636d42a1011f7ad84dfdd3de527d3}{pterror}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00597}00597                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00598}00598         \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00599}00599 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00600}00600         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00601}00601 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00602}00602         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00603}00603 \}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00605}00605 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00606}\mbox{\hyperlink{scsi__pt_8c_a44f5b13064c260742de62218fa72726b}{00606}} \mbox{\hyperlink{scsi__pt_8c_a44f5b13064c260742de62218fa72726b}{scsi\_send\_receive}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio, u\_int32\_t retries,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00607}00607                   \textcolor{keywordtype}{void} (*cbfcnp)(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *),}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00608}00608                   u\_int tag\_action, \textcolor{keywordtype}{int} readop, u\_int byte2,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00609}00609                   u\_int32\_t xfer\_len, u\_int8\_t *data\_ptr, u\_int8\_t sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00610}00610                   u\_int32\_t timeout)}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00611}00611 \{}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00612}00612         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__send__receive}{scsi\_send\_receive}} *scsi\_cmd;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00613}00613 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00614}00614         scsi\_cmd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__send__receive}{scsi\_send\_receive}} *)\&csio-\/>\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00615}00615         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__send__receive_a1ea83a8220c65859d7f91251d8a7d74f}{opcode}} = readop ? \mbox{\hyperlink{scsi__pt_8h_a3b4d8a5e259fa47a909adefcda3bfb80}{RECEIVE}} : \mbox{\hyperlink{scsi__pt_8h_abc9603445bf79a3793831ee1d0ea8890}{SEND}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00616}00616         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__send__receive_af203b7c90a0154bcf7aaf9dd137a3d09}{byte2}} = \mbox{\hyperlink{structscsi__send__receive_af203b7c90a0154bcf7aaf9dd137a3d09}{byte2}};}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00617}00617         \mbox{\hyperlink{scsi__all_8h_ad744ce4fe5b776d796fca7338f45d1a6}{scsi\_ulto3b}}(\mbox{\hyperlink{structscsi__send__receive_ac367ec53615c4ee97adf176fb170c7a4}{xfer\_len}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__send__receive_ac367ec53615c4ee97adf176fb170c7a4}{xfer\_len}});}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00618}00618         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__send__receive_aea9ba51d68652b71648f38e1423fc591}{control}} = 0;}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00620}00620         \mbox{\hyperlink{cam__ccb_8h_aa2f54bfe52060582eb17ef5584b8f62b}{cam\_fill\_csio}}(csio,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00621}00621                       retries,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00622}00622                       cbfcnp,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00623}00623                       \textcolor{comment}{/*flags*/}readop ? \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676a00dc62a475e9a013d8a7f90fcf08f3af}{CAM\_DIR\_IN}} : \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676adf60a86f59d84768dceb1af379c0dc3a}{CAM\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00624}00624                       tag\_action,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00625}00625                       data\_ptr,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00626}00626                       \mbox{\hyperlink{structscsi__send__receive_ac367ec53615c4ee97adf176fb170c7a4}{xfer\_len}},}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00627}00627                       sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00628}00628                       \textcolor{keyword}{sizeof}(*scsi\_cmd),}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00629}00629                       timeout);}
\DoxyCodeLine{\Hypertarget{scsi__pt_8c_source_l00630}00630 \}}

\end{DoxyCode}
