\hypertarget{ctl__tpc_8c_source}{}\doxysection{ctl\+\_\+tpc.\+c}
\label{ctl__tpc_8c_source}\index{cam/ctl/ctl\_tpc.c@{cam/ctl/ctl\_tpc.c}}
\mbox{\hyperlink{ctl__tpc_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00002}00002 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/2-\/Clause-\/FreeBSD}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00003}00003 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2014-\/2021 Alexander Motin <mav@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00012}00012 \textcolor{comment}{ *    without modification, immediately at the beginning of the file.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00013}00013 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00014}00014 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00015}00015 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00016}00016 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00017}00017 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00019}00019 \textcolor{comment}{ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00020}00020 \textcolor{comment}{ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00021}00021 \textcolor{comment}{ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00022}00022 \textcolor{comment}{ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00023}00023 \textcolor{comment}{ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00024}00024 \textcolor{comment}{ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00025}00025 \textcolor{comment}{ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00026}00026 \textcolor{comment}{ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00030}\mbox{\hyperlink{ctl__tpc_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{ctl__tpc_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <sys/conf.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00043}00043 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/nv.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/dnv.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <machine/atomic.h>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{cam_8h}{cam/cam.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__all_8h}{cam/scsi/scsi\_all.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{scsi__da_8h}{cam/scsi/scsi\_da.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__io_8h}{cam/ctl/ctl\_io.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl_8h}{cam/ctl/ctl.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__frontend_8h}{cam/ctl/ctl\_frontend.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__util_8h}{cam/ctl/ctl\_util.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__backend_8h}{cam/ctl/ctl\_backend.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__ioctl_8h}{cam/ctl/ctl\_ioctl.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__ha_8h}{cam/ctl/ctl\_ha.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__private_8h}{cam/ctl/ctl\_private.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__debug_8h}{cam/ctl/ctl\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__scsi__all_8h}{cam/ctl/ctl\_scsi\_all.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__tpc_8h}{cam/ctl/ctl\_tpc.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00062}00062 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{ctl__error_8h}{cam/ctl/ctl\_error.h}}>}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00063}00063 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00064}\mbox{\hyperlink{ctl__tpc_8c_a9ea1f3d057229996e34fb3f664fd793f}{00064}} \textcolor{preprocessor}{\#define TPC\_MAX\_CSCDS   64}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00065}\mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{00065}} \textcolor{preprocessor}{\#define TPC\_MAX\_SEGS    64}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00066}\mbox{\hyperlink{ctl__tpc_8c_a5c3c021339a0b924e7fcc9a3632b044c}{00066}} \textcolor{preprocessor}{\#define TPC\_MAX\_SEG     0}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00067}\mbox{\hyperlink{ctl__tpc_8c_a2bf7170b0cf227f73b2f0ef67ed9161e}{00067}} \textcolor{preprocessor}{\#define TPC\_MAX\_LIST    8192}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00068}\mbox{\hyperlink{ctl__tpc_8c_a6dc841c33a18100fd2bbb41e6bbe9e70}{00068}} \textcolor{preprocessor}{\#define TPC\_MAX\_INLINE  0}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00069}\mbox{\hyperlink{ctl__tpc_8c_ac68dad6803719185582dde2efece03f8}{00069}} \textcolor{preprocessor}{\#define TPC\_MAX\_LISTS   255}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00070}\mbox{\hyperlink{ctl__tpc_8c_a176ccb4ff442b01f70f254c05988500f}{00070}} \textcolor{preprocessor}{\#define TPC\_MAX\_IO\_SIZE (8 * MIN(1024 * 1024, MAX(128 * 1024, maxphys)))}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00071}\mbox{\hyperlink{ctl__tpc_8c_a2b26ac68735f384505fa95226f0bb6c7}{00071}} \textcolor{preprocessor}{\#define TPC\_MAX\_IOCHUNK\_SIZE    (TPC\_MAX\_IO\_SIZE * 4)}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00072}\mbox{\hyperlink{ctl__tpc_8c_a16afacb205ef71247fdb23333bbaecaf}{00072}} \textcolor{preprocessor}{\#define TPC\_MIN\_TOKEN\_TIMEOUT   1}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00073}\mbox{\hyperlink{ctl__tpc_8c_a21152a7061dbd8d766bad1da8fe943d7}{00073}} \textcolor{preprocessor}{\#define TPC\_DFL\_TOKEN\_TIMEOUT   60}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00074}\mbox{\hyperlink{ctl__tpc_8c_abd1ee8ca62d9cfe609baefccd289e561}{00074}} \textcolor{preprocessor}{\#define TPC\_MAX\_TOKEN\_TIMEOUT   600}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00075}00075 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00076}\mbox{\hyperlink{ctl__tpc_8c_af3fc0a8e2ade603d1e95d150d9213382}{00076}} \mbox{\hyperlink{ctl__tpc_8c_af3fc0a8e2ade603d1e95d150d9213382}{MALLOC\_DEFINE}}(M\_CTL\_TPC, \textcolor{stringliteral}{"{}ctltpc"{}}, \textcolor{stringliteral}{"{}CTL TPC"{}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00077}00077 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00078}\mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856}{00078}} \textcolor{keyword}{typedef} \textcolor{keyword}{enum} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00079}\mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856af915e2e2e2bc39e8d3d3602dd07a7614}{00079}}         \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856af915e2e2e2bc39e8d3d3602dd07a7614}{TPC\_ERR\_RETRY}}              = 0x000,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00080}\mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a3af04baa26431190b8ad8eb5f80ca095}{00080}}         \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a3af04baa26431190b8ad8eb5f80ca095}{TPC\_ERR\_FAIL}}                = 0x001,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00081}\mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856aa4e30350748007fe284696836df24d75}{00081}}         \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856aa4e30350748007fe284696836df24d75}{TPC\_ERR\_MASK}}                = 0x0ff,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00082}00082         \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a0d8fbf398d36bc703424c89639a30547}{TPC\_ERR\_NO\_DECREMENT}}        = 0x100}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00083}\mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a0d8fbf398d36bc703424c89639a30547}{00083}} \} \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856}{tpc\_error\_action}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00084}00084 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00085}00085 \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00086}\mbox{\hyperlink{ctl__tpc_8c_a7fa9728a4ef789503dbab3ac22239278}{00086}} \mbox{\hyperlink{ctl__tpc_8c_a7fa9728a4ef789503dbab3ac22239278}{TAILQ\_HEAD}}(runl, \mbox{\hyperlink{structtpc__io}{tpc\_io}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00087}\mbox{\hyperlink{structtpc__io}{00087}} \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__io}{tpc\_io}} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00088}\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{00088}}         \textcolor{keyword}{union }\mbox{\hyperlink{unionctl__io}{ctl\_io}}              *\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00089}\mbox{\hyperlink{structtpc__io_a7ee9710e0d1672d66d7f157ab29c42fc}{00089}}         uint8\_t                  \mbox{\hyperlink{structtpc__io_a7ee9710e0d1672d66d7f157ab29c42fc}{target}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00090}\mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{00090}}         uint32\_t                 \mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{cscd}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00091}\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{00091}}         uint64\_t                 \mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00092}\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{00092}}         uint8\_t                 *\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00093}\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{00093}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}}         *\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00094}\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{00094}}         \textcolor{keyword}{struct }runl              \mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00095}00095         TAILQ\_ENTRY(\mbox{\hyperlink{structtpc__io}{tpc\_io}})        rlinks;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00096}00096         TAILQ\_ENTRY(\mbox{\hyperlink{structtpc__io}{tpc\_io}})        links;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00097}00097 \};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00098}00098 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00099}\mbox{\hyperlink{structtpc__token}{00099}} \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__token}{tpc\_token}} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00100}\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{00100}}         uint8\_t                  \mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}[512];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00101}\mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{00101}}         uint64\_t                 \mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00102}\mbox{\hyperlink{structtpc__token_acf57a0941c237eac9513485aa16a2db4}{00102}}         uint32\_t                 \mbox{\hyperlink{structtpc__token_acf57a0941c237eac9513485aa16a2db4}{blocksize}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00103}\mbox{\hyperlink{structtpc__token_aa65199e596f2e37caa4f22a78f3f7dc1}{00103}}         uint8\_t                 *\mbox{\hyperlink{structtpc__token_aa65199e596f2e37caa4f22a78f3f7dc1}{params}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00104}\mbox{\hyperlink{structtpc__token_a2bf143d9f71841c021c277744b01d216}{00104}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}}   *\mbox{\hyperlink{structtpc__token_a2bf143d9f71841c021c277744b01d216}{range}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00105}\mbox{\hyperlink{structtpc__token_a72f196508f24ee2be6861c40268edaa9}{00105}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__token_a72f196508f24ee2be6861c40268edaa9}{nrange}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00106}\mbox{\hyperlink{structtpc__token_a1593ca6e4e31a01d441b18e435c8d21b}{00106}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__token_a1593ca6e4e31a01d441b18e435c8d21b}{active}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00107}\mbox{\hyperlink{structtpc__token_a9da87c373b3b424c73afd883927483bb}{00107}}         time\_t                   \mbox{\hyperlink{structtpc__token_a9da87c373b3b424c73afd883927483bb}{last\_active}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00108}\mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{00108}}         uint32\_t                 \mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{timeout}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00109}00109         TAILQ\_ENTRY(\mbox{\hyperlink{structtpc__token}{tpc\_token}})  links;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00110}00110 \};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00112}\mbox{\hyperlink{structtpc__list}{00112}} \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00113}\mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{00113}}         uint8\_t                  \mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{service\_action}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00114}\mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{00114}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{init\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00115}\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{00115}}         uint32\_t                 \mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00116}\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{00116}}         uint32\_t                 \mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00117}\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{00117}}         uint8\_t                  \mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00118}\mbox{\hyperlink{structtpc__list_a6f329d9ed25bb63405b24dd086568e49}{00118}}         uint8\_t                 *\mbox{\hyperlink{structtpc__list_a6f329d9ed25bb63405b24dd086568e49}{params}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00119}\mbox{\hyperlink{structtpc__list_a58b7f402e52b2d491b1168fe7fe165ef}{00119}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}} *\mbox{\hyperlink{structtpc__list_a58b7f402e52b2d491b1168fe7fe165ef}{cscd}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00120}\mbox{\hyperlink{structtpc__list_ac4854f8f5f7af43bccca3059202b0cb1}{00120}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}}   *\mbox{\hyperlink{structtpc__list_ac4854f8f5f7af43bccca3059202b0cb1}{seg}}[\mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}}];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00121}\mbox{\hyperlink{structtpc__list_a46becf05fb7374dc71a5552c8114e7c3}{00121}}         uint8\_t                 *\mbox{\hyperlink{structtpc__list_a46becf05fb7374dc71a5552c8114e7c3}{inl}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00122}\mbox{\hyperlink{structtpc__list_aa951f3601acd3cb18d28fdbe2a63044d}{00122}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_aa951f3601acd3cb18d28fdbe2a63044d}{ncscd}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00123}\mbox{\hyperlink{structtpc__list_af89be68b92a7a04d1043a389527a8d82}{00123}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_af89be68b92a7a04d1043a389527a8d82}{nseg}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00124}\mbox{\hyperlink{structtpc__list_ab6b9e3316ca4ee4445a7d47c9813cadd}{00124}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_ab6b9e3316ca4ee4445a7d47c9813cadd}{leninl}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00125}\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{00125}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__token}{tpc\_token}}       *\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00126}\mbox{\hyperlink{structtpc__list_a855e2ec8780c32546a315d0b400c69d5}{00126}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}}   *\mbox{\hyperlink{structtpc__list_a855e2ec8780c32546a315d0b400c69d5}{range}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00127}\mbox{\hyperlink{structtpc__list_a8345c4ba8b1043abafe39652a59fc5ec}{00127}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_a8345c4ba8b1043abafe39652a59fc5ec}{nrange}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00128}\mbox{\hyperlink{structtpc__list_a4e96b3cdc27eae5202a459391facbaec}{00128}}         off\_t                    \mbox{\hyperlink{structtpc__list_a4e96b3cdc27eae5202a459391facbaec}{offset\_into\_rod}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00129}00129 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00130}\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{00130}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00131}\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{00131}}         off\_t                    \mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00132}\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{00132}}         off\_t                    \mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00133}\mbox{\hyperlink{structtpc__list_afff202a7b9843f4866fd6ae53f0fc4dd}{00133}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_afff202a7b9843f4866fd6ae53f0fc4dd}{curops}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00134}\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{00134}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00135}\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{00135}}         off\_t                    \mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00136}\mbox{\hyperlink{structtpc__list_a72a094715a107150b7636d8a83690def}{00136}}         off\_t                    \mbox{\hyperlink{structtpc__list_a72a094715a107150b7636d8a83690def}{segbytes}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00137}\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{00137}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00138}\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{00138}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00139}\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{00139}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00140}\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{00140}}         \textcolor{keywordtype}{int}                      \mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00141}\mbox{\hyperlink{structtpc__list_a8104b241abab11b74d51870868c1e836}{00141}}         time\_t                   \mbox{\hyperlink{structtpc__list_a8104b241abab11b74d51870868c1e836}{last\_active}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00142}00142         \mbox{\hyperlink{ctl__tpc_8c_a7fa9728a4ef789503dbab3ac22239278}{TAILQ\_HEAD}}(, \mbox{\hyperlink{structtpc__io}{tpc\_io}})     allio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00143}00143         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__sense__data}{scsi\_sense\_data}}    fwd\_sense\_data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00144}00144         uint8\_t                  fwd\_sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00145}00145         uint8\_t                  fwd\_scsi\_status;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00146}00146         uint8\_t                  fwd\_target;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00147}00147         uint16\_t                 fwd\_cscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00148}00148         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__sense__data}{scsi\_sense\_data}}    sense\_data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00149}00149         uint8\_t                  sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00150}00150         uint8\_t                  scsi\_status;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00151}00151         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}}     *ctsio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00152}00152         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}}           *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00153}00153         \textcolor{keywordtype}{int}                      res\_token\_valid;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00154}00154         uint8\_t                  res\_token[512];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00155}00155         TAILQ\_ENTRY(\mbox{\hyperlink{structtpc__list}{tpc\_list}})    links;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00156}00156 \};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00157}00157 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00158}00158 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00159}\mbox{\hyperlink{ctl__tpc_8c_a66fbda6ffca5c9a9386de4bba5ccd95a}{00159}} \mbox{\hyperlink{ctl__tpc_8c_a66fbda6ffca5c9a9386de4bba5ccd95a}{tpc\_timeout}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00160}00160 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00161}00161         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__softc}{ctl\_softc}} *softc = arg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00162}00162         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00163}00163         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__token}{tpc\_token}} *\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, *ttoken;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00164}00164         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list, *tlist;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00165}00165 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00166}00166         \textcolor{comment}{/* Free completed lists with expired timeout. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00167}00167         STAILQ\_FOREACH(lun, \&softc-\/>lun\_list, links) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00168}00168                 mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00169}00169                 TAILQ\_FOREACH\_SAFE(list, \&lun-\/>tpc\_lists, links, tlist) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00170}00170                         \textcolor{keywordflow}{if} (!list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}} || time\_uptime < list-\/>\mbox{\hyperlink{structtpc__list_a8104b241abab11b74d51870868c1e836}{last\_active}} +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00171}00171                             \mbox{\hyperlink{ctl__tpc_8c_a21152a7061dbd8d766bad1da8fe943d7}{TPC\_DFL\_TOKEN\_TIMEOUT}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00172}00172                                 \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00173}00173                         TAILQ\_REMOVE(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00174}00174                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00175}00175                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00176}00176                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00177}00177         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00178}00178 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00179}00179         \textcolor{comment}{/* Free inactive ROD tokens with expired timeout. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00180}00180         mtx\_lock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00181}00181         TAILQ\_FOREACH\_SAFE(\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}, \&softc-\/>tpc\_tokens, links, ttoken) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00182}00182                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a1593ca6e4e31a01d441b18e435c8d21b}{active}} ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00183}00183                     time\_uptime < token-\/>\mbox{\hyperlink{structtpc__list_a8104b241abab11b74d51870868c1e836}{last\_active}} + \mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{timeout}} + 1)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00184}00184                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00185}00185                 TAILQ\_REMOVE(\&softc-\/>tpc\_tokens, \mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00186}00186                 free(\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_aa65199e596f2e37caa4f22a78f3f7dc1}{params}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00187}00187                 free(\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00188}00188         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00189}00189         mtx\_unlock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00190}00190         callout\_schedule\_sbt(\&softc-\/>\mbox{\hyperlink{structctl__softc_a265955c62a53f25228f457fc04b2611a}{tpc\_timeout}}, SBT\_1S, SBT\_1S, 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00191}00191 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00192}00192 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00193}00193 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00194}\mbox{\hyperlink{ctl__private_8h_a9b03c26ce0209c534f64be7f3c3f4d4a}{00194}} \mbox{\hyperlink{ctl__tpc_8c_a9b03c26ce0209c534f64be7f3c3f4d4a}{ctl\_tpc\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__softc}{ctl\_softc}} *softc)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00195}00195 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00197}00197         mtx\_init(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}}, \textcolor{stringliteral}{"{}CTL TPC mutex"{}}, NULL, MTX\_DEF);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00198}00198         TAILQ\_INIT(\&softc-\/>tpc\_tokens);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00199}00199         callout\_init\_mtx(\&softc-\/>\mbox{\hyperlink{structctl__softc_a265955c62a53f25228f457fc04b2611a}{tpc\_timeout}}, \&softc-\/>\mbox{\hyperlink{structctl__softc_ab7e54e9b5e5040934e784732b0396b20}{ctl\_lock}}, 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00200}00200         callout\_reset\_sbt(\&softc-\/>\mbox{\hyperlink{structctl__softc_a265955c62a53f25228f457fc04b2611a}{tpc\_timeout}}, SBT\_1S, SBT\_1S,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00201}00201             \mbox{\hyperlink{ctl__tpc_8c_a66fbda6ffca5c9a9386de4bba5ccd95a}{tpc\_timeout}}, softc, 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00202}00202 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00203}00203 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00204}00204 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00205}\mbox{\hyperlink{ctl__private_8h_a9d13b0bfe6383162d77065582c00d986}{00205}} \mbox{\hyperlink{ctl__tpc_8c_a9d13b0bfe6383162d77065582c00d986}{ctl\_tpc\_shutdown}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__softc}{ctl\_softc}} *softc)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00206}00206 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00207}00207         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__token}{tpc\_token}} *\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00208}00208 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00209}00209         callout\_drain(\&softc-\/>\mbox{\hyperlink{structctl__softc_a265955c62a53f25228f457fc04b2611a}{tpc\_timeout}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00210}00210 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00211}00211         \textcolor{comment}{/* Free ROD tokens. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00212}00212         mtx\_lock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00213}00213         \textcolor{keywordflow}{while} ((\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}} = TAILQ\_FIRST(\&softc-\/>tpc\_tokens)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00214}00214                 TAILQ\_REMOVE(\&softc-\/>tpc\_tokens, \mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00215}00215                 free(\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}-\/>params, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00216}00216                 free(\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00217}00217         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00218}00218         mtx\_unlock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00219}00219         mtx\_destroy(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00220}00220 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00221}00221 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00222}00222 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00223}\mbox{\hyperlink{ctl__private_8h_a061cf79dd78430ffb0262c48656b10b5}{00223}} \mbox{\hyperlink{ctl__tpc_8c_a061cf79dd78430ffb0262c48656b10b5}{ctl\_tpc\_lun\_init}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00224}00224 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00225}00225 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00226}00226         TAILQ\_INIT(\&\mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}}-\/>tpc\_lists);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00227}00227 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00228}00228 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00229}00229 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00230}\mbox{\hyperlink{ctl__private_8h_a3bde3b5ff5b8da23ed6a22c3fe75ee8a}{00230}} \mbox{\hyperlink{ctl__tpc_8c_a3bde3b5ff5b8da23ed6a22c3fe75ee8a}{ctl\_tpc\_lun\_clear}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}}, uint32\_t initidx)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00231}00231 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00232}00232         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list, *tlist;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00234}00234         TAILQ\_FOREACH\_SAFE(list, \&lun-\/>tpc\_lists, links, tlist) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00235}00235                 \textcolor{keywordflow}{if} (initidx != -\/1 \&\& list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}} != initidx)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00236}00236                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00237}00237                 \textcolor{keywordflow}{if} (!list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00238}00238                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00239}00239                 TAILQ\_REMOVE(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00240}00240                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00241}00241         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00242}00242 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00243}00243 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00244}00244 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00245}\mbox{\hyperlink{ctl__private_8h_a57467445466be2778fb7043d926b7b0e}{00245}} \mbox{\hyperlink{ctl__tpc_8c_a57467445466be2778fb7043d926b7b0e}{ctl\_tpc\_lun\_shutdown}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__lun}{ctl\_lun}} *lun)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00246}00246 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00247}00247         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__softc}{ctl\_softc}} *softc = lun-\/>\mbox{\hyperlink{structctl__lun_aa95d81a8a00d4a53e02bac1fff5ddf5f}{ctl\_softc}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00248}00248         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00249}00249         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__token}{tpc\_token}} *\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, *ttoken;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00250}00250 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00251}00251         \textcolor{comment}{/* Free lists for this LUN. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00252}00252         \textcolor{keywordflow}{while} ((list = TAILQ\_FIRST(\&\mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}}-\/>tpc\_lists)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00253}00253                 TAILQ\_REMOVE(\&\mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}}-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00254}00254                 KASSERT(list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00255}00255                     (\textcolor{stringliteral}{"{}Not completed TPC (\%p) on shutdown"{}}, list));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00256}00256                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00257}00257         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00258}00258 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00259}00259         \textcolor{comment}{/* Free ROD tokens for this LUN. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00260}00260         mtx\_lock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00261}00261         TAILQ\_FOREACH\_SAFE(\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, \&softc-\/>tpc\_tokens, links, ttoken) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00262}00262                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}-\/>lun != \mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}}-\/>lun || \mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}-\/>active)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00263}00263                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00264}00264                 TAILQ\_REMOVE(\&softc-\/>tpc\_tokens, \mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00265}00265                 free(\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}-\/>params, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00266}00266                 free(\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00267}00267         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00268}00268         mtx\_unlock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00269}00269 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00271}00271 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00272}\mbox{\hyperlink{ctl__private_8h_a76d090bbbe254da3fd9428813954d5bc}{00272}} \mbox{\hyperlink{ctl__tpc_8c_a76d090bbbe254da3fd9428813954d5bc}{ctl\_inquiry\_evpd\_tpc}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio, \textcolor{keywordtype}{int} alloc\_len)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00273}00273 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00274}00274         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00275}00275         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc}{scsi\_vpd\_tpc}} *tpc\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00276}00276         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00277}00277         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl}{scsi\_vpd\_tpc\_descriptor\_bdrl}} *bdrl\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00278}00278         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc}{scsi\_vpd\_tpc\_descriptor\_sc}} *sc\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00279}00279         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr}{scsi\_vpd\_tpc\_descriptor\_sc\_descr}} *scd\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00280}00280         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd}{scsi\_vpd\_tpc\_descriptor\_pd}} *pd\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00281}00281         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd}{scsi\_vpd\_tpc\_descriptor\_sd}} *sd\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00282}00282         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sdid}{scsi\_vpd\_tpc\_descriptor\_sdid}} *sdid\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00283}00283         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf}{scsi\_vpd\_tpc\_descriptor\_rtf}} *rtf\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00284}00284         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block}{scsi\_vpd\_tpc\_descriptor\_rtf\_block}} *rtfb\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00285}00285         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srt}{scsi\_vpd\_tpc\_descriptor\_srt}} *srt\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00286}00286         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd}{scsi\_vpd\_tpc\_descriptor\_srtd}} *srtd\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00287}00287         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco}{scsi\_vpd\_tpc\_descriptor\_gco}} *gco\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00288}00288         \textcolor{keywordtype}{int} data\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00289}00289 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00290}00290         data\_len = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc}{scsi\_vpd\_tpc}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00291}00291             sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl}{scsi\_vpd\_tpc\_descriptor\_bdrl}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00292}00292             roundup2(sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc}{scsi\_vpd\_tpc\_descriptor\_sc}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00293}00293              2 * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr}{scsi\_vpd\_tpc\_descriptor\_sc\_descr}}) + 11, 4) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00294}00294             sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd}{scsi\_vpd\_tpc\_descriptor\_pd}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00295}00295             roundup2(sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd}{scsi\_vpd\_tpc\_descriptor\_sd}}) + 4, 4) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00296}00296             roundup2(sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sdid}{scsi\_vpd\_tpc\_descriptor\_sdid}}) + 2, 4) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00297}00297             sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf}{scsi\_vpd\_tpc\_descriptor\_rtf}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00298}00298              sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block}{scsi\_vpd\_tpc\_descriptor\_rtf\_block}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00299}00299             sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srt}{scsi\_vpd\_tpc\_descriptor\_srt}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00300}00300              2*\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd}{scsi\_vpd\_tpc\_descriptor\_srtd}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00301}00301             sizeof(struct \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco}{scsi\_vpd\_tpc\_descriptor\_gco}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00302}00302 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00303}00303         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(data\_len, M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00304}00304         tpc\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc}{scsi\_vpd\_tpc}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00305}00305         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00306}00306         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00307}00307         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = min(data\_len, alloc\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00308}00308         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00309}00309 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00310}00310         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00311}00311 \textcolor{comment}{         * The control device is always connected.  The disk device, on the}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00312}00312 \textcolor{comment}{         * other hand, may not be online all the time.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00313}00313 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00314}00314         \textcolor{keywordflow}{if} (lun != NULL)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00315}00315                 tpc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc_acff34b8a68c8899408058630ea4c1c3c}{device}} = (\mbox{\hyperlink{scsi__all_8h_a8a4bc5643529b38b5a6b9a8fe867af90}{SID\_QUAL\_LU\_CONNECTED}} << 5) |}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00316}00316                                      lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_a5130beae8e5f13f6afa58f5514a962d6}{lun\_type}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00317}00317         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00318}00318                 tpc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc_acff34b8a68c8899408058630ea4c1c3c}{device}} = (\mbox{\hyperlink{scsi__all_8h_acee7aa691427292c36c3d0502b9859c5}{SID\_QUAL\_LU\_OFFLINE}} << 5) | \mbox{\hyperlink{scsi__all_8h_a5245a6853095fb224e6183bfcbf948cb}{T\_DIRECT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00319}00319         tpc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc_a4444b3ea629904fb51442b102f9f865f}{page\_code}} = \mbox{\hyperlink{scsi__all_8h_a0f1340333bc0ab99b13cfd35a90fc889}{SVPD\_SCSI\_TPC}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00320}00320         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(data\_len -\/ 4, tpc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc_a1c465d506d14bd198eefef214d0a63bc}{page\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00321}00321 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00322}00322         \textcolor{comment}{/* Block Device ROD Limits */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00323}00323         d\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *)\&tpc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc_ab358bfeea12f5e68a20bc1c5595bfee0}{descr}}[0];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00324}00324         bdrl\_ptr = (\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl}{scsi\_vpd\_tpc\_descriptor\_bdrl}} *)d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00325}00325         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{scsi__all_8h_a0bffcdbf137cb8488f806bd196a35c2a}{SVPD\_TPC\_BDRL}}, bdrl\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl_ad11b2f32f29cecfba54f15aaf7bfe96f}{desc\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00326}00326         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\textcolor{keyword}{sizeof}(*bdrl\_ptr) -\/ 4, bdrl\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl_a7bcfeae656b35f61bc66c0dcf032f013}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00327}00327         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}}, bdrl\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl_a7eca12d1cb6b44a650ac8bda7e7bdd45}{maximum\_ranges}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00328}00328         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_abd1ee8ca62d9cfe609baefccd289e561}{TPC\_MAX\_TOKEN\_TIMEOUT}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00329}00329             bdrl\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl_a1064c18e5a4603a4098b13817bc35e8e}{maximum\_inactivity\_timeout}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00330}00330         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_a21152a7061dbd8d766bad1da8fe943d7}{TPC\_DFL\_TOKEN\_TIMEOUT}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00331}00331             bdrl\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl_a322bbe3ebf817fe1884f87bda32456fd}{default\_inactivity\_timeout}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00332}00332         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(0, bdrl\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl_ab568059f6c4091b59b370938f31bb446}{maximum\_token\_transfer\_size}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00333}00333         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(0, bdrl\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__bdrl_abcbbb7a489e6e78bc509f0a9d89747f9}{optimal\_transfer\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00334}00334 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00335}00335         \textcolor{comment}{/* Supported commands */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00336}00336         d\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00337}00337             (\&d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_a43df28650c2d5763b4ea610788761c1f}{parameters}}[0] + \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_aa57a99718adacc8ba69a0980602bb5e3}{desc\_length}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00338}00338         sc\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc}{scsi\_vpd\_tpc\_descriptor\_sc}} *)d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00339}00339         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{scsi__all_8h_ae9f79ffdd584543f92ad873ca640aa67}{SVPD\_TPC\_SC}}, sc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc_aaac1e7a9eb725c7982369de5e593b82e}{desc\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00340}00340         sc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc_a25406c6f40795197a92d65da87b81541}{list\_length}} = 2 * \textcolor{keyword}{sizeof}(*scd\_ptr) + 11;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00341}00341         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(roundup2(1 + sc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc_a25406c6f40795197a92d65da87b81541}{list\_length}}, 4), sc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc_a34a57a79798d8e4fab7047964d8b840f}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00342}00342         scd\_ptr = \&sc\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc_afda3b0ab737f2b3ba61d69a8bc625bfb}{descr}}[0];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00343}00343         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_abbcb5037b0ea38b88ad9993e9feafd0d}{opcode}} = \mbox{\hyperlink{scsi__all_8h_a172de0bc05fb2badc6372df2cf76b679}{EXTENDED\_COPY}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00344}00344         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ad91b2abd6763356689cbceea9f1df940}{sa\_length}} = 5;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00345}00345         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[0] = \mbox{\hyperlink{scsi__all_8h_a24d694888a0f3e836e26c1061744764f}{EC\_EC\_LID1}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00346}00346         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[1] = \mbox{\hyperlink{scsi__all_8h_a81a2012b1181db89571b4bd8f1bdf563}{EC\_EC\_LID4}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00347}00347         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[2] = \mbox{\hyperlink{scsi__all_8h_a53f489c66704b2cde022d4b0c3deec47}{EC\_PT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00348}00348         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[3] = \mbox{\hyperlink{scsi__all_8h_a57c23fdd209d03c855731dc241927cb2}{EC\_WUT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00349}00349         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[4] = \mbox{\hyperlink{scsi__all_8h_adb973da278dd020f7ffa8f0598ae2503}{EC\_COA}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00350}00350         scd\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr}{scsi\_vpd\_tpc\_descriptor\_sc\_descr}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00351}00351             \&scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ad91b2abd6763356689cbceea9f1df940}{sa\_length}}];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00352}00352         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_abbcb5037b0ea38b88ad9993e9feafd0d}{opcode}} = \mbox{\hyperlink{scsi__all_8h_af52024c7b640b008118ec91a133fbf7d}{RECEIVE\_COPY\_STATUS}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00353}00353         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ad91b2abd6763356689cbceea9f1df940}{sa\_length}} = 6;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00354}00354         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[0] = \mbox{\hyperlink{scsi__all_8h_ac4d57ad38063ecd7223fa7e79f34308b}{RCS\_RCS\_LID1}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00355}00355         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[1] = \mbox{\hyperlink{scsi__all_8h_a0845ea0fb52f2f5199c25b397e847823}{RCS\_RCFD}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00356}00356         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[2] = \mbox{\hyperlink{scsi__all_8h_acd529511525b3a425afbeb76c352fd83}{RCS\_RCS\_LID4}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00357}00357         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[3] = \mbox{\hyperlink{scsi__all_8h_a88666322aaaf48269293baf0c9a0a3c1}{RCS\_RCOP}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00358}00358         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[4] = \mbox{\hyperlink{scsi__all_8h_a20271cab26693d81c7a49831b92e575d}{RCS\_RRTI}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00359}00359         scd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sc__descr_ada8f713f13db7a64abeaf19ad7dddd51}{supported\_service\_actions}}[5] = \mbox{\hyperlink{scsi__all_8h_adfa40235f029a685b56e0114d518bd47}{RCS\_RART}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00360}00360 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00361}00361         \textcolor{comment}{/* Parameter data. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00362}00362         d\_ptr = (\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00363}00363             (\&d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_a43df28650c2d5763b4ea610788761c1f}{parameters}}[0] + \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_aa57a99718adacc8ba69a0980602bb5e3}{desc\_length}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00364}00364         pd\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd}{scsi\_vpd\_tpc\_descriptor\_pd}} *)d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00365}00365         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{scsi__all_8h_acd8e886f758b9ac2f0e1a39466074fbe}{SVPD\_TPC\_PD}}, pd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd_ae65756a0de05d1204d99d704b7a6315e}{desc\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00366}00366         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\textcolor{keyword}{sizeof}(*pd\_ptr) -\/ 4, pd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd_a2b1d10ff332b0011c7e0c9a4df0564f0}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00367}00367         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{ctl__tpc_8c_a9ea1f3d057229996e34fb3f664fd793f}{TPC\_MAX\_CSCDS}}, pd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd_aa41f8a7765d04f306af051b02cfb90c0}{maximum\_cscd\_descriptor\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00368}00368         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}}, pd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd_ac419cbedba915790a57a28c4c8f20c79}{maximum\_segment\_descriptor\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00369}00369         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_a2bf7170b0cf227f73b2f0ef67ed9161e}{TPC\_MAX\_LIST}}, pd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd_a51e3a865ec8f4001e29e530987e718d1}{maximum\_descriptor\_list\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00370}00370         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_a6dc841c33a18100fd2bbb41e6bbe9e70}{TPC\_MAX\_INLINE}}, pd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__pd_a72f9794d6afa691ec893056ce4dac210}{maximum\_inline\_data\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00371}00371 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00372}00372         \textcolor{comment}{/* Supported Descriptors */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00373}00373         d\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00374}00374             (\&d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_a43df28650c2d5763b4ea610788761c1f}{parameters}}[0] + \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_aa57a99718adacc8ba69a0980602bb5e3}{desc\_length}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00375}00375         sd\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd}{scsi\_vpd\_tpc\_descriptor\_sd}} *)d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00376}00376         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{scsi__all_8h_a3bc6e20e3fc7bf04da9b47834bae4746}{SVPD\_TPC\_SD}}, sd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd_aeb9449cd1a6ad0f0d4c615a5c79b72d0}{desc\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00377}00377         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(roundup2(\textcolor{keyword}{sizeof}(*sd\_ptr) -\/ 4 + 4, 4), sd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd_ab16cbd912e1941305be0b25f016f80be}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00378}00378         sd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd_a272fa0ab62aacc5dcbcbc9ef4e7f2363}{list\_length}} = 4;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00379}00379         sd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd_a298e3f497386457b61125415c9a068f0}{supported\_descriptor\_codes}}[0] = \mbox{\hyperlink{scsi__all_8h_a2d7a7a0fccf0a4a50cc8d6f99aa38ad1}{EC\_SEG\_B2B}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00380}00380         sd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd_a298e3f497386457b61125415c9a068f0}{supported\_descriptor\_codes}}[1] = \mbox{\hyperlink{scsi__all_8h_ab5507f14011dac15971247e31fed293b}{EC\_SEG\_VERIFY}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00381}00381         sd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd_a298e3f497386457b61125415c9a068f0}{supported\_descriptor\_codes}}[2] = \mbox{\hyperlink{scsi__all_8h_ac8981f9a8fb08f70b107f527fbe4a65d}{EC\_SEG\_REGISTER\_KEY}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00382}00382         sd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sd_a298e3f497386457b61125415c9a068f0}{supported\_descriptor\_codes}}[3] = \mbox{\hyperlink{scsi__all_8h_a662e24546f4522c2f0d97bba5282252a}{EC\_CSCD\_ID}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00383}00383 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00384}00384         \textcolor{comment}{/* Supported CSCD Descriptor IDs */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00385}00385         d\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00386}00386             (\&d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_a43df28650c2d5763b4ea610788761c1f}{parameters}}[0] + \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_aa57a99718adacc8ba69a0980602bb5e3}{desc\_length}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00387}00387         sdid\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sdid}{scsi\_vpd\_tpc\_descriptor\_sdid}} *)d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00388}00388         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{scsi__all_8h_afdc6dffe210db6b0ffdf99da34cf2aaa}{SVPD\_TPC\_SDID}}, sdid\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sdid_a26476136c5ebf37aac4ef0942979a777}{desc\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00389}00389         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(roundup2(\textcolor{keyword}{sizeof}(*sdid\_ptr) -\/ 4 + 2, 4), sdid\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sdid_ad321b2dac6b188af231c5685b6823632}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00390}00390         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(2, sdid\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sdid_a239d0e242af8eae5d740957a19b7c1e6}{list\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00391}00391         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(0xffff, \&sdid\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__sdid_ac4fb994966c992fbc64b086f4a26bc6f}{supported\_descriptor\_ids}}[0]);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00392}00392 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00393}00393         \textcolor{comment}{/* ROD Token Features */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00394}00394         d\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00395}00395             (\&d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_a43df28650c2d5763b4ea610788761c1f}{parameters}}[0] + \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_aa57a99718adacc8ba69a0980602bb5e3}{desc\_length}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00396}00396         rtf\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf}{scsi\_vpd\_tpc\_descriptor\_rtf}} *)d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00397}00397         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{scsi__all_8h_abffc54ac93e4c9561ae8a3e83b9255b0}{SVPD\_TPC\_RTF}}, rtf\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf_a36adbb56c32b6547ce14c2a0c679e1f9}{desc\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00398}00398         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\textcolor{keyword}{sizeof}(*rtf\_ptr) -\/ 4 + \textcolor{keyword}{sizeof}(*rtfb\_ptr), rtf\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf_a1d7728f2e9bf9107932640b1196e1a2b}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00399}00399         rtf\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf_a7146abfedfd2a39369192a21cff3813e}{remote\_tokens}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00400}00400         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_a16afacb205ef71247fdb23333bbaecaf}{TPC\_MIN\_TOKEN\_TIMEOUT}}, rtf\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf_a67b27de679a7f04287772cfaba26782b}{minimum\_token\_lifetime}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00401}00401         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(UINT32\_MAX, rtf\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf_ad0fb023995aaff88af17a045210ccab3}{maximum\_token\_lifetime}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00402}00402         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_abd1ee8ca62d9cfe609baefccd289e561}{TPC\_MAX\_TOKEN\_TIMEOUT}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00403}00403             rtf\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf_a7739217af83b9dff25f7818c9bc892c3}{maximum\_token\_inactivity\_timeout}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00404}00404         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\textcolor{keyword}{sizeof}(*rtfb\_ptr), rtf\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf_a006691dd77119def1b2f0137b2c88685}{type\_specific\_features\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00405}00405         rtfb\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block}{scsi\_vpd\_tpc\_descriptor\_rtf\_block}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00406}00406             \&rtf\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf_a63c14f008e20a33a490dae3ca3b476ec}{type\_specific\_features}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00407}00407         rtfb\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block_ac821aab5b1b658c11f085799f48a958a}{type\_format}} = \mbox{\hyperlink{scsi__all_8h_af390fca4548ab5a32dc98a8c540463ba}{SVPD\_TPC\_RTF\_BLOCK}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00408}00408         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\textcolor{keyword}{sizeof}(*rtfb\_ptr) -\/ 4, rtfb\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block_a315048b3a87fc81114e2636df2174daa}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00409}00409         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(0, rtfb\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block_a7a678a8eeb679f7c8b0e70adc23cad52}{optimal\_length\_granularity}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00410}00410         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(0, rtfb\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block_ad9e593e598ed9d74bed919e7f4513635}{maximum\_bytes}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00411}00411         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(0, rtfb\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block_ae38d66a52f451a1f6754596e4344a85a}{optimal\_bytes}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00412}00412         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(UINT64\_MAX, rtfb\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block_a73d99a4f6c015fbf026d9e46e86d0c4e}{optimal\_bytes\_to\_token\_per\_segment}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00413}00413         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(\mbox{\hyperlink{ctl__tpc_8c_a2b26ac68735f384505fa95226f0bb6c7}{TPC\_MAX\_IOCHUNK\_SIZE}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00414}00414             rtfb\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__rtf__block_a69ebeab4678a0fe7c40c8287869f792e}{optimal\_bytes\_from\_token\_per\_segment}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00415}00415 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00416}00416         \textcolor{comment}{/* Supported ROD Tokens */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00417}00417         d\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00418}00418             (\&d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_a43df28650c2d5763b4ea610788761c1f}{parameters}}[0] + \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_aa57a99718adacc8ba69a0980602bb5e3}{desc\_length}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00419}00419         srt\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srt}{scsi\_vpd\_tpc\_descriptor\_srt}} *)d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00420}00420         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{scsi__all_8h_a01c99ae33be13e93612933637f86841a}{SVPD\_TPC\_SRT}}, srt\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srt_a73257b0bf205dc740a49c239ea72b986}{desc\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00421}00421         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\textcolor{keyword}{sizeof}(*srt\_ptr) -\/ 4 + 2*\textcolor{keyword}{sizeof}(*srtd\_ptr), srt\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srt_a0ad490b3045b3ffe97e20a316e85910d}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00422}00422         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(2*\textcolor{keyword}{sizeof}(*srtd\_ptr), srt\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srt_a88918ddc57439911942dba3748c9c7d1}{rod\_type\_descriptors\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00423}00423         srtd\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd}{scsi\_vpd\_tpc\_descriptor\_srtd}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00424}00424             \&srt\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srt_a06bffb4bbe386b16402210c811cf0671}{rod\_type\_descriptors}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00425}00425         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{scsi__all_8h_ac4342e340aa8e708738e7ee708db72fa}{ROD\_TYPE\_AUR}}, srtd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd_ae31174b486f46f98448604a59824e96e}{rod\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00426}00426         srtd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd_afb84b0c5b17607ed4f205bee7c97481a}{flags}} = \mbox{\hyperlink{scsi__all_8h_a941cd5b18dac99980a26f033bdc4ffb4}{SVPD\_TPC\_SRTD\_TIN}} | \mbox{\hyperlink{scsi__all_8h_a9fa414f99e1c66995e0644e28b641046}{SVPD\_TPC\_SRTD\_TOUT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00427}00427         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(0, srtd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd_a9a55a59496f789bb0703f4892f762759}{preference\_indicator}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00428}00428         srtd\_ptr++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00429}00429         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{scsi__all_8h_af07b4362ea13eac9590d80fe4bbb4060}{ROD\_TYPE\_BLOCK\_ZERO}}, srtd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd_ae31174b486f46f98448604a59824e96e}{rod\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00430}00430         srtd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd_afb84b0c5b17607ed4f205bee7c97481a}{flags}} = \mbox{\hyperlink{scsi__all_8h_a941cd5b18dac99980a26f033bdc4ffb4}{SVPD\_TPC\_SRTD\_TIN}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00431}00431         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(0, srtd\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__srtd_a9a55a59496f789bb0703f4892f762759}{preference\_indicator}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00432}00432 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00433}00433         \textcolor{comment}{/* General Copy Operations */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00434}00434         d\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor}{scsi\_vpd\_tpc\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00435}00435             (\&d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_a43df28650c2d5763b4ea610788761c1f}{parameters}}[0] + \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(d\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor_aa57a99718adacc8ba69a0980602bb5e3}{desc\_length}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00436}00436         gco\_ptr = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco}{scsi\_vpd\_tpc\_descriptor\_gco}} *)d\_ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00437}00437         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{scsi__all_8h_aec4aae90ed9789d3570a1d9b3bb40db1}{SVPD\_TPC\_GCO}}, gco\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco_a45e13af28256e80c6c5cbb9a287262b3}{desc\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00438}00438         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\textcolor{keyword}{sizeof}(*gco\_ptr) -\/ 4, gco\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco_a2e6d4cd6b5cd2edeebbffb6d81feade4}{desc\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00439}00439         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_ac68dad6803719185582dde2efece03f8}{TPC\_MAX\_LISTS}}, gco\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco_a88a31f1161136c0e1f7fada1eb947d04}{total\_concurrent\_copies}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00440}00440         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_ac68dad6803719185582dde2efece03f8}{TPC\_MAX\_LISTS}}, gco\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco_a7d0b745dcc721b6f37f859d2f2f0cc37}{maximum\_identified\_concurrent\_copies}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00441}00441         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_a5c3c021339a0b924e7fcc9a3632b044c}{TPC\_MAX\_SEG}}, gco\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco_ab02cf2a1b02a95134fbc695ed23056d2}{maximum\_segment\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00442}00442         gco\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco_a45f060051a3fc0eecf6e8b1df87e0aee}{data\_segment\_granularity}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00443}00443         gco\_ptr-\/>\mbox{\hyperlink{structscsi__vpd__tpc__descriptor__gco_a565d999c4cb3e3b23d8bdf9f31174eb0}{inline\_data\_granularity}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00445}00445         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00446}00446         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00447}00447         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00448}00448         \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00449}00449 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00450}00450         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00451}00451 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00452}00452 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00453}00453 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00454}\mbox{\hyperlink{ctl__private_8h_a974944f69f58ff7da722ef7f6cd97090}{00454}} \mbox{\hyperlink{ctl__tpc_8c_a974944f69f58ff7da722ef7f6cd97090}{ctl\_receive\_copy\_operating\_parameters}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00455}00455 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00456}00456         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__operating__parameters}{scsi\_receive\_copy\_operating\_parameters}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00457}00457         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data}{scsi\_receive\_copy\_operating\_parameters\_data}} *data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00458}00458         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00459}00459         \textcolor{keywordtype}{int} alloc\_len, total\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00460}00460 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00461}00461         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_report\_supported\_tmf\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00462}00462 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00463}00463         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__operating__parameters}{scsi\_receive\_copy\_operating\_parameters}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00464}00464 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00465}00465         retval = \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00466}00466 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00467}00467         total\_len = \textcolor{keyword}{sizeof}(*data) + 4;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00468}00468         alloc\_len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters_a6c7e39a4ab370b99ac89276d2445c39e}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00469}00469 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00470}00470         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(total\_len, M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00471}00471         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00472}00472         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00473}00473         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = min(total\_len, alloc\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00474}00474         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00475}00475 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00476}00476         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data}{scsi\_receive\_copy\_operating\_parameters\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00477}00477         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\textcolor{keyword}{sizeof}(*data) -\/ 4 + 4, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_ab5884b062db003ecc425c2764ae5ca12}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00478}00478         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a2f90fea1110947d059adc504be2a4fa0}{snlid}} = \mbox{\hyperlink{scsi__all_8h_a3bf12b9b19db40635a852d23d4a2f8a2}{RCOP\_SNLID}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00479}00479         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{ctl__tpc_8c_a9ea1f3d057229996e34fb3f664fd793f}{TPC\_MAX\_CSCDS}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a2d49e51bde2a075de3a6c86847954b8c}{maximum\_cscd\_descriptor\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00480}00480         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_af2a8010d1afd8fdd23b1a9a9d8836cf8}{maximum\_segment\_descriptor\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00481}00481         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_a2bf7170b0cf227f73b2f0ef67ed9161e}{TPC\_MAX\_LIST}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a9791cb0bac631bf6ad06c82af609366f}{maximum\_descriptor\_list\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00482}00482         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_a5c3c021339a0b924e7fcc9a3632b044c}{TPC\_MAX\_SEG}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a6d621e82322647477ba906454749ad9e}{maximum\_segment\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00483}00483         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{ctl__tpc_8c_a6dc841c33a18100fd2bbb41e6bbe9e70}{TPC\_MAX\_INLINE}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a2c24a2d34aa5b5072d8ea6edb2d704c5}{maximum\_inline\_data\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00484}00484         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(0, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_ac63b2c7f85718f6c14670b48142d0e4f}{held\_data\_limit}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00485}00485         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(0, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a9aaf8944342d9468117772334fd7098e}{maximum\_stream\_device\_transfer\_size}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00486}00486         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(\mbox{\hyperlink{ctl__tpc_8c_ac68dad6803719185582dde2efece03f8}{TPC\_MAX\_LISTS}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a3df5dd4acb08ae8880ba5f2b27893c69}{total\_concurrent\_copies}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00487}00487         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a1718c50f964792565dd5186675d026c1}{maximum\_concurrent\_copies}} = \mbox{\hyperlink{ctl__tpc_8c_ac68dad6803719185582dde2efece03f8}{TPC\_MAX\_LISTS}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00488}00488         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_af48594244d0beac171e70aa601e12ca2}{data\_segment\_granularity}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00489}00489         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a747b55d50ae409344b4534ec07d7282f}{inline\_data\_granularity}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00490}00490         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_ab36636ed3a944a1dcd14e7f6f82a3a34}{held\_data\_granularity}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00491}00491         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a8925d2400263797a1c56728473c6abff}{implemented\_descriptor\_list\_length}} = 4;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00492}00492         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a00ade1bf26aa9f9529c8ac30916446bc}{list\_of\_implemented\_descriptor\_type\_codes}}[0] = \mbox{\hyperlink{scsi__all_8h_a2d7a7a0fccf0a4a50cc8d6f99aa38ad1}{EC\_SEG\_B2B}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00493}00493         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a00ade1bf26aa9f9529c8ac30916446bc}{list\_of\_implemented\_descriptor\_type\_codes}}[1] = \mbox{\hyperlink{scsi__all_8h_ab5507f14011dac15971247e31fed293b}{EC\_SEG\_VERIFY}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00494}00494         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a00ade1bf26aa9f9529c8ac30916446bc}{list\_of\_implemented\_descriptor\_type\_codes}}[2] = \mbox{\hyperlink{scsi__all_8h_ac8981f9a8fb08f70b107f527fbe4a65d}{EC\_SEG\_REGISTER\_KEY}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00495}00495         data-\/>\mbox{\hyperlink{structscsi__receive__copy__operating__parameters__data_a00ade1bf26aa9f9529c8ac30916446bc}{list\_of\_implemented\_descriptor\_type\_codes}}[3] = \mbox{\hyperlink{scsi__all_8h_a662e24546f4522c2f0d97bba5282252a}{EC\_CSCD\_ID}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00496}00496 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00497}00497         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00498}00498         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00499}00499         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00500}00500         \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00501}00501         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00502}00502 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00503}00503 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00504}00504 \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00505}\mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{00505}} \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__lun}{ctl\_lun}} *lun, uint32\_t \mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}}, uint32\_t \mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00506}00506 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00507}00507         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00508}00508 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00509}00509         mtx\_assert(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}}, MA\_OWNED);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00510}00510         TAILQ\_FOREACH(list, \&lun-\/>tpc\_lists, links) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00511}00511                 \textcolor{keywordflow}{if} ((list-\/>\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}} \& \mbox{\hyperlink{scsi__all_8h_a024a751d2794b592c7d9fbd0cacc9ef1}{EC\_LIST\_ID\_USAGE\_MASK}}) !=}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00512}00512                      \mbox{\hyperlink{scsi__all_8h_a553ae7f7cda9f655311e26f9bfad4897}{EC\_LIST\_ID\_USAGE\_NONE}} \&\& list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}} == \mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}} \&\&}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00513}00513                     list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}} == \mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00514}00514                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00515}00515         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00516}00516         \textcolor{keywordflow}{return} (list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00517}00517 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00518}00518 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00519}00519 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00520}\mbox{\hyperlink{ctl__private_8h_aa00ae90cba7cc4f1314a595f118c4497}{00520}} \mbox{\hyperlink{ctl__tpc_8c_aa00ae90cba7cc4f1314a595f118c4497}{ctl\_receive\_copy\_status\_lid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00521}00521 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00522}00522         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00523}00523         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid1}{scsi\_receive\_copy\_status\_lid1}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00524}00524         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data}{scsi\_receive\_copy\_status\_lid1\_data}} *data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00525}00525         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00526}00526         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} list\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00527}00527         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00528}00528         \textcolor{keywordtype}{int} alloc\_len, total\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00529}00529         uint32\_t \mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00530}00530 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00531}00531         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_receive\_copy\_status\_lid1\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00532}00532 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00533}00533         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid1}{scsi\_receive\_copy\_status\_lid1}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00534}00534         retval = \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00536}00536         list\_id = cdb-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1_a4c760f24692c2688d9c7ad28daba202d}{list\_identifier}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00537}00537         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00538}00538         list = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list\_id,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00539}00539             \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00540}00540         \textcolor{keywordflow}{if} (list == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00541}00541                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00542}00542                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00543}00543                     \textcolor{comment}{/*command*/} 1, \textcolor{comment}{/*field*/} 2, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00544}00544                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00545}00545                 \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00546}00546                 \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00547}00547         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00548}00548         list\_copy = *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00549}00549         \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00550}00550                 TAILQ\_REMOVE(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00551}00551                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00552}00552         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00553}00553         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00554}00554 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00555}00555         total\_len = \textcolor{keyword}{sizeof}(*data);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00556}00556         alloc\_len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1_a5b92bc0a38f507ff73bf690e14d54799}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00557}00557 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00558}00558         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(total\_len, M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00559}00559         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00560}00560         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00561}00561         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = min(total\_len, alloc\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00562}00562         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00563}00563 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00564}00564         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data}{scsi\_receive\_copy\_status\_lid1\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00565}00565         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\textcolor{keyword}{sizeof}(*data) -\/ 4, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_af2039a6650904141277ad0b4d99cf156}{available\_data}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00566}00566         \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00567}00567                 \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}} || list\_copy.\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00568}00568                         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_a6ec1b051304c77792dabae3b94c9c4c6}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a58bb4f77c88148a898201410916b30c2}{RCS\_CCS\_ERROR}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00569}00569                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00570}00570                         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_a6ec1b051304c77792dabae3b94c9c4c6}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a22ef08838b1803a47e9a24ead497a6f7}{RCS\_CCS\_COMPLETED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00571}00571         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00572}00572                 data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_a6ec1b051304c77792dabae3b94c9c4c6}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_ac86294d76918cfc8fc315e0a4f1a591a}{RCS\_CCS\_INPROG}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00573}00573         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(list\_copy.\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_a2bde340d6171b6fbf960bbc40d0bb962}{segments\_processed}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00574}00574         \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}} <= UINT32\_MAX) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00575}00575                 data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_aaa8c9c4cff254de766a61822baee11b8}{transfer\_count\_units}} = \mbox{\hyperlink{scsi__all_8h_a00ec7ea2747be6e226c8bc120d1f7d9f}{RCS\_TC\_BYTES}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00576}00576                 \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(list\_copy.\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_abb468b19360b130b661c62d9914960e6}{transfer\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00577}00577         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00578}00578                 data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_aaa8c9c4cff254de766a61822baee11b8}{transfer\_count\_units}} = \mbox{\hyperlink{scsi__all_8h_a5ec2dcebf8683c1fb2ef5b3cd551b5a0}{RCS\_TC\_MBYTES}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00579}00579                 \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(list\_copy.\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}} >> 20, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid1__data_abb468b19360b130b661c62d9914960e6}{transfer\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00580}00580         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00581}00581 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00582}00582         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00583}00583         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00584}00584         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00585}00585         \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00586}00586         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00587}00587 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00588}00588 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00589}00589 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00590}\mbox{\hyperlink{ctl__private_8h_a860f0245fc24c808ca220c8e08644e86}{00590}} \mbox{\hyperlink{ctl__tpc_8c_a860f0245fc24c808ca220c8e08644e86}{ctl\_receive\_copy\_failure\_details}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00591}00591 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00592}00592         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00593}00593         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__failure__details}{scsi\_receive\_copy\_failure\_details}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00594}00594         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__failure__details__data}{scsi\_receive\_copy\_failure\_details\_data}} *data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00595}00595         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00596}00596         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} list\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00597}00597         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00598}00598         \textcolor{keywordtype}{int} alloc\_len, total\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00599}00599         uint32\_t \mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00600}00600 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00601}00601         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_receive\_copy\_failure\_details\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00602}00602 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00603}00603         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__failure__details}{scsi\_receive\_copy\_failure\_details}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00604}00604         retval = \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00605}00605 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00606}00606         list\_id = cdb-\/>\mbox{\hyperlink{structscsi__receive__copy__failure__details_aa5bf76559156192f304851c191d6e64b}{list\_identifier}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00607}00607         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00608}00608         list = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list\_id,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00609}00609             \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00610}00610         \textcolor{keywordflow}{if} (list == NULL || !list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00611}00611                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00612}00612                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00613}00613                     \textcolor{comment}{/*command*/} 1, \textcolor{comment}{/*field*/} 2, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00614}00614                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00615}00615                 \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00616}00616                 \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00617}00617         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00618}00618         list\_copy = *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00619}00619         TAILQ\_REMOVE(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00620}00620         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00621}00621         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00622}00622 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00623}00623         total\_len = \textcolor{keyword}{sizeof}(*data) + list\_copy.sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00624}00624         alloc\_len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__receive__copy__failure__details_aa7923cfe59f6c92439d427268f98ae50}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00625}00625 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00626}00626         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(total\_len, M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00627}00627         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00628}00628         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00629}00629         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = min(total\_len, alloc\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00630}00630         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00631}00631 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00632}00632         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__failure__details__data}{scsi\_receive\_copy\_failure\_details\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00633}00633         if (list\_copy.\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}} \&\& (list\_copy.\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}} || list\_copy.\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00634}00634                 \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\textcolor{keyword}{sizeof}(*data) -\/ 4 + list\_copy.sense\_len,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00635}00635                     data-\/>\mbox{\hyperlink{structscsi__receive__copy__failure__details__data_aba89715f6c2f29773f9932b0ab5c4309}{available\_data}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00636}00636                 data-\/>\mbox{\hyperlink{structscsi__receive__copy__failure__details__data_aa64cad643e0facedb65a0013181b661b}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a58bb4f77c88148a898201410916b30c2}{RCS\_CCS\_ERROR}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00637}00637         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00638}00638                 \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(0, data-\/>\mbox{\hyperlink{structscsi__receive__copy__failure__details__data_aba89715f6c2f29773f9932b0ab5c4309}{available\_data}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00639}00639         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(list\_copy.sense\_len, data-\/>\mbox{\hyperlink{structscsi__receive__copy__failure__details__data_a305d6335b513154eb29677d21bdb70a9}{sense\_data\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00640}00640         memcpy(data-\/>\mbox{\hyperlink{structscsi__receive__copy__failure__details__data_a6e73aeffce82e9e8bbe4edb9d5d9829f}{sense\_data}}, \&list\_copy.sense\_data, list\_copy.sense\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00641}00641 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00642}00642         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00643}00643         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00644}00644         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00645}00645         \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00646}00646         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00647}00647 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00648}00648 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00649}00649 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00650}\mbox{\hyperlink{ctl__private_8h_a758b6a4c66919b1f1b6a188509e72a32}{00650}} \mbox{\hyperlink{ctl__tpc_8c_a758b6a4c66919b1f1b6a188509e72a32}{ctl\_receive\_copy\_status\_lid4}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00651}00651 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00652}00652         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00653}00653         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid4}{scsi\_receive\_copy\_status\_lid4}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00654}00654         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data}{scsi\_receive\_copy\_status\_lid4\_data}} *data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00655}00655         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00656}00656         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} list\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00657}00657         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00658}00658         \textcolor{keywordtype}{int} alloc\_len, total\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00659}00659         uint32\_t \mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00660}00660 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00661}00661         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_receive\_copy\_status\_lid4\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00662}00662 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00663}00663         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid4}{scsi\_receive\_copy\_status\_lid4}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00664}00664         retval = \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00666}00666         list\_id = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4_a468c0dc9213485cc68f50de8c8800b5f}{list\_identifier}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00667}00667         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00668}00668         list = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list\_id,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00669}00669             \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00670}00670         \textcolor{keywordflow}{if} (list == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00671}00671                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00672}00672                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00673}00673                     \textcolor{comment}{/*command*/} 1, \textcolor{comment}{/*field*/} 2, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00674}00674                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00675}00675                 \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00676}00676                 \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00677}00677         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00678}00678         list\_copy = *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00679}00679         \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00680}00680                 TAILQ\_REMOVE(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00681}00681                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00682}00682         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00683}00683         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00684}00684 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00685}00685         total\_len = \textcolor{keyword}{sizeof}(*data) + list\_copy.sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00686}00686         alloc\_len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4_af8d70a0101c71ef7f352d3477b447c5c}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00687}00687 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00688}00688         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(total\_len, M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00689}00689         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00690}00690         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00691}00691         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = min(total\_len, alloc\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00692}00692         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00694}00694         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data}{scsi\_receive\_copy\_status\_lid4\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00695}00695         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\textcolor{keyword}{sizeof}(*data) -\/ 4 + list\_copy.sense\_len,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00696}00696             data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a1572758fcfd435f6cee3494ca024adcf}{available\_data}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00697}00697         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a25a6fe609f01d39c32770e336e3be3ef}{response\_to\_service\_action}} = list\_copy.\mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{service\_action}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00698}00698         \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00699}00699                 \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00700}00700                         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a64f6d1d1894f92b72a9895ec9fdad8dd}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a58bb4f77c88148a898201410916b30c2}{RCS\_CCS\_ERROR}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00701}00701                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00702}00702                         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a64f6d1d1894f92b72a9895ec9fdad8dd}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_af0a5813a77c426d711e25be025fecb04}{RCS\_CCS\_ABORTED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00703}00703                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00704}00704                         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a64f6d1d1894f92b72a9895ec9fdad8dd}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a22ef08838b1803a47e9a24ead497a6f7}{RCS\_CCS\_COMPLETED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00705}00705         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00706}00706                 data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a64f6d1d1894f92b72a9895ec9fdad8dd}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a763496817a320ff812cfbbf12e836bec}{RCS\_CCS\_INPROG\_FG}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00707}00707         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(list\_copy.\mbox{\hyperlink{structtpc__list_afff202a7b9843f4866fd6ae53f0fc4dd}{curops}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_aae8c34639f4a41cd183ea9f352324fad}{operation\_counter}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00708}00708         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(UINT32\_MAX, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_acdf389164b8394b77e9ab849872fedf9}{estimated\_status\_update\_delay}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00709}00709         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a57718487a69f06a91f11b492163056ab}{transfer\_count\_units}} = \mbox{\hyperlink{scsi__all_8h_a00ec7ea2747be6e226c8bc120d1f7d9f}{RCS\_TC\_BYTES}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00710}00710         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(list\_copy.\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a4f7ad82d1561b46cb8cc3b518807418d}{transfer\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00711}00711         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(list\_copy.\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_abd64e08af3f4282cc3e0b4990122ede9}{segments\_processed}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00712}00712         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a8ab4dfb7203ca0ba4ed2a9c4673609af}{length\_of\_the\_sense\_data\_field}} = list\_copy.sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00713}00713         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_ab030ca84548bdcf3617262800d409412}{sense\_data\_length}} = list\_copy.sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00714}00714         memcpy(data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_afb36132d15b5dadf50787e04e6a80287}{sense\_data}}, \&list\_copy.sense\_data, list\_copy.sense\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00715}00715 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00716}00716         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00717}00717         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00718}00718         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00719}00719         \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00720}00720         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00721}00721 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00722}00722 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00723}00723 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00724}\mbox{\hyperlink{ctl__private_8h_a14de5885914578e6d8730be03f44a5a2}{00724}} \mbox{\hyperlink{ctl__tpc_8c_a14de5885914578e6d8730be03f44a5a2}{ctl\_copy\_operation\_abort}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00725}00725 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00726}00726         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00727}00727         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__copy__operation__abort}{scsi\_copy\_operation\_abort}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00728}00728         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00729}00729         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00730}00730         uint32\_t \mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00731}00731 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00732}00732         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_copy\_operation\_abort\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00733}00733 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00734}00734         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__copy__operation__abort}{scsi\_copy\_operation\_abort}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00735}00735         retval = \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00736}00736 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00737}00737         list\_id = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__copy__operation__abort_a409891b873374d03c5bed3a73545172d}{list\_identifier}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00738}00738         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00739}00739         list = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list\_id,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00740}00740             \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00741}00741         \textcolor{keywordflow}{if} (list == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00742}00742                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00743}00743                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00744}00744                     \textcolor{comment}{/*command*/} 1, \textcolor{comment}{/*field*/} 2, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00745}00745                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00746}00746                 \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00747}00747                 \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00748}00748         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00749}00749         list-\/>\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00750}00750         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00751}00751 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00752}00752         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00753}00753         \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00754}00754         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00755}00755 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00756}00756 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00757}00757 \textcolor{keyword}{static} uint64\_t}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00758}\mbox{\hyperlink{ctl__tpc_8c_aface03cafbeb096484ff99724782f98f}{00758}} \mbox{\hyperlink{ctl__tpc_8c_aface03cafbeb096484ff99724782f98f}{tpc\_resolve}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}} *list, uint16\_t idx, uint32\_t *ss,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00759}00759     uint32\_t *pb, uint32\_t *pbo)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00760}00760 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00761}00761 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00762}00762         \textcolor{keywordflow}{if} (idx == 0xffff) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00763}00763                 \textcolor{keywordflow}{if} (ss)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00764}00764                         *ss = list-\/>lun-\/>be\_lun-\/>blocksize;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00765}00765                 \textcolor{keywordflow}{if} (pb)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00766}00766                         *pb = list-\/>lun-\/>be\_lun-\/>blocksize <<}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00767}00767                             list-\/>lun-\/>be\_lun-\/>pblockexp;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00768}00768                 \textcolor{keywordflow}{if} (pbo)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00769}00769                         *pbo = list-\/>lun-\/>be\_lun-\/>blocksize *}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00770}00770                             list-\/>lun-\/>be\_lun-\/>pblockoff;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00771}00771                 \textcolor{keywordflow}{return} (list-\/>lun-\/>lun);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00772}00772         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00773}00773         \textcolor{keywordflow}{if} (idx >= list-\/>\mbox{\hyperlink{structtpc__list_aa951f3601acd3cb18d28fdbe2a63044d}{ncscd}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00774}00774                 \textcolor{keywordflow}{return} (UINT64\_MAX);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00775}00775         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl__tpc_8h_a3c5f32637c4d1d1f006b261b9d5d61c6}{tpcl\_resolve}}(list-\/>lun-\/>ctl\_softc,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00776}00776             list-\/>\mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{init\_port}}, \&list-\/>\mbox{\hyperlink{structtpc__list_a58b7f402e52b2d491b1168fe7fe165ef}{cscd}}[idx], ss, pb, pbo));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00777}00777 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00778}00778 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00779}00779 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00780}\mbox{\hyperlink{ctl__tpc_8c_aad15b2ad05d2228a4ccdc7a0b1de3eb6}{00780}} \mbox{\hyperlink{ctl__tpc_8c_aad15b2ad05d2228a4ccdc7a0b1de3eb6}{tpc\_set\_io\_error\_sense}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}} *list)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00781}00781 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00782}00782         \textcolor{keywordtype}{int} flen;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00783}00783         uint8\_t csi[4];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00784}00784         uint8\_t sks[3];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00785}00785         uint8\_t fbuf[4 + 64];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00786}00786 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00787}00787         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}, csi);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00788}00788         \textcolor{keywordflow}{if} (list-\/>fwd\_cscd <= 0x07ff) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00789}00789                 sks[0] = \mbox{\hyperlink{scsi__all_8h_a9c5e768844f6fa994be8f8fceb041352}{SSD\_SKS\_SEGMENT\_VALID}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00790}00790                 \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}((uint8\_t *)\&list-\/>\mbox{\hyperlink{structtpc__list_a58b7f402e52b2d491b1168fe7fe165ef}{cscd}}[list-\/>fwd\_cscd] -\/}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00791}00791                     list-\/>\mbox{\hyperlink{structtpc__list_a6f329d9ed25bb63405b24dd086568e49}{params}}, \&sks[1]);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00792}00792         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00793}00793                 sks[0] = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00794}00794         \textcolor{keywordflow}{if} (list-\/>fwd\_scsi\_status) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00795}00795                 fbuf[0] = 0x0c;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00796}00796                 fbuf[2] = list-\/>fwd\_target;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00797}00797                 flen = list-\/>fwd\_sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00798}00798                 \textcolor{keywordflow}{if} (flen > 64) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00799}00799                         flen = 64;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00800}00800                         fbuf[2] |= \mbox{\hyperlink{scsi__all_8h_a8fc4111aad8a45eb23b6536f2c0ec696}{SSD\_FORWARDED\_FSDT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00801}00801                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00802}00802                 fbuf[1] = 2 + flen;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00803}00803                 fbuf[3] = list-\/>fwd\_scsi\_status;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00804}00804                 bcopy(\&list-\/>fwd\_sense\_data, \&fbuf[4], flen);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00805}00805                 flen += 4;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00806}00806         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00807}00807                 flen = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00808}00808         \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(list-\/>ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00809}00809             \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_af694c31bbc55b3bdd9cd04b0f208cf19}{SSD\_KEY\_COPY\_ABORTED}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00810}00810             \textcolor{comment}{/*asc*/} 0x0d, \textcolor{comment}{/*ascq*/} 0x01,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00811}00811             \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a3b5f66aa2955470973525b0e1b5f357b}{SSD\_ELEM\_COMMAND}}, \textcolor{keyword}{sizeof}(csi), csi,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00812}00812             sks[0] ? \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a2bd791f4f28754c23bb7e60e5edea9c1}{SSD\_ELEM\_SKS}} : \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380aac955686733d47c7829494464264ecae}{SSD\_ELEM\_SKIP}}, \textcolor{keyword}{sizeof}(sks), sks,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00813}00813             flen ? \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380aea4edf8814cdfb2c8b808b1c65152260}{SSD\_ELEM\_DESC}} : \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380aac955686733d47c7829494464264ecae}{SSD\_ELEM\_SKIP}}, flen, fbuf,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00814}00814             \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00815}00815 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00816}00816 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00817}00817 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00818}\mbox{\hyperlink{ctl__tpc_8c_ae7c4183f6587c75377b39deaa6effd2e}{00818}} \mbox{\hyperlink{ctl__tpc_8c_ae7c4183f6587c75377b39deaa6effd2e}{tpc\_process\_b2b}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}} *list)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00819}00819 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00820}00820         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment__b2b}{scsi\_ec\_segment\_b2b}} *seg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00821}00821         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd__dtsp}{scsi\_ec\_cscd\_dtsp}} *sdstp, *ddstp;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00822}00822         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__io}{tpc\_io}} *tior, *tiow;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00823}00823         \textcolor{keyword}{struct }runl run;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00824}00824         uint64\_t sl, dl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00825}00825         off\_t srclba, dstlba, numbytes, donebytes, roundbytes;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00826}00826         \textcolor{keywordtype}{int} numlba;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00827}00827         uint32\_t srcblock, dstblock, pb, pbo, adj;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00828}00828         uint16\_t scscd, dcscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00829}00829         uint8\_t csi[4];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00830}00830 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00831}00831         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}, csi);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00832}00832         \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}} == 1) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00833}00833                 \textcolor{keywordflow}{while} ((tior = TAILQ\_FIRST(\&list-\/>allio)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00834}00834                         TAILQ\_REMOVE(\&list-\/>allio, tior, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00835}00835                         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00836}00836                         free(tior-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00837}00837                         free(tior, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00838}00838                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00839}00839                 \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00840}00840                         \mbox{\hyperlink{ctl__error_8c_a1cbfd99beb0c9ef3b65d5c9500f16b73}{ctl\_set\_task\_aborted}}(list-\/>ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00841}00841                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00842}00842                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00843}00843                         \mbox{\hyperlink{ctl__tpc_8c_aad15b2ad05d2228a4ccdc7a0b1de3eb6}{tpc\_set\_io\_error\_sense}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00844}00844                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00845}00845                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00846}00846                 list-\/>\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}} += list-\/>\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00847}00847                 list-\/>\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}} += list-\/>\mbox{\hyperlink{structtpc__list_a72a094715a107150b7636d8a83690def}{segbytes}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00848}00848                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00849}00849         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00850}00850 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00851}00851         TAILQ\_INIT(\&list-\/>allio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00852}00852         seg = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment__b2b}{scsi\_ec\_segment\_b2b}} *)list-\/>\mbox{\hyperlink{structtpc__list_ac4854f8f5f7af43bccca3059202b0cb1}{seg}}[list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00853}00853         scscd = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__b2b_a3341ab4d4032bc31f6156dcd3910c897}{src\_cscd}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00854}00854         dcscd = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__b2b_ad5ef22245d76750677f040722d1945f4}{dst\_cscd}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00855}00855         sl = \mbox{\hyperlink{ctl__tpc_8c_aface03cafbeb096484ff99724782f98f}{tpc\_resolve}}(list, scscd, \&srcblock, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00856}00856         dl = \mbox{\hyperlink{ctl__tpc_8c_aface03cafbeb096484ff99724782f98f}{tpc\_resolve}}(list, dcscd, \&dstblock, \&pb, \&pbo);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00857}00857         \textcolor{keywordflow}{if} (sl == UINT64\_MAX || dl == UINT64\_MAX) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00858}00858                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(list-\/>ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00859}00859                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_af694c31bbc55b3bdd9cd04b0f208cf19}{SSD\_KEY\_COPY\_ABORTED}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00860}00860                     \textcolor{comment}{/*asc*/} 0x08, \textcolor{comment}{/*ascq*/} 0x04,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00861}00861                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a3b5f66aa2955470973525b0e1b5f357b}{SSD\_ELEM\_COMMAND}}, \textcolor{keyword}{sizeof}(csi), csi,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00862}00862                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00863}00863                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00864}00864         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00865}00865         \textcolor{keywordflow}{if} (pbo > 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00866}00866                 pbo = pb -\/ pbo;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00867}00867         sdstp = \&list-\/>\mbox{\hyperlink{structtpc__list_a58b7f402e52b2d491b1168fe7fe165ef}{cscd}}[scscd].\mbox{\hyperlink{structscsi__ec__cscd_a3c0d80ec1b32175cca2212cef2d884de}{dtsp}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00868}00868         \textcolor{keywordflow}{if} (\mbox{\hyperlink{scsi__all_8h_a3320d56b7bc675e8f20399c14e09a574}{scsi\_3btoul}}(sdstp-\/>\mbox{\hyperlink{structscsi__ec__cscd__dtsp_a3d28e718c8926c8598b3937a86a4650c}{block\_length}}) != 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00869}00869                 srcblock = \mbox{\hyperlink{scsi__all_8h_a3320d56b7bc675e8f20399c14e09a574}{scsi\_3btoul}}(sdstp-\/>\mbox{\hyperlink{structscsi__ec__cscd__dtsp_a3d28e718c8926c8598b3937a86a4650c}{block\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00870}00870         ddstp = \&list-\/>\mbox{\hyperlink{structtpc__list_a58b7f402e52b2d491b1168fe7fe165ef}{cscd}}[dcscd].\mbox{\hyperlink{structscsi__ec__cscd_a3c0d80ec1b32175cca2212cef2d884de}{dtsp}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00871}00871         \textcolor{keywordflow}{if} (\mbox{\hyperlink{scsi__all_8h_a3320d56b7bc675e8f20399c14e09a574}{scsi\_3btoul}}(ddstp-\/>\mbox{\hyperlink{structscsi__ec__cscd__dtsp_a3d28e718c8926c8598b3937a86a4650c}{block\_length}}) != 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00872}00872                 dstblock = \mbox{\hyperlink{scsi__all_8h_a3320d56b7bc675e8f20399c14e09a574}{scsi\_3btoul}}(ddstp-\/>\mbox{\hyperlink{structscsi__ec__cscd__dtsp_a3d28e718c8926c8598b3937a86a4650c}{block\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00873}00873         numlba = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__b2b_a6ed1deae0786187e8f2035531ac6f52a}{number\_of\_blocks}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00874}00874         \textcolor{keywordflow}{if} (seg-\/>\mbox{\hyperlink{structscsi__ec__segment__b2b_a24fc0d19de53d6210e70a6b67d74efb1}{flags}} \& \mbox{\hyperlink{scsi__all_8h_a9be1f55a098c086254c8836babb8e8bc}{EC\_SEG\_DC}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00875}00875                 numbytes = (off\_t)numlba * dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00876}00876         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00877}00877                 numbytes = (off\_t)numlba * srcblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00878}00878         srclba = \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__b2b_ac56aa893b9bba6a9173785492631db8c}{src\_lba}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00879}00879         dstlba = \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__b2b_acc51060e406f6c98a8fe47c7acd1c522}{dst\_lba}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00880}00880 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00881}00881 \textcolor{comment}{//      printf("{}Copy \%ju bytes from \%ju @ \%ju to \%ju @ \%ju\(\backslash\)n"{},}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00882}00882 \textcolor{comment}{//          (uintmax\_t)numbytes, sl, scsi\_8btou64(seg-\/>src\_lba),}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00883}00883 \textcolor{comment}{//          dl, scsi\_8btou64(seg-\/>dst\_lba));}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00884}00884 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00885}00885         \textcolor{keywordflow}{if} (numbytes == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00886}00886                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00887}00887 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00888}00888         \textcolor{keywordflow}{if} (numbytes \% srcblock != 0 || numbytes \% dstblock != 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00889}00889                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(list-\/>ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00890}00890                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_af694c31bbc55b3bdd9cd04b0f208cf19}{SSD\_KEY\_COPY\_ABORTED}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00891}00891                     \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x0A,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00892}00892                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a3b5f66aa2955470973525b0e1b5f357b}{SSD\_ELEM\_COMMAND}}, \textcolor{keyword}{sizeof}(csi), csi,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00893}00893                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00894}00894                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00895}00895         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00896}00896 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00897}00897         list-\/>\mbox{\hyperlink{structtpc__list_a72a094715a107150b7636d8a83690def}{segbytes}} = numbytes;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00898}00898         list-\/>\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}} = numbytes / dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00899}00899         donebytes = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00900}00900         TAILQ\_INIT(\&run);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00901}00901         list-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00902}00902         \textcolor{keywordflow}{while} (donebytes < numbytes) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00903}00903                 roundbytes = numbytes -\/ donebytes;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00904}00904                 \textcolor{keywordflow}{if} (roundbytes > \mbox{\hyperlink{ctl__tpc_8c_a176ccb4ff442b01f70f254c05988500f}{TPC\_MAX\_IO\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00905}00905                         roundbytes = \mbox{\hyperlink{ctl__tpc_8c_a176ccb4ff442b01f70f254c05988500f}{TPC\_MAX\_IO\_SIZE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00906}00906                         roundbytes -\/= roundbytes \% dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00907}00907                         \textcolor{keywordflow}{if} (pb > dstblock) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00908}00908                                 adj = (dstlba * dstblock + roundbytes -\/ pbo) \% pb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00909}00909                                 \textcolor{keywordflow}{if} (roundbytes > adj)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00910}00910                                         roundbytes -\/= adj;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00911}00911                         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00912}00912                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00913}00913 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00914}00914                 tior = malloc(\textcolor{keyword}{sizeof}(*tior), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00915}00915                 TAILQ\_INIT(\&tior-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00916}00916                 tior-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}} = malloc(roundbytes, M\_CTL, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00917}00917                 tior-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}} = list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00918}00918                 TAILQ\_INSERT\_TAIL(\&list-\/>allio, tior, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00919}00919                 tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}} = \mbox{\hyperlink{ctl__tpc_8h_a8cbb203cbd5215cfe724c70b1fd914b5}{tpcl\_alloc\_io}}();}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00920}00920                 \mbox{\hyperlink{ctl__util_8c_a3c14a565b7967489f4cf62680053a151}{ctl\_scsi\_read\_write}}(tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00921}00921                                     \textcolor{comment}{/*data\_ptr*/} tior-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00922}00922                                     \textcolor{comment}{/*data\_len*/} roundbytes,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00923}00923                                     \textcolor{comment}{/*read\_op*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00924}00924                                     \textcolor{comment}{/*byte2*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00925}00925                                     \textcolor{comment}{/*minimum\_cdb\_size*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00926}00926                                     \textcolor{comment}{/*lba*/} srclba,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00927}00927                                     \textcolor{comment}{/*num\_blocks*/} roundbytes / srcblock,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00928}00928                                     \textcolor{comment}{/*tag\_type*/} \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00929}00929                                     \textcolor{comment}{/*control*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00930}00930                 tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}} = 3;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00931}00931                 tior-\/>\mbox{\hyperlink{structtpc__io_a7ee9710e0d1672d66d7f157ab29c42fc}{target}} = \mbox{\hyperlink{scsi__all_8h_ac416549309e82fc149413e5310ea7218}{SSD\_FORWARDED\_SDS\_EXSRC}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00932}00932                 tior-\/>\mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{cscd}} = scscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00933}00933                 tior-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}} = sl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00934}00934                 tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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}} = tior;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00935}00935 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00936}00936                 tiow = malloc(\textcolor{keyword}{sizeof}(*tior), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00937}00937                 TAILQ\_INIT(\&tiow-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00938}00938                 tiow-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}} = list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00939}00939                 TAILQ\_INSERT\_TAIL(\&list-\/>allio, tiow, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00940}00940                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}} = \mbox{\hyperlink{ctl__tpc_8h_a8cbb203cbd5215cfe724c70b1fd914b5}{tpcl\_alloc\_io}}();}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00941}00941                 \mbox{\hyperlink{ctl__util_8c_a3c14a565b7967489f4cf62680053a151}{ctl\_scsi\_read\_write}}(tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00942}00942                                     \textcolor{comment}{/*data\_ptr*/} tior-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00943}00943                                     \textcolor{comment}{/*data\_len*/} roundbytes,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00944}00944                                     \textcolor{comment}{/*read\_op*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00945}00945                                     \textcolor{comment}{/*byte2*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00946}00946                                     \textcolor{comment}{/*minimum\_cdb\_size*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00947}00947                                     \textcolor{comment}{/*lba*/} dstlba,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00948}00948                                     \textcolor{comment}{/*num\_blocks*/} roundbytes / dstblock,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00949}00949                                     \textcolor{comment}{/*tag\_type*/} \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00950}00950                                     \textcolor{comment}{/*control*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00951}00951                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}} = 3;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00952}00952                 tiow-\/>\mbox{\hyperlink{structtpc__io_a7ee9710e0d1672d66d7f157ab29c42fc}{target}} = \mbox{\hyperlink{scsi__all_8h_a50f3936df253a3286972d59e2e2b7da4}{SSD\_FORWARDED\_SDS\_EXDST}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00953}00953                 tiow-\/>\mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{cscd}} = dcscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00954}00954                 tiow-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}} = dl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00955}00955                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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}} = tiow;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00956}00956 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00957}00957                 TAILQ\_INSERT\_TAIL(\&tior-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}}, tiow, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00958}00958                 TAILQ\_INSERT\_TAIL(\&run, tior, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00959}00959                 list-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00960}00960                 donebytes += roundbytes;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00961}00961                 srclba += roundbytes / srcblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00962}00962                 dstlba += roundbytes / dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00963}00963         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00964}00964 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00965}00965         \textcolor{keywordflow}{while} ((tior = TAILQ\_FIRST(\&run)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00966}00966                 TAILQ\_REMOVE(\&run, tior, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00967}00967                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8h_af05b8159038446b108fa61d221b9de56}{tpcl\_queue}}(tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}, tior-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}}) != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00968}00968                         panic(\textcolor{stringliteral}{"{}tpcl\_queue() error"{}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00969}00969         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00970}00970 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00971}00971         list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00972}00972         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a9580f2903fae9ce7849a59a302ce30a6}{CTL\_RETVAL\_QUEUED}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00973}00973 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00974}00974 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00975}00975 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00976}\mbox{\hyperlink{ctl__tpc_8c_a1c71d0bb9b4b36a5a4a1c8cf36f6d5f1}{00976}} \mbox{\hyperlink{ctl__tpc_8c_a1c71d0bb9b4b36a5a4a1c8cf36f6d5f1}{tpc\_process\_verify}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}} *list)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00977}00977 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00978}00978         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment__verify}{scsi\_ec\_segment\_verify}} *seg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00979}00979         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__io}{tpc\_io}} *tio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00980}00980         uint64\_t sl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00981}00981         uint16\_t \mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{cscd}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00982}00982         uint8\_t csi[4];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00983}00983 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00984}00984         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}, csi);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00985}00985         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}} == 1) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00986}00986                 \textcolor{keywordflow}{while} ((tio = TAILQ\_FIRST(\&\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>allio)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00987}00987                         TAILQ\_REMOVE(\&\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>allio, tio, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00988}00988                         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00989}00989                         free(tio, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00990}00990                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00991}00991                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00992}00992                         \mbox{\hyperlink{ctl__error_8c_a1cbfd99beb0c9ef3b65d5c9500f16b73}{ctl\_set\_task\_aborted}}(\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00993}00993                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00994}00994                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00995}00995                         \mbox{\hyperlink{ctl__tpc_8c_aad15b2ad05d2228a4ccdc7a0b1de3eb6}{tpc\_set\_io\_error\_sense}}(\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00996}00996                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00997}00997                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00998}00998                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l00999}00999         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01000}01000 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01001}01001         TAILQ\_INIT(\&\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>allio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01002}01002         seg = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment__verify}{scsi\_ec\_segment\_verify}} *)list-\/>\mbox{\hyperlink{structtpc__list_ac4854f8f5f7af43bccca3059202b0cb1}{seg}}[list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01003}01003         cscd = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__verify_a735e59271806be2fc75bd2079732e550}{src\_cscd}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01004}01004         sl = \mbox{\hyperlink{ctl__tpc_8c_aface03cafbeb096484ff99724782f98f}{tpc\_resolve}}(list, cscd, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01005}01005         \textcolor{keywordflow}{if} (sl == UINT64\_MAX) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01006}01006                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(list-\/>ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01007}01007                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_af694c31bbc55b3bdd9cd04b0f208cf19}{SSD\_KEY\_COPY\_ABORTED}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01008}01008                     \textcolor{comment}{/*asc*/} 0x08, \textcolor{comment}{/*ascq*/} 0x04,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01009}01009                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a3b5f66aa2955470973525b0e1b5f357b}{SSD\_ELEM\_COMMAND}}, \textcolor{keyword}{sizeof}(csi), csi,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01010}01010                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01011}01011                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01012}01012         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01013}01013 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01014}01014 \textcolor{comment}{//      printf("{}Verify \%ju\(\backslash\)n"{}, sl);}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01015}01015 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01016}01016         \textcolor{keywordflow}{if} ((seg-\/>\mbox{\hyperlink{structscsi__ec__segment__verify_a72b0bf3b8953807af56f3a96e14c3e9a}{tur}} \& 0x01) == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01017}01017                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01018}01018 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01019}01019         list-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01020}01020         tio = malloc(\textcolor{keyword}{sizeof}(*tio), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01021}01021         TAILQ\_INIT(\&tio-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01022}01022         tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}} = list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01023}01023         TAILQ\_INSERT\_TAIL(\&list-\/>allio, tio, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01024}01024         tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}} = \mbox{\hyperlink{ctl__tpc_8h_a8cbb203cbd5215cfe724c70b1fd914b5}{tpcl\_alloc\_io}}();}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01025}01025         \mbox{\hyperlink{ctl__util_8c_a9bfdd052d9a1d51e118b59ace73d0f4c}{ctl\_scsi\_tur}}(tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}, \textcolor{comment}{/*tag\_type*/} \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}}, \textcolor{comment}{/*control*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01026}01026         tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}} = 3;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01027}01027         tio-\/>\mbox{\hyperlink{structtpc__io_a7ee9710e0d1672d66d7f157ab29c42fc}{target}} = \mbox{\hyperlink{scsi__all_8h_ac416549309e82fc149413e5310ea7218}{SSD\_FORWARDED\_SDS\_EXSRC}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01028}01028         tio-\/>\mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{cscd}} = cscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01029}01029         tio-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}} = sl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01030}01030         tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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}} = tio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01031}01031         list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01032}01032         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8h_af05b8159038446b108fa61d221b9de56}{tpcl\_queue}}(tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}, tio-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}}) != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01033}01033                 panic(\textcolor{stringliteral}{"{}tpcl\_queue() error"{}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01034}01034         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a9580f2903fae9ce7849a59a302ce30a6}{CTL\_RETVAL\_QUEUED}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01035}01035 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01036}01036 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01037}01037 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01038}\mbox{\hyperlink{ctl__tpc_8c_af3146a5c41ff82f7702a015b646d3cdd}{01038}} \mbox{\hyperlink{ctl__tpc_8c_af3146a5c41ff82f7702a015b646d3cdd}{tpc\_process\_register\_key}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}} *list)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01039}01039 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01040}01040         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment__register__key}{scsi\_ec\_segment\_register\_key}} *seg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01041}01041         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__io}{tpc\_io}} *tio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01042}01042         uint64\_t dl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01043}01043         \textcolor{keywordtype}{int} datalen;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01044}01044         uint16\_t \mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{cscd}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01045}01045         uint8\_t csi[4];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01046}01046 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01047}01047         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}, csi);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01048}01048         \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}} == 1) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01049}01049                 \textcolor{keywordflow}{while} ((tio = TAILQ\_FIRST(\&\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>allio)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01050}01050                         TAILQ\_REMOVE(\&\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>allio, tio, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01051}01051                         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01052}01052                         free(tio-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01053}01053                         free(tio, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01054}01054                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01055}01055                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01056}01056                         \mbox{\hyperlink{ctl__error_8c_a1cbfd99beb0c9ef3b65d5c9500f16b73}{ctl\_set\_task\_aborted}}(\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01057}01057                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01058}01058                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01059}01059                         \mbox{\hyperlink{ctl__tpc_8c_aad15b2ad05d2228a4ccdc7a0b1de3eb6}{tpc\_set\_io\_error\_sense}}(\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01060}01060                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01061}01061                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01062}01062                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01063}01063         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01064}01064 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01065}01065         TAILQ\_INIT(\&\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>allio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01066}01066         seg = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment__register__key}{scsi\_ec\_segment\_register\_key}} *)list-\/>\mbox{\hyperlink{structtpc__list_ac4854f8f5f7af43bccca3059202b0cb1}{seg}}[list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01067}01067         cscd = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__register__key_a0db4ed2899ed3ee9249063cc1480e67c}{dst\_cscd}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01068}01068         dl = \mbox{\hyperlink{ctl__tpc_8c_aface03cafbeb096484ff99724782f98f}{tpc\_resolve}}(list, cscd, NULL, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01069}01069         \textcolor{keywordflow}{if} (dl == UINT64\_MAX) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01070}01070                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(list-\/>ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01071}01071                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_af694c31bbc55b3bdd9cd04b0f208cf19}{SSD\_KEY\_COPY\_ABORTED}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01072}01072                     \textcolor{comment}{/*asc*/} 0x08, \textcolor{comment}{/*ascq*/} 0x04,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01073}01073                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a3b5f66aa2955470973525b0e1b5f357b}{SSD\_ELEM\_COMMAND}}, \textcolor{keyword}{sizeof}(csi), csi,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01074}01074                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01075}01075                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01076}01076         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01077}01077 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01078}01078 \textcolor{comment}{//      printf("{}Register Key \%ju\(\backslash\)n"{}, dl);}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01079}01079 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01080}01080         list-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01081}01081         tio = malloc(\textcolor{keyword}{sizeof}(*tio), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01082}01082         TAILQ\_INIT(\&tio-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01083}01083         tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}} = list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01084}01084         TAILQ\_INSERT\_TAIL(\&list-\/>allio, tio, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01085}01085         tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}} = \mbox{\hyperlink{ctl__tpc_8h_a8cbb203cbd5215cfe724c70b1fd914b5}{tpcl\_alloc\_io}}();}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01086}01086         datalen = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__per__res__out__parms}{scsi\_per\_res\_out\_parms}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01087}01087         tio-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}} = malloc(datalen, M\_CTL, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01088}01088         \mbox{\hyperlink{ctl__util_8c_ad3806f111ad8ac8484defcd2e22ce9a0}{ctl\_scsi\_persistent\_res\_out}}(tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01089}01089             tio-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}}, datalen, \mbox{\hyperlink{scsi__all_8h_aae1d844fa8b81415becbe4dd28b69ff1}{SPRO\_REGISTER}}, -\/1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01090}01090             \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__register__key_ae20b287ed53e7619d363f71ed0c42400}{res\_key}}), \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment__register__key_ab29ad2108e5b76cd3878472d4677f513}{sa\_res\_key}}),}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01091}01091             \textcolor{comment}{/*tag\_type*/} \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}}, \textcolor{comment}{/*control*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01092}01092         tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}} = 3;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01093}01093         tio-\/>\mbox{\hyperlink{structtpc__io_a7ee9710e0d1672d66d7f157ab29c42fc}{target}} = \mbox{\hyperlink{scsi__all_8h_a50f3936df253a3286972d59e2e2b7da4}{SSD\_FORWARDED\_SDS\_EXDST}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01094}01094         tio-\/>\mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{cscd}} = cscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01095}01095         tio-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}} = dl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01096}01096         tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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}} = tio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01097}01097         list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01098}01098         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8h_af05b8159038446b108fa61d221b9de56}{tpcl\_queue}}(tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}, tio-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}}) != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01099}01099                 panic(\textcolor{stringliteral}{"{}tpcl\_queue() error"{}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01100}01100         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a9580f2903fae9ce7849a59a302ce30a6}{CTL\_RETVAL\_QUEUED}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01101}01101 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01102}01102 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01103}01103 \textcolor{keyword}{static} off\_t}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01104}\mbox{\hyperlink{ctl__tpc_8c_a9185f22049641e0a4ee38ac2538b9531}{01104}} \mbox{\hyperlink{ctl__tpc_8c_a9185f22049641e0a4ee38ac2538b9531}{tpc\_ranges\_length}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}} *range, \textcolor{keywordtype}{int} nrange)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01105}01105 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01106}01106         off\_t length = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01107}01107         \textcolor{keywordtype}{int} r;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01108}01108 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01109}01109         \textcolor{keywordflow}{for} (r = 0; r < nrange; r++)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01110}01110                 length += \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(range[r].length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01111}01111         \textcolor{keywordflow}{return} (length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01112}01112 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01113}01113 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01114}01114 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01115}\mbox{\hyperlink{ctl__tpc_8c_a341778570a9c27efa467e44769004a1c}{01115}} \mbox{\hyperlink{ctl__tpc_8c_a341778570a9c27efa467e44769004a1c}{tpc\_check\_ranges\_l}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}} *range, \textcolor{keywordtype}{int} nrange, uint64\_t maxlba,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01116}01116     uint64\_t *lba)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01117}01117 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01118}01118         uint64\_t b1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01119}01119         uint32\_t l1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01120}01120         \textcolor{keywordtype}{int} i;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01121}01121 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01122}01122         \textcolor{keywordflow}{for} (i = 0; i < nrange; i++) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01123}01123                 b1 = \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(range[i].lba);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01124}01124                 l1 = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(range[i].length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01125}01125                 \textcolor{keywordflow}{if} (b1 + l1 < b1 || b1 + l1 > maxlba + 1) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01126}01126                         *lba = MAX(b1, maxlba + 1);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01127}01127                         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01128}01128                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01129}01129         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01130}01130         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01131}01131 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01132}01132 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01133}01133 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01134}\mbox{\hyperlink{ctl__tpc_8c_aa5191738be14def15d7ef769c3395b7a}{01134}} \mbox{\hyperlink{ctl__tpc_8c_aa5191738be14def15d7ef769c3395b7a}{tpc\_check\_ranges\_x}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}} *range, \textcolor{keywordtype}{int} nrange)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01135}01135 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01136}01136         uint64\_t b1, b2;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01137}01137         uint32\_t l1, l2;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01138}01138         \textcolor{keywordtype}{int} i, j;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01139}01139 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01140}01140         \textcolor{keywordflow}{for} (i = 0; i < nrange -\/ 1; i++) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01141}01141                 b1 = \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(range[i].lba);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01142}01142                 l1 = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(range[i].length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01143}01143                 \textcolor{keywordflow}{for} (j = i + 1; j < nrange; j++) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01144}01144                         b2 = \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(range[j].lba);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01145}01145                         l2 = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(range[j].length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01146}01146                         \textcolor{keywordflow}{if} (b1 + l1 > b2 \&\& b2 + l2 > b1)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01147}01147                                 \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01148}01148                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01149}01149         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01150}01150         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01151}01151 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01152}01152 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01153}01153 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01154}\mbox{\hyperlink{ctl__tpc_8c_a10b214ce4678e3cce7280b74b4a0c1bf}{01154}} \mbox{\hyperlink{ctl__tpc_8c_a10b214ce4678e3cce7280b74b4a0c1bf}{tpc\_skip\_ranges}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}} *range, \textcolor{keywordtype}{int} nrange, off\_t skip,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01155}01155     \textcolor{keywordtype}{int} *srange, off\_t *soffset)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01156}01156 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01157}01157         off\_t off;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01158}01158         \textcolor{keywordtype}{int} r;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01159}01159 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01160}01160         r = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01161}01161         off = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01162}01162         \textcolor{keywordflow}{while} (r < nrange) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01163}01163                 \textcolor{keywordflow}{if} (skip -\/ off < \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(range[r].length)) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01164}01164                         *srange = r;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01165}01165                         *soffset = skip -\/ off;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01166}01166                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01167}01167                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01168}01168                 off += \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(range[r].length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01169}01169                 r++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01170}01170         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01171}01171         \textcolor{keywordflow}{return} (-\/1);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01172}01172 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01173}01173 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01174}01174 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01175}\mbox{\hyperlink{ctl__tpc_8c_a0abc0635d128e1a6616570a97f99f271}{01175}} \mbox{\hyperlink{ctl__tpc_8c_a0abc0635d128e1a6616570a97f99f271}{tpc\_process\_wut}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}} *list)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01176}01176 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01177}01177         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__io}{tpc\_io}} *tio, *tior, *tiow;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01178}01178         \textcolor{keyword}{struct }runl run;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01179}01179         \textcolor{keywordtype}{int} drange, srange;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01180}01180         off\_t doffset, soffset;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01181}01181         off\_t srclba, dstlba, numbytes, donebytes, roundbytes;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01182}01182         uint32\_t srcblock, dstblock, pb, pbo, adj;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01183}01183 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01184}01184         \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}} > 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01185}01185                 \textcolor{comment}{/* Cleanup after previous rounds. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01186}01186                 \textcolor{keywordflow}{while} ((tio = TAILQ\_FIRST(\&list-\/>allio)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01187}01187                         TAILQ\_REMOVE(\&list-\/>allio, tio, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01188}01188                         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01189}01189                         free(tio-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01190}01190                         free(tio, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01191}01191                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01192}01192                 \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01193}01193                         \mbox{\hyperlink{ctl__error_8c_a1cbfd99beb0c9ef3b65d5c9500f16b73}{ctl\_set\_task\_aborted}}(list-\/>ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01194}01194                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01195}01195                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01196}01196                         \textcolor{keywordflow}{if} (list-\/>fwd\_scsi\_status) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01197}01197                                 list-\/>ctsio-\/>io\_hdr.status =}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01198}01198                                     \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a382e750806810cb27d24bc9a0ff1ef86}{CTL\_SCSI\_ERROR}} | \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a2153fd95515a7cb5c25872c6b610e927}{CTL\_AUTOSENSE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01199}01199                                 list-\/>ctsio-\/>scsi\_status = list-\/>fwd\_scsi\_status;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01200}01200                                 list-\/>ctsio-\/>sense\_data = list-\/>fwd\_sense\_data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01201}01201                                 list-\/>ctsio-\/>sense\_len = list-\/>fwd\_sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01202}01202                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01203}01203                                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(list-\/>ctsio,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01204}01204                                     \textcolor{comment}{/*sks\_valid*/} 0, \textcolor{comment}{/*command*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01205}01205                                     \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01206}01206                         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01207}01207                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01208}01208                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01209}01209                 list-\/>\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}} += list-\/>\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01210}01210                 list-\/>\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}} += list-\/>\mbox{\hyperlink{structtpc__list_a72a094715a107150b7636d8a83690def}{segbytes}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01211}01211         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01212}01212 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01213}01213         \textcolor{comment}{/* Check where we are on destination ranges list. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01214}01214         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8c_a10b214ce4678e3cce7280b74b4a0c1bf}{tpc\_skip\_ranges}}(list-\/>\mbox{\hyperlink{structtpc__list_a855e2ec8780c32546a315d0b400c69d5}{range}}, list-\/>\mbox{\hyperlink{structtpc__list_a8345c4ba8b1043abafe39652a59fc5ec}{nrange}}, list-\/>\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01215}01215             \&drange, \&doffset) != 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01216}01216                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01217}01217         dstblock = list-\/>lun-\/>be\_lun-\/>blocksize;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01218}01218         pb = dstblock << list-\/>lun-\/>be\_lun-\/>pblockexp;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01219}01219         \textcolor{keywordflow}{if} (list-\/>lun-\/>be\_lun-\/>pblockoff > 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01220}01220                 pbo = pb -\/ dstblock * list-\/>lun-\/>be\_lun-\/>pblockoff;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01221}01221         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01222}01222                 pbo = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01223}01223 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01224}01224         \textcolor{comment}{/* Check where we are on source ranges list. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01225}01225         srcblock = list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_acf57a0941c237eac9513485aa16a2db4}{blocksize}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01226}01226         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8c_a10b214ce4678e3cce7280b74b4a0c1bf}{tpc\_skip\_ranges}}(list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a2bf143d9f71841c021c277744b01d216}{range}}, list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a72f196508f24ee2be6861c40268edaa9}{nrange}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01227}01227             list-\/>\mbox{\hyperlink{structtpc__list_a4e96b3cdc27eae5202a459391facbaec}{offset\_into\_rod}} + list-\/>\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}} * dstblock / srcblock,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01228}01228             \&srange, \&soffset) != 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01229}01229                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(list-\/>ctsio, \textcolor{comment}{/*sks\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01230}01230                     \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01231}01231                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01232}01232         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01233}01233 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01234}01234         srclba = \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a2bf143d9f71841c021c277744b01d216}{range}}[srange].\mbox{\hyperlink{structscsi__range__desc_a109124e2ad460b86098178b196a6bdcc}{lba}}) + soffset;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01235}01235         dstlba = \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(list-\/>\mbox{\hyperlink{structtpc__list_a855e2ec8780c32546a315d0b400c69d5}{range}}[drange].\mbox{\hyperlink{structscsi__range__desc_a109124e2ad460b86098178b196a6bdcc}{lba}}) + doffset;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01236}01236         numbytes = srcblock *}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01237}01237             (\mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a2bf143d9f71841c021c277744b01d216}{range}}[srange].\mbox{\hyperlink{structscsi__range__desc_a560891dfa20b7ef3c5e5f79c4f1453ef}{length}}) -\/ soffset);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01238}01238         numbytes = omin(numbytes, dstblock *}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01239}01239             (\mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(list-\/>\mbox{\hyperlink{structtpc__list_a855e2ec8780c32546a315d0b400c69d5}{range}}[drange].\mbox{\hyperlink{structscsi__range__desc_a560891dfa20b7ef3c5e5f79c4f1453ef}{length}}) -\/ doffset));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01240}01240         \textcolor{keywordflow}{if} (numbytes > \mbox{\hyperlink{ctl__tpc_8c_a2b26ac68735f384505fa95226f0bb6c7}{TPC\_MAX\_IOCHUNK\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01241}01241                 numbytes = \mbox{\hyperlink{ctl__tpc_8c_a2b26ac68735f384505fa95226f0bb6c7}{TPC\_MAX\_IOCHUNK\_SIZE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01242}01242                 numbytes -\/= numbytes \% dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01243}01243                 \textcolor{keywordflow}{if} (pb > dstblock) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01244}01244                         adj = (dstlba * dstblock + numbytes -\/ pbo) \% pb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01245}01245                         \textcolor{keywordflow}{if} (numbytes > adj)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01246}01246                                 numbytes -\/= adj;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01247}01247                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01248}01248         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01249}01249 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01250}01250         \textcolor{keywordflow}{if} (numbytes \% srcblock != 0 || numbytes \% dstblock != 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01251}01251                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(list-\/>ctsio, \textcolor{comment}{/*sks\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01252}01252                     \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01253}01253                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01254}01254         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01255}01255 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01256}01256         list-\/>\mbox{\hyperlink{structtpc__list_a72a094715a107150b7636d8a83690def}{segbytes}} = numbytes;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01257}01257         list-\/>\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}} = numbytes / dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01258}01258 \textcolor{comment}{//printf("{}Copy chunk of \%ju sectors from \%ju to \%ju\(\backslash\)n"{}, list-\/>segsectors,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01259}01259 \textcolor{comment}{//    srclba, dstlba);}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01260}01260         donebytes = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01261}01261         TAILQ\_INIT(\&run);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01262}01262         list-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01263}01263         TAILQ\_INIT(\&list-\/>allio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01264}01264         \textcolor{keywordflow}{while} (donebytes < numbytes) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01265}01265                 roundbytes = numbytes -\/ donebytes;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01266}01266                 \textcolor{keywordflow}{if} (roundbytes > \mbox{\hyperlink{ctl__tpc_8c_a176ccb4ff442b01f70f254c05988500f}{TPC\_MAX\_IO\_SIZE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01267}01267                         roundbytes = \mbox{\hyperlink{ctl__tpc_8c_a176ccb4ff442b01f70f254c05988500f}{TPC\_MAX\_IO\_SIZE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01268}01268                         roundbytes -\/= roundbytes \% dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01269}01269                         \textcolor{keywordflow}{if} (pb > dstblock) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01270}01270                                 adj = (dstlba * dstblock + roundbytes -\/ pbo) \% pb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01271}01271                                 \textcolor{keywordflow}{if} (roundbytes > adj)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01272}01272                                         roundbytes -\/= adj;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01273}01273                         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01274}01274                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01275}01275 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01276}01276                 tior = malloc(\textcolor{keyword}{sizeof}(*tior), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01277}01277                 TAILQ\_INIT(\&tior-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01278}01278                 tior-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}} = malloc(roundbytes, M\_CTL, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01279}01279                 tior-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}} = list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01280}01280                 TAILQ\_INSERT\_TAIL(\&list-\/>allio, tior, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01281}01281                 tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}} = \mbox{\hyperlink{ctl__tpc_8h_a8cbb203cbd5215cfe724c70b1fd914b5}{tpcl\_alloc\_io}}();}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01282}01282                 \mbox{\hyperlink{ctl__util_8c_a3c14a565b7967489f4cf62680053a151}{ctl\_scsi\_read\_write}}(tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01283}01283                                     \textcolor{comment}{/*data\_ptr*/} tior-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01284}01284                                     \textcolor{comment}{/*data\_len*/} roundbytes,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01285}01285                                     \textcolor{comment}{/*read\_op*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01286}01286                                     \textcolor{comment}{/*byte2*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01287}01287                                     \textcolor{comment}{/*minimum\_cdb\_size*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01288}01288                                     \textcolor{comment}{/*lba*/} srclba,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01289}01289                                     \textcolor{comment}{/*num\_blocks*/} roundbytes / srcblock,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01290}01290                                     \textcolor{comment}{/*tag\_type*/} \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01291}01291                                     \textcolor{comment}{/*control*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01292}01292                 tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}} = 3;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01293}01293                 tior-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}} = list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01294}01294                 tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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}} = tior;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01295}01295 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01296}01296                 tiow = malloc(\textcolor{keyword}{sizeof}(*tiow), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01297}01297                 TAILQ\_INIT(\&tiow-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01298}01298                 tiow-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}} = list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01299}01299                 TAILQ\_INSERT\_TAIL(\&list-\/>allio, tiow, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01300}01300                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}} = \mbox{\hyperlink{ctl__tpc_8h_a8cbb203cbd5215cfe724c70b1fd914b5}{tpcl\_alloc\_io}}();}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01301}01301                 \mbox{\hyperlink{ctl__util_8c_a3c14a565b7967489f4cf62680053a151}{ctl\_scsi\_read\_write}}(tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01302}01302                                     \textcolor{comment}{/*data\_ptr*/} tior-\/>\mbox{\hyperlink{structtpc__io_a77ff85e62397fa1d488cd71dd0654c90}{buf}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01303}01303                                     \textcolor{comment}{/*data\_len*/} roundbytes,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01304}01304                                     \textcolor{comment}{/*read\_op*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01305}01305                                     \textcolor{comment}{/*byte2*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01306}01306                                     \textcolor{comment}{/*minimum\_cdb\_size*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01307}01307                                     \textcolor{comment}{/*lba*/} dstlba,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01308}01308                                     \textcolor{comment}{/*num\_blocks*/} roundbytes / dstblock,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01309}01309                                     \textcolor{comment}{/*tag\_type*/} \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01310}01310                                     \textcolor{comment}{/*control*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01311}01311                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}} = 3;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01312}01312                 tiow-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}} = list-\/>lun-\/>lun;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01313}01313                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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}} = tiow;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01314}01314 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01315}01315                 TAILQ\_INSERT\_TAIL(\&tior-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}}, tiow, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01316}01316                 TAILQ\_INSERT\_TAIL(\&run, tior, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01317}01317                 list-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01318}01318                 donebytes += roundbytes;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01319}01319                 srclba += roundbytes / srcblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01320}01320                 dstlba += roundbytes / dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01321}01321         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01322}01322 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01323}01323         \textcolor{keywordflow}{while} ((tior = TAILQ\_FIRST(\&run)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01324}01324                 TAILQ\_REMOVE(\&run, tior, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01325}01325                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8h_af05b8159038446b108fa61d221b9de56}{tpcl\_queue}}(tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}, tior-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}}) != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01326}01326                         panic(\textcolor{stringliteral}{"{}tpcl\_queue() error"{}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01327}01327         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01328}01328 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01329}01329         list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01330}01330         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a9580f2903fae9ce7849a59a302ce30a6}{CTL\_RETVAL\_QUEUED}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01331}01331 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01332}01332 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01333}01333 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01334}\mbox{\hyperlink{ctl__tpc_8c_a05da043e559e962248bd95ef799a4ca9}{01334}} \mbox{\hyperlink{ctl__tpc_8c_a05da043e559e962248bd95ef799a4ca9}{tpc\_process\_zero\_wut}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}} *list)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01335}01335 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01336}01336         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__io}{tpc\_io}} *tio, *tiow;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01337}01337         \textcolor{keyword}{struct }runl run, *prun;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01338}01338         \textcolor{keywordtype}{int} r;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01339}01339         uint32\_t dstblock, len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01340}01340 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01341}01341         \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}} > 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01342}01342 complete:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01343}01343                 \textcolor{comment}{/* Cleanup after previous rounds. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01344}01344                 \textcolor{keywordflow}{while} ((tio = TAILQ\_FIRST(\&list-\/>allio)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01345}01345                         TAILQ\_REMOVE(\&list-\/>allio, tio, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01346}01346                         \mbox{\hyperlink{ctl_8c_a2298ab10c67901ade72b2a0c4a625b7b}{ctl\_free\_io}}(tio-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01347}01347                         free(tio, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01348}01348                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01349}01349                 \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01350}01350                         \mbox{\hyperlink{ctl__error_8c_a1cbfd99beb0c9ef3b65d5c9500f16b73}{ctl\_set\_task\_aborted}}(list-\/>ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01351}01351                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01352}01352                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01353}01353                         \textcolor{keywordflow}{if} (list-\/>fwd\_scsi\_status) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01354}01354                                 list-\/>ctsio-\/>io\_hdr.status =}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01355}01355                                     \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a382e750806810cb27d24bc9a0ff1ef86}{CTL\_SCSI\_ERROR}} | \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a2153fd95515a7cb5c25872c6b610e927}{CTL\_AUTOSENSE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01356}01356                                 list-\/>ctsio-\/>scsi\_status = list-\/>fwd\_scsi\_status;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01357}01357                                 list-\/>ctsio-\/>sense\_data = list-\/>fwd\_sense\_data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01358}01358                                 list-\/>ctsio-\/>sense\_len = list-\/>fwd\_sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01359}01359                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01360}01360                                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(list-\/>ctsio,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01361}01361                                     \textcolor{comment}{/*sks\_valid*/} 0, \textcolor{comment}{/*command*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01362}01362                                     \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01363}01363                         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01364}01364                         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01365}01365                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01366}01366                 list-\/>\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}} += list-\/>\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01367}01367                 list-\/>\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}} += list-\/>\mbox{\hyperlink{structtpc__list_a72a094715a107150b7636d8a83690def}{segbytes}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01368}01368                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01369}01369         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01370}01370 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01371}01371         dstblock = list-\/>lun-\/>be\_lun-\/>blocksize;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01372}01372         TAILQ\_INIT(\&run);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01373}01373         prun = \&run;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01374}01374         list-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01375}01375         TAILQ\_INIT(\&list-\/>allio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01376}01376         list-\/>\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01377}01377         \textcolor{keywordflow}{for} (r = 0; r < list-\/>\mbox{\hyperlink{structtpc__list_a8345c4ba8b1043abafe39652a59fc5ec}{nrange}}; r++) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01378}01378                 len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(list-\/>\mbox{\hyperlink{structtpc__list_a855e2ec8780c32546a315d0b400c69d5}{range}}[r].\mbox{\hyperlink{structscsi__range__desc_a560891dfa20b7ef3c5e5f79c4f1453ef}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01379}01379                 \textcolor{keywordflow}{if} (len == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01380}01380                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01381}01381 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01382}01382                 tiow = malloc(\textcolor{keyword}{sizeof}(*tiow), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01383}01383                 TAILQ\_INIT(\&tiow-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01384}01384                 tiow-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}} = list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01385}01385                 TAILQ\_INSERT\_TAIL(\&list-\/>allio, tiow, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01386}01386                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}} = \mbox{\hyperlink{ctl__tpc_8h_a8cbb203cbd5215cfe724c70b1fd914b5}{tpcl\_alloc\_io}}();}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01387}01387                 \mbox{\hyperlink{ctl__util_8c_ad54be0b091a4cb7a60e6404fb235a05e}{ctl\_scsi\_write\_same}}(tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01388}01388                                     \textcolor{comment}{/*data\_ptr*/} NULL,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01389}01389                                     \textcolor{comment}{/*data\_len*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01390}01390                                     \textcolor{comment}{/*byte2*/} \mbox{\hyperlink{scsi__all_8h_a35685386327f93dbe0b6c330c35ea357}{SWS\_NDOB}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01391}01391                                     \textcolor{comment}{/*lba*/} \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(list-\/>\mbox{\hyperlink{structtpc__list_a855e2ec8780c32546a315d0b400c69d5}{range}}[r].\mbox{\hyperlink{structscsi__range__desc_a109124e2ad460b86098178b196a6bdcc}{lba}}),}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01392}01392                                     \textcolor{comment}{/*num\_blocks*/} len,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01393}01393                                     \textcolor{comment}{/*tag\_type*/} \mbox{\hyperlink{ctl__io_8h_a319b044c4d180ed7beae7040e762d130aece8792c94febd75a60a4763ae1e0151}{CTL\_TAG\_SIMPLE}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01394}01394                                     \textcolor{comment}{/*control*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01395}01395                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}} = 3;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01396}01396                 tiow-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}} = list-\/>lun-\/>lun;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01397}01397                 tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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}} = tiow;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01398}01398 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01399}01399                 TAILQ\_INSERT\_TAIL(prun, tiow, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01400}01400                 prun = \&tiow-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01401}01401                 list-\/>\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}} += len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01402}01402         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01403}01403         list-\/>\mbox{\hyperlink{structtpc__list_a72a094715a107150b7636d8a83690def}{segbytes}} = list-\/>\mbox{\hyperlink{structtpc__list_a8438a085cd71c19004c2ecc65ccb5b72}{segsectors}} * dstblock;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01404}01404 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01405}01405         \textcolor{keywordflow}{if} (TAILQ\_EMPTY(\&run))}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01406}01406                 \textcolor{keywordflow}{goto} complete;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01407}01407 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01408}01408         \textcolor{keywordflow}{while} ((tiow = TAILQ\_FIRST(\&run)) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01409}01409                 TAILQ\_REMOVE(\&run, tiow, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01410}01410                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8h_af05b8159038446b108fa61d221b9de56}{tpcl\_queue}}(tiow-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}, tiow-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}}) != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01411}01411                         panic(\textcolor{stringliteral}{"{}tpcl\_queue() error"{}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01412}01412         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01413}01413 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01414}01414         list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01415}01415         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a9580f2903fae9ce7849a59a302ce30a6}{CTL\_RETVAL\_QUEUED}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01416}01416 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01417}01417 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01418}01418 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01419}\mbox{\hyperlink{ctl__tpc_8c_a89568b4615988b107504189a16cf1bc1}{01419}} \mbox{\hyperlink{ctl__tpc_8c_a89568b4615988b107504189a16cf1bc1}{tpc\_process}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}} *list)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01420}01420 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01421}01421         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = list-\/>lun;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01422}01422         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__softc}{ctl\_softc}} *softc = lun-\/>\mbox{\hyperlink{structctl__lun_aa95d81a8a00d4a53e02bac1fff5ddf5f}{ctl\_softc}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01423}01423         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}} *seg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01424}01424         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio = list-\/>ctsio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01425}01425         \textcolor{keywordtype}{int} retval = \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01426}01426         uint8\_t csi[4];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01427}01427 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01428}01428         \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{service\_action}} == \mbox{\hyperlink{scsi__all_8h_a57c23fdd209d03c855731dc241927cb2}{EC\_WUT}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01429}01429                 \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}} != NULL)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01430}01430                         retval = \mbox{\hyperlink{ctl__tpc_8c_a0abc0635d128e1a6616570a97f99f271}{tpc\_process\_wut}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01431}01431                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01432}01432                         retval = \mbox{\hyperlink{ctl__tpc_8c_a05da043e559e962248bd95ef799a4ca9}{tpc\_process\_zero\_wut}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01433}01433                 \textcolor{keywordflow}{if} (retval == \mbox{\hyperlink{ctl_8h_a9580f2903fae9ce7849a59a302ce30a6}{CTL\_RETVAL\_QUEUED}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01434}01434                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01435}01435                 \textcolor{keywordflow}{if} (retval == \mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01436}01436                         list-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01437}01437                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01438}01438                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01439}01439         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01440}01440 \textcolor{comment}{//printf("{}ZZZ \%d cscd, \%d segs\(\backslash\)n"{}, list-\/>ncscd, list-\/>nseg);}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01441}01441                 \textcolor{keywordflow}{while} (list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}} < list-\/>\mbox{\hyperlink{structtpc__list_af89be68b92a7a04d1043a389527a8d82}{nseg}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01442}01442                         seg = list-\/>\mbox{\hyperlink{structtpc__list_ac4854f8f5f7af43bccca3059202b0cb1}{seg}}[list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01443}01443                         \textcolor{keywordflow}{switch} (seg-\/>\mbox{\hyperlink{structscsi__ec__segment_af3d3546ae07f2b74b49599768d08391a}{type\_code}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01444}01444                         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_a2d7a7a0fccf0a4a50cc8d6f99aa38ad1}{EC\_SEG\_B2B}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01445}01445                                 retval = \mbox{\hyperlink{ctl__tpc_8c_ae7c4183f6587c75377b39deaa6effd2e}{tpc\_process\_b2b}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01446}01446                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01447}01447                         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_ab5507f14011dac15971247e31fed293b}{EC\_SEG\_VERIFY}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01448}01448                                 retval = \mbox{\hyperlink{ctl__tpc_8c_a1c71d0bb9b4b36a5a4a1c8cf36f6d5f1}{tpc\_process\_verify}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01449}01449                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01450}01450                         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_ac8981f9a8fb08f70b107f527fbe4a65d}{EC\_SEG\_REGISTER\_KEY}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01451}01451                                 retval = \mbox{\hyperlink{ctl__tpc_8c_af3146a5c41ff82f7702a015b646d3cdd}{tpc\_process\_register\_key}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01452}01452                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01453}01453                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01454}01454                                 \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}, csi);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01455}01455                                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01456}01456                                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_af694c31bbc55b3bdd9cd04b0f208cf19}{SSD\_KEY\_COPY\_ABORTED}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01457}01457                                     \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x09,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01458}01458                                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a3b5f66aa2955470973525b0e1b5f357b}{SSD\_ELEM\_COMMAND}}, \textcolor{keyword}{sizeof}(csi), csi,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01459}01459                                     \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01460}01460                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01461}01461                         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01462}01462                         \textcolor{keywordflow}{if} (retval == \mbox{\hyperlink{ctl_8h_a9580f2903fae9ce7849a59a302ce30a6}{CTL\_RETVAL\_QUEUED}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01463}01463                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01464}01464                         \textcolor{keywordflow}{if} (retval == \mbox{\hyperlink{ctl_8h_a4f6c73e57be873216dc8650d98009d98}{CTL\_RETVAL\_ERROR}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01465}01465                                 list-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01466}01466                                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01467}01467                         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01468}01468                         list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01469}01469                         list-\/>\mbox{\hyperlink{structtpc__list_a3e32d95fd8dc7f2e5476c4bc931aef26}{stage}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01470}01470                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01471}01471         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01472}01472 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01473}01473         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01474}01474 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01475}01475 done:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01476}01476 \textcolor{comment}{//printf("{}ZZZ done\(\backslash\)n"{});}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01477}01477         free(list-\/>\mbox{\hyperlink{structtpc__list_a6f329d9ed25bb63405b24dd086568e49}{params}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01478}01478         list-\/>\mbox{\hyperlink{structtpc__list_a6f329d9ed25bb63405b24dd086568e49}{params}} = NULL;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01479}01479         \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01480}01480                 mtx\_lock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01481}01481                 \textcolor{keywordflow}{if} (-\/-\/list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a1593ca6e4e31a01d441b18e435c8d21b}{active}} == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01482}01482                         list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}}-\/>\mbox{\hyperlink{structtpc__token_a9da87c373b3b424c73afd883927483bb}{last\_active}} = time\_uptime;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01483}01483                 mtx\_unlock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01484}01484                 list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}} = NULL;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01485}01485         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01486}01486         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01487}01487         \textcolor{keywordflow}{if} ((list-\/>\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}} \& \mbox{\hyperlink{scsi__all_8h_a024a751d2794b592c7d9fbd0cacc9ef1}{EC\_LIST\_ID\_USAGE\_MASK}}) == \mbox{\hyperlink{scsi__all_8h_a553ae7f7cda9f655311e26f9bfad4897}{EC\_LIST\_ID\_USAGE\_NONE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01488}01488                 TAILQ\_REMOVE(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01489}01489                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01490}01490         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01491}01491                 list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01492}01492                 list-\/>\mbox{\hyperlink{structtpc__list_a8104b241abab11b74d51870868c1e836}{last\_active}} = time\_uptime;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01493}01493                 list-\/>sense\_data = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a292cf32dbfbad8a3848044cea599971e}{sense\_data}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01494}01494                 list-\/>sense\_len = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ae3738b1fb5c045b852ec268967572868}{sense\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01495}01495                 list-\/>scsi\_status = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a48fadb6e18f4588e096a440fb37629b4}{scsi\_status}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01496}01496         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01497}01497         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01498}01498 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01499}01499         \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01500}01500 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01501}01501 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01502}01502 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01503}01503 \textcolor{comment}{ * For any sort of check condition, busy, etc., we just retry.  We do not}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01504}01504 \textcolor{comment}{ * decrement the retry count for unit attention type errors.  These are}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01505}01505 \textcolor{comment}{ * normal, and we want to save the retry count for "{}real"{} errors.  Otherwise,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01506}01506 \textcolor{comment}{ * we could end up with situations where a command will succeed in some}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01507}01507 \textcolor{comment}{ * situations and fail in others, depending on whether a unit attention is}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01508}01508 \textcolor{comment}{ * pending.  Also, some of our error recovery actions, most notably the}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01509}01509 \textcolor{comment}{ * LUN reset action, will cause a unit attention.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01510}01510 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01511}01511 \textcolor{comment}{ * We can add more detail here later if necessary.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01512}01512 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01513}01513 \textcolor{keyword}{static} \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856}{tpc\_error\_action}}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01514}\mbox{\hyperlink{ctl__tpc_8c_a9298f88abeca677c69629d432a69329b}{01514}} \mbox{\hyperlink{ctl__tpc_8c_a9298f88abeca677c69629d432a69329b}{tpc\_checkcond\_parse}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *io)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01515}01515 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01516}01516         \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856}{tpc\_error\_action}} error\_action;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01517}01517         \textcolor{keywordtype}{int} error\_code, sense\_key, asc, ascq;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01518}01518 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01519}01519         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01520}01520 \textcolor{comment}{         * Default to retrying the command.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01521}01521 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01522}01522         error\_action = \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856af915e2e2e2bc39e8d3d3602dd07a7614}{TPC\_ERR\_RETRY}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01523}01523 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01524}01524         \mbox{\hyperlink{scsi__all_8c_aa4fd274032f460c0a69461c75f3f639d}{scsi\_extract\_sense\_len}}(\&io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a292cf32dbfbad8a3848044cea599971e}{sense\_data}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01525}01525                                io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_ae3738b1fb5c045b852ec268967572868}{sense\_len}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01526}01526                                \&error\_code,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01527}01527                                \&sense\_key,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01528}01528                                \&asc,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01529}01529                                \&ascq,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01530}01530                                \textcolor{comment}{/*show\_errors*/} 1);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01531}01531 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01532}01532         \textcolor{keywordflow}{switch} (error\_code) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01533}01533         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_a6d79b8732564fa4dd9a54cac372a0808}{SSD\_DEFERRED\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01534}01534         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_a7435725c083a58dfe0c792a6047e9bb4}{SSD\_DESC\_DEFERRED\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01535}01535                 error\_action |= \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a0d8fbf398d36bc703424c89639a30547}{TPC\_ERR\_NO\_DECREMENT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01536}01536                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01537}01537         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_afdd5bebc8f0ec3b19749b988b7c9028e}{SSD\_CURRENT\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01538}01538         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_a1f071bf0401717c187cc699db2367782}{SSD\_DESC\_CURRENT\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01539}01539         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01540}01540                 \textcolor{keywordflow}{switch} (sense\_key) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01541}01541                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_a059f6fc85c83de46d7ab943b677adbdc}{SSD\_KEY\_UNIT\_ATTENTION}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01542}01542                         error\_action |= \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a0d8fbf398d36bc703424c89639a30547}{TPC\_ERR\_NO\_DECREMENT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01543}01543                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01544}01544                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_a15d88e568263869eb731025216816352}{SSD\_KEY\_HARDWARE\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01545}01545                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01546}01546 \textcolor{comment}{                         * This is our generic "{}something bad happened"{}}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01547}01547 \textcolor{comment}{                         * error code.  It often isn't recoverable.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01548}01548 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01549}01549                         \textcolor{keywordflow}{if} ((asc == 0x44) \&\& (ascq == 0x00))}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01550}01550                                 error\_action = \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a3af04baa26431190b8ad8eb5f80ca095}{TPC\_ERR\_FAIL}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01551}01551                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01552}01552                 \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_a7670aca3381ad94038cfc644060e9a7e}{SSD\_KEY\_NOT\_READY}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01553}01553                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01554}01554 \textcolor{comment}{                         * If the LUN is powered down, there likely isn't}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01555}01555 \textcolor{comment}{                         * much point in retrying right now.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01556}01556 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01557}01557                         \textcolor{keywordflow}{if} ((asc == 0x04) \&\& (ascq == 0x02))}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01558}01558                                 error\_action = \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a3af04baa26431190b8ad8eb5f80ca095}{TPC\_ERR\_FAIL}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01559}01559                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01560}01560 \textcolor{comment}{                         * If the LUN is offline, there probably isn't much}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01561}01561 \textcolor{comment}{                         * point in retrying, either.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01562}01562 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01563}01563                         \textcolor{keywordflow}{if} ((asc == 0x04) \&\& (ascq == 0x03))}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01564}01564                                 error\_action = \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a3af04baa26431190b8ad8eb5f80ca095}{TPC\_ERR\_FAIL}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01565}01565                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01566}01566                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01567}01567         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01568}01568         \textcolor{keywordflow}{return} (error\_action);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01569}01569 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01570}01570 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01571}01571 \textcolor{keyword}{static} \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856}{tpc\_error\_action}}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01572}\mbox{\hyperlink{ctl__tpc_8c_a9550eb62bea63ad969be544b0e811c75}{01572}} \mbox{\hyperlink{ctl__tpc_8c_a9550eb62bea63ad969be544b0e811c75}{tpc\_error\_parse}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *io)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01573}01573 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01574}01574         \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856}{tpc\_error\_action}} error\_action = \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856af915e2e2e2bc39e8d3d3602dd07a7614}{TPC\_ERR\_RETRY}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01575}01575 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01576}01576         \textcolor{keywordflow}{switch} (io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a13c2b01a28e2b77943df44e29fdafa84}{io\_type}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01577}01577         \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__io_8h_a22fa76f752966a2de46c63789fe342ffa158348f547d85de1ed9736de925a2a6a}{CTL\_IO\_SCSI}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01578}01578                 \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__tpc_8c_source_l01579}01579                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491a382e750806810cb27d24bc9a0ff1ef86}{CTL\_SCSI\_ERROR}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01580}01580                         \textcolor{keywordflow}{switch} (io-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a48fadb6e18f4588e096a440fb37629b4}{scsi\_status}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01581}01581                         \textcolor{keywordflow}{case} \mbox{\hyperlink{scsi__all_8h_a21361c7d567b7cea810508e76f64efce}{SCSI\_STATUS\_CHECK\_COND}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01582}01582                                 error\_action = \mbox{\hyperlink{ctl__tpc_8c_a9298f88abeca677c69629d432a69329b}{tpc\_checkcond\_parse}}(io);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01583}01583                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01584}01584                         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01585}01585                                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01586}01586                         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01587}01587                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01588}01588                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01589}01589                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01590}01590                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01591}01591                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01592}01592         \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__io_8h_a22fa76f752966a2de46c63789fe342ffa44d57f3be59d7198f57d532b2993c92d}{CTL\_IO\_TASK}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01593}01593                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01594}01594         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01595}01595                 panic(\textcolor{stringliteral}{"{}\%s: invalid ctl\_io type \%d\(\backslash\)n"{}}, \_\_func\_\_,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01596}01596                       io-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a13c2b01a28e2b77943df44e29fdafa84}{io\_type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01597}01597                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01598}01598         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01599}01599         \textcolor{keywordflow}{return} (error\_action);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01600}01600 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01601}01601 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01602}01602 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01603}\mbox{\hyperlink{ctl__tpc_8c_a22ca8877724403dd354370ad7988823b}{01603}} \mbox{\hyperlink{ctl__tpc_8c_a22ca8877724403dd354370ad7988823b}{tpc\_done}}(\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *io)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01604}01604 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01605}01605         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__io}{tpc\_io}} *tio, *tior;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01606}01606 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01607}01607         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01608}01608 \textcolor{comment}{         * Very minimal retry logic.  We basically retry if we got an error}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01609}01609 \textcolor{comment}{         * back, and the retry count is greater than 0.  If we ever want}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01610}01610 \textcolor{comment}{         * more sophisticated initiator type behavior, the CAM error}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01611}01611 \textcolor{comment}{         * recovery code in ../common might be helpful.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01612}01612 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01613}01613         tio = \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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__tpc_8c_source_l01614}01614         \textcolor{keywordflow}{if} (((\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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__tpc_8c_source_l01615}01615          \&\& (\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}} > 0)) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01616}01616                 \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491}{ctl\_io\_status}} old\_status;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01617}01617                 \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856}{tpc\_error\_action}} error\_action;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01618}01618 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01619}01619                 error\_action = \mbox{\hyperlink{ctl__tpc_8c_a9550eb62bea63ad969be544b0e811c75}{tpc\_error\_parse}}(\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01620}01620                 \textcolor{keywordflow}{switch} (error\_action \& \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856aa4e30350748007fe284696836df24d75}{TPC\_ERR\_MASK}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01621}01621                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a3af04baa26431190b8ad8eb5f80ca095}{TPC\_ERR\_FAIL}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01622}01622                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01623}01623                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856af915e2e2e2bc39e8d3d3602dd07a7614}{TPC\_ERR\_RETRY}}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01624}01624                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01625}01625                         \textcolor{keywordflow}{if} ((error\_action \& \mbox{\hyperlink{ctl__tpc_8c_a6983811b68b67769058834f168e14856a0d8fbf398d36bc703424c89639a30547}{TPC\_ERR\_NO\_DECREMENT}}) == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01626}01626                                 \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a287ef644cce721ce87e0300fae5e7d55}{retries}}-\/-\/;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01627}01627                         old\_status = \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a29f384f2742b9ff6a465ba3280608cf8}{status}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01628}01628                         \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a29f384f2742b9ff6a465ba3280608cf8}{status}} = \mbox{\hyperlink{ctl__io_8h_a8731491c7adfc6d6ee9b3d9306d2d491af309eead4699cd9155a02e024101ff4e}{CTL\_STATUS\_NONE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01629}01629                         \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \&= \string~CTL\_FLAG\_ABORT;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01630}01630                         \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \&= \string~CTL\_FLAG\_SENT\_2OTHER\_SC;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01631}01631                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8h_af05b8159038446b108fa61d221b9de56}{tpcl\_queue}}(\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}, tio-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}}) != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01632}01632                                 printf(\textcolor{stringliteral}{"{}\%s: error returned from tpcl\_queue()!\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01633}01633                                        \_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01634}01634                                 \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_addee83a31e90fca499cdc29f6901836a}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a29f384f2742b9ff6a465ba3280608cf8}{status}} = old\_status;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01635}01635                         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01636}01636                                 \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01637}01637                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01638}01638         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01639}01639 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01640}01640         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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__tpc_8c_source_l01641}01641                 tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01642}01642                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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__tpc_8c_source_l01643}01643                     (\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{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_a8731491c7adfc6d6ee9b3d9306d2d491a382e750806810cb27d24bc9a0ff1ef86}{CTL\_SCSI\_ERROR}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01644}01644                         tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>fwd\_scsi\_status = \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a48fadb6e18f4588e096a440fb37629b4}{scsi\_status}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01645}01645                         tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>fwd\_sense\_data = \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_a292cf32dbfbad8a3848044cea599971e}{sense\_data}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01646}01646                         tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>fwd\_sense\_len = \mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}-\/>\mbox{\hyperlink{unionctl__io_ac4b5d99dfde9e6a8a06fab498907edd9}{scsiio}}.\mbox{\hyperlink{structctl__scsiio_ae3738b1fb5c045b852ec268967572868}{sense\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01647}01647                         tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>fwd\_target = tio-\/>\mbox{\hyperlink{structtpc__io_a7ee9710e0d1672d66d7f157ab29c42fc}{target}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01648}01648                         tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>fwd\_cscd = tio-\/>\mbox{\hyperlink{structtpc__io_a264a8c04a78b233d829a87ad85bb919e}{cscd}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01649}01649                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01650}01650         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01651}01651                 atomic\_add\_int(\&tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_afff202a7b9843f4866fd6ae53f0fc4dd}{curops}}, 1);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01652}01652         \textcolor{keywordflow}{if} (!tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}} \&\& !tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01653}01653                 \textcolor{keywordflow}{while} ((tior = TAILQ\_FIRST(\&tio-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}})) != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01654}01654                         TAILQ\_REMOVE(\&tio-\/>\mbox{\hyperlink{structtpc__io_ac7b54498e68540e9dac84a7cecf17b1b}{run}}, tior, rlinks);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01655}01655                         atomic\_add\_int(\&tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}}, 1);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01656}01656                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8h_af05b8159038446b108fa61d221b9de56}{tpcl\_queue}}(tior-\/>\mbox{\hyperlink{structtpc__io_a889dab7313b3959e6388315d167ece83}{io}}, tior-\/>\mbox{\hyperlink{structtpc__io_a6cadca1a75a54787fce8f6eeaab8cf1c}{lun}}) != \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01657}01657                                 panic(\textcolor{stringliteral}{"{}tpcl\_queue() error"{}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01658}01658                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01659}01659         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01660}01660         \textcolor{keywordflow}{if} (atomic\_fetchadd\_int(\&tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}}-\/>\mbox{\hyperlink{structtpc__list_a7e9cfd9ea8f3af677d95d47a9e0b6503}{tbdio}}, -\/1) == 1)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01661}01661                 \mbox{\hyperlink{ctl__tpc_8c_a89568b4615988b107504189a16cf1bc1}{tpc\_process}}(tio-\/>\mbox{\hyperlink{structtpc__io_af8b784ed48bd98d854b71fb7c052b500}{list}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01662}01662 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01663}01663 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01664}01664 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01665}\mbox{\hyperlink{ctl__private_8h_a7a1e8283ced9702de62cac146d2efb9e}{01665}} \mbox{\hyperlink{ctl__tpc_8c_a7a1e8283ced9702de62cac146d2efb9e}{ctl\_extended\_copy\_lid1}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01666}01666 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01667}01667         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01668}01668         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__extended__copy}{scsi\_extended\_copy}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01669}01669         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__extended__copy__lid1__data}{scsi\_extended\_copy\_lid1\_data}} *\mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01670}01670         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}} *cscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01671}01671         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}} *seg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01672}01672         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list, *tlist;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01673}01673         uint8\_t *ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01674}01674         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01675}01675         \textcolor{keywordtype}{int} len, off, lencscd, lenseg, \mbox{\hyperlink{structtpc__list_ab6b9e3316ca4ee4445a7d47c9813cadd}{leninl}}, \mbox{\hyperlink{structtpc__list_af89be68b92a7a04d1043a389527a8d82}{nseg}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01676}01676 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01677}01677         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_extended\_copy\_lid1\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01678}01678 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01679}01679         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__extended__copy}{scsi\_extended\_copy}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01680}01680         len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__extended__copy_ac137066135cf095f02c478018f5b4eb1}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01681}01681 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01682}01682         \textcolor{keywordflow}{if} (len == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01683}01683                 \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01684}01684                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01685}01685         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01686}01686         \textcolor{keywordflow}{if} (len < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__extended__copy__lid1__data}{scsi\_extended\_copy\_lid1\_data}}) ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01687}01687             len > \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__extended__copy__lid1__data}{scsi\_extended\_copy\_lid1\_data}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01688}01688             \mbox{\hyperlink{ctl__tpc_8c_a2bf7170b0cf227f73b2f0ef67ed9161e}{TPC\_MAX\_LIST}} + \mbox{\hyperlink{ctl__tpc_8c_a6dc841c33a18100fd2bbb41e6bbe9e70}{TPC\_MAX\_INLINE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01689}01689                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01690}01690                     \textcolor{comment}{/*field*/} 9, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01691}01691                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01692}01692         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01693}01693 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01694}01694         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01695}01695 \textcolor{comment}{         * If we've got a kernel request that hasn't been malloced yet,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01696}01696 \textcolor{comment}{         * malloc it and tell the caller the data buffer is here.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01697}01697 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01698}01698         \textcolor{keywordflow}{if} ((ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01699}01699                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(len, M\_CTL, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01700}01700                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01701}01701                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01702}01702                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01703}01703                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01704}01704                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01705}01705                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01706}01706                 \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01707}01707 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01708}01708                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01709}01709         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01710}01710 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01711}01711         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__extended__copy__lid1__data}{scsi\_extended\_copy\_lid1\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01712}01712         lencscd = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(\mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}-\/>cscd\_list\_length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01713}01713         lenseg = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(\mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}-\/>segment\_list\_length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01714}01714         leninl = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(\mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}-\/>inline\_data\_length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01715}01715         \textcolor{keywordflow}{if} (lencscd > \mbox{\hyperlink{ctl__tpc_8c_a9ea1f3d057229996e34fb3f664fd793f}{TPC\_MAX\_CSCDS}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01716}01716                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01717}01717                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01718}01718                     \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x06, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01719}01719                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01720}01720         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01721}01721         \textcolor{keywordflow}{if} (lenseg > \mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01722}01722                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01723}01723                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01724}01724                     \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x08, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01725}01725                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01726}01726         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01727}01727         \textcolor{keywordflow}{if} (lencscd + lenseg > \mbox{\hyperlink{ctl__tpc_8c_a2bf7170b0cf227f73b2f0ef67ed9161e}{TPC\_MAX\_LIST}} ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01728}01728             leninl > \mbox{\hyperlink{ctl__tpc_8c_a6dc841c33a18100fd2bbb41e6bbe9e70}{TPC\_MAX\_INLINE}} ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01729}01729             len < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__extended__copy__lid1__data}{scsi\_extended\_copy\_lid1\_data}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01730}01730              lencscd + lenseg + leninl) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01731}01731                 \mbox{\hyperlink{ctl__error_8c_aa1ff809b2bcccd87c4e926f8146b3784}{ctl\_set\_param\_len\_error}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01732}01732                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01733}01733         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01734}01734 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01735}01735         list = malloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}}), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01736}01736         list-\/>\mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{service\_action}} = cdb-\/>\mbox{\hyperlink{structscsi__extended__copy_af31befd020283ce9aa6a33a32fe8eb96}{service\_action}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01737}01737         value = dnvlist\_get\_string(lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_acb8b57aa5da81298dc6834a40f7f3c31}{options}}, \textcolor{stringliteral}{"{}insecure\_tpc"{}}, NULL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01738}01738         \textcolor{keywordflow}{if} (value != NULL \&\& strcmp(value, \textcolor{stringliteral}{"{}on"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01739}01739                 list-\/>\mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{init\_port}} = -\/1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01740}01740         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01741}01741                 list-\/>\mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{init\_port}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adb614f1edadf984459502e6c49cebfce}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01742}01742         list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}} = \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01743}01743         list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}} = \mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}-\/>list\_identifier;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01744}01744         list-\/>\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}} = \mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}-\/>flags;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01745}01745         list-\/>\mbox{\hyperlink{structtpc__list_a6f329d9ed25bb63405b24dd086568e49}{params}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01746}01746         list-\/>\mbox{\hyperlink{structtpc__list_a58b7f402e52b2d491b1168fe7fe165ef}{cscd}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}} *)\&data-\/>\mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}[0];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01747}01747         ptr = \&data-\/>\mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}[0];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01748}01748         for (off = 0; off < lencscd; off += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01749}01749                 cscd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}} *)(ptr + off);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01750}01750                 \textcolor{keywordflow}{if} (cscd-\/>\mbox{\hyperlink{structscsi__ec__cscd_a103a35936c0488abacecad422304cced}{type\_code}} != \mbox{\hyperlink{scsi__all_8h_a662e24546f4522c2f0d97bba5282252a}{EC\_CSCD\_ID}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01751}01751                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01752}01752                         \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01753}01753                             \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01754}01754                             \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x07, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01755}01755                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01756}01756                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01757}01757         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01758}01758         ptr = \&data-\/>\mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}[lencscd];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01759}01759         \textcolor{keywordflow}{for} (nseg = 0, off = 0; off < lenseg; nseg++) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01760}01760                 \textcolor{keywordflow}{if} (nseg >= \mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01761}01761                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01762}01762                         \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01763}01763                             \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01764}01764                             \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x08, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01765}01765                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01766}01766                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01767}01767                 seg = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}} *)(ptr + off);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01768}01768                 \textcolor{keywordflow}{if} (seg-\/>\mbox{\hyperlink{structscsi__ec__segment_af3d3546ae07f2b74b49599768d08391a}{type\_code}} != \mbox{\hyperlink{scsi__all_8h_a2d7a7a0fccf0a4a50cc8d6f99aa38ad1}{EC\_SEG\_B2B}} \&\&}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01769}01769                     seg-\/>\mbox{\hyperlink{structscsi__ec__segment_af3d3546ae07f2b74b49599768d08391a}{type\_code}} != \mbox{\hyperlink{scsi__all_8h_ab5507f14011dac15971247e31fed293b}{EC\_SEG\_VERIFY}} \&\&}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01770}01770                     seg-\/>\mbox{\hyperlink{structscsi__ec__segment_af3d3546ae07f2b74b49599768d08391a}{type\_code}} != \mbox{\hyperlink{scsi__all_8h_ac8981f9a8fb08f70b107f527fbe4a65d}{EC\_SEG\_REGISTER\_KEY}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01771}01771                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01772}01772                         \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01773}01773                             \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01774}01774                             \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x09, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01775}01775                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01776}01776                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01777}01777                 list-\/>\mbox{\hyperlink{structtpc__list_ac4854f8f5f7af43bccca3059202b0cb1}{seg}}[nseg] = seg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01778}01778                 off += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01779}01779                     \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment_a71c9e9f2dd05c01ea0d481b5a17a7189}{descr\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01780}01780         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01781}01781         list-\/>\mbox{\hyperlink{structtpc__list_a46becf05fb7374dc71a5552c8114e7c3}{inl}} = \&data-\/>\mbox{\hyperlink{structscsi__extended__copy__lid1__data_a2c9e47471b5f734ff4f1f51e45d77732}{data}}[lencscd + lenseg];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01782}01782         list-\/>\mbox{\hyperlink{structtpc__list_aa951f3601acd3cb18d28fdbe2a63044d}{ncscd}} = lencscd / \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01783}01783         list-\/>\mbox{\hyperlink{structtpc__list_af89be68b92a7a04d1043a389527a8d82}{nseg}} = nseg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01784}01784         list-\/>\mbox{\hyperlink{structtpc__list_ab6b9e3316ca4ee4445a7d47c9813cadd}{leninl}} = leninl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01785}01785         list-\/>ctsio = ctsio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01786}01786         list-\/>lun = lun;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01787}01787         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01788}01788         \textcolor{keywordflow}{if} ((list-\/>\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}} \& \mbox{\hyperlink{scsi__all_8h_a024a751d2794b592c7d9fbd0cacc9ef1}{EC\_LIST\_ID\_USAGE\_MASK}}) != \mbox{\hyperlink{scsi__all_8h_a553ae7f7cda9f655311e26f9bfad4897}{EC\_LIST\_ID\_USAGE\_NONE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01789}01789                 tlist = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}}, list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01790}01790                 \textcolor{keywordflow}{if} (tlist != NULL \&\& !tlist-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01791}01791                         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01792}01792                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01793}01793                         \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01794}01794                             \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01795}01795                             \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01796}01796                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01797}01797                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01798}01798                 \textcolor{keywordflow}{if} (tlist != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01799}01799                         TAILQ\_REMOVE(\&lun-\/>tpc\_lists, tlist, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01800}01800                         free(tlist, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01801}01801                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01802}01802         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01803}01803         TAILQ\_INSERT\_TAIL(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01804}01804         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01805}01805 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01806}01806         \mbox{\hyperlink{ctl__tpc_8c_a89568b4615988b107504189a16cf1bc1}{tpc\_process}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01807}01807         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01808}01808 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01809}01809 done:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01810}01810         \textcolor{keywordflow}{if} (ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01811}01811                 free(ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01812}01812                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \&= \string~CTL\_FLAG\_ALLOCATED;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01813}01813         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01814}01814         \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01815}01815         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01816}01816 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01817}01817 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01818}01818 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01819}\mbox{\hyperlink{ctl__private_8h_ad8f924efcd820d5df036f5aaf22c7314}{01819}} \mbox{\hyperlink{ctl__tpc_8c_ad8f924efcd820d5df036f5aaf22c7314}{ctl\_extended\_copy\_lid4}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01820}01820 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01821}01821         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01822}01822         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__extended__copy}{scsi\_extended\_copy}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01823}01823         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__extended__copy__lid4__data}{scsi\_extended\_copy\_lid4\_data}} *\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01824}01824         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}} *cscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01825}01825         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}} *seg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01826}01826         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list, *tlist;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01827}01827         uint8\_t *ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01828}01828         \textcolor{keyword}{const} \textcolor{keywordtype}{char} *value;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01829}01829         \textcolor{keywordtype}{int} len, off, lencscd, lenseg, \mbox{\hyperlink{structtpc__list_ab6b9e3316ca4ee4445a7d47c9813cadd}{leninl}}, \mbox{\hyperlink{structtpc__list_af89be68b92a7a04d1043a389527a8d82}{nseg}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01830}01830 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01831}01831         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_extended\_copy\_lid4\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01832}01832 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01833}01833         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__extended__copy}{scsi\_extended\_copy}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01834}01834         len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__extended__copy_ac137066135cf095f02c478018f5b4eb1}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01835}01835 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01836}01836         \textcolor{keywordflow}{if} (len == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01837}01837                 \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01838}01838                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01839}01839         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01840}01840         \textcolor{keywordflow}{if} (len < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__extended__copy__lid4__data}{scsi\_extended\_copy\_lid4\_data}}) ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01841}01841             len > \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__extended__copy__lid4__data}{scsi\_extended\_copy\_lid4\_data}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01842}01842             \mbox{\hyperlink{ctl__tpc_8c_a2bf7170b0cf227f73b2f0ef67ed9161e}{TPC\_MAX\_LIST}} + \mbox{\hyperlink{ctl__tpc_8c_a6dc841c33a18100fd2bbb41e6bbe9e70}{TPC\_MAX\_INLINE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01843}01843                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01844}01844                     \textcolor{comment}{/*field*/} 9, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01845}01845                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01846}01846         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01847}01847 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01848}01848         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01849}01849 \textcolor{comment}{         * If we've got a kernel request that hasn't been malloced yet,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01850}01850 \textcolor{comment}{         * malloc it and tell the caller the data buffer is here.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01851}01851 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01852}01852         \textcolor{keywordflow}{if} ((ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01853}01853                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(len, M\_CTL, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01854}01854                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01855}01855                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01856}01856                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01857}01857                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01858}01858                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01859}01859                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01860}01860                 \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01861}01861 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01862}01862                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01863}01863         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01864}01864 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01865}01865         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__extended__copy__lid4__data}{scsi\_extended\_copy\_lid4\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01866}01866         lencscd = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}-\/>cscd\_list\_length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01867}01867         lenseg = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}-\/>segment\_list\_length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01868}01868         leninl = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}-\/>inline\_data\_length);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01869}01869         \textcolor{keywordflow}{if} (lencscd > \mbox{\hyperlink{ctl__tpc_8c_a9ea1f3d057229996e34fb3f664fd793f}{TPC\_MAX\_CSCDS}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01870}01870                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01871}01871                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01872}01872                     \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x06, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01873}01873                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01874}01874         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01875}01875         \textcolor{keywordflow}{if} (lenseg > \mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01876}01876                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01877}01877                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01878}01878                     \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x08, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01879}01879                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01880}01880         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01881}01881         \textcolor{keywordflow}{if} (lencscd + lenseg > \mbox{\hyperlink{ctl__tpc_8c_a2bf7170b0cf227f73b2f0ef67ed9161e}{TPC\_MAX\_LIST}} ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01882}01882             leninl > \mbox{\hyperlink{ctl__tpc_8c_a6dc841c33a18100fd2bbb41e6bbe9e70}{TPC\_MAX\_INLINE}} ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01883}01883             len < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__extended__copy__lid1__data}{scsi\_extended\_copy\_lid1\_data}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01884}01884              lencscd + lenseg + leninl) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01885}01885                 \mbox{\hyperlink{ctl__error_8c_aa1ff809b2bcccd87c4e926f8146b3784}{ctl\_set\_param\_len\_error}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01886}01886                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01887}01887         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01888}01888 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01889}01889         list = malloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}}), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01890}01890         list-\/>\mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{service\_action}} = cdb-\/>\mbox{\hyperlink{structscsi__extended__copy_af31befd020283ce9aa6a33a32fe8eb96}{service\_action}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01891}01891         value = dnvlist\_get\_string(lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_acb8b57aa5da81298dc6834a40f7f3c31}{options}}, \textcolor{stringliteral}{"{}insecure\_tpc"{}}, NULL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01892}01892         \textcolor{keywordflow}{if} (value != NULL \&\& strcmp(value, \textcolor{stringliteral}{"{}on"{}}) == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01893}01893                 list-\/>\mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{init\_port}} = -\/1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01894}01894         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01895}01895                 list-\/>\mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{init\_port}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adb614f1edadf984459502e6c49cebfce}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01896}01896         list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}} = \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01897}01897         list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}} = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}-\/>list\_identifier);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01898}01898         list-\/>\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}} = \mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}-\/>flags;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01899}01899         list-\/>\mbox{\hyperlink{structtpc__list_a6f329d9ed25bb63405b24dd086568e49}{params}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01900}01900         list-\/>\mbox{\hyperlink{structtpc__list_a58b7f402e52b2d491b1168fe7fe165ef}{cscd}} = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}} *)\&data-\/>\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}[0];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01901}01901         ptr = \&data-\/>\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}[0];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01902}01902         for (off = 0; off < lencscd; off += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01903}01903                 cscd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}} *)(ptr + off);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01904}01904                 \textcolor{keywordflow}{if} (cscd-\/>\mbox{\hyperlink{structscsi__ec__cscd_a103a35936c0488abacecad422304cced}{type\_code}} != \mbox{\hyperlink{scsi__all_8h_a662e24546f4522c2f0d97bba5282252a}{EC\_CSCD\_ID}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01905}01905                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01906}01906                         \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01907}01907                             \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01908}01908                             \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x07, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01909}01909                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01910}01910                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01911}01911         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01912}01912         ptr = \&data-\/>\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}[lencscd];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01913}01913         \textcolor{keywordflow}{for} (nseg = 0, off = 0; off < lenseg; nseg++) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01914}01914                 \textcolor{keywordflow}{if} (nseg >= \mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01915}01915                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01916}01916                         \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01917}01917                             \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01918}01918                             \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x08, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01919}01919                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01920}01920                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01921}01921                 seg = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}} *)(ptr + off);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01922}01922                 \textcolor{keywordflow}{if} (seg-\/>\mbox{\hyperlink{structscsi__ec__segment_af3d3546ae07f2b74b49599768d08391a}{type\_code}} != \mbox{\hyperlink{scsi__all_8h_a2d7a7a0fccf0a4a50cc8d6f99aa38ad1}{EC\_SEG\_B2B}} \&\&}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01923}01923                     seg-\/>\mbox{\hyperlink{structscsi__ec__segment_af3d3546ae07f2b74b49599768d08391a}{type\_code}} != \mbox{\hyperlink{scsi__all_8h_ab5507f14011dac15971247e31fed293b}{EC\_SEG\_VERIFY}} \&\&}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01924}01924                     seg-\/>\mbox{\hyperlink{structscsi__ec__segment_af3d3546ae07f2b74b49599768d08391a}{type\_code}} != \mbox{\hyperlink{scsi__all_8h_ac8981f9a8fb08f70b107f527fbe4a65d}{EC\_SEG\_REGISTER\_KEY}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01925}01925                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01926}01926                         \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01927}01927                             \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01928}01928                             \textcolor{comment}{/*asc*/} 0x26, \textcolor{comment}{/*ascq*/} 0x09, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01929}01929                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01930}01930                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01931}01931                 list-\/>\mbox{\hyperlink{structtpc__list_ac4854f8f5f7af43bccca3059202b0cb1}{seg}}[nseg] = seg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01932}01932                 off += \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__segment}{scsi\_ec\_segment}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01933}01933                     \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(seg-\/>\mbox{\hyperlink{structscsi__ec__segment_a71c9e9f2dd05c01ea0d481b5a17a7189}{descr\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01934}01934         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01935}01935         list-\/>\mbox{\hyperlink{structtpc__list_a46becf05fb7374dc71a5552c8114e7c3}{inl}} = \&data-\/>\mbox{\hyperlink{structscsi__extended__copy__lid4__data_a716ace82cf7e0082bc68e4712f91d783}{data}}[lencscd + lenseg];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01936}01936         list-\/>\mbox{\hyperlink{structtpc__list_aa951f3601acd3cb18d28fdbe2a63044d}{ncscd}} = lencscd / \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd}{scsi\_ec\_cscd}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01937}01937         list-\/>\mbox{\hyperlink{structtpc__list_af89be68b92a7a04d1043a389527a8d82}{nseg}} = nseg;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01938}01938         list-\/>\mbox{\hyperlink{structtpc__list_ab6b9e3316ca4ee4445a7d47c9813cadd}{leninl}} = leninl;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01939}01939         list-\/>ctsio = ctsio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01940}01940         list-\/>lun = lun;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01941}01941         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01942}01942         \textcolor{keywordflow}{if} ((list-\/>\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}} \& \mbox{\hyperlink{scsi__all_8h_a024a751d2794b592c7d9fbd0cacc9ef1}{EC\_LIST\_ID\_USAGE\_MASK}}) != \mbox{\hyperlink{scsi__all_8h_a553ae7f7cda9f655311e26f9bfad4897}{EC\_LIST\_ID\_USAGE\_NONE}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01943}01943                 tlist = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}}, list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01944}01944                 \textcolor{keywordflow}{if} (tlist != NULL \&\& !tlist-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01945}01945                         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01946}01946                         free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01947}01947                         \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01948}01948                             \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01949}01949                             \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01950}01950                         \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01951}01951                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01952}01952                 \textcolor{keywordflow}{if} (tlist != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01953}01953                         TAILQ\_REMOVE(\&lun-\/>tpc\_lists, tlist, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01954}01954                         free(tlist, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01955}01955                 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01956}01956         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01957}01957         TAILQ\_INSERT\_TAIL(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01958}01958         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01959}01959 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01960}01960         \mbox{\hyperlink{ctl__tpc_8c_a89568b4615988b107504189a16cf1bc1}{tpc\_process}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01961}01961         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01962}01962 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01963}01963 done:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01964}01964         \textcolor{keywordflow}{if} (ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01965}01965                 free(ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01966}01966                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \&= \string~CTL\_FLAG\_ALLOCATED;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01967}01967         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01968}01968         \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01969}01969         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01970}01970 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01971}01971 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01972}01972 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01973}\mbox{\hyperlink{ctl__tpc_8c_a8c9ea6b5556d2f0cb15cb4c8c2abaa57}{01973}} \mbox{\hyperlink{ctl__tpc_8c_a8c9ea6b5556d2f0cb15cb4c8c2abaa57}{tpc\_create\_token}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__lun}{ctl\_lun}} *lun, \textcolor{keyword}{struct} \mbox{\hyperlink{structctl__port}{ctl\_port}} *port, off\_t len,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01974}01974     \textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__token}{scsi\_token}} *token)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01975}01975 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01976}01976         \textcolor{keyword}{static} \textcolor{keywordtype}{int} \textcolor{keywordtype}{id} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01977}01977         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__vpd__id__descriptor}{scsi\_vpd\_id\_descriptor}} *idd = NULL;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01978}01978         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd__id}{scsi\_ec\_cscd\_id}} *cscd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01979}01979         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__read__capacity__data__long}{scsi\_read\_capacity\_data\_long}} *dtsd;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01980}01980         \textcolor{keywordtype}{int} targid\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01981}01981 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01982}01982         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\mbox{\hyperlink{scsi__all_8h_ac4342e340aa8e708738e7ee708db72fa}{ROD\_TYPE\_AUR}}, token-\/>\mbox{\hyperlink{structscsi__token_a3dfdc7fd9018aa867cf68d049545f20c}{type}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01983}01983         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(0x01f8, token-\/>\mbox{\hyperlink{structscsi__token_a963d2d6a1371a0371936e89ddd7ab48f}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01984}01984         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(atomic\_fetchadd\_int(\&\textcolor{keywordtype}{id}, 1), \&token-\/>\mbox{\hyperlink{structscsi__token_a542785249fa6487d8698b2536a9c3e52}{body}}[0]);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01985}01985         \textcolor{keywordflow}{if} (lun-\/>\mbox{\hyperlink{structctl__lun_a4ff7737176fc31a3964cbc2e05326417}{lun\_devid}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01986}01986                 idd = \mbox{\hyperlink{scsi__all_8c_a57a07957245b346fd3e0325980ed2e2e}{scsi\_get\_devid\_desc}}((\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__vpd__id__descriptor}{scsi\_vpd\_id\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01987}01987                     lun-\/>\mbox{\hyperlink{structctl__lun_a4ff7737176fc31a3964cbc2e05326417}{lun\_devid}}-\/>\mbox{\hyperlink{structctl__devid_ae64ecc17e58af368d237b205317ec2a3}{data}}, lun-\/>\mbox{\hyperlink{structctl__lun_a4ff7737176fc31a3964cbc2e05326417}{lun\_devid}}-\/>\mbox{\hyperlink{structctl__devid_afaa97ba52aab001e35a3ec862d159bae}{len}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01988}01988                     \mbox{\hyperlink{scsi__all_8c_a4107b7b6984883275efb6aa5dd83707e}{scsi\_devid\_is\_lun\_naa}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01989}01989         \textcolor{keywordflow}{if} (idd == NULL \&\& lun-\/>\mbox{\hyperlink{structctl__lun_a4ff7737176fc31a3964cbc2e05326417}{lun\_devid}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01990}01990                 idd = \mbox{\hyperlink{scsi__all_8c_a57a07957245b346fd3e0325980ed2e2e}{scsi\_get\_devid\_desc}}((\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__vpd__id__descriptor}{scsi\_vpd\_id\_descriptor}} *)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01991}01991                     lun-\/>\mbox{\hyperlink{structctl__lun_a4ff7737176fc31a3964cbc2e05326417}{lun\_devid}}-\/>\mbox{\hyperlink{structctl__devid_ae64ecc17e58af368d237b205317ec2a3}{data}}, lun-\/>\mbox{\hyperlink{structctl__lun_a4ff7737176fc31a3964cbc2e05326417}{lun\_devid}}-\/>\mbox{\hyperlink{structctl__devid_afaa97ba52aab001e35a3ec862d159bae}{len}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01992}01992                     \mbox{\hyperlink{scsi__all_8c_a0d78a346a4ab75996633d1e4e42bec85}{scsi\_devid\_is\_lun\_eui64}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01993}01993         \textcolor{keywordflow}{if} (idd != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01994}01994                 cscd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__ec__cscd__id}{scsi\_ec\_cscd\_id}} *)\&token-\/>\mbox{\hyperlink{structscsi__token_a542785249fa6487d8698b2536a9c3e52}{body}}[8];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01995}01995                 cscd-\/>\mbox{\hyperlink{structscsi__ec__cscd__id_af3f4ffff0c68783ff348d3504542c692}{type\_code}} = \mbox{\hyperlink{scsi__all_8h_a662e24546f4522c2f0d97bba5282252a}{EC\_CSCD\_ID}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01996}01996                 cscd-\/>\mbox{\hyperlink{structscsi__ec__cscd__id_a9d73f9d7bffde253599f229e96f1c5f5}{luidt\_pdt}} = \mbox{\hyperlink{scsi__all_8h_a5245a6853095fb224e6183bfcbf948cb}{T\_DIRECT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01997}01997                 memcpy(\&cscd-\/>\mbox{\hyperlink{structscsi__ec__cscd__id_ad6b30c71ec34aec962e035eb8a1d9001}{codeset}}, idd, 4 + idd-\/>\mbox{\hyperlink{structscsi__vpd__id__descriptor_a4c37fb0b3c2a33d82d7bc024b514fccd}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01998}01998                 \mbox{\hyperlink{scsi__all_8h_ad744ce4fe5b776d796fca7338f45d1a6}{scsi\_ulto3b}}(lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_a269da1e2135fb187c0bd6b5a784794de}{blocksize}}, cscd-\/>\mbox{\hyperlink{structscsi__ec__cscd__id_ac1f020f6b47613750dacc34fd602364e}{dtsp}}.\mbox{\hyperlink{structscsi__ec__cscd__dtsp_a3d28e718c8926c8598b3937a86a4650c}{block\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l01999}01999         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02000}02000         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(0, \&token-\/>\mbox{\hyperlink{structscsi__token_a542785249fa6487d8698b2536a9c3e52}{body}}[40]); \textcolor{comment}{/* XXX: Should be 128bit value. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02001}02001         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(len, \&token-\/>\mbox{\hyperlink{structscsi__token_a542785249fa6487d8698b2536a9c3e52}{body}}[48]);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02002}02002 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02003}02003         \textcolor{comment}{/* ROD token device type specific data (RC16 without first field) */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02004}02004         dtsd = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__read__capacity__data__long}{scsi\_read\_capacity\_data\_long}} *)\&token-\/>\mbox{\hyperlink{structscsi__token_a542785249fa6487d8698b2536a9c3e52}{body}}[88 -\/ 8];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02005}02005         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_a269da1e2135fb187c0bd6b5a784794de}{blocksize}}, dtsd-\/>\mbox{\hyperlink{structscsi__read__capacity__data__long_aa0c6c3ac9c51803abfa76d3075ea24d8}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02006}02006         dtsd-\/>\mbox{\hyperlink{structscsi__read__capacity__data__long_ad637f7f0276580a083e7dcee92396e15}{prot\_lbppbe}} = lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_acc7a11c0e653d0236a4284a0d9e3818e}{pblockexp}} \& \mbox{\hyperlink{scsi__all_8h_a9513d9dd4dbb4788d0899c40f933ece7}{SRC16\_LBPPBE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02007}02007         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_af41856daead760a0482b7c3e5070f30f}{pblockoff}} \& \mbox{\hyperlink{scsi__all_8h_afa2d4cfb3d987942ce1c311a35ba7534}{SRC16\_LALBA\_A}}, dtsd-\/>\mbox{\hyperlink{structscsi__read__capacity__data__long_ae8dd691c6b20f2272acb8d1c1ab0873b}{lalba\_lbp}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02008}02008         \textcolor{keywordflow}{if} (lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_acb361b9ebbf37e349f5be69b22b163d9}{flags}} \& \mbox{\hyperlink{ctl__ioctl_8h_a9adc8a68053b24e14bae4ad4a43b44d9a710ce5f8b573fe252a14809db199a350}{CTL\_LUN\_FLAG\_UNMAP}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02009}02009                 dtsd-\/>\mbox{\hyperlink{structscsi__read__capacity__data__long_ae8dd691c6b20f2272acb8d1c1ab0873b}{lalba\_lbp}}[0] |= \mbox{\hyperlink{scsi__all_8h_a27114d0e958c7f534b6ca53692c9a0f2}{SRC16\_LBPME}} | \mbox{\hyperlink{scsi__all_8h_aab3cab2af52645e2a72a574ca3c5cbd2}{SRC16\_LBPRZ}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02010}02010 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02011}02011         \textcolor{keywordflow}{if} (port-\/>\mbox{\hyperlink{structctl__port_ab73f3a389cfa2af518b2debdf997cac4}{target\_devid}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02012}02012                 targid\_len = port-\/>\mbox{\hyperlink{structctl__port_ab73f3a389cfa2af518b2debdf997cac4}{target\_devid}}-\/>\mbox{\hyperlink{structctl__devid_afaa97ba52aab001e35a3ec862d159bae}{len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02013}02013                 memcpy(\&token-\/>\mbox{\hyperlink{structscsi__token_a542785249fa6487d8698b2536a9c3e52}{body}}[120], port-\/>\mbox{\hyperlink{structctl__port_ab73f3a389cfa2af518b2debdf997cac4}{target\_devid}}-\/>\mbox{\hyperlink{structctl__devid_ae64ecc17e58af368d237b205317ec2a3}{data}}, targid\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02014}02014         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02015}02015                 targid\_len = 32;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02016}02016         arc4rand(\&token-\/>\mbox{\hyperlink{structscsi__token_a542785249fa6487d8698b2536a9c3e52}{body}}[120 + targid\_len], 384 -\/ targid\_len, 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02017}02017 \};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02018}02018 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02019}02019 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02020}\mbox{\hyperlink{ctl__private_8h_ad82335d21cd84304da3ed95a425527c9}{02020}} \mbox{\hyperlink{ctl__tpc_8c_ad82335d21cd84304da3ed95a425527c9}{ctl\_populate\_token}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02021}02021 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02022}02022         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__softc}{ctl\_softc}} *softc = \mbox{\hyperlink{ctl__io_8h_ab8d16bff3ffc95ae3e5f0f318c432fc4}{CTL\_SOFTC}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02023}02023         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__port}{ctl\_port}} *port = \mbox{\hyperlink{ctl__io_8h_a4faa78fb59037bbfc2e334615bc7c6c7}{CTL\_PORT}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02024}02024         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02025}02025         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__populate__token}{scsi\_populate\_token}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02026}02026         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__populate__token__data}{scsi\_populate\_token\_data}} *data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02027}02027         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list, *tlist;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02028}02028         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__token}{tpc\_token}} *\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02029}02029         uint64\_t lba;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02030}02030         \textcolor{keywordtype}{int} len, lendata, lendesc;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02031}02031 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02032}02032         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_populate\_token\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02033}02033 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02034}02034         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__populate__token}{scsi\_populate\_token}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02035}02035         len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__populate__token_a50e887c08f2e51b48604f30c801f514d}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02036}02036 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02037}02037         \textcolor{keywordflow}{if} (len < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__populate__token__data}{scsi\_populate\_token\_data}}) ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02038}02038             len > \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__populate__token__data}{scsi\_populate\_token\_data}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02039}02039              \mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02040}02040                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02041}02041                     \textcolor{comment}{/*field*/} 9, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02042}02042                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02043}02043         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02044}02044 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02045}02045         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02046}02046 \textcolor{comment}{         * If we've got a kernel request that hasn't been malloced yet,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02047}02047 \textcolor{comment}{         * malloc it and tell the caller the data buffer is here.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02048}02048 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02049}02049         \textcolor{keywordflow}{if} ((ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02050}02050                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(len, M\_CTL, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02051}02051                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02052}02052                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02053}02053                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02054}02054                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02055}02055                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02056}02056                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02057}02057                 \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02058}02058 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02059}02059                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02060}02060         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02061}02061 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02062}02062         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__populate__token__data}{scsi\_populate\_token\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02063}02063         lendata = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__populate__token__data_ae4e059feef3599ec201bed64697a5b7f}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02064}02064         \textcolor{keywordflow}{if} (lendata < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__populate__token__data}{scsi\_populate\_token\_data}}) -\/ 2 +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02065}02065             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02066}02066                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02067}02067                     \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02068}02068                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02069}02069         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02070}02070         lendesc = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__populate__token__data_aaeb3124ddc1ed9803e8f2f368c458d98}{range\_descriptor\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02071}02071         \textcolor{keywordflow}{if} (lendesc < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}}) ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02072}02072             len < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__populate__token__data}{scsi\_populate\_token\_data}}) + lendesc ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02073}02073             lendata < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__populate__token__data}{scsi\_populate\_token\_data}}) -\/ 2 + lendesc) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02074}02074                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02075}02075                     \textcolor{comment}{/*field*/} 14, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02076}02076                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02077}02077         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02078}02078 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02079}02079 \textcolor{comment}{        printf("{}PT(list=\%u) flags=\%x to=\%d rt=\%x len=\%x\(\backslash\)n"{},}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02080}02080 \textcolor{comment}{            scsi\_4btoul(cdb-\/>list\_identifier),}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02081}02081 \textcolor{comment}{            data-\/>flags, scsi\_4btoul(data-\/>inactivity\_timeout),}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02082}02082 \textcolor{comment}{            scsi\_4btoul(data-\/>rod\_type),}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02083}02083 \textcolor{comment}{            scsi\_2btoul(data-\/>range\_descriptor\_length));}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02084}02084 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02085}02085 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02086}02086         \textcolor{comment}{/* Validate INACTIVITY TIMEOUT field */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02087}02087         \textcolor{keywordflow}{if} (\mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(data-\/>\mbox{\hyperlink{structscsi__populate__token__data_ae4d8b7aa85b0b7d6e9ef7f550675cfb8}{inactivity\_timeout}}) > \mbox{\hyperlink{ctl__tpc_8c_abd1ee8ca62d9cfe609baefccd289e561}{TPC\_MAX\_TOKEN\_TIMEOUT}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02088}02088                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02089}02089                     \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 4, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02090}02090                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02091}02091                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02092}02092         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02093}02093 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02094}02094         \textcolor{comment}{/* Validate ROD TYPE field */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02095}02095         \textcolor{keywordflow}{if} ((data-\/>\mbox{\hyperlink{structscsi__populate__token__data_a4635bbacb6d4724c139843482ec61ea5}{flags}} \& \mbox{\hyperlink{scsi__all_8h_a85aa770a76a1d214124d1450c5d81181}{EC\_PT\_RTV}}) \&\&}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02096}02096             \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(data-\/>\mbox{\hyperlink{structscsi__populate__token__data_aa1f505da55f6c1fc00f955fb545be9fb}{rod\_type}}) != \mbox{\hyperlink{scsi__all_8h_ac4342e340aa8e708738e7ee708db72fa}{ROD\_TYPE\_AUR}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02097}02097                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02098}02098                     \textcolor{comment}{/*field*/} 8, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02099}02099                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02100}02100         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02101}02101 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02102}02102         \textcolor{comment}{/* Validate list of ranges */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02103}02103         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8c_a341778570a9c27efa467e44769004a1c}{tpc\_check\_ranges\_l}}(\&data-\/>\mbox{\hyperlink{structscsi__populate__token__data_ac83a159584f66a67ea8300683decc2e4}{desc}}[0],}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02104}02104             \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__populate__token__data_aaeb3124ddc1ed9803e8f2f368c458d98}{range\_descriptor\_length}}) /}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02105}02105             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}}),}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02106}02106             lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_aa8d3a6eb9ac5466965712528e17617f7}{maxlba}}, \&lba) != 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02107}02107                 \mbox{\hyperlink{ctl__error_8c_ac6dd12443811a793003660787c4d4ecf}{ctl\_set\_lba\_out\_of\_range}}(ctsio, lba);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02108}02108                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02109}02109         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02110}02110         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8c_aa5191738be14def15d7ef769c3395b7a}{tpc\_check\_ranges\_x}}(\&data-\/>\mbox{\hyperlink{structscsi__populate__token__data_ac83a159584f66a67ea8300683decc2e4}{desc}}[0],}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02111}02111             \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__populate__token__data_aaeb3124ddc1ed9803e8f2f368c458d98}{range\_descriptor\_length}}) /}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02112}02112             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}})) != 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02113}02113                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02114}02114                     \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02115}02115                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02116}02116                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02117}02117         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02118}02118 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02119}02119         list = malloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}}), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02120}02120         list-\/>\mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{service\_action}} = cdb-\/>\mbox{\hyperlink{structscsi__populate__token_ae7e1280ba4c8985228aae0329bcacb6f}{service\_action}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02121}02121         list-\/>\mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{init\_port}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adb614f1edadf984459502e6c49cebfce}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02122}02122         list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}} = \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02123}02123         list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}} = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__populate__token_a33e17349d8925b290ce287b8fed33fd9}{list\_identifier}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02124}02124         list-\/>\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}} = data-\/>\mbox{\hyperlink{structscsi__populate__token__data_a4635bbacb6d4724c139843482ec61ea5}{flags}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02125}02125         list-\/>ctsio = ctsio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02126}02126         list-\/>lun = lun;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02127}02127         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02128}02128         tlist = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}}, list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02129}02129         \textcolor{keywordflow}{if} (tlist != NULL \&\& !tlist-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02130}02130                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02131}02131                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02132}02132                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02133}02133                     \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02134}02134                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02135}02135                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02136}02136         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02137}02137         \textcolor{keywordflow}{if} (tlist != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02138}02138                 TAILQ\_REMOVE(\&lun-\/>tpc\_lists, tlist, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02139}02139                 free(tlist, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02140}02140         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02141}02141         TAILQ\_INSERT\_TAIL(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02142}02142         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02143}02143 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02144}02144         token = malloc(\textcolor{keyword}{sizeof}(*token), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02145}02145         token-\/>\mbox{\hyperlink{structtpc__token_a90cfe03a53d304a618ad753b9ebe20e2}{lun}} = lun-\/>\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02146}02146         token-\/>\mbox{\hyperlink{structtpc__token_acf57a0941c237eac9513485aa16a2db4}{blocksize}} = lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_a269da1e2135fb187c0bd6b5a784794de}{blocksize}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02147}02147         token-\/>\mbox{\hyperlink{structtpc__token_aa65199e596f2e37caa4f22a78f3f7dc1}{params}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02148}02148         token-\/>\mbox{\hyperlink{structtpc__token_a2bf143d9f71841c021c277744b01d216}{range}} = \&data-\/>\mbox{\hyperlink{structscsi__populate__token__data_ac83a159584f66a67ea8300683decc2e4}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02149}02149         token-\/>\mbox{\hyperlink{structtpc__token_a72f196508f24ee2be6861c40268edaa9}{nrange}} = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__populate__token__data_aaeb3124ddc1ed9803e8f2f368c458d98}{range\_descriptor\_length}}) /}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02150}02150             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02151}02151         list-\/>\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}} = \mbox{\hyperlink{ctl__tpc_8c_a9185f22049641e0a4ee38ac2538b9531}{tpc\_ranges\_length}}(token-\/>\mbox{\hyperlink{structtpc__token_a2bf143d9f71841c021c277744b01d216}{range}}, token-\/>\mbox{\hyperlink{structtpc__token_a72f196508f24ee2be6861c40268edaa9}{nrange}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02152}02152         list-\/>\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}} = (off\_t)list-\/>\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}} * lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_a269da1e2135fb187c0bd6b5a784794de}{blocksize}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02153}02153         \mbox{\hyperlink{ctl__tpc_8c_a8c9ea6b5556d2f0cb15cb4c8c2abaa57}{tpc\_create\_token}}(lun, port, list-\/>\mbox{\hyperlink{structtpc__list_a09f55f8b0b383ad43b7793012e9386dc}{curbytes}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02154}02154             (\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__token}{scsi\_token}} *)token-\/>\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02155}02155         token-\/>\mbox{\hyperlink{structtpc__token_a1593ca6e4e31a01d441b18e435c8d21b}{active}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02156}02156         token-\/>\mbox{\hyperlink{structtpc__token_a9da87c373b3b424c73afd883927483bb}{last\_active}} = time\_uptime;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02157}02157         token-\/>\mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{timeout}} = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(data-\/>\mbox{\hyperlink{structscsi__populate__token__data_ae4d8b7aa85b0b7d6e9ef7f550675cfb8}{inactivity\_timeout}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02158}02158         \textcolor{keywordflow}{if} (token-\/>\mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{timeout}} == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02159}02159                 token-\/>\mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{timeout}} = \mbox{\hyperlink{ctl__tpc_8c_a21152a7061dbd8d766bad1da8fe943d7}{TPC\_DFL\_TOKEN\_TIMEOUT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02160}02160         \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (token-\/>\mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{timeout}} < \mbox{\hyperlink{ctl__tpc_8c_a16afacb205ef71247fdb23333bbaecaf}{TPC\_MIN\_TOKEN\_TIMEOUT}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02161}02161                 token-\/>\mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{timeout}} = \mbox{\hyperlink{ctl__tpc_8c_a16afacb205ef71247fdb23333bbaecaf}{TPC\_MIN\_TOKEN\_TIMEOUT}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02162}02162         memcpy(list-\/>res\_token, token-\/>\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, \textcolor{keyword}{sizeof}(list-\/>res\_token));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02163}02163         list-\/>res\_token\_valid = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02164}02164         list-\/>\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02165}02165         list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}} = 1;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02166}02166         list-\/>\mbox{\hyperlink{structtpc__list_a8104b241abab11b74d51870868c1e836}{last\_active}} = time\_uptime;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02167}02167         mtx\_lock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02168}02168         TAILQ\_INSERT\_TAIL(\&softc-\/>tpc\_tokens, token, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02169}02169         mtx\_unlock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02170}02170         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02171}02171         \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02172}02172         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02173}02173 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02174}02174 done:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02175}02175         \textcolor{keywordflow}{if} (ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02176}02176                 free(ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02177}02177                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \&= \string~CTL\_FLAG\_ALLOCATED;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02178}02178         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02179}02179         \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02180}02180         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02181}02181 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02182}02182 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02183}02183 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02184}\mbox{\hyperlink{ctl__private_8h_ace1e4d30128e45b545de6a484f80f76c}{02184}} \mbox{\hyperlink{ctl__tpc_8c_ace1e4d30128e45b545de6a484f80f76c}{ctl\_write\_using\_token}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02185}02185 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02186}02186         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__softc}{ctl\_softc}} *softc = \mbox{\hyperlink{ctl__io_8h_ab8d16bff3ffc95ae3e5f0f318c432fc4}{CTL\_SOFTC}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02187}02187         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02188}02188         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__write__using__token}{scsi\_write\_using\_token}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02189}02189         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__write__using__token__data}{scsi\_write\_using\_token\_data}} *data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02190}02190         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list, *tlist;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02191}02191         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__token}{tpc\_token}} *\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02192}02192         uint64\_t lba;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02193}02193         \textcolor{keywordtype}{int} len, lendata, lendesc;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02194}02194 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02195}02195         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_write\_using\_token\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02196}02196 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02197}02197         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__write__using__token}{scsi\_write\_using\_token}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02198}02198         len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__write__using__token_a2d7054e5b6da019f0a4413d86ebc0ea9}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02199}02199 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02200}02200         \textcolor{keywordflow}{if} (len < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__write__using__token__data}{scsi\_write\_using\_token\_data}}) ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02201}02201             len > \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__write__using__token__data}{scsi\_write\_using\_token\_data}}) +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02202}02202              \mbox{\hyperlink{ctl__tpc_8c_aaeee163af46f2241d943abf7617c56d8}{TPC\_MAX\_SEGS}} * \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02203}02203                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02204}02204                     \textcolor{comment}{/*field*/} 9, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02205}02205                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02206}02206         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02207}02207 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02208}02208         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02209}02209 \textcolor{comment}{         * If we've got a kernel request that hasn't been malloced yet,}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02210}02210 \textcolor{comment}{         * malloc it and tell the caller the data buffer is here.}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02211}02211 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02212}02212         \textcolor{keywordflow}{if} ((ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02213}02213                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(len, M\_CTL, M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02214}02214                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02215}02215                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02216}02216                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02217}02217                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02218}02218                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02219}02219                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02220}02220                 \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02221}02221 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02222}02222                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02223}02223         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02224}02224 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02225}02225         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__write__using__token__data}{scsi\_write\_using\_token\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02226}02226         lendata = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a8a7efd14ff8ba7e1e40a12d282dac0b0}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02227}02227         \textcolor{keywordflow}{if} (lendata < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__write__using__token__data}{scsi\_write\_using\_token\_data}}) -\/ 2 +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02228}02228             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}})) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02229}02229                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02230}02230                     \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02231}02231                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02232}02232         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02233}02233         lendesc = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a0442ed7a08a44b73a9b4225fef014221}{range\_descriptor\_length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02234}02234         \textcolor{keywordflow}{if} (lendesc < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}}) ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02235}02235             len < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__write__using__token__data}{scsi\_write\_using\_token\_data}}) + lendesc ||}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02236}02236             lendata < \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__write__using__token__data}{scsi\_write\_using\_token\_data}}) -\/ 2 + lendesc) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02237}02237                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1, \textcolor{comment}{/*command*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02238}02238                     \textcolor{comment}{/*field*/} 534, \textcolor{comment}{/*bit\_valid*/} 0, \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02239}02239                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02240}02240         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02241}02241 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02242}02242 \textcolor{comment}{        printf("{}WUT(list=\%u) flags=\%x off=\%ju len=\%x\(\backslash\)n"{},}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02243}02243 \textcolor{comment}{            scsi\_4btoul(cdb-\/>list\_identifier),}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02244}02244 \textcolor{comment}{            data-\/>flags, scsi\_8btou64(data-\/>offset\_into\_rod),}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02245}02245 \textcolor{comment}{            scsi\_2btoul(data-\/>range\_descriptor\_length));}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02246}02246 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02247}02247 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02248}02248         \textcolor{comment}{/* Validate list of ranges */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02249}02249         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8c_a341778570a9c27efa467e44769004a1c}{tpc\_check\_ranges\_l}}(\&data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a0070a233be85e821cd575b42b7dc6cba}{desc}}[0],}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02250}02250             \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a0442ed7a08a44b73a9b4225fef014221}{range\_descriptor\_length}}) /}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02251}02251             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}}),}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02252}02252             lun-\/>\mbox{\hyperlink{structctl__lun_ad607ac5176ed357cf3fb3c629ef817f8}{be\_lun}}-\/>\mbox{\hyperlink{structctl__be__lun_aa8d3a6eb9ac5466965712528e17617f7}{maxlba}}, \&lba) != 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02253}02253                 \mbox{\hyperlink{ctl__error_8c_ac6dd12443811a793003660787c4d4ecf}{ctl\_set\_lba\_out\_of\_range}}(ctsio, lba);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02254}02254                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02255}02255         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02256}02256         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ctl__tpc_8c_aa5191738be14def15d7ef769c3395b7a}{tpc\_check\_ranges\_x}}(\&data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a0070a233be85e821cd575b42b7dc6cba}{desc}}[0],}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02257}02257             \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a0442ed7a08a44b73a9b4225fef014221}{range\_descriptor\_length}}) /}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02258}02258             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}})) != 0) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02259}02259                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02260}02260                     \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02261}02261                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02262}02262                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02263}02263         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02264}02264 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02265}02265         list = malloc(\textcolor{keyword}{sizeof}(\textcolor{keyword}{struct} \mbox{\hyperlink{structtpc__list}{tpc\_list}}), M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02266}02266         list-\/>\mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{service\_action}} = cdb-\/>\mbox{\hyperlink{structscsi__write__using__token_adadffdd9f2b3950f46767650d403285c}{service\_action}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02267}02267         list-\/>\mbox{\hyperlink{structtpc__list_a5769514ca0993943357e38e91414ea9d}{init\_port}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}.\mbox{\hyperlink{structctl__nexus_adb614f1edadf984459502e6c49cebfce}{targ\_port}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02268}02268         list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}} = \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02269}02269         list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}} = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__write__using__token_a7cc2f1b325d30b75ddedd449469aa3a9}{list\_identifier}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02270}02270         list-\/>\mbox{\hyperlink{structtpc__list_a692539cfcf944731fa9381d95823c1e6}{flags}} = data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_aa7f916597af3fe826eb503d44f00fdbc}{flags}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02271}02271         list-\/>\mbox{\hyperlink{structtpc__list_a6f329d9ed25bb63405b24dd086568e49}{params}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02272}02272         list-\/>\mbox{\hyperlink{structtpc__list_a855e2ec8780c32546a315d0b400c69d5}{range}} = \&data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a0070a233be85e821cd575b42b7dc6cba}{desc}}[0];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02273}02273         list-\/>\mbox{\hyperlink{structtpc__list_a8345c4ba8b1043abafe39652a59fc5ec}{nrange}} = \mbox{\hyperlink{scsi__all_8h_a3bed0f6b9b74c170a3356b4263830a34}{scsi\_2btoul}}(data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a0442ed7a08a44b73a9b4225fef014221}{range\_descriptor\_length}}) /}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02274}02274             \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__range__desc}{scsi\_range\_desc}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02275}02275         list-\/>\mbox{\hyperlink{structtpc__list_a4e96b3cdc27eae5202a459391facbaec}{offset\_into\_rod}} = \mbox{\hyperlink{scsi__all_8h_a37a4255a8649ca4cf5f3f45c99a0513f}{scsi\_8btou64}}(data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_a9ed94c233f3d5bbe4bcf37417a803096}{offset\_into\_rod}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02276}02276         list-\/>ctsio = ctsio;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02277}02277         list-\/>lun = lun;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02278}02278         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02279}02279         tlist = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list-\/>\mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}}, list-\/>\mbox{\hyperlink{structtpc__list_a7c35dd9e69e99cd1e2d2770d01e4ea64}{init\_idx}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02280}02280         \textcolor{keywordflow}{if} (tlist != NULL \&\& !tlist-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02281}02281                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02282}02282                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02283}02283                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02284}02284                     \textcolor{comment}{/*command*/} 0, \textcolor{comment}{/*field*/} 0, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02285}02285                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02286}02286                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02287}02287         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02288}02288         \textcolor{keywordflow}{if} (tlist != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02289}02289                 TAILQ\_REMOVE(\&lun-\/>tpc\_lists, tlist, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02290}02290                 free(tlist, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02291}02291         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02292}02292         TAILQ\_INSERT\_TAIL(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02293}02293         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02294}02294 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02295}02295         \textcolor{comment}{/* Block device zero ROD token -\/> no token. */}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02296}02296         \textcolor{keywordflow}{if} (\mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_ab06629d41a0b570368df1fe494db8b2b}{rod\_token}}) == \mbox{\hyperlink{scsi__all_8h_af07b4362ea13eac9590d80fe4bbb4060}{ROD\_TYPE\_BLOCK\_ZERO}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02297}02297                 \mbox{\hyperlink{ctl__tpc_8c_a89568b4615988b107504189a16cf1bc1}{tpc\_process}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02298}02298                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02299}02299         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02300}02300 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02301}02301         mtx\_lock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02302}02302         TAILQ\_FOREACH(token, \&softc-\/>tpc\_tokens, links) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02303}02303                 \textcolor{keywordflow}{if} (memcmp(token-\/>\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_ab06629d41a0b570368df1fe494db8b2b}{rod\_token}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02304}02304                     \textcolor{keyword}{sizeof}(data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_ab06629d41a0b570368df1fe494db8b2b}{rod\_token}})) == 0)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02305}02305                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02306}02306         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02307}02307         \textcolor{keywordflow}{if} (token != NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02308}02308                 token-\/>\mbox{\hyperlink{structtpc__token_a1593ca6e4e31a01d441b18e435c8d21b}{active}}++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02309}02309                 list-\/>\mbox{\hyperlink{structtpc__list_a1ea44ad914234f9f910938bcf1493148}{token}} = token;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02310}02310                 \textcolor{keywordflow}{if} (data-\/>\mbox{\hyperlink{structscsi__write__using__token__data_aa7f916597af3fe826eb503d44f00fdbc}{flags}} \& \mbox{\hyperlink{scsi__all_8h_a23acb5ad6773fa98c2dd0f08a75b80ad}{EC\_WUT\_DEL\_TKN}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02311}02311                         token-\/>\mbox{\hyperlink{structtpc__token_a9e78fdaccbf55c198735fef473c1116f}{timeout}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02312}02312         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02313}02313         mtx\_unlock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02314}02314         \textcolor{keywordflow}{if} (token == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02315}02315                 mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02316}02316                 TAILQ\_REMOVE(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02317}02317                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02318}02318                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02319}02319                 \mbox{\hyperlink{ctl__error_8c_af17eff77679e6c6f566a3f31aa9777c5}{ctl\_set\_sense}}(ctsio, \textcolor{comment}{/*current\_error*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02320}02320                     \textcolor{comment}{/*sense\_key*/} \mbox{\hyperlink{scsi__all_8h_ada374b200ae0454b0061d41fc78ee26f}{SSD\_KEY\_ILLEGAL\_REQUEST}},}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02321}02321                     \textcolor{comment}{/*asc*/} 0x23, \textcolor{comment}{/*ascq*/} 0x04, \mbox{\hyperlink{scsi__all_8h_af1de2107ba780bd1f85a685870af5380a702ff451529cd11730609ebfb6c978f9}{SSD\_ELEM\_NONE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02322}02322                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02323}02323         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02324}02324 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02325}02325         \mbox{\hyperlink{ctl__tpc_8c_a89568b4615988b107504189a16cf1bc1}{tpc\_process}}(list);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02326}02326         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02327}02327 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02328}02328 done:}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02329}02329         \textcolor{keywordflow}{if} (ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \& \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02330}02330                 free(ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}}, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02331}02331                 ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} \&= \string~CTL\_FLAG\_ALLOCATED;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02332}02332         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02333}02333         \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02334}02334         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02335}02335 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02336}02336 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02337}02337 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02338}\mbox{\hyperlink{ctl__private_8h_a792c51db55817c199b24ba2bab9e467f}{02338}} \mbox{\hyperlink{ctl__tpc_8c_a792c51db55817c199b24ba2bab9e467f}{ctl\_receive\_rod\_token\_information}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02339}02339 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02340}02340         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__lun}{ctl\_lun}} *\mbox{\hyperlink{structctl__lun_a9987d4a7ead453405d7cccde6d237d16}{lun}} = \mbox{\hyperlink{ctl__io_8h_ac64eaafc4309172e560339adb95256c6}{CTL\_LUN}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02341}02341         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__rod__token__information}{scsi\_receive\_rod\_token\_information}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02342}02342         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data}{scsi\_receive\_copy\_status\_lid4\_data}} *data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02343}02343         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02344}02344         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__list}{tpc\_list}} list\_copy;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02345}02345         uint8\_t *ptr;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02346}02346         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02347}02347         \textcolor{keywordtype}{int} alloc\_len, total\_len, token\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02348}02348         uint32\_t \mbox{\hyperlink{structtpc__list_aaa3a05b5052cc44c212a7700076cb7ef}{list\_id}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02349}02349 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02350}02350         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_receive\_rod\_token\_information\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02351}02351 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02352}02352         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__rod__token__information}{scsi\_receive\_rod\_token\_information}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02353}02353         retval = \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02354}02354 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02355}02355         list\_id = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__receive__rod__token__information_ae5f726a798566cca7e1a9fa94fe52b26}{list\_identifier}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02356}02356         mtx\_lock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02357}02357         list = \mbox{\hyperlink{ctl__tpc_8c_aa077e1ae2889f660b9ff24e8b8b0e44b}{tpc\_find\_list}}(lun, list\_id,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02358}02358             \mbox{\hyperlink{ctl_8c_a701e1d59bc3141340c3e28502b7c66e4}{ctl\_get\_initindex}}(\&ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_a2694248a43adfcb898e8d9424df7f193}{nexus}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02359}02359         \textcolor{keywordflow}{if} (list == NULL) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02360}02360                 mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02361}02361                 \mbox{\hyperlink{ctl__error_8c_a789d8ebcf144d9ba037365d59543f5bd}{ctl\_set\_invalid\_field}}(ctsio, \textcolor{comment}{/*sks\_valid*/} 1,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02362}02362                     \textcolor{comment}{/*command*/} 1, \textcolor{comment}{/*field*/} 2, \textcolor{comment}{/*bit\_valid*/} 0,}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02363}02363                     \textcolor{comment}{/*bit*/} 0);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02364}02364                 \mbox{\hyperlink{ctl_8c_aea568a1affb1a4367acda2b21e1424ef}{ctl\_done}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02365}02365                 \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02366}02366         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02367}02367         list\_copy = *list;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02368}02368         \textcolor{keywordflow}{if} (list-\/>\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02369}02369                 TAILQ\_REMOVE(\&lun-\/>tpc\_lists, list, links);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02370}02370                 free(list, M\_CTL);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02371}02371         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02372}02372         mtx\_unlock(\&lun-\/>\mbox{\hyperlink{structctl__lun_a4765ef56608ffd3b742bc3a9eaae0019}{lun\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02373}02373 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02374}02374         token\_len = list\_copy.res\_token\_valid ? 2 + \textcolor{keyword}{sizeof}(list\_copy.res\_token) : 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02375}02375         total\_len = \textcolor{keyword}{sizeof}(*data) + list\_copy.sense\_len + 4 + token\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02376}02376         alloc\_len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__receive__rod__token__information_ac0210cb07cf62ec72ac7739980577c00}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02377}02377 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02378}02378         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(total\_len, M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02379}02379         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02380}02380         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02381}02381         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = min(total\_len, alloc\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02382}02382         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02383}02383 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02384}02384         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data}{scsi\_receive\_copy\_status\_lid4\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02385}02385         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\textcolor{keyword}{sizeof}(*data) -\/ 4 + list\_copy.sense\_len +}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02386}02386             4 + token\_len, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a1572758fcfd435f6cee3494ca024adcf}{available\_data}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02387}02387         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a25a6fe609f01d39c32770e336e3be3ef}{response\_to\_service\_action}} = list\_copy.\mbox{\hyperlink{structtpc__list_a10eb735482053e32b8c4b62c7b9b7114}{service\_action}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02388}02388         \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a0bc207ce41f7eda6ff750eff144f6ff6}{completed}}) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02389}02389                 \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a61032d89a009a9e7187e96d99e8e78e2}{error}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02390}02390                         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a64f6d1d1894f92b72a9895ec9fdad8dd}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a58bb4f77c88148a898201410916b30c2}{RCS\_CCS\_ERROR}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02391}02391                 \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (list\_copy.\mbox{\hyperlink{structtpc__list_a0e4ab6b3314a510d49a5c65272c4eb0f}{abort}})}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02392}02392                         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a64f6d1d1894f92b72a9895ec9fdad8dd}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_af0a5813a77c426d711e25be025fecb04}{RCS\_CCS\_ABORTED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02393}02393                 \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02394}02394                         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a64f6d1d1894f92b72a9895ec9fdad8dd}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a22ef08838b1803a47e9a24ead497a6f7}{RCS\_CCS\_COMPLETED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02395}02395         \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02396}02396                 data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a64f6d1d1894f92b72a9895ec9fdad8dd}{copy\_command\_status}} = \mbox{\hyperlink{scsi__all_8h_a763496817a320ff812cfbbf12e836bec}{RCS\_CCS\_INPROG\_FG}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02397}02397         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(list\_copy.\mbox{\hyperlink{structtpc__list_afff202a7b9843f4866fd6ae53f0fc4dd}{curops}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_aae8c34639f4a41cd183ea9f352324fad}{operation\_counter}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02398}02398         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(UINT32\_MAX, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_acdf389164b8394b77e9ab849872fedf9}{estimated\_status\_update\_delay}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02399}02399         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a57718487a69f06a91f11b492163056ab}{transfer\_count\_units}} = \mbox{\hyperlink{scsi__all_8h_a5338fd92857cdc4701c7874e9fde66f1}{RCS\_TC\_LBAS}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02400}02400         \mbox{\hyperlink{scsi__all_8h_aad426c8a894cc6b0f8bc505c7103655f}{scsi\_u64to8b}}(list\_copy.\mbox{\hyperlink{structtpc__list_a90ed032c15d140afe7c939371434fa74}{cursectors}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a4f7ad82d1561b46cb8cc3b518807418d}{transfer\_count}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02401}02401         \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(list\_copy.\mbox{\hyperlink{structtpc__list_a5c5d3c8a9aa96e85691b7e4ddda43012}{curseg}}, data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_abd64e08af3f4282cc3e0b4990122ede9}{segments\_processed}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02402}02402         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a8ab4dfb7203ca0ba4ed2a9c4673609af}{length\_of\_the\_sense\_data\_field}} = list\_copy.sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02403}02403         data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_ab030ca84548bdcf3617262800d409412}{sense\_data\_length}} = list\_copy.sense\_len;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02404}02404         memcpy(data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_afb36132d15b5dadf50787e04e6a80287}{sense\_data}}, \&list\_copy.sense\_data, list\_copy.sense\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02405}02405 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02406}02406         ptr = \&data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_afb36132d15b5dadf50787e04e6a80287}{sense\_data}}[data-\/>\mbox{\hyperlink{structscsi__receive__copy__status__lid4__data_a8ab4dfb7203ca0ba4ed2a9c4673609af}{length\_of\_the\_sense\_data\_field}}];}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02407}02407         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(token\_len, \&ptr[0]);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02408}02408         \textcolor{keywordflow}{if} (list\_copy.res\_token\_valid) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02409}02409                 \mbox{\hyperlink{scsi__all_8h_a645af3def268320a573c026debde29e8}{scsi\_ulto2b}}(0, \&ptr[4]);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02410}02410                 memcpy(\&ptr[6], list\_copy.res\_token, \textcolor{keyword}{sizeof}(list\_copy.res\_token));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02411}02411         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02412}02412 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02413}02413 \textcolor{comment}{        printf("{}RRTI(list=\%u) valid=\%d\(\backslash\)n"{},}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02414}02414 \textcolor{comment}{            scsi\_4btoul(cdb-\/>list\_identifier), list\_copy.res\_token\_valid);}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02415}02415 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02416}02416         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02417}02417         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02418}02418         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02419}02419         \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02420}02420         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02421}02421 \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02422}02422 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02423}02423 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02424}\mbox{\hyperlink{ctl__private_8h_a16451ddbc0075095f6783d3328934735}{02424}} \mbox{\hyperlink{ctl__tpc_8c_a16451ddbc0075095f6783d3328934735}{ctl\_report\_all\_rod\_tokens}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structctl__scsiio}{ctl\_scsiio}} *ctsio)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02425}02425 \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02426}02426         \textcolor{keyword}{struct }\mbox{\hyperlink{structctl__softc}{ctl\_softc}} *softc = \mbox{\hyperlink{ctl__io_8h_ab8d16bff3ffc95ae3e5f0f318c432fc4}{CTL\_SOFTC}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02427}02427         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__report__all__rod__tokens}{scsi\_report\_all\_rod\_tokens}} *cdb;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02428}02428         \textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__report__all__rod__tokens__data}{scsi\_report\_all\_rod\_tokens\_data}} *data;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02429}02429         \textcolor{keyword}{struct }\mbox{\hyperlink{structtpc__token}{tpc\_token}} *\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02430}02430         \textcolor{keywordtype}{int} retval;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02431}02431         \textcolor{keywordtype}{int} alloc\_len, total\_len, tokens, i;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02432}02432 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02433}02433         \mbox{\hyperlink{ctl__debug_8h_ae5d205e8c0c658eb3fbf1cd3940dd1fe}{CTL\_DEBUG\_PRINT}}((\textcolor{stringliteral}{"{}ctl\_receive\_rod\_token\_information\(\backslash\)n"{}}));}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02434}02434 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02435}02435         cdb = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__report__all__rod__tokens}{scsi\_report\_all\_rod\_tokens}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a5d2f7b49af722408745fcbddbe40ff37}{cdb}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02436}02436         retval = \mbox{\hyperlink{ctl_8h_a38cc7e60dc67430eb55c587fd6126a62}{CTL\_RETVAL\_COMPLETE}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02437}02437 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02438}02438         tokens = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02439}02439         mtx\_lock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02440}02440         TAILQ\_FOREACH(token, \&softc-\/>tpc\_tokens, links)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02441}02441                 tokens++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02442}02442         mtx\_unlock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02443}02443         \textcolor{keywordflow}{if} (tokens > 512)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02444}02444                 tokens = 512;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02445}02445 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02446}02446         total\_len = \textcolor{keyword}{sizeof}(*data) + tokens * 96;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02447}02447         alloc\_len = \mbox{\hyperlink{scsi__all_8h_a819d6f51420109cfeb06a235f299e113}{scsi\_4btoul}}(cdb-\/>\mbox{\hyperlink{structscsi__report__all__rod__tokens_a678a451d1135d9079557e6bef8a629f8}{length}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02448}02448 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02449}02449         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}} = malloc(total\_len, M\_CTL, M\_WAITOK | M\_ZERO);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02450}02450         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a198cc358715d00114992715b8b4d8a91}{kern\_sg\_entries}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02451}02451         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_aa54aaad60777d2570add13597fa33b64}{kern\_rel\_offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02452}02452         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}} = min(total\_len, alloc\_len);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02453}02453         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0c48b745eb643d738a0377eacc779020}{kern\_total\_len}} = ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a2aa17a8c5b48525f6b853d2ac9daac4c}{kern\_data\_len}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02454}02454 }
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02455}02455         data = (\textcolor{keyword}{struct }\mbox{\hyperlink{structscsi__report__all__rod__tokens__data}{scsi\_report\_all\_rod\_tokens\_data}} *)ctsio-\/>\mbox{\hyperlink{structctl__scsiio_ac0387482d69876c20201436631351e44}{kern\_data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02456}02456         i = 0;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02457}02457         mtx\_lock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02458}02458         TAILQ\_FOREACH(token, \&softc-\/>tpc\_tokens, links) \{}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02459}02459                 \textcolor{keywordflow}{if} (i >= tokens)}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02460}02460                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02461}02461                 memcpy(\&data-\/>\mbox{\hyperlink{structscsi__report__all__rod__tokens__data_a8b2ff4e93a083ec0cf6e26c2b426e4e8}{rod\_management\_token\_list}}[i * 96],}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02462}02462                     token-\/>\mbox{\hyperlink{structtpc__token_a662751f094d6fccb1b972d7f9f8ab1a8}{token}}, 96);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02463}02463                 i++;}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02464}02464         \}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02465}02465         mtx\_unlock(\&softc-\/>\mbox{\hyperlink{structctl__softc_a3e80c761a074f80a18436266b3a415c6}{tpc\_lock}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02466}02466         \mbox{\hyperlink{scsi__all_8h_aaa9d67f17d6412d1460d9bdee7e92d3e}{scsi\_ulto4b}}(\textcolor{keyword}{sizeof}(*data) -\/ 4 + i * 96, data-\/>\mbox{\hyperlink{structscsi__report__all__rod__tokens__data_a15ef730ae8092e578787cd10b35a6d78}{available\_data}});}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02467}02467 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02468}02468 \textcolor{comment}{        printf("{}RART tokens=\%d\(\backslash\)n"{}, i);}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02469}02469 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02470}02470         \mbox{\hyperlink{ctl__error_8c_a88c619b51216e3b97045dfc5e19e22a8}{ctl\_set\_success}}(ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02471}02471         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a3ec4852948984dcf048b61573e0e1780}{io\_hdr}}.\mbox{\hyperlink{structctl__io__hdr_aae032e0b9a69d74d6dc1002519171844}{flags}} |= \mbox{\hyperlink{ctl__io_8h_ac919a4e87edc6142399a36f72f0b1a01a775e7c233293f0888793231713b8777f}{CTL\_FLAG\_ALLOCATED}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02472}02472         ctsio-\/>\mbox{\hyperlink{structctl__scsiio_a0ad9b76dc2717fd3aeaa8befac0cfa0a}{be\_move\_done}} = \mbox{\hyperlink{ctl_8c_a1ffd9db72d8cb9fba3a833bf23519c89}{ctl\_config\_move\_done}};}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02473}02473         \mbox{\hyperlink{ctl_8c_a49760cade85f81ce6460c22dd463bef2}{ctl\_datamove}}((\textcolor{keyword}{union} \mbox{\hyperlink{unionctl__io}{ctl\_io}} *)ctsio);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02474}02474         \textcolor{keywordflow}{return} (retval);}
\DoxyCodeLine{\Hypertarget{ctl__tpc_8c_source_l02475}02475 \}}

\end{DoxyCode}
