\hypertarget{ctl__frontend__cam__sim_8c_source}{}\doxysection{ctl\+\_\+frontend\+\_\+cam\+\_\+sim.\+c}
\label{ctl__frontend__cam__sim_8c_source}\index{cam/ctl/ctl\_frontend\_cam\_sim.c@{cam/ctl/ctl\_frontend\_cam\_sim.c}}
\mbox{\hyperlink{ctl__frontend__cam__sim_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2009 Silicon Graphics International Corp.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions, and the following disclaimer,}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00012}00012 \textcolor{comment}{ *    without modification.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce at minimum a disclaimer}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00014}00014 \textcolor{comment}{ *    substantially similar to the "{}NO WARRANTY"{} disclaimer below}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00015}00015 \textcolor{comment}{ *    ("{}Disclaimer"{}) and any redistribution must be conditioned upon}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00016}00016 \textcolor{comment}{ *    including a substantially similar Disclaimer requirement for further}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00017}00017 \textcolor{comment}{ *    binary redistribution.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00018}00018 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00019}00019 \textcolor{comment}{ * NO WARRANTY}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00020}00020 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00021}00021 \textcolor{comment}{ * "{}AS IS"{} AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00022}00022 \textcolor{comment}{ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00023}00023 \textcolor{comment}{ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00024}00024 \textcolor{comment}{ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00025}00025 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00026}00026 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00027}00027 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00028}00028 \textcolor{comment}{ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00029}00029 \textcolor{comment}{ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00030}00030 \textcolor{comment}{ * POSSIBILITY OF SUCH DAMAGES.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00031}00031 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00032}00032 \textcolor{comment}{ * \$Id: //depot/users/kenm/FreeBSD-\/test2/sys/cam/ctl/ctl\_frontend\_cam\_sim.c\#4 \$}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00033}00033 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00034}00034 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00035}00035 \textcolor{comment}{ * CTL frontend to CAM SIM interface.  This allows access to CTL LUNs via}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00036}00036 \textcolor{comment}{ * the da(4) and pass(4) drivers from inside the system.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00037}00037 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00038}00038 \textcolor{comment}{ * Author: Ken Merry <ken@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00039}00039 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00042}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00042}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <machine/atomic.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <machine/bus.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/sbuf.h>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam_8h}{cam/cam.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__ccb_8h}{cam/cam\_ccb.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__sim_8h}{cam/cam\_sim.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__xpt__sim_8h}{cam/cam\_xpt\_sim.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__xpt_8h}{cam/cam\_xpt.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam__periph_8h}{cam/cam\_periph.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__all_8h}{cam/scsi/scsi\_all.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__message_8h}{cam/scsi/scsi\_message.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__io_8h}{cam/ctl/ctl\_io.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl_8h}{cam/ctl/ctl.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00065}00065 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__frontend_8h}{cam/ctl/ctl\_frontend.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00066}00066 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__debug_8h}{cam/ctl/ctl\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00068}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_ae6cb44d90dbc03310d82739a736648e9}{00068}} \textcolor{preprocessor}{\#define io\_ptr          spriv\_ptr1}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00070}\mbox{\hyperlink{structcfcs__io}{00070}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__io}{cfcs\_io}} \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00071}\mbox{\hyperlink{structcfcs__io_a956f8f1ef9621b23d555ea1f08df05e0}{00071}}         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{structcfcs__io_a956f8f1ef9621b23d555ea1f08df05e0}{ccb}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00072}00072 \};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00073}00073 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00074}\mbox{\hyperlink{structcfcs__softc}{00074}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}} \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00075}\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{00075}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__port}{ctl\_port}} \mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00076}\mbox{\hyperlink{structcfcs__softc_a822ca361625af9a5e70797c90aad249e}{00076}}         \textcolor{keywordtype}{char} \mbox{\hyperlink{structcfcs__softc_a822ca361625af9a5e70797c90aad249e}{port\_name}}[32];}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00077}\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{00077}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__sim}{cam\_sim}} *\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00078}\mbox{\hyperlink{structcfcs__softc_a53b2b932823e4e884d3c8ecd4710014f}{00078}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__devq}{cam\_devq}} *\mbox{\hyperlink{structcfcs__softc_a53b2b932823e4e884d3c8ecd4710014f}{devq}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00079}\mbox{\hyperlink{structcfcs__softc_abd35ddf9e2a826a62d23c8e1ae964b7b}{00079}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structcam__path}{cam\_path}} *\mbox{\hyperlink{structcfcs__softc_abd35ddf9e2a826a62d23c8e1ae964b7b}{path}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00080}\mbox{\hyperlink{structcfcs__softc_aeeaf49c515507aaea64944c83a9c00bf}{00080}}         uint64\_t \mbox{\hyperlink{structcfcs__softc_aeeaf49c515507aaea64944c83a9c00bf}{wwnn}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00081}\mbox{\hyperlink{structcfcs__softc_ad3b47a5cdf508ad9b73d76f1ad0ac067}{00081}}         uint64\_t \mbox{\hyperlink{structcfcs__softc_ad3b47a5cdf508ad9b73d76f1ad0ac067}{wwpn}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00082}\mbox{\hyperlink{structcfcs__softc_ae91ed9eb8d436661c6c4bf38ebdb2fd0}{00082}}         uint32\_t \mbox{\hyperlink{structcfcs__softc_ae91ed9eb8d436661c6c4bf38ebdb2fd0}{cur\_tag\_num}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00083}\mbox{\hyperlink{structcfcs__softc_ae6ec408e5c08f471119175f165fcc343}{00083}}         \textcolor{keywordtype}{int} \mbox{\hyperlink{structcfcs__softc_ae6ec408e5c08f471119175f165fcc343}{online}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00084}00084 \};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00085}00085 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00086}00086 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00087}00087 \textcolor{comment}{ * We can't handle CCBs with these flags.  For the most part, we just don't}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00088}00088 \textcolor{comment}{ * handle physical addresses yet.  That would require mapping things in}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00089}00089 \textcolor{comment}{ * order to do the copy.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00090}00090 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00091}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_ad416bd80082545771fa12022b9df8bde}{00091}} \textcolor{preprocessor}{\#define CFCS\_BAD\_CCB\_FLAGS (CAM\_DATA\_ISPHYS | CAM\_CDB\_PHYS | CAM\_SENSE\_PTR |            \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00092}00092 \textcolor{preprocessor}{        CAM\_SENSE\_PHYS)}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00094}00094 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a29e7e003d87cf393ca33dc8c92850802}{cfcs\_init}}(\textcolor{keywordtype}{void});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00095}00095 \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a877d8ff114354a904048e9ba147da796}{cfcs\_shutdown}}(\textcolor{keywordtype}{void});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00096}00096 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a9f865c50fd653fc373b98b26c49f538f}{cfcs\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__sim}{cam\_sim}} *sim);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00097}00097 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a08d7aa5ee38a681655b1b8fbbcf6e9c7}{cfcs\_online}}(\textcolor{keywordtype}{void} *arg);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00098}00098 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a6249cb762607f94f6fc051995e534ed8}{cfcs\_offline}}(\textcolor{keywordtype}{void} *arg);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00099}00099 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1346a37ee6eaeacf2f3fbba91a2a1fd7}{cfcs\_datamove}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00100}00100 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_abd902e19b1fdbd9d8aa63734c1392d78}{cfcs\_done}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00101}00101 \textcolor{keywordtype}{void} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1b06680cec7e02019a4e6a0fef6730ff}{cfcs\_action}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__sim}{cam\_sim}} *sim, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00102}00102 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00103}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a62dfa21571f0a647f9254c14d8303da5}{00103}} \textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}} \mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00104}00104 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00105}00105 \textcolor{comment}{ * This is primarily intended to allow for error injection to test the CAM}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00106}00106 \textcolor{comment}{ * sense data and sense residual handling code.  This sets the maximum}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00107}00107 \textcolor{comment}{ * amount of SCSI sense data that we will report to CAM.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00108}00108 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00109}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a3dbfbeb462c97f1389c66fe330fc14a7}{00109}} \textcolor{keyword}{static} \textcolor{keywordtype}{int} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a3dbfbeb462c97f1389c66fe330fc14a7}{cfcs\_max\_sense}} = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__sense__data}{scsi\_sense\_data}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00110}00110 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00111}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a0ec748f1596ce1fb02138bac65a1f5b9}{00111}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a0ec748f1596ce1fb02138bac65a1f5b9}{SYSCTL\_NODE}}(\_kern\_cam, OID\_AUTO, ctl2cam, CTLFLAG\_RD | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00112}00112     \textcolor{stringliteral}{"{}CAM Target Layer SIM frontend"{}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00113}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1c6a3ef1a9c8cc537dfa8e277775b45f}{00113}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1c6a3ef1a9c8cc537dfa8e277775b45f}{SYSCTL\_INT}}(\_kern\_cam\_ctl2cam, OID\_AUTO, max\_sense, CTLFLAG\_RW,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00114}00114            \&\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a3dbfbeb462c97f1389c66fe330fc14a7}{cfcs\_max\_sense}}, 0, \textcolor{stringliteral}{"{}Maximum sense data size"{}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00116}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a966202a4a19c588f7f3e8ec991c38d50}{00116}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__frontend}{ctl\_frontend}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a966202a4a19c588f7f3e8ec991c38d50}{cfcs\_frontend}} =}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00117}00117 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00118}00118         .\mbox{\hyperlink{structctl__frontend_a622b429bfe97ad0837124891bf83c1b2}{name}} = \textcolor{stringliteral}{"{}camsim"{}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00119}00119         .init = \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a29e7e003d87cf393ca33dc8c92850802}{cfcs\_init}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00120}00120         .shutdown = \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a877d8ff114354a904048e9ba147da796}{cfcs\_shutdown}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00121}00121 \};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00122}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a009348e2c8aeb39e9d1d738112e4ff83}{00122}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a009348e2c8aeb39e9d1d738112e4ff83}{CTL\_FRONTEND\_DECLARE}}(ctlcfcs, \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a966202a4a19c588f7f3e8ec991c38d50}{cfcs\_frontend}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00123}00123 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00124}00124 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00125}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a29e7e003d87cf393ca33dc8c92850802}{00125}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a29e7e003d87cf393ca33dc8c92850802}{cfcs\_init}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00126}00126 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00127}00127         \textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00128}00128         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__port}{ctl\_port}} *port;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00129}00129         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00131}00131         softc = \&\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a62dfa21571f0a647f9254c14d8303da5}{cfcs\_softc}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00132}00132         bzero(softc, \textcolor{keyword}{sizeof}(*softc));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00133}00133         port = \&softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00135}00135         port-\/>\mbox{\hyperlink{structctl__port_a4be0d7e10ccc7e318aad61aed95cea22}{frontend}} = \&\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a966202a4a19c588f7f3e8ec991c38d50}{cfcs\_frontend}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00136}00136         port-\/>\mbox{\hyperlink{structctl__port_a19fd51ee5bcc831c363836396e05a573}{port\_type}} = \mbox{\hyperlink{ctl_8h_a53fea0b1e347573f754d603b45e0f836a03ebb15247b9f6e5abf12b9eec8ff95d}{CTL\_PORT\_INTERNAL}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00137}00137         \textcolor{comment}{/* XXX KDM what should the real number be here? */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00138}00138         port-\/>\mbox{\hyperlink{structctl__port_a2f2c36d870549966135b43ba3f5a0298}{num\_requested\_ctl\_io}} = 4096;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00139}00139         snprintf(softc-\/>\mbox{\hyperlink{structcfcs__softc_a822ca361625af9a5e70797c90aad249e}{port\_name}}, \textcolor{keyword}{sizeof}(softc-\/>\mbox{\hyperlink{structcfcs__softc_a822ca361625af9a5e70797c90aad249e}{port\_name}}), \textcolor{stringliteral}{"{}camsim"{}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00140}00140         port-\/>\mbox{\hyperlink{structctl__port_a03ddc60fbc6e252687cfd18422e99e6e}{port\_name}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_a822ca361625af9a5e70797c90aad249e}{port\_name}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00141}00141         port-\/>\mbox{\hyperlink{structctl__port_ae44d52cd1ac2b3fcbdb727edeaaa5e32}{port\_online}} = \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a08d7aa5ee38a681655b1b8fbbcf6e9c7}{cfcs\_online}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00142}00142         port-\/>\mbox{\hyperlink{structctl__port_a5499e7cf3a18c74f85c8a36b4e4b1303}{port\_offline}} = \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a6249cb762607f94f6fc051995e534ed8}{cfcs\_offline}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00143}00143         port-\/>\mbox{\hyperlink{structctl__port_aa315af17d49945df6c1102c9d8c20dcd}{onoff\_arg}} = softc;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00144}00144         port-\/>\mbox{\hyperlink{structctl__port_a7422fb0b14604a4d17b43ea378007368}{fe\_datamove}} = \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1346a37ee6eaeacf2f3fbba91a2a1fd7}{cfcs\_datamove}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00145}00145         port-\/>\mbox{\hyperlink{structctl__port_aeab9075a921321a3ed7e5ecdaf5ed66a}{fe\_done}} = \mbox{\hyperlink{ctl__frontend__cam__sim_8c_abd902e19b1fdbd9d8aa63734c1392d78}{cfcs\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00146}00146         port-\/>\mbox{\hyperlink{structctl__port_a1ba5bbf68ec74caaf3ee4a689df6ea2b}{targ\_port}} = -\/1;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00148}00148         retval = \mbox{\hyperlink{ctl__frontend_8c_a8e5dfbba958b9f09dad9ccd82b6e9e21}{ctl\_port\_register}}(port);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00149}00149         \textcolor{keywordflow}{if} (retval != 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00150}00150                 printf(\textcolor{stringliteral}{"{}\%s: ctl\_port\_register() failed with error \%d!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00151}00151                        \_\_func\_\_, retval);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00152}00152                 \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00153}00153         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00154}00154 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00155}00155         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00156}00156 \textcolor{comment}{         * If the CTL frontend didn't tell us what our WWNN/WWPN is, go}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00157}00157 \textcolor{comment}{         * ahead and set something random.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00158}00158 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00159}00159         \textcolor{keywordflow}{if} (port-\/>\mbox{\hyperlink{structctl__port_a151ff5fe41fc4c93cdea0d0e14a4e947}{wwnn}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00160}00160                 uint64\_t random\_bits;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00161}00161 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00162}00162                 arc4rand(\&random\_bits, \textcolor{keyword}{sizeof}(random\_bits), 0);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00163}00163                 softc-\/>\mbox{\hyperlink{structcfcs__softc_aeeaf49c515507aaea64944c83a9c00bf}{wwnn}} = (random\_bits \& 0x0000000fffffff00ULL) |}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00164}00164                         \textcolor{comment}{/* Company ID */} 0x5000000000000000ULL |}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00165}00165                         \textcolor{comment}{/* NL-\/Port */}    0x0300;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00166}00166                 softc-\/>\mbox{\hyperlink{structcfcs__softc_ad3b47a5cdf508ad9b73d76f1ad0ac067}{wwpn}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_aeeaf49c515507aaea64944c83a9c00bf}{wwnn}} + port-\/>\mbox{\hyperlink{structctl__port_a1ba5bbf68ec74caaf3ee4a689df6ea2b}{targ\_port}} + 1;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00167}00167                 \mbox{\hyperlink{ctl__frontend_8c_a344b18bba5c18c1ec896ed7737b035f1}{ctl\_port\_set\_wwns}}(port, \textcolor{keyword}{true}, softc-\/>\mbox{\hyperlink{structcfcs__softc_aeeaf49c515507aaea64944c83a9c00bf}{wwnn}}, \textcolor{keyword}{true}, softc-\/>\mbox{\hyperlink{structcfcs__softc_ad3b47a5cdf508ad9b73d76f1ad0ac067}{wwpn}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00168}00168         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00169}00169                 softc-\/>\mbox{\hyperlink{structcfcs__softc_aeeaf49c515507aaea64944c83a9c00bf}{wwnn}} = port-\/>\mbox{\hyperlink{structctl__port_a151ff5fe41fc4c93cdea0d0e14a4e947}{wwnn}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00170}00170                 softc-\/>\mbox{\hyperlink{structcfcs__softc_ad3b47a5cdf508ad9b73d76f1ad0ac067}{wwpn}} = port-\/>\mbox{\hyperlink{structctl__port_aff57c7c64affc458c0479bf328137cf4}{wwpn}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00171}00171         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00172}00172 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00173}00173         softc-\/>\mbox{\hyperlink{structcfcs__softc_a53b2b932823e4e884d3c8ecd4710014f}{devq}} = \mbox{\hyperlink{cam__sim_8c_a2b97368c34f664fdb78cc0771abd24f6}{cam\_simq\_alloc}}(port-\/>\mbox{\hyperlink{structctl__port_a2f2c36d870549966135b43ba3f5a0298}{num\_requested\_ctl\_io}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00174}00174         \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structcfcs__softc_a53b2b932823e4e884d3c8ecd4710014f}{devq}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00175}00175                 printf(\textcolor{stringliteral}{"{}\%s: error allocating devq\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00176}00176                 retval = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00177}00177                 \textcolor{keywordflow}{goto} bailout;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00178}00178         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00179}00179 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00180}00180         softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}} = \mbox{\hyperlink{cam__sim_8c_a085d2cfcfabfa49abe329e1ab0393ac7}{cam\_sim\_alloc}}(\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1b06680cec7e02019a4e6a0fef6730ff}{cfcs\_action}}, \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a9f865c50fd653fc373b98b26c49f538f}{cfcs\_poll}}, softc-\/>\mbox{\hyperlink{structcfcs__softc_a822ca361625af9a5e70797c90aad249e}{port\_name}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00181}00181                                    softc, \textcolor{comment}{/*unit*/} 0, NULL, 1,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00182}00182                                    port-\/>\mbox{\hyperlink{structctl__port_a2f2c36d870549966135b43ba3f5a0298}{num\_requested\_ctl\_io}}, softc-\/>\mbox{\hyperlink{structcfcs__softc_a53b2b932823e4e884d3c8ecd4710014f}{devq}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00183}00183         \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00184}00184                 printf(\textcolor{stringliteral}{"{}\%s: error allocating SIM\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00185}00185                 retval = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00186}00186                 \textcolor{keywordflow}{goto} bailout;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00187}00187         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00188}00188 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00189}00189         \textcolor{keywordflow}{if} (\mbox{\hyperlink{cam__xpt_8c_ab01de6f5ed666604469e45c8c2998752}{xpt\_bus\_register}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}}, NULL, 0) != \mbox{\hyperlink{cam__ccb_8h_ab43e093b1ef15ad52763cde93572b5c4}{CAM\_SUCCESS}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00190}00190                 printf(\textcolor{stringliteral}{"{}\%s: error registering SIM\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00191}00191                 retval = ENOMEM;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00192}00192                 \textcolor{keywordflow}{goto} bailout;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00193}00193         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00194}00194 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00195}00195         \textcolor{keywordflow}{if} (\mbox{\hyperlink{cam__xpt_8c_a29b31416ba01fbf7ab51c968bc637d30}{xpt\_create\_path}}(\&softc-\/>\mbox{\hyperlink{structcfcs__softc_abd35ddf9e2a826a62d23c8e1ae964b7b}{path}}, \textcolor{comment}{/*periph*/}NULL,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00196}00196                             \mbox{\hyperlink{cam__sim_8h_a046f3a30bb47046dda5770947d1e0a80}{cam\_sim\_path}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}}),}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00197}00197                             \mbox{\hyperlink{cam_8h_a08317e5f8591315faef6fecfd3817fed}{CAM\_TARGET\_WILDCARD}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00198}00198                             \mbox{\hyperlink{cam_8h_a18ef98c84b4cf578514faec8ba1a8d28}{CAM\_LUN\_WILDCARD}}) != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00199}00199                 printf(\textcolor{stringliteral}{"{}\%s: error creating path\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00200}00200                 \mbox{\hyperlink{cam__xpt_8c_a018ce6c39171a67eb71a63a507797f48}{xpt\_bus\_deregister}}(\mbox{\hyperlink{cam__sim_8h_a046f3a30bb47046dda5770947d1e0a80}{cam\_sim\_path}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00201}00201                 retval = EINVAL;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00202}00202                 \textcolor{keywordflow}{goto} bailout;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00203}00203         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00204}00204 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00205}00205         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00206}00206 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00207}00207 bailout:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00208}00208         \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}})}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00209}00209                 \mbox{\hyperlink{cam__sim_8c_aa7309a981f4002889ee9eb98cdb75f68}{cam\_sim\_free}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}}, \textcolor{comment}{/*free\_devq*/} TRUE);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00210}00210         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structcfcs__softc_a53b2b932823e4e884d3c8ecd4710014f}{devq}})}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00211}00211                 \mbox{\hyperlink{cam__sim_8c_ac7d061b4681412aa660a7c6bf6166a76}{cam\_simq\_free}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_a53b2b932823e4e884d3c8ecd4710014f}{devq}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00212}00212         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00213}00213 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00214}00214 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00215}00215 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00216}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a877d8ff114354a904048e9ba147da796}{00216}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a877d8ff114354a904048e9ba147da796}{cfcs\_shutdown}}(\textcolor{keywordtype}{void})}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00217}00217 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00218}00218         \textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}} *softc = \&\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a62dfa21571f0a647f9254c14d8303da5}{cfcs\_softc}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00219}00219         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__port}{ctl\_port}} *port = \&softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00220}00220         \textcolor{keywordtype}{int} error;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00222}00222         \mbox{\hyperlink{ctl__frontend_8c_a5cf3f4bbeaa1d9eb5feeaff34caaeb3a}{ctl\_port\_offline}}(port);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00223}00223 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00224}00224         \mbox{\hyperlink{cam__xpt_8c_aa27bbf640d7c4e3bf9fb31d90c3da929}{xpt\_free\_path}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_abd35ddf9e2a826a62d23c8e1ae964b7b}{path}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00225}00225         \mbox{\hyperlink{cam__xpt_8c_a018ce6c39171a67eb71a63a507797f48}{xpt\_bus\_deregister}}(\mbox{\hyperlink{cam__sim_8h_a046f3a30bb47046dda5770947d1e0a80}{cam\_sim\_path}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00226}00226         \mbox{\hyperlink{cam__sim_8c_aa7309a981f4002889ee9eb98cdb75f68}{cam\_sim\_free}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}}, \textcolor{comment}{/*free\_devq*/} TRUE);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00227}00227 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00228}00228         \textcolor{keywordflow}{if} ((error = \mbox{\hyperlink{ctl__frontend_8c_a1331fc0ace7f7c225c0ed6aa9d031d3e}{ctl\_port\_deregister}}(port)) != 0)}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00229}00229                 printf(\textcolor{stringliteral}{"{}\%s: cam\_sim port deregistration failed\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00230}00230         \textcolor{keywordflow}{return} (error);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00231}00231 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00232}00232 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00233}00233 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00234}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a9f865c50fd653fc373b98b26c49f538f}{00234}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a9f865c50fd653fc373b98b26c49f538f}{cfcs\_poll}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__sim}{cam\_sim}} *sim)}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00235}00235 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00236}00236 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00237}00237 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00238}00238 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00239}00239 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00240}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a74fcc90345d8eb61e47a6a7f98decd13}{00240}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a74fcc90345d8eb61e47a6a7f98decd13}{cfcs\_onoffline}}(\textcolor{keywordtype}{void} *arg, \textcolor{keywordtype}{int} online)}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00241}00241 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00242}00242         \textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}} *softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}} *)arg;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00243}00243         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00244}00244 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00245}00245         softc-\/>\mbox{\hyperlink{structcfcs__softc_ae6ec408e5c08f471119175f165fcc343}{online}} = online;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00247}00247         \mbox{\hyperlink{unionccb}{ccb}} = \mbox{\hyperlink{cam__xpt_8c_a9de65e290bb5d0c78183237169d6f8dd}{xpt\_alloc\_ccb\_nowait}}();}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00248}00248         \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionccb}{ccb}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00249}00249                 printf(\textcolor{stringliteral}{"{}\%s: unable to allocate CCB for rescan\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00250}00250                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00251}00251         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00253}00253         \textcolor{keywordflow}{if} (\mbox{\hyperlink{cam__xpt_8c_a29b31416ba01fbf7ab51c968bc637d30}{xpt\_create\_path}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a47763149d044e13fcc06abfb3ddc941f}{path}}, NULL,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00254}00254                             \mbox{\hyperlink{cam__sim_8h_a046f3a30bb47046dda5770947d1e0a80}{cam\_sim\_path}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}}), \mbox{\hyperlink{cam_8h_a08317e5f8591315faef6fecfd3817fed}{CAM\_TARGET\_WILDCARD}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00255}00255                             \mbox{\hyperlink{cam_8h_a18ef98c84b4cf578514faec8ba1a8d28}{CAM\_LUN\_WILDCARD}}) != \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00256}00256                 printf(\textcolor{stringliteral}{"{}\%s: can't allocate path for rescan\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00257}00257                 \mbox{\hyperlink{cam__xpt_8c_af1e7540fc366b5cad2e58f29d1de0f60}{xpt\_free\_ccb}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00258}00258                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00259}00259         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00260}00260         \mbox{\hyperlink{cam__xpt_8c_a44ae64d5b5cc896268ac6b55f016b290}{xpt\_rescan}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00261}00261 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00263}00263 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00264}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a08d7aa5ee38a681655b1b8fbbcf6e9c7}{00264}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a08d7aa5ee38a681655b1b8fbbcf6e9c7}{cfcs\_online}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00265}00265 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00266}00266         \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a74fcc90345d8eb61e47a6a7f98decd13}{cfcs\_onoffline}}(arg, \textcolor{comment}{/*online*/} 1);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00267}00267 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00269}00269 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00270}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a6249cb762607f94f6fc051995e534ed8}{00270}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a6249cb762607f94f6fc051995e534ed8}{cfcs\_offline}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00271}00271 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00272}00272         \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a74fcc90345d8eb61e47a6a7f98decd13}{cfcs\_onoffline}}(arg, \textcolor{comment}{/*online*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00273}00273 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00275}00275 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00276}00276 \textcolor{comment}{ * This function is very similar to ctl\_ioctl\_do\_datamove().  Is there a}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00277}00277 \textcolor{comment}{ * way to combine the functionality?}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00278}00278 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00279}00279 \textcolor{comment}{ * XXX KDM may need to move this into a thread.  We're doing a bcopy in the}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00280}00280 \textcolor{comment}{ * caller's context, which will usually be the backend.  That may not be a}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00281}00281 \textcolor{comment}{ * good thing.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00282}00282 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00283}00283 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00284}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1346a37ee6eaeacf2f3fbba91a2a1fd7}{00284}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1346a37ee6eaeacf2f3fbba91a2a1fd7}{cfcs\_datamove}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *io)}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00285}00285 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00286}00286         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00287}00287         bus\_dma\_segment\_t cam\_sg\_entry, *cam\_sglist;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00288}00288         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__sg__entry}{ctl\_sg\_entry}} \mbox{\hyperlink{structctl__sg__entry}{ctl\_sg\_entry}}, *ctl\_sglist;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00289}00289         \textcolor{keywordtype}{int} cam\_sg\_count, ctl\_sg\_count, cam\_sg\_start;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00290}00290         \textcolor{keywordtype}{int} cam\_sg\_offset;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00291}00291         \textcolor{keywordtype}{int} len\_to\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00292}00292         \textcolor{keywordtype}{int} ctl\_watermark, cam\_watermark;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00293}00293         \textcolor{keywordtype}{int} i, j;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00295}00295         \mbox{\hyperlink{unionccb}{ccb}} = io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_ae6f7e42ec6b84691810ea012f12801aa}{ctl\_private}}[\mbox{\hyperlink{ctl__io_8h_a060a1d6666c902724d482da98988a993}{CTL\_PRIV\_FRONTEND}}].\mbox{\hyperlink{unionctl__priv_a7a57d9abd212a63f7e395319e4c28b36}{ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00296}00296 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00297}00297         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00298}00298 \textcolor{comment}{         * Note that we have a check in cfcs\_action() to make sure that any}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00299}00299 \textcolor{comment}{         * CCBs with "{}bad"{} flags are returned with CAM\_REQ\_INVALID.  This}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00300}00300 \textcolor{comment}{         * is just to make sure no one removes that check without updating}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00301}00301 \textcolor{comment}{         * this code to provide the additional functionality necessary to}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00302}00302 \textcolor{comment}{         * support those modes of operation.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00303}00303 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00304}00304         KASSERT(((\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a2b92b9f93c185a3bcd5da48c751c0c05}{flags}} \& \mbox{\hyperlink{ctl__frontend__cam__sim_8c_ad416bd80082545771fa12022b9df8bde}{CFCS\_BAD\_CCB\_FLAGS}}) == 0), (\textcolor{stringliteral}{"{}invalid "{}}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00305}00305                   \textcolor{stringliteral}{"{}CAM flags \%\#x"{}}, (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a2b92b9f93c185a3bcd5da48c751c0c05}{flags}} \& \mbox{\hyperlink{ctl__frontend__cam__sim_8c_ad416bd80082545771fa12022b9df8bde}{CFCS\_BAD\_CCB\_FLAGS}})));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00307}00307         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00308}00308 \textcolor{comment}{         * Simplify things on both sides by putting single buffers into a}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00309}00309 \textcolor{comment}{         * single entry S/G list.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00310}00310 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00311}00311         \textcolor{keywordflow}{switch} ((\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a2b92b9f93c185a3bcd5da48c751c0c05}{flags}} \& \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676ac058a86c200f37e91d053eca68c09d67}{CAM\_DATA\_MASK}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00312}00312         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676ae0b2af022090126ee5ad2ccc1d5f4cc9}{CAM\_DATA\_SG}}: \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00313}00313                 \textcolor{keywordtype}{int} len\_seen;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00315}00315                 cam\_sglist = (bus\_dma\_segment\_t *)\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a51063aa61cb015be29efd19874e0586c}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00316}00316                 cam\_sg\_count = \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_ad6c5d9e256e3dbd74d1e379a6216dec1}{sglist\_cnt}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00317}00317                 cam\_sg\_start = cam\_sg\_count;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00318}00318                 cam\_sg\_offset = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00319}00319 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00320}00320                 for (i = 0, len\_seen = 0; i < cam\_sg\_count; i++) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00321}00321                         \textcolor{keywordflow}{if} ((len\_seen + cam\_sglist[i].ds\_len) >=}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00322}00322                              io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00323}00323                                 cam\_sg\_start = i;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00324}00324                                 cam\_sg\_offset = io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} -\/}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00325}00325                                         len\_seen;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00326}00326                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00327}00327                         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00328}00328                         len\_seen += cam\_sglist[i].ds\_len;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00329}00329                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00330}00330                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00331}00331         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00332}00332         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_a8a331ca6ae1e86223b907c974ef6b676aaa58527ce2c212b617237872fec85f4b}{CAM\_DATA\_VADDR}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00333}00333                 cam\_sglist = \&cam\_sg\_entry;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00334}00334                 cam\_sglist[0].ds\_len = \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a876ad61cacd6314a81bcb506ed3d4744}{dxfer\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00335}00335                 cam\_sglist[0].ds\_addr = (bus\_addr\_t)(uintptr\_t)\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a51063aa61cb015be29efd19874e0586c}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00336}00336                 cam\_sg\_count = 1;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00337}00337                 cam\_sg\_start = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00338}00338                 cam\_sg\_offset = io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00339}00339                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00340}00340         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00341}00341                 panic(\textcolor{stringliteral}{"{}Invalid CAM flags \%\#x"{}}, \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a2b92b9f93c185a3bcd5da48c751c0c05}{flags}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00342}00342         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00343}00343 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00344}00344         \textcolor{keywordflow}{if} (io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} > 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00345}00345                 ctl\_sglist = (\textcolor{keyword}{struct }\mbox{\hyperlink{structctl__sg__entry}{ctl\_sg\_entry}} *)io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00346}00346                 ctl\_sg\_count = io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00347}00347         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00348}00348                 ctl\_sglist = \&\mbox{\hyperlink{structctl__sg__entry}{ctl\_sg\_entry}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00349}00349                 ctl\_sglist-\/>\mbox{\hyperlink{structctl__sg__entry_a0807b13294648429e725ed8754f38f95}{addr}} = io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00350}00350                 ctl\_sglist-\/>\mbox{\hyperlink{structctl__sg__entry_a96f6584fa78c30ecc72625d5c2926c79}{len}} = io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00351}00351                 ctl\_sg\_count = 1;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00352}00352         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00353}00353 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00354}00354         ctl\_watermark = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00355}00355         cam\_watermark = cam\_sg\_offset;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00356}00356         \textcolor{keywordflow}{for} (i = cam\_sg\_start, j = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00357}00357              i < cam\_sg\_count \&\& j < ctl\_sg\_count;) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00358}00358                 uint8\_t *cam\_ptr, *ctl\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00359}00359 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00360}00360                 len\_to\_copy = MIN(cam\_sglist[i].ds\_len -\/ cam\_watermark,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00361}00361                                   ctl\_sglist[j].\mbox{\hyperlink{structctl__sg__entry_a96f6584fa78c30ecc72625d5c2926c79}{len}} -\/ ctl\_watermark);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00362}00362 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00363}00363                 cam\_ptr = (uint8\_t *)(uintptr\_t)cam\_sglist[i].ds\_addr;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00364}00364                 cam\_ptr = cam\_ptr + cam\_watermark;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00365}00365                 \textcolor{keywordflow}{if} (io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01aa340760accb2fc0d26506c04d4385435}{CTL\_FLAG\_BUS\_ADDR}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00366}00366                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00367}00367 \textcolor{comment}{                         * XXX KDM fix this!}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00368}00368 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00369}00369                         panic(\textcolor{stringliteral}{"{}need to implement bus address support"{}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00370}00370 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00371}00371                         kern\_ptr = bus\_to\_virt(kern\_sglist[j].\mbox{\hyperlink{structctl__sg__entry_a0807b13294648429e725ed8754f38f95}{addr}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00372}00372 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00373}00373                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00374}00374                         ctl\_ptr = (uint8\_t *)ctl\_sglist[j].\mbox{\hyperlink{structctl__sg__entry_a0807b13294648429e725ed8754f38f95}{addr}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00375}00375                 ctl\_ptr = ctl\_ptr + ctl\_watermark;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00376}00376 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00377}00377                 \textcolor{keywordflow}{if} ((io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a7270a3d326bc03773df48fb1e8540f56}{CTL\_FLAG\_DATA\_MASK}}) ==}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00378}00378                      \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01ac1042c16a3395ba256156c8a68408537}{CTL\_FLAG\_DATA\_IN}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00379}00379                         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}\%s: copying \%d bytes to CAM\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00380}00380                                          \_\_func\_\_, len\_to\_copy));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00381}00381                         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}\%s: from \%p to \%p\(\backslash\)n"{}}, ctl\_ptr,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00382}00382                                          \_\_func\_\_, cam\_ptr));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00383}00383                         bcopy(ctl\_ptr, cam\_ptr, len\_to\_copy);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00384}00384                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00385}00385                         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}\%s: copying \%d bytes from CAM\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00386}00386                                          \_\_func\_\_, len\_to\_copy));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00387}00387                         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}\%s: from \%p to \%p\(\backslash\)n"{}}, cam\_ptr,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00388}00388                                          \_\_func\_\_, ctl\_ptr));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00389}00389                         bcopy(cam\_ptr, ctl\_ptr, len\_to\_copy);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00390}00390                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00391}00391 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00392}00392                 io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a5b7e4c521e3d98250b6316ced45ac556}{ext\_data\_filled}} += len\_to\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00393}00393                 io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_aa0d2f22b196c94ac3d711114e81f6437}{kern\_data\_resid}} -\/= len\_to\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00394}00394 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00395}00395                 cam\_watermark += len\_to\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00396}00396                 \textcolor{keywordflow}{if} (cam\_sglist[i].ds\_len == cam\_watermark) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00397}00397                         i++;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00398}00398                         cam\_watermark = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00399}00399                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00400}00400 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00401}00401                 ctl\_watermark += len\_to\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00402}00402                 \textcolor{keywordflow}{if} (ctl\_sglist[j].\mbox{\hyperlink{structctl__sg__entry_a96f6584fa78c30ecc72625d5c2926c79}{len}} == ctl\_watermark) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00403}00403                         j++;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00404}00404                         ctl\_watermark = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00405}00405                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00406}00406         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00407}00407 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00408}00408         \textcolor{keywordflow}{if} ((io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a29f384f2742b9ff6a465ba3280608cf8}{status}} \& \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491afd1c411e17da6e84562e497ab72a83fb}{CTL\_STATUS\_MASK}}) == \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a1c9e3eb63185106546077e17a148779d}{CTL\_SUCCESS}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00409}00409                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_ae6f7e42ec6b84691810ea012f12801aa}{ctl\_private}}[\mbox{\hyperlink{ctl__io_8h_a060a1d6666c902724d482da98988a993}{CTL\_PRIV\_FRONTEND}}].\mbox{\hyperlink{unionctl__priv_a7a57d9abd212a63f7e395319e4c28b36}{ptr}} = NULL;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00410}00410                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01ab3cdcbee1ad98214606c0346dcddf4bc}{CTL\_FLAG\_STATUS\_SENT}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00411}00411                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_aeb974c780ab5470ba5a8ef184b224c0f}{resid}} = \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a876ad61cacd6314a81bcb506ed3d4744}{dxfer\_len}} -\/}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00412}00412                     io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a5b7e4c521e3d98250b6316ced45ac556}{ext\_data\_filled}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00413}00413                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} \&= \string~CAM\_STATUS\_MASK;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00414}00414                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} |= \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00415}00415                 \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00416}00416         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00417}00417 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00418}00418         \mbox{\hyperlink{ctl_8c_a6892247897c7ca88bda0322cf63d001f}{ctl\_datamove\_done}}(io, \textcolor{keyword}{true});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00419}00419 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00420}00420 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00421}00421 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00422}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_abd902e19b1fdbd9d8aa63734c1392d78}{00422}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_abd902e19b1fdbd9d8aa63734c1392d78}{cfcs\_done}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *io)}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00423}00423 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00424}00424         \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00426}00426         \mbox{\hyperlink{unionccb}{ccb}} = io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_ae6f7e42ec6b84691810ea012f12801aa}{ctl\_private}}[\mbox{\hyperlink{ctl__io_8h_a060a1d6666c902724d482da98988a993}{CTL\_PRIV\_FRONTEND}}].\mbox{\hyperlink{unionctl__priv_a7a57d9abd212a63f7e395319e4c28b36}{ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00427}00427         \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionccb}{ccb}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00428}00428                 \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00429}00429                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00430}00430         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00431}00431 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00432}00432         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00433}00433 \textcolor{comment}{         * At this point we should have status.  If we don't, that's a bug.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00434}00434 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00435}00435         KASSERT(((io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a29f384f2742b9ff6a465ba3280608cf8}{status}} \& \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491afd1c411e17da6e84562e497ab72a83fb}{CTL\_STATUS\_MASK}}) != \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491af309eead4699cd9155a02e024101ff4e}{CTL\_STATUS\_NONE}}),}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00436}00436                 (\textcolor{stringliteral}{"{}invalid CTL status \%\#x"{}}, io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a29f384f2742b9ff6a465ba3280608cf8}{status}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00437}00437 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00438}00438         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00439}00439 \textcolor{comment}{         * Translate CTL status to CAM status.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00440}00440 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00441}00441         \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}} == \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca426a17499239f5751c747d094b4998dc}{XPT\_SCSI\_IO}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00442}00442                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_aeb974c780ab5470ba5a8ef184b224c0f}{resid}} = \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a876ad61cacd6314a81bcb506ed3d4744}{dxfer\_len}} -\/}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00443}00443                     io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a5b7e4c521e3d98250b6316ced45ac556}{ext\_data\_filled}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00444}00444         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00445}00445         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} \&= \string~CAM\_STATUS\_MASK;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00446}00446         \textcolor{keywordflow}{switch} (io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a29f384f2742b9ff6a465ba3280608cf8}{status}} \& \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491afd1c411e17da6e84562e497ab72a83fb}{CTL\_STATUS\_MASK}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00447}00447         \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a1c9e3eb63185106546077e17a148779d}{CTL\_SUCCESS}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00448}00448                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} |= \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00449}00449                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00450}00450         \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a382e750806810cb27d24bc9a0ff1ef86}{CTL\_SCSI\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00451}00451                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} |= \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3aeb963e5650478930f8ff1380b169a84f}{CAM\_SCSI\_STATUS\_ERROR}} | \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a37b2018e83666ef02a0ac344837ae38f}{CAM\_AUTOSNS\_VALID}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00452}00452                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a63de880a84354e8722599c3c218f4481}{scsi\_status}} = io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a48fadb6e18f4588e096a440fb37629b4}{scsi\_status}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00453}00453                 bcopy(\&io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a292cf32dbfbad8a3848044cea599971e}{sense\_data}}, \&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a38e04f98dac99a3084f042ec2108054a}{sense\_data}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00454}00454                       min(io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_ae3738b1fb5c045b852ec268967572868}{sense\_len}}, \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a571468ac3ea1467d532b8767a90b516c}{sense\_len}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00455}00455                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a571468ac3ea1467d532b8767a90b516c}{sense\_len}} > io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_ae3738b1fb5c045b852ec268967572868}{sense\_len}})}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00456}00456                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a692447632a92215b9089398d63001f8f}{sense\_resid}} = \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a571468ac3ea1467d532b8767a90b516c}{sense\_len}} -\/}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00457}00457                                                 io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_ae3738b1fb5c045b852ec268967572868}{sense\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00458}00458                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00459}00459                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a692447632a92215b9089398d63001f8f}{sense\_resid}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00460}00460                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a571468ac3ea1467d532b8767a90b516c}{sense\_len}} -\/ \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a692447632a92215b9089398d63001f8f}{sense\_resid}}) >}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00461}00461                      \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a3dbfbeb462c97f1389c66fe330fc14a7}{cfcs\_max\_sense}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00462}00462                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a692447632a92215b9089398d63001f8f}{sense\_resid}} = \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a571468ac3ea1467d532b8767a90b516c}{sense\_len}} -\/}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00463}00463                                                 \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a3dbfbeb462c97f1389c66fe330fc14a7}{cfcs\_max\_sense}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00464}00464                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00465}00465                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00466}00466         \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a4f515acbaad76c48e82c437997bfe8ad}{CTL\_CMD\_ABORTED}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00467}00467                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} |= \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a880e0abf6511fcc6e7967258d6a74dda}{CAM\_REQ\_ABORTED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00468}00468                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00469}00469         \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a904d7d8c2527b57aa2753157895cb60b}{CTL\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00470}00470         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00471}00471                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} |= \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a7c519e8cfabb5fd17f4d518c82c17692}{CAM\_REQ\_CMP\_ERR}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00472}00472                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00473}00473         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00474}00474         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00475}00475         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{unionccb}{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{ctl__frontend__cam__sim_8c_source_l00476}00476             (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} \& \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3afe5c2fa0edb1c8fea0119515430d223e}{CAM\_DEV\_QFRZN}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00477}00477                 \mbox{\hyperlink{cam__xpt_8c_a2cca45a6e91cae097f1d958c315231e8}{xpt\_freeze\_devq}}(\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a47763149d044e13fcc06abfb3ddc941f}{path}}, 1);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00478}00478                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} |= \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3afe5c2fa0edb1c8fea0119515430d223e}{CAM\_DEV\_QFRZN}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00479}00479         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00480}00480         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00481}00481 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00482}00482 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00483}00483 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00484}\mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1b06680cec7e02019a4e6a0fef6730ff}{00484}} \mbox{\hyperlink{ctl__frontend__cam__sim_8c_a1b06680cec7e02019a4e6a0fef6730ff}{cfcs\_action}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structcam__sim}{cam\_sim}} *sim, \textcolor{keyword}{union} \mbox{\hyperlink{unionccb}{ccb}} *\mbox{\hyperlink{unionccb}{ccb}})}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00485}00485 \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00486}00486         \textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}} *softc;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00487}00487         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00488}00488 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00489}00489         softc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structcfcs__softc}{cfcs\_softc}} *)\mbox{\hyperlink{cam__sim_8h_a27ea5b5ae9173d4896a39c3cea08c6ca}{cam\_sim\_softc}}(\mbox{\hyperlink{structcfcs__softc_afbaa61068b2c24189f29a61ca55814e9}{sim}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00490}00490 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00491}00491         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00492}00492         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca426a17499239f5751c747d094b4998dc}{XPT\_SCSI\_IO}}: \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00493}00493                 \textcolor{keyword}{union }\mbox{\hyperlink{unionctl__io}{ctl\_io}} *io;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00494}00494                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__scsiio}{ccb\_scsiio}} *csio;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00495}00495 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00496}00496                 csio = \&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00497}00497 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00498}00498                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00499}00499 \textcolor{comment}{                 * Catch CCB flags, like physical address flags, that}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00500}00500 \textcolor{comment}{                 * indicate situations we currently can't handle.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00501}00501 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00502}00502                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a2b92b9f93c185a3bcd5da48c751c0c05}{flags}} \& \mbox{\hyperlink{ctl__frontend__cam__sim_8c_ad416bd80082545771fa12022b9df8bde}{CFCS\_BAD\_CCB\_FLAGS}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00503}00503                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a12f00b32285d7ae4b17eb8aaeae0d0fb}{CAM\_REQ\_INVALID}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00504}00504                         printf(\textcolor{stringliteral}{"{}\%s: bad CCB flags \%\#x (all flags \%\#x)\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00505}00505                                \_\_func\_\_, \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a2b92b9f93c185a3bcd5da48c751c0c05}{flags}} \& \mbox{\hyperlink{ctl__frontend__cam__sim_8c_ad416bd80082545771fa12022b9df8bde}{CFCS\_BAD\_CCB\_FLAGS}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00506}00506                                \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a2b92b9f93c185a3bcd5da48c751c0c05}{flags}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00507}00507                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00508}00508                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00509}00509                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00510}00510 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00511}00511                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00512}00512 \textcolor{comment}{                 * If we aren't online, there are no devices to see.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00513}00513 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00514}00514                 \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structcfcs__softc_ae6ec408e5c08f471119175f165fcc343}{online}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00515}00515                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a45b712a5be7c3910f37757908a444e0b}{CAM\_DEV\_NOT\_THERE}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00516}00516                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00517}00517                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00518}00518                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00519}00519 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00520}00520                 io = \mbox{\hyperlink{ctl_8c_a33a39452292545a589351e88658d43ed}{ctl\_alloc\_io\_nowait}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}}.\mbox{\hyperlink{structctl__port_a9679def31f794173843a44babbd5485c}{ctl\_pool\_ref}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00521}00521                 \textcolor{keywordflow}{if} (io == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00522}00522                         printf(\textcolor{stringliteral}{"{}\%s: can't allocate ctl\_io\(\backslash\)n"{}}, \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00523}00523                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a2180b6f54739f3d6e3554ff10a909e3e}{CAM\_BUSY}} | \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3afe5c2fa0edb1c8fea0119515430d223e}{CAM\_DEV\_QFRZN}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00524}00524                         \mbox{\hyperlink{cam__xpt_8c_a2cca45a6e91cae097f1d958c315231e8}{xpt\_freeze\_devq}}(\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a47763149d044e13fcc06abfb3ddc941f}{path}}, 1);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00525}00525                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00526}00526                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00527}00527                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00528}00528                 \mbox{\hyperlink{ctl_8c_ae8dd411776d083978c8bf9efbd83ad01}{ctl\_zero\_io}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00529}00529                 \textcolor{comment}{/* Save pointers on both sides */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00530}00530                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_ae6f7e42ec6b84691810ea012f12801aa}{ctl\_private}}[\mbox{\hyperlink{ctl__io_8h_a060a1d6666c902724d482da98988a993}{CTL\_PRIV\_FRONTEND}}].\mbox{\hyperlink{unionctl__priv_a7a57d9abd212a63f7e395319e4c28b36}{ptr}} = \mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00531}00531                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.io\_ptr = io;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00532}00532 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00533}00533                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00534}00534 \textcolor{comment}{                 * Only SCSI I/O comes down this path, resets, etc. come}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00535}00535 \textcolor{comment}{                 * down via the XPT\_RESET\_BUS/LUN CCBs below.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00536}00536 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00537}00537                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a13c2b01a28e2b77943df44e29fdafa84}{io\_type}} = \mbox{\hyperlink{ctl__io_8h_a22fa76f752966a2de46c63789fe342ffa158348f547d85de1ed9736de925a2a6a}{CTL\_IO\_SCSI}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00538}00538                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adf583c30da5c38e757f1360d341f9d32}{initid}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00539}00539                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adb614f1edadf984459502e6c49cebfce}{targ\_port}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}}.\mbox{\hyperlink{structctl__port_a1ba5bbf68ec74caaf3ee4a689df6ea2b}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00540}00540                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_ac36f61555f840df7e1c66aedf8dbdfa8}{targ\_lun}} = \mbox{\hyperlink{ctl_8c_a1b156d2e1012c817dcd22482c0e2f354}{ctl\_decode\_lun}}(}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00541}00541                     \mbox{\hyperlink{cam_8h_a08bd73e2e9318e90e4e9e86df5fb987b}{CAM\_EXTLUN\_BYTE\_SWIZZLE}}(\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a9846ea08ea2a27c2c896bfe1ad3b6309}{target\_lun}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00542}00542                 io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a2c779c689eac46ad214eae29c770be78}{priority}} = csio-\/>\mbox{\hyperlink{structccb__scsiio_a36bbfd93d96f862f80e89808e17f484e}{priority}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00543}00543                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00544}00544 \textcolor{comment}{                 * This tag scheme isn't the best, since we could in theory}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00545}00545 \textcolor{comment}{                 * have a very long-\/lived I/O and tag collision, especially}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00546}00546 \textcolor{comment}{                 * in a high I/O environment.  But it should work well}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00547}00547 \textcolor{comment}{                 * enough for now.  Since we're using unsigned ints,}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00548}00548 \textcolor{comment}{                 * they'll just wrap around.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00549}00549 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00550}00550                 io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a873fb24a6675a4cad237c128eae334f7}{tag\_num}} = atomic\_fetchadd\_32(\&softc-\/>\mbox{\hyperlink{structcfcs__softc_ae91ed9eb8d436661c6c4bf38ebdb2fd0}{cur\_tag\_num}}, 1);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00551}00551                 csio-\/>\mbox{\hyperlink{structccb__scsiio_a57aa3ccde1827c2ef97a5b91ce080741}{tag\_id}} = io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a873fb24a6675a4cad237c128eae334f7}{tag\_num}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00552}00552                 \textcolor{keywordflow}{switch} (csio-\/>\mbox{\hyperlink{structccb__scsiio_a574f17912e1a64938eebd868dbcc6554}{tag\_action}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00553}00553                 \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_abc2846e666533f8bd438f0306ca7f2f9}{CAM\_TAG\_ACTION\_NONE}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00554}00554                         io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a9166c86c6f62339aecaa85bb2fbcf945}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130a93b4bb9a24bf0f0675cd131147f00682}{CTL\_TAG\_UNTAGGED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00555}00555                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00556}00556                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__message_8h_a3c31e9401c276bb7ecc43fb8d2c5de67}{MSG\_SIMPLE\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00557}00557                         io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a9166c86c6f62339aecaa85bb2fbcf945}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00558}00558                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00559}00559                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__message_8h_a13f8827945d80f877597df7c64adaeb5}{MSG\_HEAD\_OF\_QUEUE\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00560}00560                         io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a9166c86c6f62339aecaa85bb2fbcf945}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130a21abe1b40019a38ca174cab5cc817368}{CTL\_TAG\_HEAD\_OF\_QUEUE}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00561}00561                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00562}00562                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__message_8h_a75971b6824406c86e129a974a84a36f7}{MSG\_ORDERED\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00563}00563                         io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a9166c86c6f62339aecaa85bb2fbcf945}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aeee41a79cfc3a7b53aae1773c95770ea}{CTL\_TAG\_ORDERED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00564}00564                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00565}00565                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__message_8h_a69866587050c755d4ffdc468a9bc021a}{MSG\_ACA\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00566}00566                         io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a9166c86c6f62339aecaa85bb2fbcf945}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130af9ffaa8b6a089d755b3bab1fa1f5b3c6}{CTL\_TAG\_ACA}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00567}00567                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00568}00568                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00569}00569                         io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a9166c86c6f62339aecaa85bb2fbcf945}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130a93b4bb9a24bf0f0675cd131147f00682}{CTL\_TAG\_UNTAGGED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00570}00570                         printf(\textcolor{stringliteral}{"{}\%s: unhandled tag type \%\#x!!\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00571}00571                                csio-\/>\mbox{\hyperlink{structccb__scsiio_a574f17912e1a64938eebd868dbcc6554}{tag\_action}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00572}00572                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00573}00573                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00574}00574                 \textcolor{keywordflow}{if} (csio-\/>\mbox{\hyperlink{structccb__scsiio_a9839f8df1d33870cf613fc1d94b3470b}{cdb\_len}} > \textcolor{keyword}{sizeof}(io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00575}00575                         printf(\textcolor{stringliteral}{"{}\%s: WARNING: CDB len \%d > ctl\_io space \%zd\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00576}00576                                \_\_func\_\_, csio-\/>\mbox{\hyperlink{structccb__scsiio_a9839f8df1d33870cf613fc1d94b3470b}{cdb\_len}}, \textcolor{keyword}{sizeof}(io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00577}00577                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00578}00578                 io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a6c465d4ef15471ccbe863e31ee442553}{cdb\_len}} = min(csio-\/>\mbox{\hyperlink{structccb__scsiio_a9839f8df1d33870cf613fc1d94b3470b}{cdb\_len}}, \textcolor{keyword}{sizeof}(io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00579}00579                 bcopy(\mbox{\hyperlink{cam__ccb_8h_adb7df4a4ca545e3b52b16db32d60f0d5}{scsiio\_cdb\_ptr}}(csio), io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}}, io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a6c465d4ef15471ccbe863e31ee442553}{cdb\_len}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00580}00580 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00581}00581                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} |= \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3aab62757ffee7d501dc0b5e5977656ee8}{CAM\_SIM\_QUEUED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00582}00582                 err = \mbox{\hyperlink{ctl_8c_aa604fe59bfdbffff131df040d90cfd40}{ctl\_queue}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00583}00583                 \textcolor{keywordflow}{if} (err != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00584}00584                         printf(\textcolor{stringliteral}{"{}\%s: func \%d: error \%d returned by "{}}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00585}00585                                \textcolor{stringliteral}{"{}ctl\_queue()!\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00586}00586                                \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}}, err);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00587}00587                         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00588}00588                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a12f00b32285d7ae4b17eb8aaeae0d0fb}{CAM\_REQ\_INVALID}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00589}00589                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00590}00590                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00591}00591                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00592}00592                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00593}00593         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00594}00594         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055cac6104918fad106a7e3b6d8b873cdc81e}{XPT\_ABORT}}: \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00595}00595                 \textcolor{keyword}{union }\mbox{\hyperlink{unionctl__io}{ctl\_io}} *io;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00596}00596                 \textcolor{keyword}{union }\mbox{\hyperlink{unionccb}{ccb}} *abort\_ccb;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00597}00597 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00598}00598                 abort\_ccb = \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_aa8b5d154d1737256860292029d1321ed}{cab}}.\mbox{\hyperlink{structccb__abort_aced06005f4d38499d7edc168331d20c0}{abort\_ccb}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00599}00599 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00600}00600                 \textcolor{keywordflow}{if} (abort\_ccb-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}} != \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca426a17499239f5751c747d094b4998dc}{XPT\_SCSI\_IO}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00601}00601                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a12f00b32285d7ae4b17eb8aaeae0d0fb}{CAM\_REQ\_INVALID}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00602}00602                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00603}00603                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00604}00604 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00605}00605                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00606}00606 \textcolor{comment}{                 * If we aren't online, there are no devices to talk to.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00607}00607 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00608}00608                 \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structcfcs__softc_ae6ec408e5c08f471119175f165fcc343}{online}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00609}00609                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a45b712a5be7c3910f37757908a444e0b}{CAM\_DEV\_NOT\_THERE}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00610}00610                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00611}00611                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00612}00612                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00613}00613 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00614}00614                 io = \mbox{\hyperlink{ctl_8c_a33a39452292545a589351e88658d43ed}{ctl\_alloc\_io\_nowait}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}}.\mbox{\hyperlink{structctl__port_a9679def31f794173843a44babbd5485c}{ctl\_pool\_ref}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00615}00615                 \textcolor{keywordflow}{if} (io == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00616}00616                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a2180b6f54739f3d6e3554ff10a909e3e}{CAM\_BUSY}} | \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3afe5c2fa0edb1c8fea0119515430d223e}{CAM\_DEV\_QFRZN}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00617}00617                         \mbox{\hyperlink{cam__xpt_8c_a2cca45a6e91cae097f1d958c315231e8}{xpt\_freeze\_devq}}(\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a47763149d044e13fcc06abfb3ddc941f}{path}}, 1);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00618}00618                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00619}00619                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00620}00620                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00621}00621 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00622}00622                 \mbox{\hyperlink{ctl_8c_ae8dd411776d083978c8bf9efbd83ad01}{ctl\_zero\_io}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00623}00623                 \textcolor{comment}{/* Save pointers on both sides */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00624}00624                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_ae6f7e42ec6b84691810ea012f12801aa}{ctl\_private}}[\mbox{\hyperlink{ctl__io_8h_a060a1d6666c902724d482da98988a993}{CTL\_PRIV\_FRONTEND}}].\mbox{\hyperlink{unionctl__priv_a7a57d9abd212a63f7e395319e4c28b36}{ptr}} = \mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00625}00625                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.io\_ptr = io;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00626}00626 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00627}00627                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a13c2b01a28e2b77943df44e29fdafa84}{io\_type}} = \mbox{\hyperlink{ctl__io_8h_a22fa76f752966a2de46c63789fe342ffa44d57f3be59d7198f57d532b2993c92d}{CTL\_IO\_TASK}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00628}00628                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adf583c30da5c38e757f1360d341f9d32}{initid}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00629}00629                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adb614f1edadf984459502e6c49cebfce}{targ\_port}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}}.\mbox{\hyperlink{structctl__port_a1ba5bbf68ec74caaf3ee4a689df6ea2b}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00630}00630                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_ac36f61555f840df7e1c66aedf8dbdfa8}{targ\_lun}} = \mbox{\hyperlink{ctl_8c_a1b156d2e1012c817dcd22482c0e2f354}{ctl\_decode\_lun}}(}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00631}00631                     \mbox{\hyperlink{cam_8h_a08bd73e2e9318e90e4e9e86df5fb987b}{CAM\_EXTLUN\_BYTE\_SWIZZLE}}(\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a9846ea08ea2a27c2c896bfe1ad3b6309}{target\_lun}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00632}00632                 io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a03c46090cc1b6344b917b77dcfbae5b3}{task\_action}} = \mbox{\hyperlink{ctl__io_8h_a58e2c245294cf8dc804760f70dcbb1b9a98801a48a87e4e7a272e4244e4e1e665}{CTL\_TASK\_ABORT\_TASK}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00633}00633                 io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a927ee86ac9b2bf3d6e58632476f88cb1}{tag\_num}} = abort\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a57aa3ccde1827c2ef97a5b91ce080741}{tag\_id}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00634}00634                 \textcolor{keywordflow}{switch} (abort\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a574f17912e1a64938eebd868dbcc6554}{tag\_action}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00635}00635                 \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_abc2846e666533f8bd438f0306ca7f2f9}{CAM\_TAG\_ACTION\_NONE}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00636}00636                         io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a402cd79d6ef4086ad075037cdabe522e}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130a93b4bb9a24bf0f0675cd131147f00682}{CTL\_TAG\_UNTAGGED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00637}00637                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00638}00638                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__message_8h_a3c31e9401c276bb7ecc43fb8d2c5de67}{MSG\_SIMPLE\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00639}00639                         io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a402cd79d6ef4086ad075037cdabe522e}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00640}00640                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00641}00641                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__message_8h_a13f8827945d80f877597df7c64adaeb5}{MSG\_HEAD\_OF\_QUEUE\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00642}00642                         io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a402cd79d6ef4086ad075037cdabe522e}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130a21abe1b40019a38ca174cab5cc817368}{CTL\_TAG\_HEAD\_OF\_QUEUE}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00643}00643                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00644}00644                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__message_8h_a75971b6824406c86e129a974a84a36f7}{MSG\_ORDERED\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00645}00645                         io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a402cd79d6ef4086ad075037cdabe522e}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aeee41a79cfc3a7b53aae1773c95770ea}{CTL\_TAG\_ORDERED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00646}00646                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00647}00647                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__message_8h_a69866587050c755d4ffdc468a9bc021a}{MSG\_ACA\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00648}00648                         io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a402cd79d6ef4086ad075037cdabe522e}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130af9ffaa8b6a089d755b3bab1fa1f5b3c6}{CTL\_TAG\_ACA}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00649}00649                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00650}00650                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00651}00651                         io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a402cd79d6ef4086ad075037cdabe522e}{tag\_type}} = \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130a93b4bb9a24bf0f0675cd131147f00682}{CTL\_TAG\_UNTAGGED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00652}00652                         printf(\textcolor{stringliteral}{"{}\%s: unhandled tag type \%\#x!!\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00653}00653                                abort\_ccb-\/>\mbox{\hyperlink{unionccb_ab835fc67ca6736b430af71ed7b1780f4}{csio}}.\mbox{\hyperlink{structccb__scsiio_a574f17912e1a64938eebd868dbcc6554}{tag\_action}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00654}00654                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00655}00655                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00656}00656                 err = \mbox{\hyperlink{ctl_8c_aa604fe59bfdbffff131df040d90cfd40}{ctl\_queue}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00657}00657                 \textcolor{keywordflow}{if} (err != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00658}00658                         printf(\textcolor{stringliteral}{"{}\%s func \%d: error \%d returned by "{}}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00659}00659                                \textcolor{stringliteral}{"{}ctl\_queue()!\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00660}00660                                \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}}, err);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00661}00661                         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00662}00662                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00663}00663                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00664}00664         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00665}00665         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca4031c8b4cb9702134c45aee99474c0e7}{XPT\_GET\_TRAN\_SETTINGS}}: \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00666}00666                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__trans__settings}{ccb\_trans\_settings}} *\mbox{\hyperlink{mmc__sim__if_8m_aaa2434533339a541b323777f3b4d1ea9}{cts}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00667}00667                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__trans__settings__scsi}{ccb\_trans\_settings\_scsi}} *scsi;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00668}00668                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__trans__settings__fc}{ccb\_trans\_settings\_fc}} *fc;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00669}00669 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00670}00670                 \mbox{\hyperlink{mmc__sim__if_8m_aaa2434533339a541b323777f3b4d1ea9}{cts}} = \&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_a49ca2523da352ce13d213ca3881a126b}{cts}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00671}00671                 scsi = \&\mbox{\hyperlink{mmc__sim__if_8m_aaa2434533339a541b323777f3b4d1ea9}{cts}}-\/>proto\_specific.scsi;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00672}00672                 fc = \&\mbox{\hyperlink{mmc__sim__if_8m_aaa2434533339a541b323777f3b4d1ea9}{cts}}-\/>xport\_specific.fc;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00673}00673 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00674}00674                 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00675}00675                 \mbox{\hyperlink{mmc__sim__if_8m_aaa2434533339a541b323777f3b4d1ea9}{cts}}-\/>protocol = \mbox{\hyperlink{cam__ccb_8h_a283e001579038402a95e23bef57107e8a47dbcda94a42ad1914fddef379cb08ce}{PROTO\_SCSI}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00676}00676                 \mbox{\hyperlink{mmc__sim__if_8m_aaa2434533339a541b323777f3b4d1ea9}{cts}}-\/>protocol\_version = \mbox{\hyperlink{scsi__all_8h_a5781d82c8d1a6e6a0dc5a36394aca3bb}{SCSI\_REV\_SPC2}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00677}00677                 \mbox{\hyperlink{mmc__sim__if_8m_aaa2434533339a541b323777f3b4d1ea9}{cts}}-\/>transport = \mbox{\hyperlink{cam__ccb_8h_a724bbd85a7f871ac9067f5ee489192fead046a3213642a063f76303d1eca90fcd}{XPORT\_FC}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00678}00678                 \mbox{\hyperlink{mmc__sim__if_8m_aaa2434533339a541b323777f3b4d1ea9}{cts}}-\/>transport\_version = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00679}00679 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00680}00680                 scsi-\/>\mbox{\hyperlink{structccb__trans__settings__scsi_a90b08f35aa06b903f2a318d7bd6ae62f}{valid}} = \mbox{\hyperlink{cam__ccb_8h_a398856aa462596234233b13f4b4983f7}{CTS\_SCSI\_VALID\_TQ}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00681}00681                 scsi-\/>\mbox{\hyperlink{structccb__trans__settings__scsi_a041f488d8ea7d48a32e542901dd3ce66}{flags}} = \mbox{\hyperlink{cam__ccb_8h_a2eeaa939a6bc2f28a79121ec5ddc7f1f}{CTS\_SCSI\_FLAGS\_TAG\_ENB}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00682}00682                 fc-\/>\mbox{\hyperlink{structccb__trans__settings__fc_aaf204ba5c8413ea4b11f29d76575190b}{valid}} = \mbox{\hyperlink{cam__ccb_8h_add213bf58b83ac721f85a9c5ca5b826f}{CTS\_FC\_VALID\_SPEED}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00683}00683                 fc-\/>\mbox{\hyperlink{structccb__trans__settings__fc_a29cbb596050254af9fb0b6cf94698944}{bitrate}} = 800000;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00684}00684                 fc-\/>\mbox{\hyperlink{structccb__trans__settings__fc_a67f4646d4079a4b40177deb578edad4a}{wwnn}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_aeeaf49c515507aaea64944c83a9c00bf}{wwnn}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00685}00685                 fc-\/>\mbox{\hyperlink{structccb__trans__settings__fc_a36796ba827c3b903d3118d4d51f6fc65}{wwpn}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_ad3b47a5cdf508ad9b73d76f1ad0ac067}{wwpn}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00686}00686                 fc-\/>\mbox{\hyperlink{structccb__trans__settings__fc_a5020fe2083671f7b52d66f8c22db1656}{port}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}}.\mbox{\hyperlink{structctl__port_a1ba5bbf68ec74caaf3ee4a689df6ea2b}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00687}00687                 fc-\/>\mbox{\hyperlink{structccb__trans__settings__fc_aaf204ba5c8413ea4b11f29d76575190b}{valid}} |= \mbox{\hyperlink{cam__ccb_8h_a55f9b833d15922a524048c307143b752}{CTS\_FC\_VALID\_WWNN}} | \mbox{\hyperlink{cam__ccb_8h_ad8ed2b04e5b5a24a233661b9af5e6f88}{CTS\_FC\_VALID\_WWPN}} |}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00688}00688                         \mbox{\hyperlink{cam__ccb_8h_a1761ede113eb32951a17b11c2ff4e158}{CTS\_FC\_VALID\_PORT}}; }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00689}00689                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00690}00690                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00691}00691         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00692}00692         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca809010667fe314b6a4af69f3fef6bc9f}{XPT\_SET\_TRAN\_SETTINGS}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00693}00693                 \textcolor{comment}{/* XXX KDM should we actually do something here? */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00694}00694                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00695}00695                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00696}00696         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca377430b25b365e512334ca40798eafea}{XPT\_RESET\_BUS}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00697}00697         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca1eaac0f24214e1a486e98141b2924253}{XPT\_RESET\_DEV}}: \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00698}00698                 \textcolor{keyword}{union }\mbox{\hyperlink{unionctl__io}{ctl\_io}} *io;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00699}00699 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00700}00700                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00701}00701 \textcolor{comment}{                 * If we aren't online, there are no devices to talk to.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00702}00702 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00703}00703                 \textcolor{keywordflow}{if} (softc-\/>\mbox{\hyperlink{structcfcs__softc_ae6ec408e5c08f471119175f165fcc343}{online}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00704}00704                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a45b712a5be7c3910f37757908a444e0b}{CAM\_DEV\_NOT\_THERE}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00705}00705                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00706}00706                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00707}00707                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00708}00708 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00709}00709                 io = \mbox{\hyperlink{ctl_8c_a33a39452292545a589351e88658d43ed}{ctl\_alloc\_io\_nowait}}(softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}}.\mbox{\hyperlink{structctl__port_a9679def31f794173843a44babbd5485c}{ctl\_pool\_ref}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00710}00710                 \textcolor{keywordflow}{if} (io == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00711}00711                         \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a2180b6f54739f3d6e3554ff10a909e3e}{CAM\_BUSY}} | \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3afe5c2fa0edb1c8fea0119515430d223e}{CAM\_DEV\_QFRZN}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00712}00712                         \mbox{\hyperlink{cam__xpt_8c_a2cca45a6e91cae097f1d958c315231e8}{xpt\_freeze\_devq}}(\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a47763149d044e13fcc06abfb3ddc941f}{path}}, 1);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00713}00713                         \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00714}00714                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00715}00715                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00716}00716 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00717}00717                 \mbox{\hyperlink{ctl_8c_ae8dd411776d083978c8bf9efbd83ad01}{ctl\_zero\_io}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00718}00718                 \textcolor{comment}{/* Save pointers on both sides */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00719}00719                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}} == \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca1eaac0f24214e1a486e98141b2924253}{XPT\_RESET\_DEV}})}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00720}00720                         io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_ae6f7e42ec6b84691810ea012f12801aa}{ctl\_private}}[\mbox{\hyperlink{ctl__io_8h_a060a1d6666c902724d482da98988a993}{CTL\_PRIV\_FRONTEND}}].\mbox{\hyperlink{unionctl__priv_a7a57d9abd212a63f7e395319e4c28b36}{ptr}} = \mbox{\hyperlink{mmc__sim__if_8m_a3b75bbd1e046a488543d1dccdbcae16b}{ccb}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00721}00721                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.io\_ptr = io;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00722}00722 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00723}00723                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a13c2b01a28e2b77943df44e29fdafa84}{io\_type}} = \mbox{\hyperlink{ctl__io_8h_a22fa76f752966a2de46c63789fe342ffa44d57f3be59d7198f57d532b2993c92d}{CTL\_IO\_TASK}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00724}00724                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adf583c30da5c38e757f1360d341f9d32}{initid}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00725}00725                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adb614f1edadf984459502e6c49cebfce}{targ\_port}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}}.\mbox{\hyperlink{structctl__port_a1ba5bbf68ec74caaf3ee4a689df6ea2b}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00726}00726                 io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_ac36f61555f840df7e1c66aedf8dbdfa8}{targ\_lun}} = \mbox{\hyperlink{ctl_8c_a1b156d2e1012c817dcd22482c0e2f354}{ctl\_decode\_lun}}(}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00727}00727                     \mbox{\hyperlink{cam_8h_a08bd73e2e9318e90e4e9e86df5fb987b}{CAM\_EXTLUN\_BYTE\_SWIZZLE}}(\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a9846ea08ea2a27c2c896bfe1ad3b6309}{target\_lun}}));}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00728}00728                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}} == \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055ca377430b25b365e512334ca40798eafea}{XPT\_RESET\_BUS}})}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00729}00729                         io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a03c46090cc1b6344b917b77dcfbae5b3}{task\_action}} = \mbox{\hyperlink{ctl__io_8h_a58e2c245294cf8dc804760f70dcbb1b9a23c4658775c1210502955614fa816e57}{CTL\_TASK\_BUS\_RESET}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00730}00730                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00731}00731                         io-\/>\mbox{\hyperlink{unionctl__io_a5af37f48478b398c51d492549bc860a6}{taskio}}.\mbox{\hyperlink{structctl__taskio_a03c46090cc1b6344b917b77dcfbae5b3}{task\_action}} = \mbox{\hyperlink{ctl__io_8h_a58e2c245294cf8dc804760f70dcbb1b9a0f08e36a2ea2b0086fc5fce560c0a28b}{CTL\_TASK\_LUN\_RESET}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00732}00732 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00733}00733                 err = \mbox{\hyperlink{ctl_8c_aa604fe59bfdbffff131df040d90cfd40}{ctl\_queue}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00734}00734                 \textcolor{keywordflow}{if} (err != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00735}00735                         printf(\textcolor{stringliteral}{"{}\%s func \%d: error \%d returned by "{}}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00736}00736                               \textcolor{stringliteral}{"{}ctl\_queue()!\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00737}00737                               \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}}, err);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00738}00738                         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00739}00739                 \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00740}00740                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00741}00741         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00742}00742         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055caacbf4303a264c7c105b44031ddb3a8c8}{XPT\_CALC\_GEOMETRY}}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00743}00743                 \mbox{\hyperlink{cam_8c_ad2bbbd1c650500bd3fc3c265f7447234}{cam\_calc\_geometry}}(\&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_a8846fda93a10c897b1edc8b18993639b}{ccg}}, 1);}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00744}00744                 \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00745}00745                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00746}00746         \textcolor{keywordflow}{case} \mbox{\hyperlink{cam__ccb_8h_aa49540dd5ca09d2e63a5251de499055cad34c7b5cb68e0ed050bc95a55cd87f7c}{XPT\_PATH\_INQ}}: \{}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00747}00747                 \textcolor{keyword}{struct }\mbox{\hyperlink{structccb__pathinq}{ccb\_pathinq}} *cpi;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00749}00749                 cpi = \&\mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_af5f8e018edd68ac4078165c32ef6aa82}{cpi}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00750}00750 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00751}00751                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a186b2ecd616f68937803d71dc650a452}{version\_num}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00752}00752                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a8b368b467067fee18bb09e83859ecaa1}{hba\_inquiry}} = \mbox{\hyperlink{cam__ccb_8h_a0190dcb4d6f59004e5d9c350ac66dd62a861b78718e1d3864f57a586201b6ce0a}{PI\_TAG\_ABLE}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00753}00753                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a923e6a1383bc827632294040e0545ce5}{target\_sprt}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00754}00754                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a7b48ff4ce816b541a1c06a92bf0a4447}{hba\_misc}} = \mbox{\hyperlink{cam__ccb_8h_a3c8f3fa68445478749d5dd7dcb4b014eae5a1181e7bc76ec54df09067c61ec580}{PIM\_EXTLUNS}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00755}00755                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a16b6c273fb16591cf693774c1262943d}{hba\_eng\_cnt}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00756}00756                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a2629d14fcfe43ae557567ec7122716cd}{max\_target}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00757}00757                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_aa34411e891163e736104ee783f82c17c}{max\_lun}} = 1024;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00758}00758                 \textcolor{comment}{/* Do we really have a limit? */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00759}00759                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_acafc5a0159d616aaa6b45619619dcc1e}{maxio}} = 1024 * 1024;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00760}00760                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a405180b0ab4adbb53eeb917b2acff56b}{async\_flags}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00761}00761                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a47b15f2fe90dfee3d72a7b4641dabefe}{hpath\_id}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00762}00762                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_ac9f9c21909016837f81bdea36c0e63db}{initiator\_id}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00763}00763 }
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00764}00764                 strlcpy(cpi-\/>\mbox{\hyperlink{structccb__pathinq_a8cfa668dd6fa253ba49f5b33fea2ad00}{sim\_vid}}, \textcolor{stringliteral}{"{}FreeBSD"{}}, \mbox{\hyperlink{cam__ccb_8h_ad96f7253a5daa2b903b136b892f3adb9}{SIM\_IDLEN}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00765}00765                 strlcpy(cpi-\/>\mbox{\hyperlink{structccb__pathinq_a52fac0091fb32cab83b5b60a868a145a}{hba\_vid}}, \textcolor{stringliteral}{"{}FreeBSD"{}}, \mbox{\hyperlink{cam__ccb_8h_abd60e5ed8cd7bf05c5bf99bab99af73e}{HBA\_IDLEN}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00766}00766                 strlcpy(cpi-\/>\mbox{\hyperlink{structccb__pathinq_a59c310c25aeebc87e2238f4e9fdde59c}{dev\_name}}, \mbox{\hyperlink{cam__sim_8h_af072fac14801b2861497672e4459c8c1}{cam\_sim\_name}}(sim), \mbox{\hyperlink{cam__ccb_8h_aea661c8c832c80ccc92e62f1a37b3cec}{DEV\_IDLEN}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00767}00767                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a39cb13194f2d3b32ba291584ef9c5b6a}{unit\_number}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00768}00768                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_ae61da712ae294939a70488cec8cba2ba}{bus\_id}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00769}00769                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_aa99a953da5f645be9a9658555e91a4a3}{base\_transfer\_speed}} = 800000;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00770}00770                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a0fd2217429605ad2fb67e9e8bca6a4f2}{protocol}} = \mbox{\hyperlink{cam__ccb_8h_a283e001579038402a95e23bef57107e8a47dbcda94a42ad1914fddef379cb08ce}{PROTO\_SCSI}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00771}00771                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a41b70fcb8e7e4b6dad351296978a7693}{protocol\_version}} = \mbox{\hyperlink{scsi__all_8h_a5781d82c8d1a6e6a0dc5a36394aca3bb}{SCSI\_REV\_SPC2}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00772}00772                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00773}00773 \textcolor{comment}{                 * Pretend to be Fibre Channel.}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00774}00774 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00775}00775                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_aaef7c0420017996140ae4bdede6a8152}{transport}} = \mbox{\hyperlink{cam__ccb_8h_a724bbd85a7f871ac9067f5ee489192fead046a3213642a063f76303d1eca90fcd}{XPORT\_FC}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00776}00776                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_acb3156bdd68be769552f3814625a9691}{transport\_version}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00777}00777                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a363090cd4c868a0f05caae34afe3b1a3}{xport\_specific}}.\mbox{\hyperlink{structccb__pathinq_a6ade6322379fcf3a12959ec6ffbf3e04}{fc}}.\mbox{\hyperlink{structccb__pathinq__settings__fc_a48c3c8e9e5b5d3d8ada1482f9a9446f4}{wwnn}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_aeeaf49c515507aaea64944c83a9c00bf}{wwnn}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00778}00778                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a363090cd4c868a0f05caae34afe3b1a3}{xport\_specific}}.\mbox{\hyperlink{structccb__pathinq_a6ade6322379fcf3a12959ec6ffbf3e04}{fc}}.\mbox{\hyperlink{structccb__pathinq__settings__fc_a2736d6447029a95f6cf61dadd43ecfd4}{wwpn}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_ad3b47a5cdf508ad9b73d76f1ad0ac067}{wwpn}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00779}00779                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a363090cd4c868a0f05caae34afe3b1a3}{xport\_specific}}.\mbox{\hyperlink{structccb__pathinq_a6ade6322379fcf3a12959ec6ffbf3e04}{fc}}.\mbox{\hyperlink{structccb__pathinq__settings__fc_a2e1d247379ae1a6478c06b35966968eb}{port}} = softc-\/>\mbox{\hyperlink{structcfcs__softc_a91113471a373b9c729c250bcdf3453b2}{port}}.\mbox{\hyperlink{structctl__port_a1ba5bbf68ec74caaf3ee4a689df6ea2b}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00780}00780                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a363090cd4c868a0f05caae34afe3b1a3}{xport\_specific}}.\mbox{\hyperlink{structccb__pathinq_a6ade6322379fcf3a12959ec6ffbf3e04}{fc}}.\mbox{\hyperlink{structccb__pathinq__settings__fc_a414d95a2d8e2f620b51c0c6aa32d2995}{bitrate}} = 8 * 1000 * 1000;}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00781}00781                 cpi-\/>\mbox{\hyperlink{structccb__pathinq_a9e4ef19d9e427247f68ee45ea48a93d2}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a3487a040bd091973beb62275a7309324}{CAM\_REQ\_CMP}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00782}00782                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00783}00783         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00784}00784         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00785}00785                 \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_abcec535dec8d07473cd2af995bf25d88}{status}} = \mbox{\hyperlink{cam_8h_a9ff49352334e6ad8ce937cf2fdf4cfb3a2a1190144c9400cbdd81240bda66e6ca}{CAM\_PROVIDE\_FAIL}};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00786}00786                 printf(\textcolor{stringliteral}{"{}\%s: unsupported CCB type \%\#x\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00787}00787                        \mbox{\hyperlink{unionccb}{ccb}}-\/>\mbox{\hyperlink{unionccb_ab0f218bc2944e08931eb0d935ce4085f}{ccb\_h}}.\mbox{\hyperlink{structccb__hdr_a7439d6fedcb6191113a285c51038cd71}{func\_code}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00788}00788                 \mbox{\hyperlink{cam__xpt_8c_a708fed7e2d55a1b2a180bb4462513393}{xpt\_done}}(\mbox{\hyperlink{unionccb}{ccb}});}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00789}00789                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00790}00790         \}}
\DoxyCodeLine{\Hypertarget{ctl__frontend__cam__sim_8c_source_l00791}00791 \}}

\end{DoxyCode}
