\hypertarget{scsi__ch_8c_source}{}\doxysection{scsi\+\_\+ch.\+c}
\label{scsi__ch_8c_source}\index{cam/scsi/scsi\_ch.c@{cam/scsi/scsi\_ch.c}}
\mbox{\hyperlink{scsi__ch_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: (BSD-\/2-\/Clause-\/FreeBSD AND BSD-\/4-\/Clause)}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 1997 Justin T. Gibbs.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00006}00006 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00007}00007 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00008}00008 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00009}00009 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00010}00010 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00011}00011 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00012}00012 \textcolor{comment}{ *    notice, this list of conditions, and the following disclaimer,}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00013}00013 \textcolor{comment}{ *    without modification, immediately at the beginning of the file.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00014}00014 \textcolor{comment}{ * 2. The name of the author may not be used to endorse or promote products}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00015}00015 \textcolor{comment}{ *    derived from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00017}00017 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00018}00018 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00019}00019 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00020}00020 \textcolor{comment}{ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00021}00021 \textcolor{comment}{ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00022}00022 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00023}00023 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00024}00024 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00025}00025 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00026}00026 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00027}00027 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00028}00028 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00030}00030 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00031}00031 \textcolor{comment}{ * Copyright (c) 1996, 1997 Jason R. Thorpe <thorpej@and.com>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00032}00032 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00033}00033 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00034}00034 \textcolor{comment}{ * Partially based on an autochanger driver written by Stefan Grefen}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00035}00035 \textcolor{comment}{ * and on an autochanger driver written by the Systems Programming Group}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00036}00036 \textcolor{comment}{ * at the University of Utah Computer Science Department.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00037}00037 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00038}00038 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00039}00039 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00040}00040 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00041}00041 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00042}00042 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00043}00043 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00044}00044 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00045}00045 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00046}00046 \textcolor{comment}{ * 3. All advertising materials mentioning features or use of this software}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00047}00047 \textcolor{comment}{ *    must display the following acknowledgements:}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00048}00048 \textcolor{comment}{ *      This product includes software developed by Jason R. Thorpe}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00049}00049 \textcolor{comment}{ *      for And Communications, http://www.and.com/}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00050}00050 \textcolor{comment}{ * 4. The name of the author may not be used to endorse or promote products}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00051}00051 \textcolor{comment}{ *    derived from this software without specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00052}00052 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00053}00053 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00054}00054 \textcolor{comment}{ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00055}00055 \textcolor{comment}{ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00056}00056 \textcolor{comment}{ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00057}00057 \textcolor{comment}{ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00058}00058 \textcolor{comment}{ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00059}00059 \textcolor{comment}{ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00060}00060 \textcolor{comment}{ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00061}00061 \textcolor{comment}{ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00062}00062 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00063}00063 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00064}00064 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00065}00065 \textcolor{comment}{ * \$NetBSD: ch.c,v 1.34 1998/08/31 22:28:06 cgd Exp \$}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00066}00066 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00068}00068 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00069}\mbox{\hyperlink{scsi__ch_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00069}} \mbox{\hyperlink{scsi__ch_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00070}00070 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00071}00071 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00072}00072 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00073}00073 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00074}00074 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00075}00075 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00076}00076 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00077}00077 \textcolor{preprocessor}{\#include <sys/fcntl.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00078}00078 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00079}00079 \textcolor{preprocessor}{\#include <sys/chio.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00080}00080 \textcolor{preprocessor}{\#include <sys/errno.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00081}00081 \textcolor{preprocessor}{\#include <sys/devicestat.h>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00083}00083 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam_8h}{cam/cam.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00084}00084 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__ccb_8h}{cam/cam\_ccb.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00085}00085 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__periph_8h}{cam/cam\_periph.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00086}00086 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__xpt__periph_8h}{cam/cam\_xpt\_periph.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00087}00087 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__debug_8h}{cam/cam\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00089}00089 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__all_8h}{cam/scsi/scsi\_all.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00090}00090 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__message_8h}{cam/scsi/scsi\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00091}00091 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__ch_8h}{cam/scsi/scsi\_ch.h}}>}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00092}00092 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00093}00093 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00094}00094 \textcolor{comment}{ * Timeout definitions for various changer related commands.  They may}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00095}00095 \textcolor{comment}{ * be too short for some devices (especially the timeout for INITIALIZE}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00096}00096 \textcolor{comment}{ * ELEMENT STATUS).}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00097}00097 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00099}\mbox{\hyperlink{scsi__ch_8c_a4b667259079afc6d5414198b591a95e7}{00099}} \textcolor{keyword}{static} \textcolor{keyword}{const} u\_int32\_t  \mbox{\hyperlink{scsi__ch_8c_a4b667259079afc6d5414198b591a95e7}{CH\_TIMEOUT\_MODE\_SENSE}}                = 6000;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00100}\mbox{\hyperlink{scsi__ch_8c_a198764c6c45e5b0c1cbe2041bf9a3487}{00100}} \textcolor{keyword}{static} \textcolor{keyword}{const} u\_int32\_t  \mbox{\hyperlink{scsi__ch_8c_a198764c6c45e5b0c1cbe2041bf9a3487}{CH\_TIMEOUT\_MOVE\_MEDIUM}}               = 15 * 60 * 1000;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00101}\mbox{\hyperlink{scsi__ch_8c_a511d836117ae55ddbaf5d6ada9a53a5c}{00101}} \textcolor{keyword}{static} \textcolor{keyword}{const} u\_int32\_t  \mbox{\hyperlink{scsi__ch_8c_a511d836117ae55ddbaf5d6ada9a53a5c}{CH\_TIMEOUT\_EXCHANGE\_MEDIUM}}           = 15 * 60 * 1000;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00102}\mbox{\hyperlink{scsi__ch_8c_a0c9d0e664cd15160b1f773094d2546fb}{00102}} \textcolor{keyword}{static} \textcolor{keyword}{const} u\_int32\_t  \mbox{\hyperlink{scsi__ch_8c_a0c9d0e664cd15160b1f773094d2546fb}{CH\_TIMEOUT\_POSITION\_TO\_ELEMENT}}       = 15 * 60 * 1000;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00103}\mbox{\hyperlink{scsi__ch_8c_a16df651f20ffcdc94ef9724df5fd5109}{00103}} \textcolor{keyword}{static} \textcolor{keyword}{const} u\_int32\_t  \mbox{\hyperlink{scsi__ch_8c_a16df651f20ffcdc94ef9724df5fd5109}{CH\_TIMEOUT\_READ\_ELEMENT\_STATUS}}       = 5 * 60 * 1000;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00104}\mbox{\hyperlink{scsi__ch_8c_a7a259f4ce20a96b9e7f6a48b2e0694b6}{00104}} \textcolor{keyword}{static} \textcolor{keyword}{const} u\_int32\_t  \mbox{\hyperlink{scsi__ch_8c_a7a259f4ce20a96b9e7f6a48b2e0694b6}{CH\_TIMEOUT\_SEND\_VOLTAG}}                 = 10000;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00105}\mbox{\hyperlink{scsi__ch_8c_ad0e46d4df5364b325ca7e8babbf3b3e5}{00105}} \textcolor{keyword}{static} \textcolor{keyword}{const} u\_int32\_t  \mbox{\hyperlink{scsi__ch_8c_ad0e46d4df5364b325ca7e8babbf3b3e5}{CH\_TIMEOUT\_INITIALIZE\_ELEMENT\_STATUS}} = 500000;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00106}00106 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00107}\mbox{\hyperlink{scsi__ch_8c_a25ed33926496b383a88f29e5e51abdf0}{00107}} \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00108}00108         \mbox{\hyperlink{scsi__ch_8c_a25ed33926496b383a88f29e5e51abdf0a82ae50ec0385efa2b63f567c801587bb}{CH\_FLAG\_INVALID}}          = 0x001}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00109}\mbox{\hyperlink{scsi__ch_8c_a25ed33926496b383a88f29e5e51abdf0a82ae50ec0385efa2b63f567c801587bb}{00109}} \} \mbox{\hyperlink{scsi__ch_8c_a25ed33926496b383a88f29e5e51abdf0}{ch\_flags}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00111}\mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739da}{00111}} \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00112}\mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739daa728f9bf501005cca439857012f3b3262}{00112}}         \mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739daa728f9bf501005cca439857012f3b3262}{CH\_STATE\_PROBE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00113}00113         \mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739daa481ee8765d7f0e7313614a19278cde50}{CH\_STATE\_NORMAL}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00114}\mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739daa481ee8765d7f0e7313614a19278cde50}{00114}} \} \mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739da}{ch\_state}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00116}\mbox{\hyperlink{scsi__ch_8c_aa2d61eab6dcb38aaa924dab39b865542}{00116}} \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00117}00117         \mbox{\hyperlink{scsi__ch_8c_aa2d61eab6dcb38aaa924dab39b865542a9dee25eb7f27e757dd2e23a376498e30}{CH\_CCB\_PROBE}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00118}\mbox{\hyperlink{scsi__ch_8c_aa2d61eab6dcb38aaa924dab39b865542a9dee25eb7f27e757dd2e23a376498e30}{00118}} \} \mbox{\hyperlink{scsi__ch_8c_aa2d61eab6dcb38aaa924dab39b865542}{ch\_ccb\_types}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00119}00119 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00120}\mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfa}{00120}} \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00121}\mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaad434fa1b272aa78575b62af0f5400bc5}{00121}}         \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaad434fa1b272aa78575b62af0f5400bc5}{CH\_Q\_NONE}}      = 0x00,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00122}\mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa986e17fe85d41ca09d211ad3c2fab56c}{00122}}         \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa986e17fe85d41ca09d211ad3c2fab56c}{CH\_Q\_NO\_DBD}}  = 0x01,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00123}00123         \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa750e51c4f9c7196df3bccf66c48994ff}{CH\_Q\_NO\_DVCID}}      = 0x02}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00124}\mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa750e51c4f9c7196df3bccf66c48994ff}{00124}} \} \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfa}{ch\_quirks}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00125}00125 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00126}\mbox{\hyperlink{scsi__ch_8c_a866ac930bb910015640255100c24be82}{00126}} \textcolor{preprocessor}{\#define CH\_Q\_BIT\_STRING \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00127}00127 \textcolor{preprocessor}{        "{}\(\backslash\)020"{}}          \(\backslash\)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00128}00128         "{}\(\backslash\)001NO\_DBD"{}    \(\backslash\)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00129}00129         "{}\(\backslash\)002NO\_DVCID"{}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00131}\mbox{\hyperlink{scsi__ch_8c_a06847d962f339e20fc5fbd8549006344}{00131}} \textcolor{preprocessor}{\#define ccb\_state       ppriv\_field0}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00132}\mbox{\hyperlink{scsi__ch_8c_aa8cbccb0f9744ba58c6df5ddc2e8b35a}{00132}} \textcolor{preprocessor}{\#define ccb\_bp          ppriv\_ptr1}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00133}00133 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00134}\mbox{\hyperlink{structscsi__mode__sense__data}{00134}} \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__sense__data}{scsi\_mode\_sense\_data}} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00135}\mbox{\hyperlink{structscsi__mode__sense__data_ad2f00f3ea91141700fa5595694533f12}{00135}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__header__6}{scsi\_mode\_header\_6}} \mbox{\hyperlink{structscsi__mode__sense__data_ad2f00f3ea91141700fa5595694533f12}{header}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00136}\mbox{\hyperlink{structscsi__mode__sense__data_ae677902fc539bf0f9119aff5fec2397a}{00136}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__blk__desc}{scsi\_mode\_blk\_desc}} \mbox{\hyperlink{structscsi__mode__sense__data_ae677902fc539bf0f9119aff5fec2397a}{blk\_desc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00137}00137         \textcolor{keyword}{union }\{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00138}\mbox{\hyperlink{structscsi__mode__sense__data_a1cabd6013f11b6b2f4a0f5b3d58aeec5}{00138}}                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpage__element__address__assignment}{page\_element\_address\_assignment}} \mbox{\hyperlink{structscsi__mode__sense__data_a1cabd6013f11b6b2f4a0f5b3d58aeec5}{ea}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00139}\mbox{\hyperlink{structscsi__mode__sense__data_ae808000f627dc4e28645d476cd5114a6}{00139}}                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpage__transport__geometry__parameters}{page\_transport\_geometry\_parameters}} \mbox{\hyperlink{structscsi__mode__sense__data_ae808000f627dc4e28645d476cd5114a6}{tg}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00140}\mbox{\hyperlink{structscsi__mode__sense__data_a00eb5418f9718adbde0d634708c01571}{00140}}                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpage__device__capabilities}{page\_device\_capabilities}} \mbox{\hyperlink{structscsi__mode__sense__data_a00eb5418f9718adbde0d634708c01571}{cap}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00141}\mbox{\hyperlink{structscsi__mode__sense__data_a478b819a3b09224347b5f37779f9d51b}{00141}}         \} \mbox{\hyperlink{structscsi__mode__sense__data_a478b819a3b09224347b5f37779f9d51b}{pages}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00142}00142 \};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00143}00143 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00144}\mbox{\hyperlink{structch__softc}{00144}} \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00145}\mbox{\hyperlink{structch__softc_ad834f151cacb70060e0986d7354adf4c}{00145}}         \mbox{\hyperlink{scsi__ch_8c_a25ed33926496b383a88f29e5e51abdf0}{ch\_flags}}        \mbox{\hyperlink{structch__softc_ad834f151cacb70060e0986d7354adf4c}{flags}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00146}\mbox{\hyperlink{structch__softc_a9cdd183ebb347f556850f8c2e544a2ca}{00146}}         \mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739da}{ch\_state}}        \mbox{\hyperlink{structch__softc_a9cdd183ebb347f556850f8c2e544a2ca}{state}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00147}\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{00147}}         \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfa}{ch\_quirks}}      \mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00148}\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{00148}}         \textcolor{keyword}{struct }devstat  *\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00149}\mbox{\hyperlink{structch__softc_ac882634f376b144eae8c76643b035b2b}{00149}}         \textcolor{keyword}{struct }cdev     *\mbox{\hyperlink{structch__softc_ac882634f376b144eae8c76643b035b2b}{dev}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00150}\mbox{\hyperlink{structch__softc_a5a846e4f6185058771a2cfca7c3b625d}{00150}}         \textcolor{keywordtype}{int}             \mbox{\hyperlink{structch__softc_a5a846e4f6185058771a2cfca7c3b625d}{open\_count}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00151}00151 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00152}\mbox{\hyperlink{structch__softc_a623ee78dbace25d4211d2e8ecfa31e7c}{00152}}         \textcolor{keywordtype}{int}             \mbox{\hyperlink{structch__softc_a623ee78dbace25d4211d2e8ecfa31e7c}{sc\_picker}};     \textcolor{comment}{/* current picker */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00154}00154         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00155}00155 \textcolor{comment}{         * The following information is obtained from the}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00156}00156 \textcolor{comment}{         * element address assignment page.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00157}00157 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00158}\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{00158}}         \textcolor{keywordtype}{int}             \mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_MAX + 1];       \textcolor{comment}{/* firsts */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00159}\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{00159}}         \textcolor{keywordtype}{int}             \mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_MAX + 1];       \textcolor{comment}{/* counts */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00160}00160 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00161}00161         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00162}00162 \textcolor{comment}{         * The following mask defines the legal combinations}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00163}00163 \textcolor{comment}{         * of elements for the MOVE MEDIUM command.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00164}00164 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00165}\mbox{\hyperlink{structch__softc_a8cb33f55148d225539dab1dc926a698c}{00165}}         u\_int8\_t        \mbox{\hyperlink{structch__softc_a8cb33f55148d225539dab1dc926a698c}{sc\_movemask}}[CHET\_MAX + 1];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00167}00167         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00168}00168 \textcolor{comment}{         * As above, but for EXCHANGE MEDIUM.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00169}00169 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00170}\mbox{\hyperlink{structch__softc_a86bfb96ab5a53a4ae9d6cad535336ce0}{00170}}         u\_int8\_t        \mbox{\hyperlink{structch__softc_a86bfb96ab5a53a4ae9d6cad535336ce0}{sc\_exchangemask}}[CHET\_MAX + 1];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00171}00171 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00172}00172         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00173}00173 \textcolor{comment}{         * Quirks; see below.  XXX KDM not implemented yet}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00174}00174 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00175}\mbox{\hyperlink{structch__softc_a5c6089fdc48753dea235f1fb71f65be6}{00175}}         \textcolor{keywordtype}{int}             \mbox{\hyperlink{structch__softc_a5c6089fdc48753dea235f1fb71f65be6}{sc\_settledelay}};   \textcolor{comment}{/* delay for settle */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00176}00176 \};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00177}00177 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00178}\mbox{\hyperlink{scsi__ch_8c_aefc675b7ed321f55b218b6dbcbb976e6}{00178}} \textcolor{keyword}{static}  d\_open\_t        \mbox{\hyperlink{scsi__ch_8c_aefc675b7ed321f55b218b6dbcbb976e6}{chopen}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00179}\mbox{\hyperlink{scsi__ch_8c_a79fa019cb6222f4623a49c57710d1491}{00179}} \textcolor{keyword}{static}  d\_close\_t       \mbox{\hyperlink{scsi__ch_8c_a79fa019cb6222f4623a49c57710d1491}{chclose}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00180}\mbox{\hyperlink{scsi__ch_8c_a2391ef7917bd7cf47ed01c74e4e463a3}{00180}} \textcolor{keyword}{static}  d\_ioctl\_t       \mbox{\hyperlink{scsi__ch_8c_a2391ef7917bd7cf47ed01c74e4e463a3}{chioctl}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00181}\mbox{\hyperlink{scsi__ch_8c_a86ec3d3926bc1d523738f74649ac4334}{00181}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_ae8635482322b2513ab2f662535250ac0}{periph\_init\_t}}      \mbox{\hyperlink{scsi__ch_8c_a86ec3d3926bc1d523738f74649ac4334}{chinit}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00182}\mbox{\hyperlink{scsi__ch_8c_a2aec9d22797bd83c229b755675b896ff}{00182}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_a0134746116b0c19d248d1342a16aab04}{periph\_ctor\_t}}      \mbox{\hyperlink{scsi__ch_8c_a2aec9d22797bd83c229b755675b896ff}{chregister}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00183}\mbox{\hyperlink{scsi__ch_8c_a3cf5638ba0576ef299d4d7584b630ad0}{00183}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_a14602bb3ac9272ea2209d63f1e618fca}{periph\_oninv\_t}}    \mbox{\hyperlink{scsi__ch_8c_a3cf5638ba0576ef299d4d7584b630ad0}{choninvalidate}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00184}\mbox{\hyperlink{scsi__ch_8c_a3269a8cf5012223ad413c41dae0ecbd4}{00184}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_a8d863e438ef46ba796fbf3e77340b3e3}{periph\_dtor\_t}}   \mbox{\hyperlink{scsi__ch_8c_a3269a8cf5012223ad413c41dae0ecbd4}{chcleanup}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00185}\mbox{\hyperlink{scsi__ch_8c_a3bd243795ece99e35cec3a2338c258c9}{00185}} \textcolor{keyword}{static}  \mbox{\hyperlink{cam__periph_8h_ab04cb4cf3fd8f8a44ce312952af7cb7f}{periph\_start\_t}}  \mbox{\hyperlink{scsi__ch_8c_a3bd243795ece99e35cec3a2338c258c9}{chstart}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00186}00186 \textcolor{keyword}{static}  \textcolor{keywordtype}{void}            \mbox{\hyperlink{scsi__ch_8c_a62bd58c71bd98dc7c1de78e30ec4c7dd}{chasync}}(\textcolor{keywordtype}{void} *callback\_arg, u\_int32\_t code,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00187}00187                                 \textcolor{keyword}{struct} \mbox{\hyperlink{structcam__path}{cam\_path}} *path, \textcolor{keywordtype}{void} *arg);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00188}00188 \textcolor{keyword}{static}  \textcolor{keywordtype}{void}            \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00189}00189                                \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *done\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00190}00190 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{unionccb}{ccb}}, u\_int32\_t \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316}{cam\_flags}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00191}00191                                 u\_int32\_t sense\_flags);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00192}00192 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_ae49b09766cd8433bb99c85bb7864bdd2}{chmove}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00193}00193                                \textcolor{keyword}{struct} changer\_move *cm);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00194}00194 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_a2c03d6f1c5606bc2b3701474084a5e6c}{chexchange}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00195}00195                                    \textcolor{keyword}{struct} changer\_exchange *ce);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00196}00196 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_a85ef32b0b65ff0da725db58b086aa4d4}{chposition}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00197}00197                                    \textcolor{keyword}{struct} changer\_position *cp);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00198}00198 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_adeba3b8e8887ca44827df029fafbfe7f}{chgetelemstatus}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00199}00199                                 \textcolor{keywordtype}{int} scsi\_version, u\_long cmd,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00200}00200                                 \textcolor{keyword}{struct} changer\_element\_status\_request *csr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00201}00201 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_a1c42babd4cca445f7505e778a384973d}{chsetvoltag}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00202}00202                                     \textcolor{keyword}{struct} changer\_set\_voltag\_request *csvr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00203}00203 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_a349d2f5b0ecee2f4d43d8dd9194ff668}{chielem}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00204}00204                                 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} timeout);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00205}00205 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_af2d54c3710d99c162025fc7f552ad020}{chgetparams}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00206}00206 \textcolor{keyword}{static}  \textcolor{keywordtype}{int}             \mbox{\hyperlink{scsi__ch_8c_aaa6b29cc1115796b832180b30c045cc6}{chscsiversion}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00207}00207 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00208}\mbox{\hyperlink{scsi__ch_8c_a2b2942747584db4c5924d5b62403d8f1}{00208}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structperiph__driver}{periph\_driver}} \mbox{\hyperlink{scsi__ch_8c_a2b2942747584db4c5924d5b62403d8f1}{chdriver}} =}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00209}00209 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00210}00210         \mbox{\hyperlink{scsi__ch_8c_a86ec3d3926bc1d523738f74649ac4334}{chinit}}, \textcolor{stringliteral}{"{}ch"{}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00211}00211         TAILQ\_HEAD\_INITIALIZER(\mbox{\hyperlink{scsi__ch_8c_a2b2942747584db4c5924d5b62403d8f1}{chdriver}}.units), \textcolor{comment}{/* generation */} 0}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00212}00212 \};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00213}00213 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00214}\mbox{\hyperlink{scsi__ch_8c_aa9523eb452b3f8f1796ff6ded906f86e}{00214}} \mbox{\hyperlink{scsi__ch_8c_aa9523eb452b3f8f1796ff6ded906f86e}{PERIPHDRIVER\_DECLARE}}(ch, \mbox{\hyperlink{scsi__ch_8c_a2b2942747584db4c5924d5b62403d8f1}{chdriver}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00216}\mbox{\hyperlink{scsi__ch_8c_ae59047582a6e637dad286cc4d5f3c53c}{00216}} \textcolor{keyword}{static} \textcolor{keyword}{struct }cdevsw \mbox{\hyperlink{scsi__ch_8c_ae59047582a6e637dad286cc4d5f3c53c}{ch\_cdevsw}} = \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00217}00217         .d\_version =    D\_VERSION,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00218}00218         .d\_flags =      D\_TRACKCLOSE,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00219}00219         .d\_open =       \mbox{\hyperlink{scsi__ch_8c_aefc675b7ed321f55b218b6dbcbb976e6}{chopen}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00220}00220         .d\_close =      \mbox{\hyperlink{scsi__ch_8c_a79fa019cb6222f4623a49c57710d1491}{chclose}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00221}00221         .d\_ioctl =      \mbox{\hyperlink{scsi__ch_8c_a2391ef7917bd7cf47ed01c74e4e463a3}{chioctl}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00222}00222         .d\_name =       \textcolor{stringliteral}{"{}ch"{}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00223}00223 \};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00224}00224 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00225}\mbox{\hyperlink{scsi__ch_8c_ac4236bac586506ece85d4615118a8ea2}{00225}} \textcolor{keyword}{static} \mbox{\hyperlink{scsi__ch_8c_ac4236bac586506ece85d4615118a8ea2}{MALLOC\_DEFINE}}(M\_SCSICH, \textcolor{stringliteral}{"{}scsi\_ch"{}}, \textcolor{stringliteral}{"{}scsi\_ch buffers"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00227}00227 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00228}00228 \mbox{\hyperlink{scsi__ch_8c_a86ec3d3926bc1d523738f74649ac4334}{chinit}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00229}00229 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00230}00230         \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3}{cam\_status}} status;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00231}00231 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00232}00232         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00233}00233 \textcolor{comment}{         * Install a global async callback.  This callback will}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00234}00234 \textcolor{comment}{         * receive async callbacks like "{}new device found"{}.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00235}00235 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00236}00236         status = \mbox{\hyperlink{cam__xpt_8c_a8307586c12fb4774768a25a1fa4e6388}{xpt\_register\_async}}(\mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0a04183843e65dd16d378d105270a6debd}{AC\_FOUND\_DEVICE}}, \mbox{\hyperlink{scsi__ch_8c_a62bd58c71bd98dc7c1de78e30ec4c7dd}{chasync}}, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00237}00237 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00238}00238         \textcolor{keywordflow}{if} (status != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00239}00239                 printf(\textcolor{stringliteral}{"{}ch: Failed to attach master async callback "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00240}00240                        \textcolor{stringliteral}{"{}due to status 0x\%x!\(\backslash\)n"{}}, status);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00241}00241         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00242}00242 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00243}00243 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00244}00244 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00245}\mbox{\hyperlink{scsi__ch_8c_a9595c9bb8a1b6a817b1e07d8ae2c315e}{00245}} \mbox{\hyperlink{scsi__ch_8c_a9595c9bb8a1b6a817b1e07d8ae2c315e}{chdevgonecb}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00246}00246 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00247}00247         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}}   *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00248}00248         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00249}00249         \textcolor{keyword}{struct }mtx *mtx;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00250}00250         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00251}00251 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00252}00252         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)arg;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00253}00253         mtx = \mbox{\hyperlink{cam__periph_8h_a8b9ecf78613a0fdde3d227cf5a109101}{cam\_periph\_mtx}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00254}00254         mtx\_lock(mtx);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00256}00256         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00257}00257         KASSERT(softc-\/>\mbox{\hyperlink{structch__softc_a5a846e4f6185058771a2cfca7c3b625d}{open\_count}} >= 0, (\textcolor{stringliteral}{"{}Negative open count \%d"{}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00258}00258                 softc-\/>\mbox{\hyperlink{structch__softc_a5a846e4f6185058771a2cfca7c3b625d}{open\_count}}));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00260}00260         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00261}00261 \textcolor{comment}{         * When we get this callback, we will get no more close calls from}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00262}00262 \textcolor{comment}{         * devfs.  So if we have any dangling opens, we need to release the}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00263}00263 \textcolor{comment}{         * reference held for that particular context.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00264}00264 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00265}00265         \textcolor{keywordflow}{for} (i = 0; i < softc-\/>\mbox{\hyperlink{structch__softc_a5a846e4f6185058771a2cfca7c3b625d}{open\_count}}; i++)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00266}00266                 \mbox{\hyperlink{cam__periph_8c_a06741cfe8f484a9dad6f9607a233908c}{cam\_periph\_release\_locked}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00267}00267 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00268}00268         softc-\/>\mbox{\hyperlink{structch__softc_a5a846e4f6185058771a2cfca7c3b625d}{open\_count}} = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00270}00270         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00271}00271 \textcolor{comment}{         * Release the reference held for the device node, it is gone now.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00272}00272 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00273}00273         \mbox{\hyperlink{cam__periph_8c_a06741cfe8f484a9dad6f9607a233908c}{cam\_periph\_release\_locked}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00275}00275         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00276}00276 \textcolor{comment}{         * We reference the lock directly here, instead of using}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00277}00277 \textcolor{comment}{         * cam\_periph\_unlock().  The reason is that the final call to}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00278}00278 \textcolor{comment}{         * cam\_periph\_release\_locked() above could result in the periph}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00279}00279 \textcolor{comment}{         * getting freed.  If that is the case, dereferencing the periph}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00280}00280 \textcolor{comment}{         * with a cam\_periph\_unlock() call would cause a page fault.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00281}00281 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00282}00282         mtx\_unlock(mtx);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00283}00283 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00285}00285 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00286}\mbox{\hyperlink{scsi__ch_8c_a67e64b0a6915c2014ca7e12b161c6472}{00286}} \mbox{\hyperlink{scsi__ch_8c_a3cf5638ba0576ef299d4d7584b630ad0}{choninvalidate}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00287}00287 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00288}00288         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00290}00290         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00291}00291 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00292}00292         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00293}00293 \textcolor{comment}{         * De-\/register any async callbacks.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00294}00294 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00295}00295         \mbox{\hyperlink{cam__xpt_8c_a8307586c12fb4774768a25a1fa4e6388}{xpt\_register\_async}}(0, \mbox{\hyperlink{scsi__ch_8c_a62bd58c71bd98dc7c1de78e30ec4c7dd}{chasync}}, periph, periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00297}00297         softc-\/>\mbox{\hyperlink{structch__softc_ad834f151cacb70060e0986d7354adf4c}{flags}} |= \mbox{\hyperlink{scsi__ch_8c_a25ed33926496b383a88f29e5e51abdf0a82ae50ec0385efa2b63f567c801587bb}{CH\_FLAG\_INVALID}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00298}00298 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00299}00299         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00300}00300 \textcolor{comment}{         * Tell devfs this device has gone away, and ask for a callback}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00301}00301 \textcolor{comment}{         * when it has cleaned up its state.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00302}00302 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00303}00303         destroy\_dev\_sched\_cb(softc-\/>\mbox{\hyperlink{structch__softc_ac882634f376b144eae8c76643b035b2b}{dev}}, \mbox{\hyperlink{scsi__ch_8c_a9595c9bb8a1b6a817b1e07d8ae2c315e}{chdevgonecb}}, periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00304}00304 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00305}00305 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00306}00306 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00307}\mbox{\hyperlink{scsi__ch_8c_a353a3464c710a01b3ed0f6695ff019a0}{00307}} \mbox{\hyperlink{scsi__ch_8c_a3269a8cf5012223ad413c41dae0ecbd4}{chcleanup}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00308}00308 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00309}00309         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00310}00310 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00311}00311         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00312}00312 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00313}00313         devstat\_remove\_entry(softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00315}00315         free(softc, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00316}00316 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00317}00317 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00318}00318 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00319}\mbox{\hyperlink{scsi__ch_8c_a62bd58c71bd98dc7c1de78e30ec4c7dd}{00319}} \mbox{\hyperlink{scsi__ch_8c_a62bd58c71bd98dc7c1de78e30ec4c7dd}{chasync}}(\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__ch_8c_source_l00320}00320 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00321}00321         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00322}00322 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00323}00323         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)callback\_arg;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00324}00324 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00325}00325         \textcolor{keywordflow}{switch}(code) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00326}00326         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0a04183843e65dd16d378d105270a6debd}{AC\_FOUND\_DEVICE}}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00327}00327         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00328}00328                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *cgd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00329}00329                 \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3}{cam\_status}} status;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00330}00330 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00331}00331                 cgd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *)arg;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00332}00332                 \textcolor{keywordflow}{if} (cgd == NULL)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00333}00333                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00335}00335                 \textcolor{keywordflow}{if} (cgd-\/>\mbox{\hyperlink{structccb__getdev_a019f53feca9e4c09b563eef64e19c1fd}{protocol}} != \mbox{\hyperlink{cam__ccb_8h_a283e001579038402a95e23bef57107e8a47dbcda94a42ad1914fddef379cb08ce}{PROTO\_SCSI}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00336}00336                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00337}00337                 \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__ch_8c_source_l00338}00338                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00339}00339                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{scsi__all_8h_aaf542baf40a444b689af23b271bfbebd}{SID\_TYPE}}(\&cgd-\/>\mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}})!= \mbox{\hyperlink{scsi__all_8h_af87779d94ffb9b7e4f29a99a09a715ca}{T\_CHANGER}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00340}00340                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00341}00341 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00342}00342                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00343}00343 \textcolor{comment}{                 * Allocate a peripheral instance for}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00344}00344 \textcolor{comment}{                 * this device and start the probe}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00345}00345 \textcolor{comment}{                 * process.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00346}00346 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00347}00347                 status = \mbox{\hyperlink{cam__periph_8c_ad5e57f86a941e5a4021b0b026851e445}{cam\_periph\_alloc}}(\mbox{\hyperlink{scsi__ch_8c_a2aec9d22797bd83c229b755675b896ff}{chregister}}, \mbox{\hyperlink{scsi__ch_8c_a3cf5638ba0576ef299d4d7584b630ad0}{choninvalidate}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00348}00348                                           \mbox{\hyperlink{scsi__ch_8c_a3269a8cf5012223ad413c41dae0ecbd4}{chcleanup}}, \mbox{\hyperlink{scsi__ch_8c_a3bd243795ece99e35cec3a2338c258c9}{chstart}}, \textcolor{stringliteral}{"{}ch"{}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00349}00349                                           \mbox{\hyperlink{cam__periph_8h_ae648b142a75d7546562342a7b7961e6cada5282ff3d485d68259bc309db51476b}{CAM\_PERIPH\_BIO}}, path,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00350}00350                                           \mbox{\hyperlink{scsi__ch_8c_a62bd58c71bd98dc7c1de78e30ec4c7dd}{chasync}}, \mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0a04183843e65dd16d378d105270a6debd}{AC\_FOUND\_DEVICE}}, cgd);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00351}00351 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00352}00352                 \textcolor{keywordflow}{if} (status != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00353}00353                  \&\& status != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a167c9bce81d6e65c16734d3e0d59fe24}{CAM\_REQ\_INPROG}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00354}00354                         printf(\textcolor{stringliteral}{"{}chasync: Unable to probe new device "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00355}00355                                \textcolor{stringliteral}{"{}due to status 0x\%x\(\backslash\)n"{}}, status);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00356}00356 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00357}00357                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00358}00358         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00359}00359         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00360}00360                 \mbox{\hyperlink{cam__periph_8c_a75ca97e267b2b0a98d4c146ec1967bdc}{cam\_periph\_async}}(periph, code, path, arg);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00361}00361                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00362}00362         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00363}00363 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00365}00365 \textcolor{keyword}{static} \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3}{cam\_status}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00366}\mbox{\hyperlink{scsi__ch_8c_ad93c360979ef30030402af330dc9aa62}{00366}} \mbox{\hyperlink{scsi__ch_8c_a2aec9d22797bd83c229b755675b896ff}{chregister}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00367}00367 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00368}00368         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00369}00369         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *cgd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00370}00370         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__pathinq}{ccb\_pathinq}} cpi;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00371}00371         \textcolor{keyword}{struct }make\_dev\_args args;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00372}00372         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00373}00373 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00374}00374         cgd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *)arg;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00375}00375         \textcolor{keywordflow}{if} (cgd == NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00376}00376                 printf(\textcolor{stringliteral}{"{}chregister: no getdev CCB, can't register device\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00377}00377                 \textcolor{keywordflow}{return}(\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a7c519e8cfabb5fd17f4d518c82c17692}{CAM\_REQ\_CMP\_ERR}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00378}00378         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00379}00379 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00380}00380         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)malloc(\textcolor{keyword}{sizeof}(*softc),M\_DEVBUF,M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00381}00381 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00382}00382         \textcolor{keywordflow}{if} (softc == NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00383}00383                 printf(\textcolor{stringliteral}{"{}chregister: Unable to probe new device. "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00384}00384                        \textcolor{stringliteral}{"{}Unable to allocate softc\(\backslash\)n"{}});                           }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00385}00385                 \textcolor{keywordflow}{return}(\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a7c519e8cfabb5fd17f4d518c82c17692}{CAM\_REQ\_CMP\_ERR}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00386}00386         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00387}00387 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00388}00388         bzero(softc, \textcolor{keyword}{sizeof}(*softc));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00389}00389         softc-\/>\mbox{\hyperlink{structch__softc_a9cdd183ebb347f556850f8c2e544a2ca}{state}} = \mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739daa728f9bf501005cca439857012f3b3262}{CH\_STATE\_PROBE}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00390}00390         periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00391}00391         softc-\/>\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}} = \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaad434fa1b272aa78575b62af0f5400bc5}{CH\_Q\_NONE}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00393}00393         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00394}00394 \textcolor{comment}{         * The DVCID and CURDATA bits were not introduced until the SMC}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00395}00395 \textcolor{comment}{         * spec.  If this device claims SCSI-\/2 or earlier support, then it}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00396}00396 \textcolor{comment}{         * very likely does not support these bits.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00397}00397 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00398}00398         \textcolor{keywordflow}{if} (cgd-\/>\mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}}.\mbox{\hyperlink{structscsi__inquiry__data_ae1eb2e33319954898775af8b9eecfac6}{version}} <= \mbox{\hyperlink{scsi__all_8h_a0998c5a889c1c838a9f5b90e9f87d722}{SCSI\_REV\_2}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00399}00399                 softc-\/>\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}} |= \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa750e51c4f9c7196df3bccf66c48994ff}{CH\_Q\_NO\_DVCID}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00400}00400 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00401}00401         \mbox{\hyperlink{cam__xpt_8h_ae111c3fbe95a53d1bdb2f112d86b929b}{xpt\_path\_inq}}(\&cpi, periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00402}00402 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00403}00403         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00404}00404 \textcolor{comment}{         * Changers don't have a blocksize, and obviously don't support}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00405}00405 \textcolor{comment}{         * tagged queueing.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00406}00406 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00407}00407         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00408}00408         softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}} = devstat\_new\_entry(\textcolor{stringliteral}{"{}ch"{}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00409}00409                           periph-\/>\mbox{\hyperlink{structcam__periph_a2b4a50e233de9e726afe3e7e85e63960}{unit\_number}}, 0,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00410}00410                           DEVSTAT\_NO\_BLOCKSIZE | DEVSTAT\_NO\_ORDERED\_TAGS,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00411}00411                           \mbox{\hyperlink{scsi__all_8h_aaf542baf40a444b689af23b271bfbebd}{SID\_TYPE}}(\&cgd-\/>\mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}}) |}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00412}00412                           \mbox{\hyperlink{cam__ccb_8h_ab208430ee4ee01798ab512f38fc0cc7b}{XPORT\_DEVSTAT\_TYPE}}(cpi.\mbox{\hyperlink{structccb__pathinq_aaef7c0420017996140ae4bdede6a8152}{transport}}),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00413}00413                           DEVSTAT\_PRIORITY\_OTHER);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00414}00414 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00415}00415         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00416}00416 \textcolor{comment}{         * Acquire a reference to the periph before we create the devfs}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00417}00417 \textcolor{comment}{         * instance for it.  We'll release this reference once the devfs}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00418}00418 \textcolor{comment}{         * instance has been freed.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00419}00419 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00420}00420         \textcolor{keywordflow}{if} (\mbox{\hyperlink{cam__periph_8c_a5b3dbda06d83cc62f5ba1be9622efa4b}{cam\_periph\_acquire}}(periph) != 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00421}00421                 \mbox{\hyperlink{cam__xpt_8c_a342b8e2ed77d0b7a12ae7bc49dd2beac}{xpt\_print}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}}, \textcolor{stringliteral}{"{}\%s: lost periph during "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00422}00422                           \textcolor{stringliteral}{"{}registration!\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00423}00423                 \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00424}00424                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a7c519e8cfabb5fd17f4d518c82c17692}{CAM\_REQ\_CMP\_ERR}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00425}00425         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00426}00426 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00427}00427         \textcolor{comment}{/* Register the device */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00428}00428         make\_dev\_args\_init(\&args);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00429}00429         args.mda\_devsw = \&\mbox{\hyperlink{scsi__ch_8c_ae59047582a6e637dad286cc4d5f3c53c}{ch\_cdevsw}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00430}00430         args.mda\_unit = periph-\/>\mbox{\hyperlink{structcam__periph_a2b4a50e233de9e726afe3e7e85e63960}{unit\_number}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00431}00431         args.mda\_uid = UID\_ROOT;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00432}00432         args.mda\_gid = GID\_OPERATOR;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00433}00433         args.mda\_mode = 0600;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00434}00434         args.mda\_si\_drv1 = periph;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00435}00435         error = make\_dev\_s(\&args, \&softc-\/>\mbox{\hyperlink{structch__softc_ac882634f376b144eae8c76643b035b2b}{dev}}, \textcolor{stringliteral}{"{}\%s\%d"{}}, periph-\/>\mbox{\hyperlink{structcam__periph_a12b5871a0ccca32fa359b1512d5dabad}{periph\_name}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00436}00436             periph-\/>\mbox{\hyperlink{structcam__periph_a2b4a50e233de9e726afe3e7e85e63960}{unit\_number}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00437}00437         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00438}00438         \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00439}00439                 \mbox{\hyperlink{cam__periph_8c_a06741cfe8f484a9dad6f9607a233908c}{cam\_periph\_release\_locked}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00440}00440                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a7c519e8cfabb5fd17f4d518c82c17692}{CAM\_REQ\_CMP\_ERR}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00441}00441         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00442}00442 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00443}00443         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00444}00444 \textcolor{comment}{         * Add an async callback so that we get}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00445}00445 \textcolor{comment}{         * notified if this device goes away.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00446}00446 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00447}00447         \mbox{\hyperlink{cam__xpt_8c_a8307586c12fb4774768a25a1fa4e6388}{xpt\_register\_async}}(\mbox{\hyperlink{cam__ccb_8h_a01187b765c0d47bdbc0776db5c5851f0ac3008f99f93ca1448f9c8705b1653da5}{AC\_LOST\_DEVICE}}, \mbox{\hyperlink{scsi__ch_8c_a62bd58c71bd98dc7c1de78e30ec4c7dd}{chasync}}, periph, periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00448}00448 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00449}00449         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00450}00450 \textcolor{comment}{         * Lock this periph until we are setup.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00451}00451 \textcolor{comment}{         * This first call can't block}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00452}00452 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00453}00453         (void)\mbox{\hyperlink{cam__periph_8c_a9590854e2c9bfe6a5ba541b1a211d494}{cam\_periph\_hold}}(periph, PRIBIO);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00454}00454         \mbox{\hyperlink{cam__xpt_8c_a26e646d0732b4acab4667d28f24d026e}{xpt\_schedule}}(periph, \mbox{\hyperlink{cam_8h_ae316ae6e125010c0ca0b3e778aa04bea}{CAM\_PRIORITY\_DEV}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00455}00455 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00456}00456         \textcolor{keywordflow}{return}(\mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00457}00457 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00458}00458 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00459}00459 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00460}\mbox{\hyperlink{scsi__ch_8c_a7e9c7fe3f9e606d42c4d122d70936f9b}{00460}} \mbox{\hyperlink{scsi__ch_8c_aefc675b7ed321f55b218b6dbcbb976e6}{chopen}}(\textcolor{keyword}{struct} cdev *\mbox{\hyperlink{structch__softc_ac882634f376b144eae8c76643b035b2b}{dev}}, \textcolor{keywordtype}{int} \mbox{\hyperlink{structch__softc_ad834f151cacb70060e0986d7354adf4c}{flags}}, \textcolor{keywordtype}{int} fmt, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00461}00461 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00462}00462         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00463}00463         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00464}00464         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00465}00465 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00466}00466         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00467}00467         if (\mbox{\hyperlink{cam__periph_8c_a5b3dbda06d83cc62f5ba1be9622efa4b}{cam\_periph\_acquire}}(periph) != 0)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00468}00468                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00470}00470         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00472}00472         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00473}00473 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00474}00474         \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structch__softc_ad834f151cacb70060e0986d7354adf4c}{flags}} \& \mbox{\hyperlink{scsi__ch_8c_a25ed33926496b383a88f29e5e51abdf0a82ae50ec0385efa2b63f567c801587bb}{CH\_FLAG\_INVALID}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00475}00475                 \mbox{\hyperlink{cam__periph_8c_a06741cfe8f484a9dad6f9607a233908c}{cam\_periph\_release\_locked}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00476}00476                 \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00477}00477                 \textcolor{keywordflow}{return}(ENXIO);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00478}00478         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00479}00479 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00480}00480         \textcolor{keywordflow}{if} ((error = \mbox{\hyperlink{cam__periph_8c_a9590854e2c9bfe6a5ba541b1a211d494}{cam\_periph\_hold}}(periph, PRIBIO | PCATCH)) != 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00481}00481                 \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00482}00482                 \mbox{\hyperlink{cam__periph_8c_a7b495eee22da0818e6aec8aa176843b7}{cam\_periph\_release}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00483}00483                 \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00484}00484         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00485}00485 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00486}00486         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00487}00487 \textcolor{comment}{         * Load information about this changer device into the softc.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00488}00488 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00489}00489         \textcolor{keywordflow}{if} ((error = \mbox{\hyperlink{scsi__ch_8c_af2d54c3710d99c162025fc7f552ad020}{chgetparams}}(periph)) != 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00490}00490                 \mbox{\hyperlink{cam__periph_8c_a87d933ebed78bbf0c6fce590bb487a8d}{cam\_periph\_unhold}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00491}00491                 \mbox{\hyperlink{cam__periph_8c_a06741cfe8f484a9dad6f9607a233908c}{cam\_periph\_release\_locked}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00492}00492                 \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00493}00493                 \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00494}00494         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00496}00496         \mbox{\hyperlink{cam__periph_8c_a87d933ebed78bbf0c6fce590bb487a8d}{cam\_periph\_unhold}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00498}00498         softc-\/>\mbox{\hyperlink{structch__softc_a5a846e4f6185058771a2cfca7c3b625d}{open\_count}}++;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00499}00499 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00500}00500         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00501}00501 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00502}00502         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00503}00503 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00504}00504 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00505}00505 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00506}\mbox{\hyperlink{scsi__ch_8c_acc322e2083632cb6e4c53ca5629ac235}{00506}} \mbox{\hyperlink{scsi__ch_8c_a79fa019cb6222f4623a49c57710d1491}{chclose}}(\textcolor{keyword}{struct} cdev *\mbox{\hyperlink{structch__softc_ac882634f376b144eae8c76643b035b2b}{dev}}, \textcolor{keywordtype}{int} flag, \textcolor{keywordtype}{int} fmt, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00507}00507 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00508}00508         \textcolor{keyword}{struct  }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00509}00509         \textcolor{keyword}{struct  }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00510}00510         \textcolor{keyword}{struct }mtx *mtx;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00511}00511 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00512}00512         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00513}00513         mtx = \mbox{\hyperlink{cam__periph_8h_a8b9ecf78613a0fdde3d227cf5a109101}{cam\_periph\_mtx}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00514}00514         mtx\_lock(mtx);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00515}00515 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00516}00516         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00517}00517         softc-\/>\mbox{\hyperlink{structch__softc_a5a846e4f6185058771a2cfca7c3b625d}{open\_count}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00518}00518 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00519}00519         \mbox{\hyperlink{cam__periph_8c_a06741cfe8f484a9dad6f9607a233908c}{cam\_periph\_release\_locked}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00520}00520 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00521}00521         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00522}00522 \textcolor{comment}{         * We reference the lock directly here, instead of using}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00523}00523 \textcolor{comment}{         * cam\_periph\_unlock().  The reason is that the call to}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00524}00524 \textcolor{comment}{         * cam\_periph\_release\_locked() above could result in the periph}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00525}00525 \textcolor{comment}{         * getting freed.  If that is the case, dereferencing the periph}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00526}00526 \textcolor{comment}{         * with a cam\_periph\_unlock() call would cause a page fault.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00527}00527 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00528}00528 \textcolor{comment}{         * cam\_periph\_release() avoids this problem using the same method,}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00529}00529 \textcolor{comment}{         * but we're manually acquiring and dropping the lock here to}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00530}00530 \textcolor{comment}{         * protect the open count and avoid another lock acquisition and}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00531}00531 \textcolor{comment}{         * release.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00532}00532 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00533}00533         mtx\_unlock(mtx);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00534}00534 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00535}00535         \textcolor{keywordflow}{return}(0);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00536}00536 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00537}00537 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00538}00538 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00539}\mbox{\hyperlink{scsi__ch_8c_aee5ce3a5cd887161be01a03176eb53ba}{00539}} \mbox{\hyperlink{scsi__ch_8c_a3bd243795ece99e35cec3a2338c258c9}{chstart}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *start\_ccb)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00540}00540 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00541}00541         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00542}00542 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00543}00543         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00544}00544 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00545}00545         switch (softc-\/>\mbox{\hyperlink{structch__softc_a9cdd183ebb347f556850f8c2e544a2ca}{state}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00546}00546         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739daa481ee8765d7f0e7313614a19278cde50}{CH\_STATE\_NORMAL}}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00547}00547         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00548}00548                 \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(start\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00549}00549                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00550}00550         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00551}00551         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739daa728f9bf501005cca439857012f3b3262}{CH\_STATE\_PROBE}}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00552}00552         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00553}00553                 \textcolor{keywordtype}{int} mode\_buffer\_len;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00554}00554                 \textcolor{keywordtype}{void} *mode\_buffer;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00555}00555 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00556}00556                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00557}00557 \textcolor{comment}{                 * Include the block descriptor when calculating the mode}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00558}00558 \textcolor{comment}{                 * buffer length,}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00559}00559 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00560}00560                 mode\_buffer\_len = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__header__6}{scsi\_mode\_header\_6}}) +}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00561}00561                                   sizeof(struct \mbox{\hyperlink{structscsi__mode__blk__desc}{scsi\_mode\_blk\_desc}}) +}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00562}00562                                  sizeof(struct \mbox{\hyperlink{structpage__element__address__assignment}{page\_element\_address\_assignment}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00563}00563 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00564}00564                 mode\_buffer = malloc(mode\_buffer\_len, M\_SCSICH, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00565}00565 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00566}00566                 \textcolor{keywordflow}{if} (mode\_buffer == NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00567}00567                         printf(\textcolor{stringliteral}{"{}chstart: couldn't malloc mode sense data\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00568}00568                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00569}00569                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00570}00570                 bzero(mode\_buffer, mode\_buffer\_len);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00572}00572                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00573}00573 \textcolor{comment}{                 * Get the element address assignment page.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00574}00574 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00575}00575                 \mbox{\hyperlink{scsi__all_8c_a07dd4b57b56297e478ebd3731a7ec608}{scsi\_mode\_sense}}(\&start\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00576}00576                                 \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00577}00577                                 \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00578}00578                                 \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00579}00579                                 \textcolor{comment}{/* dbd */} (softc-\/>\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}} \& \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa986e17fe85d41ca09d211ad3c2fab56c}{CH\_Q\_NO\_DBD}}) ?}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00580}00580                                         FALSE : TRUE,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00581}00581                                 \textcolor{comment}{/* pc */} \mbox{\hyperlink{scsi__all_8h_a8b73ae18fa8796de2cbfc59283a89bd7}{SMS\_PAGE\_CTRL\_CURRENT}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00582}00582                                 \textcolor{comment}{/* page */} \mbox{\hyperlink{scsi__ch_8h_a5c515fd8e3be34f49d6a7d84bbcb14ee}{CH\_ELEMENT\_ADDR\_ASSIGN\_PAGE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00583}00583                                 \textcolor{comment}{/* param\_buf */} (u\_int8\_t *)mode\_buffer,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00584}00584                                 \textcolor{comment}{/* param\_len */} mode\_buffer\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00585}00585                                 \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00586}00586                                 \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a4b667259079afc6d5414198b591a95e7}{CH\_TIMEOUT\_MODE\_SENSE}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00587}00587 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00588}00588                 start\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.ccb\_bp = NULL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00589}00589                 start\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.ccb\_state = \mbox{\hyperlink{scsi__ch_8c_aa2d61eab6dcb38aaa924dab39b865542a9dee25eb7f27e757dd2e23a376498e30}{CH\_CCB\_PROBE}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00590}00590                 \mbox{\hyperlink{cam__xpt_8c_a6ef97382f5b1590b4d2d138516a63bcc}{xpt\_action}}(start\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00591}00591                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00592}00592         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00593}00593         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00594}00594 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00595}00595 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00596}00596 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00597}\mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{00597}} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *done\_ccb)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00598}00598 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00599}00599         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00600}00600         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00601}00601 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00602}00602         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00603}00603         csio = \&done\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00605}00605         \textcolor{keywordflow}{switch}(done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.ccb\_state) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00606}00606         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__ch_8c_aa2d61eab6dcb38aaa924dab39b865542a9dee25eb7f27e757dd2e23a376498e30}{CH\_CCB\_PROBE}}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00607}00607         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00608}00608                 \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__header__6}{scsi\_mode\_header\_6}} *mode\_header;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00609}00609                 \textcolor{keyword}{struct }\mbox{\hyperlink{structpage__element__address__assignment}{page\_element\_address\_assignment}} *ea;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00610}00610                 \textcolor{keywordtype}{char} announce\_buf[80];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00611}00611 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00612}00612                 mode\_header = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__header__6}{scsi\_mode\_header\_6}} *)csio-\/>\mbox{\hyperlink{structccb__scsiio_a51063aa61cb015be29efd19874e0586c}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00613}00613 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00614}00614                 ea = (\textcolor{keyword}{struct} \mbox{\hyperlink{structpage__element__address__assignment}{page\_element\_address\_assignment}} *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00615}00615                         \mbox{\hyperlink{scsi__all_8h_ab8b5890be8441d5fcafa1187e58bfa97}{find\_mode\_page\_6}}(mode\_header);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00616}00616 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00617}00617                 \textcolor{keywordflow}{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__ch_8c_source_l00618}00618                         }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00619}00619                         softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_MT] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a6e8c890d6474fb6a8a25bae90725013a}{mtea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00620}00620                         softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_MT] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_aabc7dd7d270ecab9d603288be7c46f7d}{nmte}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00621}00621                         softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_ST] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_acfde82cac132d74c30b984812bc13990}{fsea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00622}00622                         softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_ST] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a8c0fca8a8f22d43947f53028f4ded7fc}{nse}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00623}00623                         softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_IE] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a7035136a789edd3aca945ad40cbaeb33}{fieea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00624}00624                         softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_IE] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_afa8303e64fe251dc98a9eab4259dadf1}{niee}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00625}00625                         softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_DT] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a453e65af316e8c7feab8f3516236bbc9}{fdtea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00626}00626                         softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_DT] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a17dc0d45f29edf4c95d6000b9543dc6d}{ndte}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00627}00627                         softc-\/>\mbox{\hyperlink{structch__softc_a623ee78dbace25d4211d2e8ecfa31e7c}{sc\_picker}} = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_MT];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00628}00628 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00629}00629 \textcolor{preprocessor}{\#define PLURAL(c)       (c) == 1 ? "{}"{}} : "{}s"{}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00630}00630                         snprintf(announce\_buf, \textcolor{keyword}{sizeof}(announce\_buf),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00631}00631                                 \textcolor{stringliteral}{"{}\%d slot\%s, \%d drive\%s, "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00632}00632                                 \textcolor{stringliteral}{"{}\%d picker\%s, \%d portal\%s"{}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00633}00633                                 softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_ST],}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00634}00634                                 \mbox{\hyperlink{scsi__ch_8c_ab70c80c47c4cca145713c6b9583f9811}{PLURAL}}(softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_ST]),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00635}00635                                 softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_DT],}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00636}00636                                 \mbox{\hyperlink{scsi__ch_8c_ab70c80c47c4cca145713c6b9583f9811}{PLURAL}}(softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_DT]),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00637}00637                                 softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_MT],}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00638}00638                                 \mbox{\hyperlink{scsi__ch_8c_ab70c80c47c4cca145713c6b9583f9811}{PLURAL}}(softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_MT]),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00639}00639                                 softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_IE],}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00640}00640                                 \mbox{\hyperlink{scsi__ch_8c_ab70c80c47c4cca145713c6b9583f9811}{PLURAL}}(softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_IE]));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00641}00641 \textcolor{preprocessor}{\#undef PLURAL}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00642}00642                         \textcolor{keywordflow}{if} (announce\_buf[0] != \textcolor{charliteral}{'\(\backslash\)0'}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00643}00643                                 \mbox{\hyperlink{cam__xpt_8c_a62eab2d96b6a86a325df1d826c201746}{xpt\_announce\_periph}}(periph, announce\_buf);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00644}00644                                 \mbox{\hyperlink{cam__xpt_8c_ae4c51443613933a7cdffc5abbb6c3568}{xpt\_announce\_quirks}}(periph, softc-\/>\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00645}00645                                     \mbox{\hyperlink{scsi__ch_8c_a866ac930bb910015640255100c24be82}{CH\_Q\_BIT\_STRING}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00646}00646                         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00647}00647                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00648}00648                         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00649}00649 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00650}00650                         error = \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}(done\_ccb, \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00651}00651                                         \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}} | \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55baf5ee8065dc68dd8b0eddebd7eb317a35}{SF\_NO\_PRINT}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00652}00652                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00653}00653 \textcolor{comment}{                         * Retry any UNIT ATTENTION type errors.  They}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00654}00654 \textcolor{comment}{                         * are expected at boot.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00655}00655 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00656}00656                         \textcolor{keywordflow}{if} (error == ERESTART) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00657}00657                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00658}00658 \textcolor{comment}{                                 * A retry was scheduled, so}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00659}00659 \textcolor{comment}{                                 * just return.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00660}00660 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00661}00661                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00662}00662                         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (error != 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00663}00663                                 \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__sense__6}{scsi\_mode\_sense\_6}} *sms;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00664}00664                                 \textcolor{keywordtype}{int} frozen, retry\_scheduled;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00666}00666                                 sms = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__sense__6}{scsi\_mode\_sense\_6}} *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00667}00667                                         done\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00668}00668                                 frozen = (done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} \&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00669}00669                                     \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3afe5c2fa0edb1c8fea0119515430d223e}{CAM\_DEV\_QFRZN}}) != 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00670}00670 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00671}00671                                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00672}00672 \textcolor{comment}{                                 * Check to see if block descriptors were}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00673}00673 \textcolor{comment}{                                 * disabled.  Some devices don't like that.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00674}00674 \textcolor{comment}{                                 * We're taking advantage of the fact that}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00675}00675 \textcolor{comment}{                                 * the first few bytes of the 6 and 10 byte}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00676}00676 \textcolor{comment}{                                 * mode sense commands are the same.  If}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00677}00677 \textcolor{comment}{                                 * block descriptors were disabled, enable}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00678}00678 \textcolor{comment}{                                 * them and re-\/send the command.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00679}00679 \textcolor{comment}{                                 */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00680}00680                                 \textcolor{keywordflow}{if} ((sms-\/>\mbox{\hyperlink{structscsi__mode__sense__6_a5bd79694d37081cc58e8abc9b547cfe1}{byte2}} \& \mbox{\hyperlink{scsi__all_8h_a5620f0d292b7ef32bbc8709e0898da08}{SMS\_DBD}}) != 0 \&\&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00681}00681                                     (periph-\/>\mbox{\hyperlink{structcam__periph_adc175e8331b0d9559b02277232bc8c5a}{flags}} \& \mbox{\hyperlink{cam__periph_8h_a102702353fe3915d10c6d66bf5b643a7}{CAM\_PERIPH\_INVALID}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00682}00682                                         sms-\/>\mbox{\hyperlink{structscsi__mode__sense__6_a5bd79694d37081cc58e8abc9b547cfe1}{byte2}} \&= \string~SMS\_DBD;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00683}00683                                         \mbox{\hyperlink{cam__xpt_8c_a6ef97382f5b1590b4d2d138516a63bcc}{xpt\_action}}(done\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00684}00684                                         softc-\/>\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}} |= \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa986e17fe85d41ca09d211ad3c2fab56c}{CH\_Q\_NO\_DBD}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00685}00685                                         retry\_scheduled = 1;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00686}00686                                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00687}00687                                         retry\_scheduled = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00688}00688 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00689}00689                                 \textcolor{comment}{/* Don't wedge this device's queue */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00690}00690                                 \textcolor{keywordflow}{if} (frozen)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00691}00691                                         \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__ch_8c_source_l00692}00692                                                  \textcolor{comment}{/*relsim\_flags*/}0,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00693}00693                                                  \textcolor{comment}{/*reduction*/}0,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00694}00694                                                  \textcolor{comment}{/*timeout*/}0,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00695}00695                                                  \textcolor{comment}{/*getcount\_only*/}0);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00696}00696 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00697}00697                                 \textcolor{keywordflow}{if} (retry\_scheduled)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00698}00698                                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00699}00699 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00700}00700                                 \textcolor{keywordflow}{if} ((done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} \& \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a82f0d57eda0654067dc2db0c2a218caa}{CAM\_STATUS\_MASK}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00701}00701                                     == \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3aeb963e5650478930f8ff1380b169a84f}{CAM\_SCSI\_STATUS\_ERROR}}) }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00702}00702                                         \mbox{\hyperlink{scsi__all_8c_a4c4e999b950a849e9de2497a26efff53}{scsi\_sense\_print}}(\&done\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00703}00703                                 \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00704}00704                                         \mbox{\hyperlink{cam__xpt_8c_a342b8e2ed77d0b7a12ae7bc49dd2beac}{xpt\_print}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00705}00705                                             \textcolor{stringliteral}{"{}got CAM status \%\#x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00706}00706                                             done\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00707}00707                                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00708}00708                                 \mbox{\hyperlink{cam__xpt_8c_a342b8e2ed77d0b7a12ae7bc49dd2beac}{xpt\_print}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}}, \textcolor{stringliteral}{"{}fatal error, failed "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00709}00709                                     \textcolor{stringliteral}{"{}to attach to device\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00710}00710 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00711}00711                                 \mbox{\hyperlink{cam__periph_8c_ac018c88658c51ec769298af70819c000}{cam\_periph\_invalidate}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00712}00712                         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00713}00713                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00714}00714                 softc-\/>\mbox{\hyperlink{structch__softc_a9cdd183ebb347f556850f8c2e544a2ca}{state}} = \mbox{\hyperlink{scsi__ch_8c_a6091ad1fb66681f49396d0c5c64739daa481ee8765d7f0e7313614a19278cde50}{CH\_STATE\_NORMAL}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00715}00715                 free(mode\_header, M\_SCSICH);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00716}00716                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00717}00717 \textcolor{comment}{                 * Since our peripheral may be invalidated by an error}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00718}00718 \textcolor{comment}{                 * above or an external event, we must release our CCB}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00719}00719 \textcolor{comment}{                 * before releasing the probe lock on the peripheral.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00720}00720 \textcolor{comment}{                 * The peripheral will only go away once the last lock}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00721}00721 \textcolor{comment}{                 * is removed, and we need it around for the CCB release}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00722}00722 \textcolor{comment}{                 * operation.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00723}00723 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00724}00724                 \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(done\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00725}00725                 \mbox{\hyperlink{cam__periph_8c_a87d933ebed78bbf0c6fce590bb487a8d}{cam\_periph\_unhold}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00726}00726                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00727}00727         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00728}00728         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00729}00729                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00730}00730         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00731}00731         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(done\_ccb);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00732}00732 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00734}00734 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00735}\mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{00735}} \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}(\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__ch_8c_source_l00736}00736 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00737}00737 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00738}00738         \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__ch_8c_source_l00739}00739 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00740}00740 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00741}00741 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00742}\mbox{\hyperlink{scsi__ch_8c_ace31f58e64cc05da8f3135e582089f40}{00742}} \mbox{\hyperlink{scsi__ch_8c_a2391ef7917bd7cf47ed01c74e4e463a3}{chioctl}}(\textcolor{keyword}{struct} cdev *dev, u\_long cmd, caddr\_t addr, \textcolor{keywordtype}{int} flag, \textcolor{keyword}{struct} thread *td)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00743}00743 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00744}00744         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00745}00745         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00746}00746         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00747}00747 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00748}00748         periph = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcam__periph}{cam\_periph}} *)dev-\/>si\_drv1;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00749}00749         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00750}00750         \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}{"{}entering chioctl\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00751}00751 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00752}00752         \mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00753}00753 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00754}00754         error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00756}00756         \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__ch_8c_source_l00757}00757                   (\textcolor{stringliteral}{"{}trying to do ioctl \%\#lx\(\backslash\)n"{}}, cmd));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00758}00758 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00759}00759         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00760}00760 \textcolor{comment}{         * If this command can change the device's state, we must}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00761}00761 \textcolor{comment}{         * have the device open for writing.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00762}00762 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00763}00763         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00764}00764         \textcolor{keywordflow}{case} CHIOGPICKER:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00765}00765         \textcolor{keywordflow}{case} CHIOGPARAMS:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00766}00766         \textcolor{keywordflow}{case} OCHIOGSTATUS:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00767}00767         \textcolor{keywordflow}{case} CHIOGSTATUS:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00768}00768                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00769}00769 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00770}00770         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00771}00771                 \textcolor{keywordflow}{if} ((flag \& FWRITE) == 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00772}00772                         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00773}00773                         \textcolor{keywordflow}{return} (EBADF);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00774}00774                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00775}00775         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00776}00776 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00777}00777         \textcolor{keywordflow}{switch} (cmd) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00778}00778         \textcolor{keywordflow}{case} CHIOMOVE:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00779}00779                 error = \mbox{\hyperlink{scsi__ch_8c_ae49b09766cd8433bb99c85bb7864bdd2}{chmove}}(periph, (\textcolor{keyword}{struct} changer\_move *)addr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00780}00780                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00781}00781 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00782}00782         \textcolor{keywordflow}{case} CHIOEXCHANGE:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00783}00783                 error = \mbox{\hyperlink{scsi__ch_8c_a2c03d6f1c5606bc2b3701474084a5e6c}{chexchange}}(periph, (\textcolor{keyword}{struct} changer\_exchange *)addr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00784}00784                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00785}00785 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00786}00786         \textcolor{keywordflow}{case} CHIOPOSITION:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00787}00787                 error = \mbox{\hyperlink{scsi__ch_8c_a85ef32b0b65ff0da725db58b086aa4d4}{chposition}}(periph, (\textcolor{keyword}{struct} changer\_position *)addr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00788}00788                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00789}00789 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00790}00790         \textcolor{keywordflow}{case} CHIOGPICKER:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00791}00791                 *(\textcolor{keywordtype}{int} *)addr = softc-\/>\mbox{\hyperlink{structch__softc_a623ee78dbace25d4211d2e8ecfa31e7c}{sc\_picker}} -\/ softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_MT];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00792}00792                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00793}00793 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00794}00794         \textcolor{keywordflow}{case} CHIOSPICKER:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00795}00795         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00796}00796                 \textcolor{keywordtype}{int} new\_picker = *(\textcolor{keywordtype}{int} *)addr;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00797}00797 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00798}00798                 \textcolor{keywordflow}{if} (new\_picker > (softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_MT] -\/ 1)) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00799}00799                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00800}00800                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00801}00801                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00802}00802                 softc-\/>\mbox{\hyperlink{structch__softc_a623ee78dbace25d4211d2e8ecfa31e7c}{sc\_picker}} = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_MT] + new\_picker;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00803}00803                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00804}00804         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00805}00805         \textcolor{keywordflow}{case} CHIOGPARAMS:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00806}00806         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00807}00807                 \textcolor{keyword}{struct }changer\_params *cp = (\textcolor{keyword}{struct }changer\_params *)addr;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00808}00808 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00809}00809                 cp-\/>cp\_npickers = softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_MT];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00810}00810                 cp-\/>cp\_nslots = softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_ST];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00811}00811                 cp-\/>cp\_nportals = softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_IE];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00812}00812                 cp-\/>cp\_ndrives = softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_DT];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00813}00813                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00814}00814         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00815}00815         \textcolor{keywordflow}{case} CHIOIELEM:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00816}00816                 error = \mbox{\hyperlink{scsi__ch_8c_a349d2f5b0ecee2f4d43d8dd9194ff668}{chielem}}(periph, *(\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} *)addr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00817}00817                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00818}00818 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00819}00819         \textcolor{keywordflow}{case} OCHIOGSTATUS:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00820}00820         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00821}00821                 error = \mbox{\hyperlink{scsi__ch_8c_adeba3b8e8887ca44827df029fafbfe7f}{chgetelemstatus}}(periph, \mbox{\hyperlink{scsi__all_8h_a0998c5a889c1c838a9f5b90e9f87d722}{SCSI\_REV\_2}}, cmd,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00822}00822                     (\textcolor{keyword}{struct} changer\_element\_status\_request *)addr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00823}00823                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00824}00824         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00825}00825 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00826}00826         \textcolor{keywordflow}{case} CHIOGSTATUS:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00827}00827         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00828}00828                 \textcolor{keywordtype}{int} scsi\_version;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00829}00829 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00830}00830                 scsi\_version = \mbox{\hyperlink{scsi__ch_8c_aaa6b29cc1115796b832180b30c045cc6}{chscsiversion}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00831}00831                 \textcolor{keywordflow}{if} (scsi\_version >= \mbox{\hyperlink{scsi__all_8h_a4cb01a4baa36d317efd2ed185e75b53c}{SCSI\_REV\_0}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00832}00832                         error = \mbox{\hyperlink{scsi__ch_8c_adeba3b8e8887ca44827df029fafbfe7f}{chgetelemstatus}}(periph, scsi\_version, cmd,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00833}00833                             (\textcolor{keyword}{struct} changer\_element\_status\_request *)addr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00834}00834                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00835}00835                 \textcolor{keywordflow}{else} \{ \textcolor{comment}{/* unable to determine the SCSI version */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00836}00836                         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00837}00837                         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00838}00838                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00839}00839                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00840}00840         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00841}00841 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00842}00842         \textcolor{keywordflow}{case} CHIOSETVOLTAG:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00843}00843         \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00844}00844                 error = \mbox{\hyperlink{scsi__ch_8c_a1c42babd4cca445f7505e778a384973d}{chsetvoltag}}(periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00845}00845                                     (\textcolor{keyword}{struct} changer\_set\_voltag\_request *) addr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00846}00846                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00847}00847         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00848}00848 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00849}00849         \textcolor{comment}{/* Implement prevent/allow? */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00850}00850 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00851}00851         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00852}00852                 error = \mbox{\hyperlink{cam__periph_8c_ac87854e887a6602529ea8cafa66dbdac}{cam\_periph\_ioctl}}(periph, cmd, addr, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00853}00853                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00854}00854         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00855}00855 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00856}00856         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00857}00857         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00858}00858 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00859}00859 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00860}00860 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00861}\mbox{\hyperlink{scsi__ch_8c_ae49b09766cd8433bb99c85bb7864bdd2}{00861}} \mbox{\hyperlink{scsi__ch_8c_ae49b09766cd8433bb99c85bb7864bdd2}{chmove}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keyword}{struct} changer\_move *cm)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00862}00862 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00863}00863         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00864}00864         u\_int16\_t fromelem, toelem;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00865}00865         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00866}00866         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00867}00867 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00868}00868         error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00869}00869         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00870}00870 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00871}00871         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00872}00872 \textcolor{comment}{         * Check arguments.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00873}00873 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00874}00874         if ((cm-\/>cm\_fromtype > CHET\_DT) || (cm-\/>cm\_totype > CHET\_DT))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00875}00875                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00876}00876         \textcolor{keywordflow}{if} ((cm-\/>cm\_fromunit > (softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[cm-\/>cm\_fromtype] -\/ 1)) ||}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00877}00877             (cm-\/>cm\_tounit > (softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[cm-\/>cm\_totype] -\/ 1)))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00878}00878                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00879}00879 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00880}00880         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00881}00881 \textcolor{comment}{         * Check the request against the changer's capabilities.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00882}00882 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00883}00883         \textcolor{keywordflow}{if} ((softc-\/>\mbox{\hyperlink{structch__softc_a8cb33f55148d225539dab1dc926a698c}{sc\_movemask}}[cm-\/>cm\_fromtype] \& (1 << cm-\/>cm\_totype)) == 0)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00884}00884                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00885}00885 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00886}00886         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00887}00887 \textcolor{comment}{         * Calculate the source and destination elements.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00888}00888 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00889}00889         fromelem = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[cm-\/>cm\_fromtype] + cm-\/>cm\_fromunit;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00890}00890         toelem = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[cm-\/>cm\_totype] + cm-\/>cm\_tounit;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00891}00891 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00892}00892         \mbox{\hyperlink{unionccb}{ccb}} = \mbox{\hyperlink{cam__periph_8h_a3e0b448f630edd6d782fb33e4a12e3f1}{cam\_periph\_getccb}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00893}00893 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00894}00894         \mbox{\hyperlink{scsi__ch_8c_a7cc1c3be14babea28420a742eb0d2ada}{scsi\_move\_medium}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00895}00895                          \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00896}00896                          \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00897}00897                          \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00898}00898                          \textcolor{comment}{/* tea */} softc-\/>\mbox{\hyperlink{structch__softc_a623ee78dbace25d4211d2e8ecfa31e7c}{sc\_picker}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00899}00899                          \textcolor{comment}{/* src */} fromelem,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00900}00900                          \textcolor{comment}{/* dst */} toelem,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00901}00901                          \textcolor{comment}{/* invert */} (cm-\/>cm\_flags \& CM\_INVERT) ? TRUE : FALSE,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00902}00902                          \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00903}00903                          \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a198764c6c45e5b0c1cbe2041bf9a3487}{CH\_TIMEOUT\_MOVE\_MEDIUM}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00904}00904 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00905}00905         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/}\mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00906}00906                                   \textcolor{comment}{/*sense\_flags*/} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00907}00907                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00908}00908 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00909}00909         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00910}00910 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00911}00911         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00912}00912 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00913}00913 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00914}00914 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00915}\mbox{\hyperlink{scsi__ch_8c_a2c03d6f1c5606bc2b3701474084a5e6c}{00915}} \mbox{\hyperlink{scsi__ch_8c_a2c03d6f1c5606bc2b3701474084a5e6c}{chexchange}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keyword}{struct} changer\_exchange *ce)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00916}00916 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00917}00917         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00918}00918         u\_int16\_t src, dst1, dst2;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00919}00919         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00920}00920         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00921}00921 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00922}00922         error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00923}00923         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00924}00924         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00925}00925 \textcolor{comment}{         * Check arguments.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00926}00926 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00927}00927         if ((ce-\/>ce\_srctype > CHET\_DT) || (ce-\/>ce\_fdsttype > CHET\_DT) ||}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00928}00928             (ce-\/>ce\_sdsttype > CHET\_DT))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00929}00929                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00930}00930         \textcolor{keywordflow}{if} ((ce-\/>ce\_srcunit > (softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[ce-\/>ce\_srctype] -\/ 1)) ||}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00931}00931             (ce-\/>ce\_fdstunit > (softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[ce-\/>ce\_fdsttype] -\/ 1)) ||}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00932}00932             (ce-\/>ce\_sdstunit > (softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[ce-\/>ce\_sdsttype] -\/ 1)))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00933}00933                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00934}00934 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00935}00935         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00936}00936 \textcolor{comment}{         * Check the request against the changer's capabilities.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00937}00937 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00938}00938         \textcolor{keywordflow}{if} (((softc-\/>\mbox{\hyperlink{structch__softc_a86bfb96ab5a53a4ae9d6cad535336ce0}{sc\_exchangemask}}[ce-\/>ce\_srctype] \&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00939}00939              (1 << ce-\/>ce\_fdsttype)) == 0) ||}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00940}00940             ((softc-\/>\mbox{\hyperlink{structch__softc_a86bfb96ab5a53a4ae9d6cad535336ce0}{sc\_exchangemask}}[ce-\/>ce\_fdsttype] \&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00941}00941              (1 << ce-\/>ce\_sdsttype)) == 0))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00942}00942                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00943}00943 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00944}00944         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00945}00945 \textcolor{comment}{         * Calculate the source and destination elements.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00946}00946 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00947}00947         src = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[ce-\/>ce\_srctype] + ce-\/>ce\_srcunit;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00948}00948         dst1 = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[ce-\/>ce\_fdsttype] + ce-\/>ce\_fdstunit;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00949}00949         dst2 = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[ce-\/>ce\_sdsttype] + ce-\/>ce\_sdstunit;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00950}00950 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00951}00951         \mbox{\hyperlink{unionccb}{ccb}} = \mbox{\hyperlink{cam__periph_8h_a3e0b448f630edd6d782fb33e4a12e3f1}{cam\_periph\_getccb}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00952}00952 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00953}00953         \mbox{\hyperlink{scsi__ch_8c_aa3c02ab23ecefb92cb3b4dc5542a0168}{scsi\_exchange\_medium}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00954}00954                              \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00955}00955                              \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00956}00956                              \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00957}00957                              \textcolor{comment}{/* tea */} softc-\/>\mbox{\hyperlink{structch__softc_a623ee78dbace25d4211d2e8ecfa31e7c}{sc\_picker}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00958}00958                              \textcolor{comment}{/* src */} src,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00959}00959                              \textcolor{comment}{/* dst1 */} dst1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00960}00960                              \textcolor{comment}{/* dst2 */} dst2,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00961}00961                              \textcolor{comment}{/* invert1 */} (ce-\/>ce\_flags \& CE\_INVERT1) ?}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00962}00962                                            TRUE : FALSE,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00963}00963                              \textcolor{comment}{/* invert2 */} (ce-\/>ce\_flags \& CE\_INVERT2) ?}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00964}00964                                            TRUE : FALSE,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00965}00965                              \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00966}00966                              \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a511d836117ae55ddbaf5d6ada9a53a5c}{CH\_TIMEOUT\_EXCHANGE\_MEDIUM}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00967}00967 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00968}00968         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/}\mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00969}00969                                   \textcolor{comment}{/*sense\_flags*/} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00970}00970                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00971}00971 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00972}00972         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00973}00973 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00974}00974         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00975}00975 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00976}00976 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00977}00977 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00978}\mbox{\hyperlink{scsi__ch_8c_a85ef32b0b65ff0da725db58b086aa4d4}{00978}} \mbox{\hyperlink{scsi__ch_8c_a85ef32b0b65ff0da725db58b086aa4d4}{chposition}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keyword}{struct} changer\_position *cp)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00979}00979 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00980}00980         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00981}00981         u\_int16\_t dst;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00982}00982         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00983}00983         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00984}00984 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00985}00985         error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00986}00986         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00987}00987 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00988}00988         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00989}00989 \textcolor{comment}{         * Check arguments.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00990}00990 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00991}00991         if (cp-\/>cp\_type > CHET\_DT)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00992}00992                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00993}00993         \textcolor{keywordflow}{if} (cp-\/>cp\_unit > (softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[cp-\/>cp\_type] -\/ 1))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00994}00994                 \textcolor{keywordflow}{return} (ENODEV);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00995}00995 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00996}00996         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00997}00997 \textcolor{comment}{         * Calculate the destination element.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00998}00998 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l00999}00999         dst = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[cp-\/>cp\_type] + cp-\/>cp\_unit;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01000}01000 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01001}01001         \mbox{\hyperlink{unionccb}{ccb}} = \mbox{\hyperlink{cam__periph_8h_a3e0b448f630edd6d782fb33e4a12e3f1}{cam\_periph\_getccb}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01002}01002 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01003}01003         \mbox{\hyperlink{scsi__ch_8c_a7d0be791f5ed9f625e5ca2d4eed4331f}{scsi\_position\_to\_element}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01004}01004                                  \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01005}01005                                  \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01006}01006                                  \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01007}01007                                  \textcolor{comment}{/* tea */} softc-\/>\mbox{\hyperlink{structch__softc_a623ee78dbace25d4211d2e8ecfa31e7c}{sc\_picker}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01008}01008                                  \textcolor{comment}{/* dst */} dst,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01009}01009                                  \textcolor{comment}{/* invert */} (cp-\/>cp\_flags \& CP\_INVERT) ?}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01010}01010                                               TRUE : FALSE,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01011}01011                                  \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01012}01012                                  \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a0c9d0e664cd15160b1f773094d2546fb}{CH\_TIMEOUT\_POSITION\_TO\_ELEMENT}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01013}01013 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01014}01014         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01015}01015                                   \textcolor{comment}{/*sense\_flags*/} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01016}01016                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01017}01017 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01018}01018         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01019}01019 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01020}01020         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01021}01021 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01022}01022 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01023}01023 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01024}01024 \textcolor{comment}{ * Copy a volume tag to a volume\_tag struct, converting SCSI byte order}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01025}01025 \textcolor{comment}{ * to host native byte order in the volume serial number.  The volume}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01026}01026 \textcolor{comment}{ * label as returned by the changer is transferred to user mode as}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01027}01027 \textcolor{comment}{ * nul-\/terminated string.  Volume labels are truncated at the first}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01028}01028 \textcolor{comment}{ * space, as suggested by SCSI-\/2.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01029}01029 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01030}01030 \textcolor{keyword}{static}  \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01031}\mbox{\hyperlink{scsi__ch_8c_a538c16fae8743aae91ca5aef2931ea7d}{01031}} \mbox{\hyperlink{scsi__ch_8c_a538c16fae8743aae91ca5aef2931ea7d}{copy\_voltag}}(\textcolor{keyword}{struct} changer\_voltag *uvoltag, \textcolor{keyword}{struct} \mbox{\hyperlink{structvolume__tag}{volume\_tag}} *voltag)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01032}01032 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01033}01033         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01034}01034         \textcolor{keywordflow}{for} (i=0; i<CH\_VOLTAG\_MAXLEN; i++) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01035}01035                 \textcolor{keywordtype}{char} c = voltag-\/>\mbox{\hyperlink{structvolume__tag_ad48afea9ecefccd27a74403d0deb2dac}{vif}}[i];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01036}01036                 \textcolor{keywordflow}{if} (c \&\& c != \textcolor{charliteral}{' '})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01037}01037                         uvoltag-\/>cv\_volid[i] = c;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01038}01038                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01039}01039                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01040}01040         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01041}01041         uvoltag-\/>cv\_serial = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(voltag-\/>\mbox{\hyperlink{structvolume__tag_a76a1e0d17511458da0e5815cf85eb8f9}{vsn}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01042}01042 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01043}01043 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01044}01044 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01045}01045 \textcolor{comment}{ * Copy an element status descriptor to a user-\/mode}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01046}01046 \textcolor{comment}{ * changer\_element\_status structure.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01047}01047 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01048}01048 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01049}\mbox{\hyperlink{scsi__ch_8c_a6660da55459a09520f5942c0f5144678}{01049}} \mbox{\hyperlink{scsi__ch_8c_a6660da55459a09520f5942c0f5144678}{copy\_element\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structch__softc}{ch\_softc}} *softc,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01050}01050                     u\_int16\_t \mbox{\hyperlink{structch__softc_ad834f151cacb70060e0986d7354adf4c}{flags}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01051}01051                     \textcolor{keyword}{struct} \mbox{\hyperlink{structread__element__status__descriptor}{read\_element\_status\_descriptor}} *desc,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01052}01052                     \textcolor{keyword}{struct} changer\_element\_status *ces,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01053}01053                     \textcolor{keywordtype}{int} scsi\_version)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01054}01054 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01055}01055         u\_int16\_t eaddr = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_ad8ec52aeebf2644654c92a00ff532c68}{eaddr}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01056}01056         u\_int16\_t et;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01057}01057         \textcolor{keyword}{struct }\mbox{\hyperlink{structvolume__tag}{volume\_tag}} *pvol\_tag = NULL, *avol\_tag = NULL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01058}01058         \textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__device__id}{read\_element\_status\_device\_id}} *devid = NULL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01059}01059 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01060}01060         ces-\/>ces\_int\_addr = eaddr;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01061}01061         \textcolor{comment}{/* set up logical address in element status */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01062}01062         \textcolor{keywordflow}{for} (et = CHET\_MT; et <= CHET\_DT; et++) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01063}01063                 \textcolor{keywordflow}{if} ((softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[et] <= eaddr)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01064}01064                     \&\& ((softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[et] + softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[et])}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01065}01065                         > eaddr)) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01066}01066                         ces-\/>ces\_addr = eaddr -\/ softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[et];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01067}01067                         ces-\/>ces\_type = et;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01068}01068                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01069}01069                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01070}01070         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01071}01071 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01072}01072         ces-\/>ces\_flags = desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_a4a65e7b40f254e50670d43e2269bff04}{flags1}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01073}01073 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01074}01074         ces-\/>ces\_sensecode = desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_a85748622595164ba8a7c33cd6933c439}{sense\_code}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01075}01075         ces-\/>ces\_sensequal = desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_a7fbabd2b5f774da667f8a6c1fbe25688}{sense\_qual}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01076}01076 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01077}01077         \textcolor{keywordflow}{if} (desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_af3359a42fe774b8db10f1aa456cf99ad}{flags2}} \& \mbox{\hyperlink{scsi__ch_8h_a669f5a2ab3f535ad5461126e62d105c3}{READ\_ELEMENT\_STATUS\_INVERT}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01078}01078                 ces-\/>ces\_flags |= CES\_INVERT;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01079}01079 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01080}01080         \textcolor{keywordflow}{if} (desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_af3359a42fe774b8db10f1aa456cf99ad}{flags2}} \& \mbox{\hyperlink{scsi__ch_8h_a301a49f2b9c032933b1eb7ead6c3f686}{READ\_ELEMENT\_STATUS\_SVALID}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01081}01081                 eaddr = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_afde8b66000cb1f481a54b1f04d8a0531}{ssea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01082}01082 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01083}01083                 \textcolor{comment}{/* convert source address to logical format */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01084}01084                 \textcolor{keywordflow}{for} (et = CHET\_MT; et <= CHET\_DT; et++) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01085}01085                         \textcolor{keywordflow}{if} ((softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[et] <= eaddr)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01086}01086                             \&\& ((softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[et] + softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[et])}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01087}01087                                 > eaddr)) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01088}01088                                 ces-\/>ces\_source\_addr =}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01089}01089                                         eaddr -\/ softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[et];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01090}01090                                 ces-\/>ces\_source\_type = et;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01091}01091                                 ces-\/>ces\_flags |= CES\_SOURCE\_VALID;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01092}01092                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01093}01093                         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01094}01094                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01095}01095 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01096}01096                 \textcolor{keywordflow}{if} (!(ces-\/>ces\_flags \& CES\_SOURCE\_VALID))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01097}01097                         printf(\textcolor{stringliteral}{"{}ch: warning: could not map element source "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01098}01098                                \textcolor{stringliteral}{"{}address \%ud to a valid element type\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01099}01099                                eaddr);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01100}01100         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01101}01101 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01102}01102         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01103}01103 \textcolor{comment}{         * pvoltag and avoltag are common between SCSI-\/2 and later versions}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01104}01104 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01105}01105         \textcolor{keywordflow}{if} (flags \& \mbox{\hyperlink{scsi__ch_8h_acfa45213a821cd06fa698b7d34169091}{READ\_ELEMENT\_STATUS\_PVOLTAG}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01106}01106                 pvol\_tag = \&desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_aa1c37c8735f2e06244442eb2ffe24b46}{voltag\_devid}}.\mbox{\hyperlink{structread__element__status__descriptor_a3bae8d14310b30c2966dd2cba155c3af}{pvoltag}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01107}01107         \textcolor{keywordflow}{if} (flags \& \mbox{\hyperlink{scsi__ch_8h_a513f3343087c73796dcbcd3f3b3cccbc}{READ\_ELEMENT\_STATUS\_AVOLTAG}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01108}01108                 avol\_tag = (flags \& \mbox{\hyperlink{scsi__ch_8h_acfa45213a821cd06fa698b7d34169091}{READ\_ELEMENT\_STATUS\_PVOLTAG}}) ?}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01109}01109                     \&desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_aa1c37c8735f2e06244442eb2ffe24b46}{voltag\_devid}}.\mbox{\hyperlink{structread__element__status__descriptor_a4f353e20820e7c872ccfa688a89c5b22}{voltag}}[1] :\&desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_aa1c37c8735f2e06244442eb2ffe24b46}{voltag\_devid}}.\mbox{\hyperlink{structread__element__status__descriptor_a3bae8d14310b30c2966dd2cba155c3af}{pvoltag}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01110}01110         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01111}01111 \textcolor{comment}{         * For SCSI-\/3 and later, element status can carry designator and}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01112}01112 \textcolor{comment}{         * other information.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01113}01113 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01114}01114         if (scsi\_version >= \mbox{\hyperlink{scsi__all_8h_a4ca74e45eb903450c0ffe2f95e447c6d}{SCSI\_REV\_SPC}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01115}01115                 \textcolor{keywordflow}{if} ((flags \& \mbox{\hyperlink{scsi__ch_8h_acfa45213a821cd06fa698b7d34169091}{READ\_ELEMENT\_STATUS\_PVOLTAG}}) \string^}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01116}01116                     (flags \& \mbox{\hyperlink{scsi__ch_8h_a513f3343087c73796dcbcd3f3b3cccbc}{READ\_ELEMENT\_STATUS\_AVOLTAG}}))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01117}01117                         devid = \&desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_aa1c37c8735f2e06244442eb2ffe24b46}{voltag\_devid}}.\mbox{\hyperlink{structread__element__status__descriptor_ab50d43c877d4ec2ef5e60369b2c03969}{pvol\_and\_devid}}.\mbox{\hyperlink{structread__element__status__descriptor_a9e30db61756ecdefb46194210a0c0a9c}{devid}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01118}01118                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (!(flags \& \mbox{\hyperlink{scsi__ch_8h_acfa45213a821cd06fa698b7d34169091}{READ\_ELEMENT\_STATUS\_PVOLTAG}}) \&\&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01119}01119                          !(flags \& \mbox{\hyperlink{scsi__ch_8h_a513f3343087c73796dcbcd3f3b3cccbc}{READ\_ELEMENT\_STATUS\_AVOLTAG}}))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01120}01120                         devid = \&desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_aa1c37c8735f2e06244442eb2ffe24b46}{voltag\_devid}}.\mbox{\hyperlink{structread__element__status__descriptor_a9e30db61756ecdefb46194210a0c0a9c}{devid}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01121}01121                 \textcolor{keywordflow}{else} \textcolor{comment}{/* Have both PVOLTAG and AVOLTAG */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01122}01122                         devid = \&desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_aa1c37c8735f2e06244442eb2ffe24b46}{voltag\_devid}}.\mbox{\hyperlink{structread__element__status__descriptor_ae1453ca5a07d3cc0895376e0da83fe51}{vol\_tags\_and\_devid}}.\mbox{\hyperlink{structread__element__status__descriptor_a9e30db61756ecdefb46194210a0c0a9c}{devid}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01123}01123         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01124}01124 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01125}01125         \textcolor{keywordflow}{if} (pvol\_tag)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01126}01126                 \mbox{\hyperlink{scsi__ch_8c_a538c16fae8743aae91ca5aef2931ea7d}{copy\_voltag}}(\&(ces-\/>ces\_pvoltag), pvol\_tag);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01127}01127         \textcolor{keywordflow}{if} (avol\_tag)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01128}01128                 \mbox{\hyperlink{scsi__ch_8c_a538c16fae8743aae91ca5aef2931ea7d}{copy\_voltag}}(\&(ces-\/>ces\_pvoltag), avol\_tag);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01129}01129         \textcolor{keywordflow}{if} (devid != NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01130}01130                 \textcolor{keywordflow}{if} (devid-\/>\mbox{\hyperlink{structread__element__status__device__id_adc2f88719415857a6a580183942c4a4a}{designator\_length}} > 0) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01131}01131                         bcopy((\textcolor{keywordtype}{void} *)devid-\/>\mbox{\hyperlink{structread__element__status__device__id_aa4b433d1eefc7a418c7fc76cb048f103}{designator}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01132}01132                               (\textcolor{keywordtype}{void} *)ces-\/>ces\_designator,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01133}01133                               devid-\/>\mbox{\hyperlink{structread__element__status__device__id_adc2f88719415857a6a580183942c4a4a}{designator\_length}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01134}01134                         ces-\/>ces\_designator\_length = devid-\/>\mbox{\hyperlink{structread__element__status__device__id_adc2f88719415857a6a580183942c4a4a}{designator\_length}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01135}01135                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01136}01136 \textcolor{comment}{                         * Make sure we are always NUL terminated.  The}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01137}01137 \textcolor{comment}{                         * This won't matter for the binary code set,}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01138}01138 \textcolor{comment}{                         * since the user will only pay attention to the}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01139}01139 \textcolor{comment}{                         * length field.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01140}01140 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01141}01141                         ces-\/>ces\_designator[devid-\/>\mbox{\hyperlink{structread__element__status__device__id_adc2f88719415857a6a580183942c4a4a}{designator\_length}}]= \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01142}01142                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01143}01143                 \textcolor{keywordflow}{if} (devid-\/>\mbox{\hyperlink{structread__element__status__device__id_a0265585181dbe3edb5f062d446017c38}{piv\_assoc\_designator\_type}} \&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01144}01144                     \mbox{\hyperlink{scsi__ch_8h_a2724548a308f6e5c2cfdcf53e34cd666}{READ\_ELEMENT\_STATUS\_PIV\_SET}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01145}01145                         ces-\/>ces\_flags |= CES\_PIV;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01146}01146                         ces-\/>ces\_protocol\_id =}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01147}01147                             \mbox{\hyperlink{scsi__ch_8h_a1ced824b7451c0e246240a6f813b7fec}{READ\_ELEMENT\_STATUS\_PROTOCOL\_ID}}(}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01148}01148                             devid-\/>\mbox{\hyperlink{structread__element__status__device__id_a4d7673194ebe5f3b418fcefbc0f60290}{prot\_code\_set}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01149}01149                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01150}01150                 ces-\/>ces\_code\_set =}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01151}01151                     \mbox{\hyperlink{scsi__ch_8h_a75f55364b7d6829d4add589e41fcbd1d}{READ\_ELEMENT\_STATUS\_CODE\_SET}}(devid-\/>\mbox{\hyperlink{structread__element__status__device__id_a4d7673194ebe5f3b418fcefbc0f60290}{prot\_code\_set}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01152}01152                 ces-\/>ces\_assoc = \mbox{\hyperlink{scsi__ch_8h_ae1f4697d84e02401b650c4b633613403}{READ\_ELEMENT\_STATUS\_ASSOCIATION}}(}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01153}01153                     devid-\/>\mbox{\hyperlink{structread__element__status__device__id_a0265585181dbe3edb5f062d446017c38}{piv\_assoc\_designator\_type}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01154}01154                 ces-\/>ces\_designator\_type = \mbox{\hyperlink{scsi__ch_8h_a1b72da807f1ee2b78e22c00393353345}{READ\_ELEMENT\_STATUS\_DESIGNATOR\_TYPE}}(}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01155}01155                     devid-\/>\mbox{\hyperlink{structread__element__status__device__id_a0265585181dbe3edb5f062d446017c38}{piv\_assoc\_designator\_type}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01156}01156         \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (scsi\_version > \mbox{\hyperlink{scsi__all_8h_a0998c5a889c1c838a9f5b90e9f87d722}{SCSI\_REV\_2}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01157}01157                 \textcolor{comment}{/* SCSI-\/SPC and No devid, no designator */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01158}01158                 ces-\/>ces\_designator\_length = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01159}01159                 ces-\/>ces\_designator[0] = \textcolor{charliteral}{'\(\backslash\)0'};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01160}01160                 ces-\/>ces\_protocol\_id = CES\_PROTOCOL\_ID\_FCP\_4;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01161}01161         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01162}01162 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01163}01163         \textcolor{keywordflow}{if} (scsi\_version <= \mbox{\hyperlink{scsi__all_8h_a0998c5a889c1c838a9f5b90e9f87d722}{SCSI\_REV\_2}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01164}01164                 \textcolor{keywordflow}{if} (desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_a316e14eedd2d20e239ff0a9014d7a646}{dt\_or\_obsolete}}.\mbox{\hyperlink{structread__element__status__descriptor_a7da4140163211230d5f0223fb1df1b52}{scsi\_2}}.\mbox{\hyperlink{structread__element__status__descriptor_a88e60639bb50349a333936adea5225cc}{dt\_scsi\_flags}} \&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01165}01165                     \mbox{\hyperlink{scsi__ch_8h_a93f1c006e83e0a2d10fbb8552260c255}{READ\_ELEMENT\_STATUS\_DT\_IDVALID}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01166}01166                         ces-\/>ces\_flags |= CES\_SCSIID\_VALID;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01167}01167                         ces-\/>ces\_scsi\_id =}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01168}01168                             desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_a316e14eedd2d20e239ff0a9014d7a646}{dt\_or\_obsolete}}.\mbox{\hyperlink{structread__element__status__descriptor_a7da4140163211230d5f0223fb1df1b52}{scsi\_2}}.\mbox{\hyperlink{structread__element__status__descriptor_ab04a6a18c8780aca85022bffd4f831b4}{dt\_scsi\_addr}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01169}01169                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01170}01170 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01171}01171                 \textcolor{keywordflow}{if} (desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_a316e14eedd2d20e239ff0a9014d7a646}{dt\_or\_obsolete}}.\mbox{\hyperlink{structread__element__status__descriptor_a7da4140163211230d5f0223fb1df1b52}{scsi\_2}}.\mbox{\hyperlink{structread__element__status__descriptor_ab04a6a18c8780aca85022bffd4f831b4}{dt\_scsi\_addr}} \&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01172}01172                     \mbox{\hyperlink{scsi__ch_8h_a119fc25f6efff9f934d4f2d29396090c}{READ\_ELEMENT\_STATUS\_DT\_LUVALID}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01173}01173                         ces-\/>ces\_flags |= CES\_LUN\_VALID;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01174}01174                         ces-\/>ces\_scsi\_lun =}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01175}01175                             desc-\/>\mbox{\hyperlink{structread__element__status__descriptor_a316e14eedd2d20e239ff0a9014d7a646}{dt\_or\_obsolete}}.\mbox{\hyperlink{structread__element__status__descriptor_a7da4140163211230d5f0223fb1df1b52}{scsi\_2}}.\mbox{\hyperlink{structread__element__status__descriptor_a88e60639bb50349a333936adea5225cc}{dt\_scsi\_flags}} \&}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01176}01176                             \mbox{\hyperlink{scsi__ch_8h_a6ea1f4abdbe773be7652d4d6262e396d}{READ\_ELEMENT\_STATUS\_DT\_LUNMASK}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01177}01177                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01178}01178         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01179}01179 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01180}01180 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01181}01181 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01182}\mbox{\hyperlink{scsi__ch_8c_adeba3b8e8887ca44827df029fafbfe7f}{01182}} \mbox{\hyperlink{scsi__ch_8c_adeba3b8e8887ca44827df029fafbfe7f}{chgetelemstatus}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph, \textcolor{keywordtype}{int} scsi\_version, u\_long cmd,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01183}01183                 \textcolor{keyword}{struct} changer\_element\_status\_request *cesr)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01184}01184 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01185}01185         \textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__header}{read\_element\_status\_header}} *st\_hdr;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01186}01186         \textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__page__header}{read\_element\_status\_page\_header}} *pg\_hdr;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01187}01187         \textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__descriptor}{read\_element\_status\_descriptor}} *desc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01188}01188         caddr\_t data = NULL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01189}01189         \textcolor{keywordtype}{size\_t} size, desclen;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01190}01190         u\_int avail, i;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01191}01191         \textcolor{keywordtype}{int} curdata, dvcid, sense\_flags;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01192}01192         \textcolor{keywordtype}{int} try\_no\_dvcid = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01193}01193         \textcolor{keyword}{struct }changer\_element\_status *user\_data = NULL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01194}01194         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01195}01195         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01196}01196         \textcolor{keywordtype}{int} chet = cesr-\/>cesr\_element\_type;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01197}01197         \textcolor{keywordtype}{int} error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01198}01198         \textcolor{keywordtype}{int} want\_voltags = (cesr-\/>cesr\_flags \& CESR\_VOLTAGS) ? 1 : 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01199}01199 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01200}01200         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01201}01201 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01202}01202         \textcolor{comment}{/* perform argument checking */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01203}01203 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01204}01204         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01205}01205 \textcolor{comment}{         * Perform a range check on the cesr\_element\_\{base,count\}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01206}01206 \textcolor{comment}{         * request argument fields.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01207}01207 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01208}01208         if ((softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[chet] -\/ cesr-\/>cesr\_element\_base) <= 0}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01209}01209             || (cesr-\/>cesr\_element\_base + cesr-\/>cesr\_element\_count)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01210}01210                 > softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[chet])}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01211}01211                 \textcolor{keywordflow}{return} (EINVAL);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01212}01212 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01213}01213         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01214}01214 \textcolor{comment}{         * Request one descriptor for the given element type.  This}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01215}01215 \textcolor{comment}{         * is used to determine the size of the descriptor so that}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01216}01216 \textcolor{comment}{         * we can allocate enough storage for all of them.  We assume}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01217}01217 \textcolor{comment}{         * that the first one can fit into 1k.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01218}01218 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01219}01219         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01220}01220         data = (caddr\_t)malloc(1024, M\_DEVBUF, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01221}01221 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01222}01222         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01223}01223         \mbox{\hyperlink{unionccb}{ccb}} = \mbox{\hyperlink{cam__periph_8h_a3e0b448f630edd6d782fb33e4a12e3f1}{cam\_periph\_getccb}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01224}01224 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01225}01225         sense\_flags = \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01226}01226         \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}} \& \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa750e51c4f9c7196df3bccf66c48994ff}{CH\_Q\_NO\_DVCID}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01227}01227                 dvcid = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01228}01228                 curdata = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01229}01229         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01230}01230                 dvcid = 1;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01231}01231                 curdata = 1;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01232}01232                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01233}01233 \textcolor{comment}{                 * Don't print anything for an Illegal Request, because}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01234}01234 \textcolor{comment}{                 * these flags can cause some changers to complain.  We'll}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01235}01235 \textcolor{comment}{                 * retry without them if we get an error.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01236}01236 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01237}01237                 sense\_flags |= \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba032bb2bff9d794c3b78f4a8c5c47637a}{SF\_QUIET\_IR}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01238}01238         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01239}01239 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01240}01240 retry\_einval:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01241}01241 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01242}01242         \mbox{\hyperlink{scsi__ch_8c_a69134e2cb4d592a5fdb2fa1cde424874}{scsi\_read\_element\_status}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01243}01243                                  \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01244}01244                                  \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01245}01245                                  \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01246}01246                                  \textcolor{comment}{/* voltag */} want\_voltags,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01247}01247                                  \textcolor{comment}{/* sea */} softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[chet],}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01248}01248                                  \textcolor{comment}{/* curdata */} curdata,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01249}01249                                  \textcolor{comment}{/* dvcid */} dvcid,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01250}01250                                  \textcolor{comment}{/* count */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01251}01251                                  \textcolor{comment}{/* data\_ptr */} data,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01252}01252                                  \textcolor{comment}{/* dxfer\_len */} 1024,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01253}01253                                  \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01254}01254                                  \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a16df651f20ffcdc94ef9724df5fd5109}{CH\_TIMEOUT\_READ\_ELEMENT\_STATUS}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01255}01255 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01256}01256         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01257}01257                                   \textcolor{comment}{/*sense\_flags*/} sense\_flags,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01258}01258                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01259}01259 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01260}01260         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01261}01261 \textcolor{comment}{         * An Illegal Request sense key (only used if there is no asc/ascq)}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01262}01262 \textcolor{comment}{         * or 0x24,0x00 for an ASC/ASCQ both map to EINVAL.  If dvcid or}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01263}01263 \textcolor{comment}{         * curdata are set (we set both or neither), try turning them off}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01264}01264 \textcolor{comment}{         * and see if the command is successful.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01265}01265 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01266}01266         \textcolor{keywordflow}{if} ((error == EINVAL)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01267}01267          \&\& (dvcid || curdata))  \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01268}01268                 dvcid = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01269}01269                 curdata = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01270}01270                 error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01271}01271                 \textcolor{comment}{/* At this point we want to report any Illegal Request */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01272}01272                 sense\_flags \&= \string~SF\_QUIET\_IR;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01273}01273                 try\_no\_dvcid = 1;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01274}01274                 \textcolor{keywordflow}{goto} retry\_einval;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01275}01275         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01276}01276 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01277}01277         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01278}01278 \textcolor{comment}{         * In this case, we tried a read element status with dvcid and}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01279}01279 \textcolor{comment}{         * curdata set, and it failed.  We retried without those bits, and}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01280}01280 \textcolor{comment}{         * it succeeded.  Suggest to the user that he set a quirk, so we}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01281}01281 \textcolor{comment}{         * don't go through the retry process the first time in the future.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01282}01282 \textcolor{comment}{         * This should only happen on changers that claim SCSI-\/3 or higher,}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01283}01283 \textcolor{comment}{         * but don't support these bits.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01284}01284 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01285}01285         \textcolor{keywordflow}{if} ((try\_no\_dvcid != 0)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01286}01286          \&\& (error == 0))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01287}01287                 softc-\/>\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}} |= \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa750e51c4f9c7196df3bccf66c48994ff}{CH\_Q\_NO\_DVCID}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01288}01288 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01289}01289         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01290}01290                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01291}01291         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01292}01292 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01293}01293         st\_hdr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__header}{read\_element\_status\_header}} *)data;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01294}01294         pg\_hdr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__page__header}{read\_element\_status\_page\_header}} *)((uintptr\_t)st\_hdr +}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01295}01295                   \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__header}{read\_element\_status\_header}}));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01296}01296         desclen = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(pg\_hdr-\/>\mbox{\hyperlink{structread__element__status__page__header_ac321f5b236955fc334ac6bd0d48470f2}{edl}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01297}01297 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01298}01298         size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__header}{read\_element\_status\_header}}) +}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01299}01299                sizeof(struct \mbox{\hyperlink{structread__element__status__page__header}{read\_element\_status\_page\_header}}) +}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01300}01300                (desclen * cesr-\/>cesr\_element\_count);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01301}01301         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01302}01302 \textcolor{comment}{         * Reallocate storage for descriptors and get them from the}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01303}01303 \textcolor{comment}{         * device.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01304}01304 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01305}01305         free(data, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01306}01306         data = (caddr\_t)malloc(size, M\_DEVBUF, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01307}01307 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01308}01308         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01309}01309         \mbox{\hyperlink{scsi__ch_8c_a69134e2cb4d592a5fdb2fa1cde424874}{scsi\_read\_element\_status}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01310}01310                                  \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01311}01311                                  \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01312}01312                                  \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01313}01313                                  \textcolor{comment}{/* voltag */} want\_voltags,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01314}01314                                  \textcolor{comment}{/* sea */} softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[chet]}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01315}01315                                  + cesr-\/>cesr\_element\_base,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01316}01316                                  \textcolor{comment}{/* curdata */} curdata,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01317}01317                                  \textcolor{comment}{/* dvcid */} dvcid,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01318}01318                                  \textcolor{comment}{/* count */} cesr-\/>cesr\_element\_count,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01319}01319                                  \textcolor{comment}{/* data\_ptr */} data,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01320}01320                                  \textcolor{comment}{/* dxfer\_len */} size,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01321}01321                                  \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01322}01322                                  \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a16df651f20ffcdc94ef9724df5fd5109}{CH\_TIMEOUT\_READ\_ELEMENT\_STATUS}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01323}01323 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01324}01324         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01325}01325                                   \textcolor{comment}{/*sense\_flags*/} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01326}01326                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01327}01327 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01328}01328         \textcolor{keywordflow}{if} (error)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01329}01329                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01330}01330         \mbox{\hyperlink{cam__periph_8h_a66d8b47f5a566db5a6be4697c17886c7}{cam\_periph\_unlock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01331}01331 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01332}01332         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01333}01333 \textcolor{comment}{         * Fill in the user status array.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01334}01334 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01335}01335         st\_hdr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__header}{read\_element\_status\_header}} *)data;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01336}01336         pg\_hdr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__page__header}{read\_element\_status\_page\_header}} *)((uintptr\_t)st\_hdr +}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01337}01337                   \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__header}{read\_element\_status\_header}}));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01338}01338         avail = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(st\_hdr-\/>\mbox{\hyperlink{structread__element__status__header_a17f83a6ebcd77ad6e29889cf47e8c83d}{count}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01339}01339 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01340}01340         \textcolor{keywordflow}{if} (avail != cesr-\/>cesr\_element\_count) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01341}01341                 \mbox{\hyperlink{cam__xpt_8c_a342b8e2ed77d0b7a12ae7bc49dd2beac}{xpt\_print}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01342}01342                     \textcolor{stringliteral}{"{}warning, READ ELEMENT STATUS avail != count\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01343}01343         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01344}01344 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01345}01345         user\_data = (\textcolor{keyword}{struct }changer\_element\_status *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01346}01346                 malloc(avail * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} changer\_element\_status),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01347}01347                        M\_DEVBUF, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01348}01348 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01349}01349         desc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__descriptor}{read\_element\_status\_descriptor}} *)((uintptr\_t)data +}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01350}01350                 \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__header}{read\_element\_status\_header}}) +}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01351}01351                 sizeof(struct \mbox{\hyperlink{structread__element__status__page__header}{read\_element\_status\_page\_header}}));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01352}01352         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01353}01353 \textcolor{comment}{         * Set up the individual element status structures}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01354}01354 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01355}01355         \textcolor{keywordflow}{for} (i = 0; i < avail; ++i) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01356}01356                 \textcolor{keyword}{struct }changer\_element\_status *ces;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01357}01357 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01358}01358                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01359}01359 \textcolor{comment}{                 * In the changer\_element\_status structure, fields from}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01360}01360 \textcolor{comment}{                 * the beginning to the field of ces\_scsi\_lun are common}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01361}01361 \textcolor{comment}{                 * between SCSI-\/2 and SCSI-\/3, while all the rest are new}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01362}01362 \textcolor{comment}{                 * from SCSI-\/3. In order to maintain backward compatibility}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01363}01363 \textcolor{comment}{                 * of the chio command, the ces pointer, below, is computed}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01364}01364 \textcolor{comment}{                 * such that it lines up with the structure boundary}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01365}01365 \textcolor{comment}{                 * corresponding to the SCSI version.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01366}01366 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01367}01367                 ces = cmd == OCHIOGSTATUS ?}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01368}01368                     (\textcolor{keyword}{struct }changer\_element\_status *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01369}01369                     ((\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *)user\_data + i *}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01370}01370                      (offsetof(\textcolor{keyword}{struct} changer\_element\_status,ces\_scsi\_lun)+1)):}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01371}01371                     \&user\_data[i];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01372}01372 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01373}01373                 \mbox{\hyperlink{scsi__ch_8c_a6660da55459a09520f5942c0f5144678}{copy\_element\_status}}(softc, pg\_hdr-\/>\mbox{\hyperlink{structread__element__status__page__header_a9c57d1899f8404b6aa0a3c6bc26cdbc6}{flags}}, desc,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01374}01374                                     ces, scsi\_version);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01375}01375 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01376}01376                 desc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structread__element__status__descriptor}{read\_element\_status\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01377}01377                        ((\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} *)desc + desclen);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01378}01378         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01379}01379 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01380}01380         \textcolor{comment}{/* Copy element status structures out to userspace. */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01381}01381         \textcolor{keywordflow}{if} (cmd == OCHIOGSTATUS)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01382}01382                 error = copyout(user\_data,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01383}01383                                 cesr-\/>cesr\_element\_status,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01384}01384                                 avail* (offsetof(\textcolor{keyword}{struct} changer\_element\_status,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01385}01385                                 ces\_scsi\_lun) + 1));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01386}01386         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01387}01387                 error = copyout(user\_data,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01388}01388                                 cesr-\/>cesr\_element\_status,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01389}01389                                 avail * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} changer\_element\_status));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01390}01390 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01391}01391         \mbox{\hyperlink{cam__periph_8h_a1f320a7fdaff6524ad067970fbab4b27}{cam\_periph\_lock}}(periph);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01392}01392 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01393}01393  done:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01394}01394         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01395}01395 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01396}01396         \textcolor{keywordflow}{if} (data != NULL)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01397}01397                 free(data, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01398}01398         \textcolor{keywordflow}{if} (user\_data != NULL)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01399}01399                 free(user\_data, M\_DEVBUF);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01400}01400 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01401}01401         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01402}01402 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01403}01403 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01404}01404 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01405}\mbox{\hyperlink{scsi__ch_8c_a349d2f5b0ecee2f4d43d8dd9194ff668}{01405}} \mbox{\hyperlink{scsi__ch_8c_a349d2f5b0ecee2f4d43d8dd9194ff668}{chielem}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01406}01406         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} timeout)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01407}01407 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01408}01408         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01409}01409         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01410}01410         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01411}01411 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01412}01412         \textcolor{keywordflow}{if} (!timeout) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01413}01413                 timeout = \mbox{\hyperlink{scsi__ch_8c_ad0e46d4df5364b325ca7e8babbf3b3e5}{CH\_TIMEOUT\_INITIALIZE\_ELEMENT\_STATUS}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01414}01414         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01415}01415                 timeout *= 1000;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01416}01416         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01417}01417 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01418}01418         error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01419}01419         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01420}01420 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01421}01421         \mbox{\hyperlink{unionccb}{ccb}} = \mbox{\hyperlink{cam__periph_8h_a3e0b448f630edd6d782fb33e4a12e3f1}{cam\_periph\_getccb}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01422}01422 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01423}01423         \mbox{\hyperlink{scsi__ch_8c_a88dc5b00f0ea298a820324abb6ae7dd2}{scsi\_initialize\_element\_status}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01424}01424                                       \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01425}01425                                       \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01426}01426                                       \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01427}01427                                       \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01428}01428                                       \textcolor{comment}{/* timeout */} timeout);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01429}01429 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01430}01430         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01431}01431                                   \textcolor{comment}{/*sense\_flags*/} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01432}01432                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01433}01433 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01434}01434         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01435}01435 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01436}01436         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01437}01437 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01438}01438 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01439}01439 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01440}\mbox{\hyperlink{scsi__ch_8c_a1c42babd4cca445f7505e778a384973d}{01440}} \mbox{\hyperlink{scsi__ch_8c_a1c42babd4cca445f7505e778a384973d}{chsetvoltag}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01441}01441             \textcolor{keyword}{struct} changer\_set\_voltag\_request *csvr)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01442}01442 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01443}01443         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01444}01444         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01445}01445         u\_int16\_t ea;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01446}01446         u\_int8\_t sac;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01447}01447         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__send__volume__tag__parameters}{scsi\_send\_volume\_tag\_parameters}} ssvtp;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01448}01448         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01449}01449         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01450}01450 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01451}01451         error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01452}01452         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01453}01453 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01454}01454         bzero(\&ssvtp, \textcolor{keyword}{sizeof}(ssvtp));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01455}01455         \textcolor{keywordflow}{for} (i=0; i<\textcolor{keyword}{sizeof}(ssvtp.\mbox{\hyperlink{structscsi__send__volume__tag__parameters_af5a434b3464f506313336fd0a6f7ccf4}{vitf}}); i++) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01456}01456                 ssvtp.\mbox{\hyperlink{structscsi__send__volume__tag__parameters_af5a434b3464f506313336fd0a6f7ccf4}{vitf}}[i] = \textcolor{charliteral}{' '};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01457}01457         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01458}01458 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01459}01459         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01460}01460 \textcolor{comment}{         * Check arguments.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01461}01461 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01462}01462         \textcolor{keywordflow}{if} (csvr-\/>csvr\_type > CHET\_DT)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01463}01463                 \textcolor{keywordflow}{return} EINVAL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01464}01464         \textcolor{keywordflow}{if} (csvr-\/>csvr\_addr > (softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[csvr-\/>csvr\_type] -\/ 1))}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01465}01465                 \textcolor{keywordflow}{return} ENODEV;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01466}01466 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01467}01467         ea = softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[csvr-\/>csvr\_type] + csvr-\/>csvr\_addr;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01468}01468 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01469}01469         \textcolor{keywordflow}{if} (csvr-\/>csvr\_flags \& CSVR\_ALTERNATE) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01470}01470                 \textcolor{keywordflow}{switch} (csvr-\/>csvr\_flags \& CSVR\_MODE\_MASK) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01471}01471                 \textcolor{keywordflow}{case} CSVR\_MODE\_SET:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01472}01472                         sac = \mbox{\hyperlink{scsi__ch_8h_ac671d8b08f74e5f63b068e4767a6ec07}{SEND\_VOLUME\_TAG\_ASSERT\_ALTERNATE}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01473}01473                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01474}01474                 \textcolor{keywordflow}{case} CSVR\_MODE\_REPLACE:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01475}01475                         sac = \mbox{\hyperlink{scsi__ch_8h_ac597088fcb543256a92840e278acbd3a}{SEND\_VOLUME\_TAG\_REPLACE\_ALTERNATE}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01476}01476                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01477}01477                 \textcolor{keywordflow}{case} CSVR\_MODE\_CLEAR:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01478}01478                         sac = \mbox{\hyperlink{scsi__ch_8h_a85ba62c6e5caff22c14749d2d662b637}{SEND\_VOLUME\_TAG\_UNDEFINED\_ALTERNATE}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01479}01479                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01480}01480                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01481}01481                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01482}01482                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01483}01483                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01484}01484         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01485}01485                 \textcolor{keywordflow}{switch} (csvr-\/>csvr\_flags \& CSVR\_MODE\_MASK) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01486}01486                 \textcolor{keywordflow}{case} CSVR\_MODE\_SET:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01487}01487                         sac = \mbox{\hyperlink{scsi__ch_8h_af8ebaed0008eb345656e5ed8754ee3db}{SEND\_VOLUME\_TAG\_ASSERT\_PRIMARY}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01488}01488                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01489}01489                 \textcolor{keywordflow}{case} CSVR\_MODE\_REPLACE:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01490}01490                         sac = \mbox{\hyperlink{scsi__ch_8h_ae605454b88a63a74ff12c47e86a275ea}{SEND\_VOLUME\_TAG\_REPLACE\_PRIMARY}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01491}01491                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01492}01492                 \textcolor{keywordflow}{case} CSVR\_MODE\_CLEAR:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01493}01493                         sac = \mbox{\hyperlink{scsi__ch_8h_ab4bb2aed32e5142dcf43f50d89723981}{SEND\_VOLUME\_TAG\_UNDEFINED\_PRIMARY}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01494}01494                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01495}01495                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01496}01496                         error = EINVAL;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01497}01497                         \textcolor{keywordflow}{goto} out;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01498}01498                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01499}01499         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01500}01500 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01501}01501         memcpy(ssvtp.\mbox{\hyperlink{structscsi__send__volume__tag__parameters_af5a434b3464f506313336fd0a6f7ccf4}{vitf}}, csvr-\/>csvr\_voltag.cv\_volid,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01502}01502                min(strlen(csvr-\/>csvr\_voltag.cv\_volid), \textcolor{keyword}{sizeof}(ssvtp.\mbox{\hyperlink{structscsi__send__volume__tag__parameters_af5a434b3464f506313336fd0a6f7ccf4}{vitf}})));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01503}01503         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(csvr-\/>csvr\_voltag.cv\_serial, ssvtp.\mbox{\hyperlink{structscsi__send__volume__tag__parameters_a1a61a610e38f66d13f256dfff10affc9}{minvsn}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01504}01504 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01505}01505         \mbox{\hyperlink{unionccb}{ccb}} = \mbox{\hyperlink{cam__periph_8h_a3e0b448f630edd6d782fb33e4a12e3f1}{cam\_periph\_getccb}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01506}01506 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01507}01507         \mbox{\hyperlink{scsi__ch_8c_a7ab4d4841676722765640050f2bd14e5}{scsi\_send\_volume\_tag}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01508}01508                              \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01509}01509                              \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01510}01510                              \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01511}01511                              \textcolor{comment}{/* element\_address */} ea,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01512}01512                              \textcolor{comment}{/* send\_action\_code */} sac,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01513}01513                              \textcolor{comment}{/* parameters */} \&ssvtp,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01514}01514                              \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01515}01515                              \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a7a259f4ce20a96b9e7f6a48b2e0694b6}{CH\_TIMEOUT\_SEND\_VOLTAG}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01516}01516 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01517}01517         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01518}01518                                   \textcolor{comment}{/*sense\_flags*/} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01519}01519                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01520}01520 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01521}01521         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01522}01522 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01523}01523  out:}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01524}01524         \textcolor{keywordflow}{return} error;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01525}01525 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01526}01526 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01527}01527 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01528}\mbox{\hyperlink{scsi__ch_8c_af2d54c3710d99c162025fc7f552ad020}{01528}} \mbox{\hyperlink{scsi__ch_8c_af2d54c3710d99c162025fc7f552ad020}{chgetparams}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01529}01529 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01530}01530         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01531}01531         \textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01532}01532         \textcolor{keywordtype}{void} *mode\_buffer;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01533}01533         \textcolor{keywordtype}{int} mode\_buffer\_len;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01534}01534         \textcolor{keyword}{struct }\mbox{\hyperlink{structpage__element__address__assignment}{page\_element\_address\_assignment}} *ea;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01535}01535         \textcolor{keyword}{struct }\mbox{\hyperlink{structpage__device__capabilities}{page\_device\_capabilities}} *cap;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01536}01536         \textcolor{keywordtype}{int} error, from, dbd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01537}01537         u\_int8\_t *moves, *exchanges;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01538}01538 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01539}01539         error = 0;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01540}01540 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01541}01541         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structch__softc}{ch\_softc}} *)periph-\/>\mbox{\hyperlink{structcam__periph_a6ba6ec6ae18e7f5935209ff5ca9ba385}{softc}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01542}01542 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01543}01543         \mbox{\hyperlink{unionccb}{ccb}} = \mbox{\hyperlink{cam__periph_8h_a3e0b448f630edd6d782fb33e4a12e3f1}{cam\_periph\_getccb}}(periph, \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01544}01544 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01545}01545         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01546}01546 \textcolor{comment}{         * The scsi\_mode\_sense\_data structure is just a convenience}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01547}01547 \textcolor{comment}{         * structure that allows us to easily calculate the worst-\/case}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01548}01548 \textcolor{comment}{         * storage size of the mode sense buffer.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01549}01549 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01550}01550         mode\_buffer\_len = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__sense__data}{scsi\_mode\_sense\_data}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01551}01551 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01552}01552         mode\_buffer = malloc(mode\_buffer\_len, M\_SCSICH, M\_NOWAIT);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01553}01553 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01554}01554         \textcolor{keywordflow}{if} (mode\_buffer == NULL) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01555}01555                 printf(\textcolor{stringliteral}{"{}chgetparams: couldn't malloc mode sense data\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01556}01556                 \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01557}01557                 \textcolor{keywordflow}{return}(ENOSPC);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01558}01558         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01559}01559 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01560}01560         bzero(mode\_buffer, mode\_buffer\_len);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01561}01561 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01562}01562         \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structch__softc_a4dd336b7ceb3a2ec9873f8a1d0f21e33}{quirks}} \& \mbox{\hyperlink{scsi__ch_8c_ac2adc0750af9f5e632d4e0ede97c4bfaa986e17fe85d41ca09d211ad3c2fab56c}{CH\_Q\_NO\_DBD}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01563}01563                 dbd = FALSE;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01564}01564         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01565}01565                 dbd = TRUE;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01566}01566 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01567}01567         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01568}01568 \textcolor{comment}{         * Get the element address assignment page.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01569}01569 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01570}01570         \mbox{\hyperlink{scsi__all_8c_a07dd4b57b56297e478ebd3731a7ec608}{scsi\_mode\_sense}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01571}01571                         \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01572}01572                         \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01573}01573                         \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01574}01574                         \textcolor{comment}{/* dbd */} dbd,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01575}01575                         \textcolor{comment}{/* pc */} \mbox{\hyperlink{scsi__all_8h_a8b73ae18fa8796de2cbfc59283a89bd7}{SMS\_PAGE\_CTRL\_CURRENT}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01576}01576                         \textcolor{comment}{/* page */} \mbox{\hyperlink{scsi__ch_8h_a5c515fd8e3be34f49d6a7d84bbcb14ee}{CH\_ELEMENT\_ADDR\_ASSIGN\_PAGE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01577}01577                         \textcolor{comment}{/* param\_buf */} (u\_int8\_t *)mode\_buffer,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01578}01578                         \textcolor{comment}{/* param\_len */} mode\_buffer\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01579}01579                         \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01580}01580                         \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a4b667259079afc6d5414198b591a95e7}{CH\_TIMEOUT\_MODE\_SENSE}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01581}01581 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01582}01582         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01583}01583                                   \textcolor{comment}{/* sense\_flags */} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}}|\mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55baf5ee8065dc68dd8b0eddebd7eb317a35}{SF\_NO\_PRINT}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01584}01584                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01585}01585 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01586}01586         \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01587}01587                 \textcolor{keywordflow}{if} (dbd) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01588}01588                         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__sense__6}{scsi\_mode\_sense\_6}} *sms;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01589}01589 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01590}01590                         sms = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__sense__6}{scsi\_mode\_sense\_6}} *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01591}01591                                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01592}01592 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01593}01593                         sms-\/>\mbox{\hyperlink{structscsi__mode__sense__6_a5bd79694d37081cc58e8abc9b547cfe1}{byte2}} \&= \string~\mbox{\hyperlink{scsi__all_8h_a5620f0d292b7ef32bbc8709e0898da08}{SMS\_DBD}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01594}01594                         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01595}01595                                                   \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01596}01596                                                   \textcolor{comment}{/*sense\_flags*/} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01597}01597                                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01598}01598                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01599}01599                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01600}01600 \textcolor{comment}{                         * Since we disabled sense printing above, print}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01601}01601 \textcolor{comment}{                         * out the sense here since we got an error.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01602}01602 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01603}01603                         \mbox{\hyperlink{scsi__all_8c_a4c4e999b950a849e9de2497a26efff53}{scsi\_sense\_print}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01604}01604                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01605}01605 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01606}01606                 \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01607}01607                         \mbox{\hyperlink{cam__xpt_8c_a342b8e2ed77d0b7a12ae7bc49dd2beac}{xpt\_print}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01608}01608                             \textcolor{stringliteral}{"{}chgetparams: error getting element "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01609}01609                             \textcolor{stringliteral}{"{}address page\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01610}01610                         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01611}01611                         free(mode\_buffer, M\_SCSICH);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01612}01612                         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01613}01613                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01614}01614         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01615}01615 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01616}01616         ea = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpage__element__address__assignment}{page\_element\_address\_assignment}} *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01617}01617                 \mbox{\hyperlink{scsi__all_8h_ab8b5890be8441d5fcafa1187e58bfa97}{find\_mode\_page\_6}}((\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__mode__header__6}{scsi\_mode\_header\_6}} *)mode\_buffer);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01618}01618 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01619}01619         softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_MT] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a6e8c890d6474fb6a8a25bae90725013a}{mtea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01620}01620         softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_MT] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_aabc7dd7d270ecab9d603288be7c46f7d}{nmte}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01621}01621         softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_ST] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_acfde82cac132d74c30b984812bc13990}{fsea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01622}01622         softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_ST] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a8c0fca8a8f22d43947f53028f4ded7fc}{nse}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01623}01623         softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_IE] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a7035136a789edd3aca945ad40cbaeb33}{fieea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01624}01624         softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_IE] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_afa8303e64fe251dc98a9eab4259dadf1}{niee}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01625}01625         softc-\/>\mbox{\hyperlink{structch__softc_ab5931c8893fd9eeede63627d93018068}{sc\_firsts}}[CHET\_DT] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a453e65af316e8c7feab8f3516236bbc9}{fdtea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01626}01626         softc-\/>\mbox{\hyperlink{structch__softc_a19aa16c627cd01b55e81de284b0e9357}{sc\_counts}}[CHET\_DT] = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(ea-\/>\mbox{\hyperlink{structpage__element__address__assignment_a17dc0d45f29edf4c95d6000b9543dc6d}{ndte}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01627}01627 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01628}01628         bzero(mode\_buffer, mode\_buffer\_len);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01629}01629 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01630}01630         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01631}01631 \textcolor{comment}{         * Now get the device capabilities page.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01632}01632 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01633}01633         \mbox{\hyperlink{scsi__all_8c_a07dd4b57b56297e478ebd3731a7ec608}{scsi\_mode\_sense}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01634}01634                         \textcolor{comment}{/* retries */} 1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01635}01635                         \textcolor{comment}{/* cbfcnp */} \mbox{\hyperlink{scsi__ch_8c_a4bc5fb7683596126aa6ae72bb0351e23}{chdone}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01636}01636                         \textcolor{comment}{/* tag\_action */} \mbox{\hyperlink{scsi__message_8h_ac500601f6c78c28499b430fd47f2aa17}{MSG\_SIMPLE\_Q\_TAG}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01637}01637                         \textcolor{comment}{/* dbd */} dbd,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01638}01638                         \textcolor{comment}{/* pc */} \mbox{\hyperlink{scsi__all_8h_a8b73ae18fa8796de2cbfc59283a89bd7}{SMS\_PAGE\_CTRL\_CURRENT}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01639}01639                         \textcolor{comment}{/* page */} \mbox{\hyperlink{scsi__ch_8h_a13a8c19f21623b5a0136c3a19d68dc53}{CH\_DEVICE\_CAP\_PAGE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01640}01640                         \textcolor{comment}{/* param\_buf */} (u\_int8\_t *)mode\_buffer,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01641}01641                         \textcolor{comment}{/* param\_len */} mode\_buffer\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01642}01642                         \textcolor{comment}{/* sense\_len */} \mbox{\hyperlink{scsi__all_8h_adacdb3c5663de7101bb6a888ebde165c}{SSD\_FULL\_SIZE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01643}01643                         \textcolor{comment}{/* timeout */} \mbox{\hyperlink{scsi__ch_8c_a4b667259079afc6d5414198b591a95e7}{CH\_TIMEOUT\_MODE\_SENSE}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01644}01644 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01645}01645         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}}, \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01646}01646                                   \textcolor{comment}{/* sense\_flags */} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}} | \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55baf5ee8065dc68dd8b0eddebd7eb317a35}{SF\_NO\_PRINT}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01647}01647                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01648}01648 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01649}01649         \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01650}01650                 \textcolor{keywordflow}{if} (dbd) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01651}01651                         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__sense__6}{scsi\_mode\_sense\_6}} *sms;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01652}01652 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01653}01653                         sms = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__mode__sense__6}{scsi\_mode\_sense\_6}} *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01654}01654                                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01655}01655 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01656}01656                         sms-\/>\mbox{\hyperlink{structscsi__mode__sense__6_a5bd79694d37081cc58e8abc9b547cfe1}{byte2}} \&= \string~\mbox{\hyperlink{scsi__all_8h_a5620f0d292b7ef32bbc8709e0898da08}{SMS\_DBD}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01657}01657                         error = \mbox{\hyperlink{cam__periph_8c_a9eb7c5c2381f6769e4ecf63233bfff6f}{cam\_periph\_runccb}}(\mbox{\hyperlink{unionccb}{ccb}}, \mbox{\hyperlink{scsi__ch_8c_a215cf3ce7eb518bbdb01a11b38201cdd}{cherror}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01658}01658                                                   \textcolor{comment}{/*cam\_flags*/} \mbox{\hyperlink{cam_8h_a14bf0cceb256c2063f776e6cc4aba316a22ee721e6ada9c8fb4a4697789d5246f}{CAM\_RETRY\_SELTO}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01659}01659                                                   \textcolor{comment}{/*sense\_flags*/} \mbox{\hyperlink{cam_8h_a06fc87d81c62e9abb8790b6e5713c55ba323bacc6659dffecaffcd935f98954a5}{SF\_RETRY\_UA}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01660}01660                                                   softc-\/>\mbox{\hyperlink{structch__softc_abddb3c41274d6a0653b3f42a2cd4b552}{device\_stats}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01661}01661                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01662}01662                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01663}01663 \textcolor{comment}{                         * Since we disabled sense printing above, print}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01664}01664 \textcolor{comment}{                         * out the sense here since we got an error.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01665}01665 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01666}01666                         \mbox{\hyperlink{scsi__all_8c_a4c4e999b950a849e9de2497a26efff53}{scsi\_sense\_print}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01667}01667                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01668}01668 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01669}01669                 \textcolor{keywordflow}{if} (error) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01670}01670                         \mbox{\hyperlink{cam__xpt_8c_a342b8e2ed77d0b7a12ae7bc49dd2beac}{xpt\_print}}(periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01671}01671                             \textcolor{stringliteral}{"{}chgetparams: error getting device "{}}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01672}01672                             \textcolor{stringliteral}{"{}capabilities page\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01673}01673                         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01674}01674                         free(mode\_buffer, M\_SCSICH);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01675}01675                         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01676}01676                 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01677}01677         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01678}01678 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01679}01679         \mbox{\hyperlink{cam__xpt_8c_acb560602f4997cc269e6bb54efa93725}{xpt\_release\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01680}01680 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01681}01681         cap = (\textcolor{keyword}{struct }\mbox{\hyperlink{structpage__device__capabilities}{page\_device\_capabilities}} *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01682}01682                 \mbox{\hyperlink{scsi__all_8h_ab8b5890be8441d5fcafa1187e58bfa97}{find\_mode\_page\_6}}((\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__mode__header__6}{scsi\_mode\_header\_6}} *)mode\_buffer);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01683}01683 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01684}01684         bzero(softc-\/>\mbox{\hyperlink{structch__softc_a8cb33f55148d225539dab1dc926a698c}{sc\_movemask}}, \textcolor{keyword}{sizeof}(softc-\/>\mbox{\hyperlink{structch__softc_a8cb33f55148d225539dab1dc926a698c}{sc\_movemask}}));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01685}01685         bzero(softc-\/>\mbox{\hyperlink{structch__softc_a86bfb96ab5a53a4ae9d6cad535336ce0}{sc\_exchangemask}}, \textcolor{keyword}{sizeof}(softc-\/>\mbox{\hyperlink{structch__softc_a86bfb96ab5a53a4ae9d6cad535336ce0}{sc\_exchangemask}}));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01686}01686         moves = cap-\/>\mbox{\hyperlink{structpage__device__capabilities_a29b4a672eaffb3512a6aac8211f8c186}{move\_from}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01687}01687         exchanges = cap-\/>\mbox{\hyperlink{structpage__device__capabilities_afa21f1991e0df1748f0b77990f081da7}{exchange\_with}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01688}01688         \textcolor{keywordflow}{for} (from = CHET\_MT; from <= CHET\_MAX; ++from) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01689}01689                 softc-\/>\mbox{\hyperlink{structch__softc_a8cb33f55148d225539dab1dc926a698c}{sc\_movemask}}[from] = moves[from];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01690}01690                 softc-\/>\mbox{\hyperlink{structch__softc_a86bfb96ab5a53a4ae9d6cad535336ce0}{sc\_exchangemask}}[from] = exchanges[from];}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01691}01691         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01692}01692 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01693}01693         free(mode\_buffer, M\_SCSICH);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01694}01694 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01695}01695         \textcolor{keywordflow}{return}(error);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01696}01696 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01697}01697 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01698}01698 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01699}\mbox{\hyperlink{scsi__ch_8c_aaa6b29cc1115796b832180b30c045cc6}{01699}} \mbox{\hyperlink{scsi__ch_8c_aaa6b29cc1115796b832180b30c045cc6}{chscsiversion}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *periph)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01700}01700 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01701}01701         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__inquiry__data}{scsi\_inquiry\_data}} *inq\_data;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01702}01702         \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *cgd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01703}01703         \textcolor{keywordtype}{int} dev\_scsi\_version;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01704}01704 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01705}01705         \mbox{\hyperlink{cam__periph_8h_a14a9062a3b53e1d1a2570a39695c2cd3}{cam\_periph\_assert}}(periph, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01706}01706         \textcolor{keywordflow}{if} ((cgd = (\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__getdev}{ccb\_getdev}} *)\mbox{\hyperlink{cam__xpt_8c_a9de65e290bb5d0c78183237169d6f8dd}{xpt\_alloc\_ccb\_nowait}}()) == NULL)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01707}01707                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01708}01708         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01709}01709 \textcolor{comment}{         * Get the device information.}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01710}01710 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01711}01711         \mbox{\hyperlink{cam__xpt_8c_a64b1b7434225c072f2d9379fe39e359c}{xpt\_setup\_ccb}}(\&cgd-\/>\mbox{\hyperlink{structccb__getdev_a5d14cdc58f775661b78dccb59121e90e}{ccb\_h}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01712}01712                       periph-\/>\mbox{\hyperlink{structcam__periph_ab9f512b2fa31891d84372cd6279670b7}{path}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01713}01713                       \mbox{\hyperlink{cam_8h_a29369d4bf711763f232c214158987e20}{CAM\_PRIORITY\_NORMAL}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01714}01714         cgd-\/>\mbox{\hyperlink{structccb__getdev_a5d14cdc58f775661b78dccb59121e90e}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}} = \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055cae076749d68954cdfbd24a6060976168f}{XPT\_GDEV\_TYPE}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01715}01715         \mbox{\hyperlink{cam__xpt_8c_a6ef97382f5b1590b4d2d138516a63bcc}{xpt\_action}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *)cgd);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01716}01716 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01717}01717         \textcolor{keywordflow}{if} (cgd-\/>\mbox{\hyperlink{structccb__getdev_a5d14cdc58f775661b78dccb59121e90e}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}) \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01718}01718                 \mbox{\hyperlink{cam__xpt_8c_af1e7540fc366b5cad2e58f29d1de0f60}{xpt\_free\_ccb}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *)cgd);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01719}01719                 \textcolor{keywordflow}{return} -\/1;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01720}01720         \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01721}01721 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01722}01722         \mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}} = \&cgd-\/>\mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01723}01723         dev\_scsi\_version = \mbox{\hyperlink{structccb__getdev_ae40c7472cbd2a8142162c69e8f66dc55}{inq\_data}}-\/>\mbox{\hyperlink{structscsi__inquiry__data_ae1eb2e33319954898775af8b9eecfac6}{version}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01724}01724         \mbox{\hyperlink{cam__xpt_8c_af1e7540fc366b5cad2e58f29d1de0f60}{xpt\_free\_ccb}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *)cgd);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01725}01725 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01726}01726         \textcolor{keywordflow}{return} dev\_scsi\_version;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01727}01727 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01728}01728 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01729}01729 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01730}\mbox{\hyperlink{scsi__ch_8c_a7cc1c3be14babea28420a742eb0d2ada}{01730}} \mbox{\hyperlink{scsi__ch_8c_a7cc1c3be14babea28420a742eb0d2ada}{scsi\_move\_medium}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio, u\_int32\_t retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01731}01731                  \textcolor{keywordtype}{void} (*cbfcnp)(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01732}01732                  u\_int8\_t tag\_action, u\_int32\_t tea, u\_int32\_t src,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01733}01733                  u\_int32\_t dst, \textcolor{keywordtype}{int} invert, u\_int8\_t sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01734}01734                  u\_int32\_t timeout)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01735}01735 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01736}01736         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__move__medium}{scsi\_move\_medium}} *scsi\_cmd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01737}01737 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01738}01738         scsi\_cmd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__move__medium}{scsi\_move\_medium}} *)\&csio-\/>\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01739}01739         bzero(scsi\_cmd, \textcolor{keyword}{sizeof}(*scsi\_cmd));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01740}01740 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01741}01741         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__move__medium_a2e679300dac63ad09dd9c71f047730ae}{opcode}} = \mbox{\hyperlink{scsi__all_8h_aa652cb677ba382203407a1115dc6c183}{MOVE\_MEDIUM}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01742}01742 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01743}01743         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__move__medium_ade30eff15d0f713ac0dbdfb591ee4193}{tea}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__move__medium_ade30eff15d0f713ac0dbdfb591ee4193}{tea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01744}01744         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__move__medium_a12ce08110ea50f02b6c20c961e6ac89d}{src}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__move__medium_a12ce08110ea50f02b6c20c961e6ac89d}{src}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01745}01745         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__move__medium_a3b3d4f66a4e368d25a992945fe55b2ac}{dst}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__move__medium_a3b3d4f66a4e368d25a992945fe55b2ac}{dst}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01746}01746 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01747}01747         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structscsi__move__medium_abb5866dd605b930761f534633c01de6b}{invert}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01748}01748                 scsi\_cmd-\/>\mbox{\hyperlink{structscsi__move__medium_abb5866dd605b930761f534633c01de6b}{invert}} |= \mbox{\hyperlink{scsi__ch_8h_ab729bd8ca1bdb6b0d6450d5ac8794834}{MOVE\_MEDIUM\_INVERT}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01749}01749 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01750}01750         \mbox{\hyperlink{cam__ccb_8h_aa2f54bfe52060582eb17ef5584b8f62b}{cam\_fill\_csio}}(csio,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01751}01751                       retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01752}01752                       cbfcnp,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01753}01753                       \textcolor{comment}{/*flags*/} \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676a17c5461f834828a5af4980b5ac3a375d}{CAM\_DIR\_NONE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01754}01754                       tag\_action,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01755}01755                       \textcolor{comment}{/*data\_ptr*/} NULL,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01756}01756                       \textcolor{comment}{/*dxfer\_len*/} 0,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01757}01757                       sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01758}01758                       \textcolor{keyword}{sizeof}(*scsi\_cmd),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01759}01759                       timeout);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01760}01760 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01761}01761 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01762}01762 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01763}\mbox{\hyperlink{scsi__ch_8c_aa3c02ab23ecefb92cb3b4dc5542a0168}{01763}} \mbox{\hyperlink{scsi__ch_8c_aa3c02ab23ecefb92cb3b4dc5542a0168}{scsi\_exchange\_medium}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio, u\_int32\_t retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01764}01764                      \textcolor{keywordtype}{void} (*cbfcnp)(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01765}01765                      u\_int8\_t tag\_action, u\_int32\_t \mbox{\hyperlink{structscsi__move__medium_ade30eff15d0f713ac0dbdfb591ee4193}{tea}}, u\_int32\_t \mbox{\hyperlink{structscsi__move__medium_a12ce08110ea50f02b6c20c961e6ac89d}{src}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01766}01766                      u\_int32\_t dst1, u\_int32\_t dst2, \textcolor{keywordtype}{int} invert1,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01767}01767                      \textcolor{keywordtype}{int} invert2, u\_int8\_t sense\_len, u\_int32\_t timeout)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01768}01768 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01769}01769         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__exchange__medium}{scsi\_exchange\_medium}} *scsi\_cmd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01770}01770 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01771}01771         scsi\_cmd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__exchange__medium}{scsi\_exchange\_medium}} *)\&csio-\/>\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01772}01772         bzero(scsi\_cmd, \textcolor{keyword}{sizeof}(*scsi\_cmd));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01773}01773 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01774}01774         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__exchange__medium_afc405433bd96ae50ac0a4893406d8fc2}{opcode}} = \mbox{\hyperlink{scsi__ch_8h_af50aa69a708175721b2da9ceb1221810}{EXCHANGE\_MEDIUM}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01775}01775 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01776}01776         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__exchange__medium_ad4753feb25428beb06f8a5a490d4b6ce}{tea}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__exchange__medium_ad4753feb25428beb06f8a5a490d4b6ce}{tea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01777}01777         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__exchange__medium_ad23d4d0d79d14dccb4ba9bb06cc4fb91}{src}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__exchange__medium_ad23d4d0d79d14dccb4ba9bb06cc4fb91}{src}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01778}01778         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(dst1, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__exchange__medium_ae9f98be90b8fdc7042317b112e174726}{fdst}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01779}01779         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(dst2, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__exchange__medium_afce755de9505045eb527c2ea28ad8e51}{sdst}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01780}01780 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01781}01781         \textcolor{keywordflow}{if} (invert1)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01782}01782                 scsi\_cmd-\/>\mbox{\hyperlink{structscsi__exchange__medium_a13ea2fad65dfbfcc773881d247a8520c}{invert}} |= \mbox{\hyperlink{scsi__ch_8h_abd5c46807805c87d7e1b8ecddd0b3595}{EXCHANGE\_MEDIUM\_INV1}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01783}01783 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01784}01784         \textcolor{keywordflow}{if} (invert2)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01785}01785                 scsi\_cmd-\/>\mbox{\hyperlink{structscsi__exchange__medium_a13ea2fad65dfbfcc773881d247a8520c}{invert}} |= \mbox{\hyperlink{scsi__ch_8h_aadfb0ab637ed39ea6dbfadc8076d819d}{EXCHANGE\_MEDIUM\_INV2}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01786}01786 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01787}01787         \mbox{\hyperlink{cam__ccb_8h_aa2f54bfe52060582eb17ef5584b8f62b}{cam\_fill\_csio}}(csio,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01788}01788                       retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01789}01789                       cbfcnp,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01790}01790                       \textcolor{comment}{/*flags*/} \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676a17c5461f834828a5af4980b5ac3a375d}{CAM\_DIR\_NONE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01791}01791                       tag\_action,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01792}01792                       \textcolor{comment}{/*data\_ptr*/} NULL,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01793}01793                       \textcolor{comment}{/*dxfer\_len*/} 0,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01794}01794                       sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01795}01795                       \textcolor{keyword}{sizeof}(*scsi\_cmd),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01796}01796                       timeout);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01797}01797 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01798}01798 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01799}01799 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01800}\mbox{\hyperlink{scsi__ch_8c_a7d0be791f5ed9f625e5ca2d4eed4331f}{01800}} \mbox{\hyperlink{scsi__ch_8c_a7d0be791f5ed9f625e5ca2d4eed4331f}{scsi\_position\_to\_element}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio, u\_int32\_t retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01801}01801                          \textcolor{keywordtype}{void} (*cbfcnp)(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01802}01802                          u\_int8\_t tag\_action, u\_int32\_t \mbox{\hyperlink{structscsi__exchange__medium_ad4753feb25428beb06f8a5a490d4b6ce}{tea}}, u\_int32\_t dst,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01803}01803                          \textcolor{keywordtype}{int} \mbox{\hyperlink{structscsi__exchange__medium_a13ea2fad65dfbfcc773881d247a8520c}{invert}}, u\_int8\_t sense\_len, u\_int32\_t timeout)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01804}01804 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01805}01805         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__position__to__element}{scsi\_position\_to\_element}} *scsi\_cmd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01806}01806 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01807}01807         scsi\_cmd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__position__to__element}{scsi\_position\_to\_element}} *)\&csio-\/>\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01808}01808         bzero(scsi\_cmd, \textcolor{keyword}{sizeof}(*scsi\_cmd));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01809}01809 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01810}01810         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__position__to__element_a2fb7bf3d3be3cfb0f3832a6d85a54634}{opcode}} = \mbox{\hyperlink{scsi__all_8h_a2f7b36a9ed24341fb30afa273df84dda}{POSITION\_TO\_ELEMENT}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01811}01811 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01812}01812         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__position__to__element_a424cd8820b586a058f86064cc1ce501e}{tea}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__position__to__element_a424cd8820b586a058f86064cc1ce501e}{tea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01813}01813         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__position__to__element_a8d928ed1ea494f899eddf60f394f3cd8}{dst}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__position__to__element_a8d928ed1ea494f899eddf60f394f3cd8}{dst}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01814}01814 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01815}01815         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structscsi__position__to__element_a9ce7e6105cb16df9e37bb815e8fe6675}{invert}})}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01816}01816                 scsi\_cmd-\/>\mbox{\hyperlink{structscsi__position__to__element_a9ce7e6105cb16df9e37bb815e8fe6675}{invert}} |= \mbox{\hyperlink{scsi__ch_8h_ae50c52b0742d66374515551586a1a28c}{POSITION\_TO\_ELEMENT\_INVERT}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01817}01817 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01818}01818         \mbox{\hyperlink{cam__ccb_8h_aa2f54bfe52060582eb17ef5584b8f62b}{cam\_fill\_csio}}(csio,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01819}01819                       retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01820}01820                       cbfcnp,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01821}01821                       \textcolor{comment}{/*flags*/} \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676a17c5461f834828a5af4980b5ac3a375d}{CAM\_DIR\_NONE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01822}01822                       tag\_action,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01823}01823                       \textcolor{comment}{/*data\_ptr*/} NULL,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01824}01824                       \textcolor{comment}{/*dxfer\_len*/} 0,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01825}01825                       sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01826}01826                       \textcolor{keyword}{sizeof}(*scsi\_cmd),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01827}01827                       timeout);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01828}01828 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01829}01829 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01830}01830 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01831}\mbox{\hyperlink{scsi__ch_8c_a69134e2cb4d592a5fdb2fa1cde424874}{01831}} \mbox{\hyperlink{scsi__ch_8c_a69134e2cb4d592a5fdb2fa1cde424874}{scsi\_read\_element\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio, u\_int32\_t retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01832}01832                          \textcolor{keywordtype}{void} (*cbfcnp)(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01833}01833                          u\_int8\_t tag\_action, \textcolor{keywordtype}{int} voltag, u\_int32\_t sea,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01834}01834                          \textcolor{keywordtype}{int} curdata, \textcolor{keywordtype}{int} dvcid,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01835}01835                          u\_int32\_t count, u\_int8\_t *data\_ptr,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01836}01836                          u\_int32\_t dxfer\_len, u\_int8\_t sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01837}01837                          u\_int32\_t timeout)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01838}01838 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01839}01839         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__read__element__status}{scsi\_read\_element\_status}} *scsi\_cmd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01840}01840 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01841}01841         scsi\_cmd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__read__element__status}{scsi\_read\_element\_status}} *)\&csio-\/>\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01842}01842         bzero(scsi\_cmd, \textcolor{keyword}{sizeof}(*scsi\_cmd));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01843}01843 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01844}01844         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__read__element__status_a200bda205b0dab2fc16f0ccf5863befc}{opcode}} = \mbox{\hyperlink{scsi__all_8h_a8f1b95543a7808585087498821cab960}{READ\_ELEMENT\_STATUS}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01845}01845 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01846}01846         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__read__element__status_a3fdfddb415999f57764a762bf8b10c71}{sea}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__read__element__status_a3fdfddb415999f57764a762bf8b10c71}{sea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01847}01847         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{structscsi__read__element__status_aaffd7a26e869f9be91ac46fb519047c1}{count}}, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__read__element__status_aaffd7a26e869f9be91ac46fb519047c1}{count}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01848}01848         \mbox{\hyperlink{scsi__all_8h_ad744ce4fe5b776d796fca7338f45d1a6}{scsi\_ulto3b}}(dxfer\_len, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__read__element__status_a8c0e06449442daa8187506b03cdca02b}{len}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01849}01849         \textcolor{keywordflow}{if} (dvcid)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01850}01850                 scsi\_cmd-\/>\mbox{\hyperlink{structscsi__read__element__status_ab7d8d20e270bb7bd8b04b7791bb6bcd6}{flags}} |= \mbox{\hyperlink{scsi__ch_8h_a8532b11f3a27ae30d7ce51ee79a9d2e1}{READ\_ELEMENT\_STATUS\_DVCID}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01851}01851         \textcolor{keywordflow}{if} (curdata)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01852}01852                 scsi\_cmd-\/>\mbox{\hyperlink{structscsi__read__element__status_ab7d8d20e270bb7bd8b04b7791bb6bcd6}{flags}} |= \mbox{\hyperlink{scsi__ch_8h_a7bd4915b1eaa42fa3b430beaec1133e3}{READ\_ELEMENT\_STATUS\_CURDATA}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01853}01853 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01854}01854         \textcolor{keywordflow}{if} (voltag)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01855}01855                 scsi\_cmd-\/>\mbox{\hyperlink{structscsi__read__element__status_aa756e083a3b858e26a8198ac0d20815d}{byte2}} |= \mbox{\hyperlink{scsi__ch_8h_ac839b7e7b73d906151852e72f2ba237f}{READ\_ELEMENT\_STATUS\_VOLTAG}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01856}01856 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01857}01857         \mbox{\hyperlink{cam__ccb_8h_aa2f54bfe52060582eb17ef5584b8f62b}{cam\_fill\_csio}}(csio,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01858}01858                       retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01859}01859                       cbfcnp,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01860}01860                       \textcolor{comment}{/*flags*/} \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676a00dc62a475e9a013d8a7f90fcf08f3af}{CAM\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01861}01861                       tag\_action,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01862}01862                       data\_ptr,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01863}01863                       dxfer\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01864}01864                       sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01865}01865                       \textcolor{keyword}{sizeof}(*scsi\_cmd),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01866}01866                       timeout);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01867}01867 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01868}01868 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01869}01869 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01870}\mbox{\hyperlink{scsi__ch_8c_a88dc5b00f0ea298a820324abb6ae7dd2}{01870}} \mbox{\hyperlink{scsi__ch_8c_a88dc5b00f0ea298a820324abb6ae7dd2}{scsi\_initialize\_element\_status}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio, u\_int32\_t retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01871}01871                                \textcolor{keywordtype}{void} (*cbfcnp)(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01872}01872                                u\_int8\_t tag\_action, u\_int8\_t sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01873}01873                                u\_int32\_t timeout)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01874}01874 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01875}01875         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__initialize__element__status}{scsi\_initialize\_element\_status}} *scsi\_cmd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01876}01876 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01877}01877         scsi\_cmd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__initialize__element__status}{scsi\_initialize\_element\_status}} *)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01878}01878                     \&csio-\/>\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01879}01879         bzero(scsi\_cmd, \textcolor{keyword}{sizeof}(*scsi\_cmd));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01880}01880 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01881}01881         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__initialize__element__status_ac1052204cd5b71f100634d73c0ce6aee}{opcode}} = \mbox{\hyperlink{scsi__ch_8h_aacc6439503688c381caa4d09de9adaf6}{INITIALIZE\_ELEMENT\_STATUS}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01882}01882 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01883}01883         \mbox{\hyperlink{cam__ccb_8h_aa2f54bfe52060582eb17ef5584b8f62b}{cam\_fill\_csio}}(csio,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01884}01884                       retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01885}01885                       cbfcnp,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01886}01886                       \textcolor{comment}{/*flags*/} \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676a17c5461f834828a5af4980b5ac3a375d}{CAM\_DIR\_NONE}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01887}01887                       tag\_action,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01888}01888                       \textcolor{comment}{/* data\_ptr */} NULL,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01889}01889                       \textcolor{comment}{/* dxfer\_len */} 0,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01890}01890                       sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01891}01891                       \textcolor{keyword}{sizeof}(*scsi\_cmd),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01892}01892                       timeout);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01893}01893 \}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01894}01894 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01895}01895 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01896}\mbox{\hyperlink{scsi__ch_8c_a7ab4d4841676722765640050f2bd14e5}{01896}} \mbox{\hyperlink{scsi__ch_8c_a7ab4d4841676722765640050f2bd14e5}{scsi\_send\_volume\_tag}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio, u\_int32\_t retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01897}01897                      \textcolor{keywordtype}{void} (*cbfcnp)(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__periph}{cam\_periph}} *, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01898}01898                      u\_int8\_t tag\_action, }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01899}01899                      u\_int16\_t element\_address,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01900}01900                      u\_int8\_t send\_action\_code,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01901}01901                      \textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__send__volume__tag__parameters}{scsi\_send\_volume\_tag\_parameters}} *parameters,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01902}01902                      u\_int8\_t sense\_len, u\_int32\_t timeout)}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01903}01903 \{}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01904}01904         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__send__volume__tag}{scsi\_send\_volume\_tag}} *scsi\_cmd;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01905}01905 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01906}01906         scsi\_cmd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__send__volume__tag}{scsi\_send\_volume\_tag}} *) \&csio-\/>\mbox{\hyperlink{structccb__scsiio_a13387230fb12876920d96b0fe3a74689}{cdb\_io}}.\mbox{\hyperlink{unioncdb__t_a2d84ee02fd9dd4cabf1d6bd187625dc2}{cdb\_bytes}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01907}01907         bzero(scsi\_cmd, \textcolor{keyword}{sizeof}(*scsi\_cmd));}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01908}01908 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01909}01909         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__send__volume__tag_a84c11bf3e2a77ad23c67ae8cf1e7dea7}{opcode}} = \mbox{\hyperlink{scsi__ch_8h_ad0decc062fb46b38d0063cf739dd64cb}{SEND\_VOLUME\_TAG}};}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01910}01910         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(element\_address, scsi\_cmd-\/>\mbox{\hyperlink{structscsi__send__volume__tag_afb32173e248855a7831af15db05791a7}{ea}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01911}01911         scsi\_cmd-\/>\mbox{\hyperlink{structscsi__send__volume__tag_a910b1987914c34815f7cf62bb6c042fd}{sac}} = send\_action\_code;}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01912}01912         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\textcolor{keyword}{sizeof}(*parameters), scsi\_cmd-\/>\mbox{\hyperlink{structscsi__send__volume__tag_a332e9420819c28f1b715cc91214366c1}{pll}});}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01913}01913 }
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01914}01914         \mbox{\hyperlink{cam__ccb_8h_aa2f54bfe52060582eb17ef5584b8f62b}{cam\_fill\_csio}}(csio,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01915}01915                       retries,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01916}01916                       cbfcnp,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01917}01917                       \textcolor{comment}{/*flags*/} \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676adf60a86f59d84768dceb1af379c0dc3a}{CAM\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01918}01918                       tag\_action,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01919}01919                       \textcolor{comment}{/* data\_ptr */} (u\_int8\_t *) parameters,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01920}01920                       \textcolor{keyword}{sizeof}(*parameters),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01921}01921                       sense\_len,}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01922}01922                       \textcolor{keyword}{sizeof}(*scsi\_cmd),}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01923}01923                       timeout);}
\DoxyCodeLine{\Hypertarget{scsi__ch_8c_source_l01924}01924 \}}

\end{DoxyCode}
