\hypertarget{ustorage__fs_8c_source}{}\doxysection{ustorage\+\_\+fs.\+c}
\label{ustorage__fs_8c_source}\index{dev/usb/storage/ustorage\_fs.c@{dev/usb/storage/ustorage\_fs.c}}
\mbox{\hyperlink{ustorage__fs_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00001}00001 \textcolor{comment}{/* \$FreeBSD\$ */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00002}00002 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00003}00003 \textcolor{comment}{ * SPDX-\/License-\/Identifier: BSD-\/3-\/Clause}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00005}00005 \textcolor{comment}{ * Copyright (C) 2003-\/2005 Alan Stern}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00006}00006 \textcolor{comment}{ * Copyright (C) 2008 Hans Petter Selasky}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00007}00007 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00008}00008 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00009}00009 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00010}00010 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00011}00011 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00012}00012 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions, and the following disclaimer,}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00014}00014 \textcolor{comment}{ *    without modification.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00015}00015 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00016}00016 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00017}00017 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00018}00018 \textcolor{comment}{ * 3. The names of the above-\/listed copyright holders may not be used}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00019}00019 \textcolor{comment}{ *    to endorse or promote products derived from this software without}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00020}00020 \textcolor{comment}{ *    specific prior written permission.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00021}00021 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00022}00022 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00023}00023 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "{}AS}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00024}00024 \textcolor{comment}{ * IS"{} AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00025}00025 \textcolor{comment}{ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00026}00026 \textcolor{comment}{ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00027}00027 \textcolor{comment}{ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00028}00028 \textcolor{comment}{ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00029}00029 \textcolor{comment}{ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00030}00030 \textcolor{comment}{ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00031}00031 \textcolor{comment}{ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00032}00032 \textcolor{comment}{ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00033}00033 \textcolor{comment}{ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00034}00034 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00035}00035 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00036}00036 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00037}00037 \textcolor{comment}{ * NOTE: Much of the SCSI statemachine handling code derives from the}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00038}00038 \textcolor{comment}{ * Linux USB gadget stack.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00039}00039 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00040}00040 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00041}00041 \textcolor{preprocessor}{\#ifdef USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00042}00042 \textcolor{preprocessor}{\#include USB\_GLOBAL\_INCLUDE\_FILE}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00043}00043 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00044}00044 \textcolor{preprocessor}{\#include <sys/stdint.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <sys/stddef.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00047}00047 \textcolor{preprocessor}{\#include <sys/queue.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00048}00048 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00049}00049 \textcolor{preprocessor}{\#include <sys/systm.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00050}00050 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00051}00051 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00052}00052 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00053}00053 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00054}00054 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00055}00055 \textcolor{preprocessor}{\#include <sys/condvar.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <sys/sysctl.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <sys/sx.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00058}00058 \textcolor{preprocessor}{\#include <sys/unistd.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00059}00059 \textcolor{preprocessor}{\#include <sys/callout.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00060}00060 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00061}00061 \textcolor{preprocessor}{\#include <sys/priv.h>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00062}00062 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00063}00063 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb_8h}{dev/usb/usb.h}}>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00064}00064 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usbdi_8h}{dev/usb/usbdi.h}}>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00065}00065 \textcolor{preprocessor}{\#include "{}usbdevs.h"{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00066}00066 \textcolor{preprocessor}{\#include "{}usb\_if.h"{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00068}\mbox{\hyperlink{ustorage__fs_8c_a927dd6f59caf10a2991dfb564bcbb1e1}{00068}} \textcolor{preprocessor}{\#define USB\_DEBUG\_VAR ustorage\_fs\_debug}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00069}00069 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{usb__debug_8h}{dev/usb/usb\_debug.h}}>}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00070}00070 \textcolor{preprocessor}{\#endif                  }\textcolor{comment}{/* USB\_GLOBAL\_INCLUDE\_FILE */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00072}00072 \textcolor{preprocessor}{\#ifdef USB\_DEBUG}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00073}00073 \textcolor{keyword}{static} \textcolor{keywordtype}{int} ustorage\_fs\_debug = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00074}00074 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00075}00075 \mbox{\hyperlink{dwc__otg_8c_a58e125bcf985ce2333baef42f97b33b3}{SYSCTL\_NODE}}(\_hw\_usb, OID\_AUTO, ustorage\_fs, CTLFLAG\_RW | CTLFLAG\_MPSAFE, 0,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00076}00076     \textcolor{stringliteral}{"{}USB ustorage\_fs"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00077}00077 \mbox{\hyperlink{dwc__otg_8c_a83d020f0b15dc2783f3f1a6966c75e36}{SYSCTL\_INT}}(\_hw\_usb\_ustorage\_fs, OID\_AUTO, \mbox{\hyperlink{cfumass_8c_ac3e1795766a80ec63b157951b4b9a7d4}{debug}}, CTLFLAG\_RWTUN,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00078}00078     \&ustorage\_fs\_debug, 0, \textcolor{stringliteral}{"{}ustorage\_fs debug level"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00079}00079 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00080}00080 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00081}00081 \textcolor{comment}{/* Define some limits */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00082}00082 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00083}00083 \textcolor{preprocessor}{\#ifndef USTORAGE\_FS\_BULK\_SIZE }}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00084}\mbox{\hyperlink{ustorage__fs_8c_aa1eea8cf48cd6202c8f1af3d2281dfc7}{00084}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_BULK\_SIZE   (1U << 17)      }\textcolor{comment}{/* bytes */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00085}00085 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00087}00087 \textcolor{preprocessor}{\#ifndef USTORAGE\_FS\_MAX\_LUN}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00088}\mbox{\hyperlink{ustorage__fs_8c_a2ad4f591e34f6f066279b35e646f55f7}{00088}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_MAX\_LUN     8       }\textcolor{comment}{/* units */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00089}00089 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00090}00090 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00091}00091 \textcolor{preprocessor}{\#ifndef USTORAGE\_QDATA\_MAX}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00092}\mbox{\hyperlink{ustorage__fs_8c_a5ba97c61d77e0b51ff303d47f30c8443}{00092}} \textcolor{preprocessor}{\#define USTORAGE\_QDATA\_MAX      40      }\textcolor{comment}{/* bytes */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00093}00093 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00094}00094 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00095}00095 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00096}00096 \textcolor{comment}{ * The SCSI ID string must be exactly 28 characters long}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00097}00097 \textcolor{comment}{ * exluding the terminating zero.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00098}00098 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00099}00099 \textcolor{preprocessor}{\#ifndef USTORAGE\_FS\_ID\_STRING}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00100}\mbox{\hyperlink{ustorage__fs_8c_a47249cc55e310fb474721e9ad84fd422}{00100}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_ID\_STRING \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00101}00101 \textcolor{preprocessor}{        "{}FreeBSD "{}} \textcolor{comment}{/* 8 */}\textcolor{preprocessor}{ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00102}00102 \textcolor{preprocessor}{        "{}File-\/Stor Gadget"{}} \textcolor{comment}{/* 16 */}\textcolor{preprocessor}{ \(\backslash\)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00103}00103 \textcolor{preprocessor}{        "{}0101"{}} \textcolor{comment}{/* 4 */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00104}00104 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00105}00105 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00106}00106 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00107}00107 \textcolor{comment}{ * The following macro defines the number of}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00108}00108 \textcolor{comment}{ * sectors to be allocated for the RAM disk:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00109}00109 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00110}00110 \textcolor{preprocessor}{\#ifndef USTORAGE\_FS\_RAM\_SECT}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00111}\mbox{\hyperlink{ustorage__fs_8c_a9230cb01ef34424c57a7c55025f09c0e}{00111}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_RAM\_SECT (1UL << 13)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00112}00112 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00113}00113 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00114}\mbox{\hyperlink{ustorage__fs_8c_ad3b193e6ec3768900e2a96949e31fbb5}{00114}} \textcolor{keyword}{static} uint8\_t *\mbox{\hyperlink{ustorage__fs_8c_ad3b193e6ec3768900e2a96949e31fbb5}{ustorage\_fs\_ramdisk}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00115}00115 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00116}00116 \textcolor{comment}{/* USB transfer definitions */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00117}00117 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00118}\mbox{\hyperlink{ustorage__fs_8c_accdd89d1bbe1093a6c7594713482a256}{00118}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_T\_BBB\_COMMAND     0}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00119}\mbox{\hyperlink{ustorage__fs_8c_a262d4f620f4f8c4a511ad7914c97a39d}{00119}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_T\_BBB\_DATA\_DUMP   1}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00120}\mbox{\hyperlink{ustorage__fs_8c_ada56a71a3d76619041458afc0005773f}{00120}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_T\_BBB\_DATA\_READ   2}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00121}\mbox{\hyperlink{ustorage__fs_8c_a42d3987f781dc102b007fa85957b4dda}{00121}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_T\_BBB\_DATA\_WRITE  3}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00122}\mbox{\hyperlink{ustorage__fs_8c_a0d8aba5cd0104a73f937a0c69b182804}{00122}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_T\_BBB\_STATUS      4}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00123}\mbox{\hyperlink{ustorage__fs_8c_aa1895628185475bd721d7ad4ec9578ea}{00123}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_T\_BBB\_MAX         5}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00124}00124 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00125}00125 \textcolor{comment}{/* USB data stage direction */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00126}00126 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00127}\mbox{\hyperlink{ustorage__fs_8c_a665390e734d124195aa8d263d475c73a}{00127}} \textcolor{preprocessor}{\#define DIR\_NONE        0}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00128}\mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{00128}} \textcolor{preprocessor}{\#define DIR\_READ        1}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00129}\mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{00129}} \textcolor{preprocessor}{\#define DIR\_WRITE       2}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00130}00130 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00131}00131 \textcolor{comment}{/* USB interface specific control request */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00132}00132 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00133}\mbox{\hyperlink{ustorage__fs_8c_ab4366a21c8add102c374fe8baeddadcb}{00133}} \textcolor{preprocessor}{\#define UR\_BBB\_RESET            0xff    }\textcolor{comment}{/* Bulk-\/Only reset */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00134}\mbox{\hyperlink{ustorage__fs_8c_a6950b30cda57ceb3ff2d75caea266f1b}{00134}} \textcolor{preprocessor}{\#define UR\_BBB\_GET\_MAX\_LUN      0xfe    }\textcolor{comment}{/* Get maximum lun */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00135}00135 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00136}00136 \textcolor{comment}{/* Command Block Wrapper */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00137}00137 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00138}00138         \mbox{\hyperlink{usb__endian_8h_ae3cbe7723d7e86b29e1b743781b29d6c}{uDWord}}    dCBWSignature;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00139}\mbox{\hyperlink{ustorage__fs_8c_a15cfcf912acb56af1b66380542dcf7f6}{00139}} \textcolor{preprocessor}{\#define CBWSIGNATURE    0x43425355}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00140}00140         \mbox{\hyperlink{usb__endian_8h_ae3cbe7723d7e86b29e1b743781b29d6c}{uDWord}}    dCBWTag;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00141}00141         \mbox{\hyperlink{usb__endian_8h_ae3cbe7723d7e86b29e1b743781b29d6c}{uDWord}}    dCBWDataTransferLength;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00142}00142         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      bCBWFlags;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00143}\mbox{\hyperlink{ustorage__fs_8c_adb6bd8dfe82d0ed3eb1c2caed92d8a9e}{00143}} \textcolor{preprocessor}{\#define CBWFLAGS\_OUT    0x00}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00144}\mbox{\hyperlink{ustorage__fs_8c_ae8a2116019faea706c66bc3638995400}{00144}} \textcolor{preprocessor}{\#define CBWFLAGS\_IN     0x80}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00145}00145         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      bCBWLUN;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00146}00146         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      bCDBLength;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00147}\mbox{\hyperlink{ustorage__fs_8c_a2eaeef6fe40c085412d2b2b7b98a1e5e}{00147}} \textcolor{preprocessor}{\#define CBWCDBLENGTH    16}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00148}00148         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      CBWCDB[\mbox{\hyperlink{ustorage__fs_8c_a2eaeef6fe40c085412d2b2b7b98a1e5e}{CBWCDBLENGTH}}];}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00149}00149 \} \mbox{\hyperlink{struct____packed}{\_\_packed}} ustorage\_fs\_bbb\_cbw\_t;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00150}00150 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00151}\mbox{\hyperlink{ustorage__fs_8c_ad89a85e67edc1d6dc2e66c4aa30a898f}{00151}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_BBB\_CBW\_SIZE        31}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00152}00152 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00153}00153 \textcolor{comment}{/* Command Status Wrapper */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00154}00154 \textcolor{keyword}{typedef} \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00155}00155         \mbox{\hyperlink{usb__endian_8h_ae3cbe7723d7e86b29e1b743781b29d6c}{uDWord}}    dCSWSignature;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00156}\mbox{\hyperlink{ustorage__fs_8c_a6d29dee6ca7f61ee7407eb0c9df8fe0a}{00156}} \textcolor{preprocessor}{\#define CSWSIGNATURE    0x53425355}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00157}00157         \mbox{\hyperlink{usb__endian_8h_ae3cbe7723d7e86b29e1b743781b29d6c}{uDWord}}    dCSWTag;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00158}00158         \mbox{\hyperlink{usb__endian_8h_ae3cbe7723d7e86b29e1b743781b29d6c}{uDWord}}    dCSWDataResidue;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00159}00159         \mbox{\hyperlink{usb__endian_8h_a4dea376b5cd0c5d694660473f5e7a459}{uByte}}      bCSWStatus;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00160}\mbox{\hyperlink{ustorage__fs_8c_a0eb3a9534c70bd126379d425c54498aa}{00160}} \textcolor{preprocessor}{\#define CSWSTATUS\_GOOD  0x0}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00161}\mbox{\hyperlink{ustorage__fs_8c_aee89dc947347ceec52385e1428cdf087}{00161}} \textcolor{preprocessor}{\#define CSWSTATUS\_FAILED        0x1}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00162}\mbox{\hyperlink{ustorage__fs_8c_a05601fcfef35de03cf867dc6c6f5410a}{00162}} \textcolor{preprocessor}{\#define CSWSTATUS\_PHASE 0x2}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00163}00163 \} \mbox{\hyperlink{struct____packed}{\_\_packed}} ustorage\_fs\_bbb\_csw\_t;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00164}00164 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00165}\mbox{\hyperlink{ustorage__fs_8c_a9d283e99dc260936a2732d2b49fb75bf}{00165}} \textcolor{preprocessor}{\#define USTORAGE\_FS\_BBB\_CSW\_SIZE        13}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00166}00166 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00167}\mbox{\hyperlink{structustorage__fs__lun}{00167}} \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00168}\mbox{\hyperlink{structustorage__fs__lun_a8085151a917f01b68593431564d6e6c4}{00168}}         uint8\_t *\mbox{\hyperlink{structustorage__fs__lun_a8085151a917f01b68593431564d6e6c4}{memory\_image}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00169}00169 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00170}\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{00170}}         uint32\_t \mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00171}\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{00171}}         uint32\_t \mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00172}\mbox{\hyperlink{structustorage__fs__lun_a656ce36cd61057d53f93cb9a81062295}{00172}}         uint32\_t \mbox{\hyperlink{structustorage__fs__lun_a656ce36cd61057d53f93cb9a81062295}{sense\_data\_info}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00173}\mbox{\hyperlink{structustorage__fs__lun_a596ff4c4cb155d5a0bfd0448579960ec}{00173}}         uint32\_t \mbox{\hyperlink{structustorage__fs__lun_a596ff4c4cb155d5a0bfd0448579960ec}{unit\_attention\_data}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00174}00174 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00175}\mbox{\hyperlink{structustorage__fs__lun_aee7b0140a74ef80b921bbd36719cc50b}{00175}}         uint8\_t \mbox{\hyperlink{structustorage__fs__lun_aee7b0140a74ef80b921bbd36719cc50b}{read\_only}}:1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00176}\mbox{\hyperlink{structustorage__fs__lun_a88bed54b5cc610e641bad1a198bf9d11}{00176}}         uint8\_t \mbox{\hyperlink{structustorage__fs__lun_a88bed54b5cc610e641bad1a198bf9d11}{prevent\_medium\_removal}}:1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00177}\mbox{\hyperlink{structustorage__fs__lun_ad50231eac0b226fba1cc3557fad3c61b}{00177}}         uint8\_t \mbox{\hyperlink{structustorage__fs__lun_ad50231eac0b226fba1cc3557fad3c61b}{info\_valid}}:1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00178}\mbox{\hyperlink{structustorage__fs__lun_a419bbb2c5cac21c0c1b71c449a5c0478}{00178}}         uint8\_t \mbox{\hyperlink{structustorage__fs__lun_a419bbb2c5cac21c0c1b71c449a5c0478}{removable}}:1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00179}00179 \};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00180}00180 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00181}\mbox{\hyperlink{structustorage__fs__softc}{00181}} \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00182}\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{00182}}         ustorage\_fs\_bbb\_cbw\_t *\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}};    \textcolor{comment}{/* Command Wrapper Block */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00183}\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{00183}}         ustorage\_fs\_bbb\_csw\_t *\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}};    \textcolor{comment}{/* Command Status Block */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00184}\mbox{\hyperlink{structustorage__fs__softc_a2968f304eeac7af426a993b56c476446}{00184}}         \textcolor{keywordtype}{void} *\mbox{\hyperlink{structustorage__fs__softc_a2968f304eeac7af426a993b56c476446}{sc\_dma\_ptr}};             \textcolor{comment}{/* Main data buffer */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00185}00185 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00186}\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{00186}}         \textcolor{keyword}{struct }mtx \mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00187}00187 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00188}\mbox{\hyperlink{structustorage__fs__softc_a83080e56ecca9b0f8240dab238b4f807}{00188}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} \mbox{\hyperlink{structustorage__fs__softc_a83080e56ecca9b0f8240dab238b4f807}{sc\_lun}}[\mbox{\hyperlink{ustorage__fs_8c_a2ad4f591e34f6f066279b35e646f55f7}{USTORAGE\_FS\_MAX\_LUN}}];}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00189}00189 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00190}00190         \textcolor{keyword}{struct }\{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00191}\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{00191}}                 uint8\_t *\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00192}\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{00192}}                 \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00193}00193 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00194}\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{00194}}                 uint32\_t \mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}};      \textcolor{comment}{/* bytes, as reported by the command}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00195}00195 \textcolor{comment}{                                         * block wrapper */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00196}\mbox{\hyperlink{structustorage__fs__softc_ad20b6a7e083750c5f9479a62b01600e3}{00196}}                 uint32\_t \mbox{\hyperlink{structustorage__fs__softc_ad20b6a7e083750c5f9479a62b01600e3}{offset}};  \textcolor{comment}{/* bytes */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00197}00197 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00198}\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{00198}}                 uint8\_t \mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00199}\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{00199}}                 uint8\_t \mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00200}\mbox{\hyperlink{structustorage__fs__softc_a4364c870d6d5340302c1cc772928cc9c}{00200}}                 uint8\_t \mbox{\hyperlink{structustorage__fs__softc_a4364c870d6d5340302c1cc772928cc9c}{lun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00201}\mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{00201}}                 uint8\_t \mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{cmd\_len}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00202}\mbox{\hyperlink{structustorage__fs__softc_a2f3399a91c1477c39485ba8f53082afb}{00202}}                 uint8\_t \mbox{\hyperlink{structustorage__fs__softc_a2f3399a91c1477c39485ba8f53082afb}{data\_short}}:1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00203}\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{00203}}                 uint8\_t \mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}}:1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00204}\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{00204}}         \}       \mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00206}\mbox{\hyperlink{structustorage__fs__softc_a556c8d1cc8022c575541bbbdc5f009da}{00206}}         device\_t \mbox{\hyperlink{structustorage__fs__softc_a556c8d1cc8022c575541bbbdc5f009da}{sc\_dev}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00207}\mbox{\hyperlink{structustorage__fs__softc_a6e36915fab6e253c68496ea1fe2781d0}{00207}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device}{usb\_device}} *\mbox{\hyperlink{structustorage__fs__softc_a6e36915fab6e253c68496ea1fe2781d0}{sc\_udev}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00208}\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{00208}}         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}[\mbox{\hyperlink{ustorage__fs_8c_aa1895628185475bd721d7ad4ec9578ea}{USTORAGE\_FS\_T\_BBB\_MAX}}];}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00209}00209 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00210}\mbox{\hyperlink{structustorage__fs__softc_a9310552931e7e0ffbc700afb2b7dd66a}{00210}}         uint8\_t \mbox{\hyperlink{structustorage__fs__softc_a9310552931e7e0ffbc700afb2b7dd66a}{sc\_iface\_no}};         \textcolor{comment}{/* interface number */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00211}\mbox{\hyperlink{structustorage__fs__softc_aa12e2966cbe7837afc2a2f45159aab33}{00211}}         uint8\_t \mbox{\hyperlink{structustorage__fs__softc_aa12e2966cbe7837afc2a2f45159aab33}{sc\_last\_lun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00212}\mbox{\hyperlink{structustorage__fs__softc_a730eaa6377ceb22743d2e7961541ca7a}{00212}}         uint8\_t \mbox{\hyperlink{structustorage__fs__softc_a730eaa6377ceb22743d2e7961541ca7a}{sc\_last\_xfer\_index}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00213}\mbox{\hyperlink{structustorage__fs__softc_acb0f9945bd163041f05b0fcfe8d49660}{00213}}         uint8\_t \mbox{\hyperlink{structustorage__fs__softc_acb0f9945bd163041f05b0fcfe8d49660}{sc\_qdata}}[\mbox{\hyperlink{ustorage__fs_8c_a5ba97c61d77e0b51ff303d47f30c8443}{USTORAGE\_QDATA\_MAX}}];}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00214}00214 \};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00215}00215 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00216}00216 \textcolor{comment}{/* prototypes */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00218}\mbox{\hyperlink{ustorage__fs_8c_a9408e5ec2d394d47a0db57fb79ef839e}{00218}} \textcolor{keyword}{static} device\_probe\_t \mbox{\hyperlink{ustorage__fs_8c_a9408e5ec2d394d47a0db57fb79ef839e}{ustorage\_fs\_probe}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00219}\mbox{\hyperlink{ustorage__fs_8c_a0dd6f738ee9631f869256d862497ea17}{00219}} \textcolor{keyword}{static} device\_attach\_t \mbox{\hyperlink{ustorage__fs_8c_a0dd6f738ee9631f869256d862497ea17}{ustorage\_fs\_attach}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00220}\mbox{\hyperlink{ustorage__fs_8c_aad52dd33b34cb1de3dad334628260ca8}{00220}} \textcolor{keyword}{static} device\_detach\_t \mbox{\hyperlink{ustorage__fs_8c_aad52dd33b34cb1de3dad334628260ca8}{ustorage\_fs\_detach}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00221}\mbox{\hyperlink{ustorage__fs_8c_ab5112453bd4a1eaa829869b0bc0a3261}{00221}} \textcolor{keyword}{static} device\_suspend\_t \mbox{\hyperlink{ustorage__fs_8c_ab5112453bd4a1eaa829869b0bc0a3261}{ustorage\_fs\_suspend}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00222}\mbox{\hyperlink{ustorage__fs_8c_afdb3a8705a6df4d3f79ed87f661864c9}{00222}} \textcolor{keyword}{static} device\_resume\_t \mbox{\hyperlink{ustorage__fs_8c_afdb3a8705a6df4d3f79ed87f661864c9}{ustorage\_fs\_resume}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00223}\mbox{\hyperlink{ustorage__fs_8c_a36823f9e0fce3e02855b8692ad2503a9}{00223}} \textcolor{keyword}{static} usb\_handle\_request\_t \mbox{\hyperlink{ustorage__fs_8c_a36823f9e0fce3e02855b8692ad2503a9}{ustorage\_fs\_handle\_request}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00224}00224 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00225}\mbox{\hyperlink{ustorage__fs_8c_a6f2ead658203bb2b973d0f2ff570ada0}{00225}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{ustorage__fs_8c_a6f2ead658203bb2b973d0f2ff570ada0}{ustorage\_fs\_t\_bbb\_command\_callback}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00226}\mbox{\hyperlink{ustorage__fs_8c_af82809290354247be3bc492260d73d10}{00226}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{ustorage__fs_8c_af82809290354247be3bc492260d73d10}{ustorage\_fs\_t\_bbb\_data\_dump\_callback}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00227}\mbox{\hyperlink{ustorage__fs_8c_af95185cc80e31f37b3fe2ae6e1aa16bf}{00227}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{ustorage__fs_8c_af95185cc80e31f37b3fe2ae6e1aa16bf}{ustorage\_fs\_t\_bbb\_data\_read\_callback}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00228}\mbox{\hyperlink{ustorage__fs_8c_ab75719aad77161b05e0538e50e7583ab}{00228}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{ustorage__fs_8c_ab75719aad77161b05e0538e50e7583ab}{ustorage\_fs\_t\_bbb\_data\_write\_callback}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00229}\mbox{\hyperlink{ustorage__fs_8c_afd417effaea6e4a7142e63f19c84b705}{00229}} \textcolor{keyword}{static} \mbox{\hyperlink{usbdi_8h_aad1085e1e87347ed71e554c4b0209239}{usb\_callback\_t}} \mbox{\hyperlink{ustorage__fs_8c_afd417effaea6e4a7142e63f19c84b705}{ustorage\_fs\_t\_bbb\_status\_callback}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00230}00230 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00231}00231 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc, uint8\_t xfer\_index);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00232}00232 \textcolor{keyword}{static} \textcolor{keywordtype}{void} \mbox{\hyperlink{ustorage__fs_8c_a5030252f5b42cf345be517c3ddee994e}{ustorage\_fs\_transfer\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00233}00233 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00234}00234 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_af8fc6e9407990450b58451ce0598e3f1}{ustorage\_fs\_verify}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00235}00235 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a43d453ab225bcf03519281c3a9074963}{ustorage\_fs\_inquiry}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00236}00236 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a41331b7a198942c12038d652c62304bd}{ustorage\_fs\_request\_sense}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00237}00237 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a1939a7d976484826439601002488fd56}{ustorage\_fs\_read\_capacity}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00238}00238 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_ade6edfc049059629dfd3cfa89da407f1}{ustorage\_fs\_mode\_sense}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00239}00239 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a1f5b2ce705ab2e9775545c4d7c201dc6}{ustorage\_fs\_start\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00240}00240 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a6b5da2d93c6a02a64fb9ad44e321749e}{ustorage\_fs\_prevent\_allow}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00241}00241 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a44340bafe5eda6d617a19604a82cfc00}{ustorage\_fs\_read\_format\_capacities}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00242}00242 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_af058bbd372130879d8170f05c70f13cd}{ustorage\_fs\_mode\_select}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00243}00243 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc, uint32\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, uint32\_t mask);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00244}00244 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a5922137d46d7364e4ec5a7915cc45c4e}{ustorage\_fs\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00245}00245 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a2c609e8f819e2c279c969d10c1aeaa02}{ustorage\_fs\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00246}00246 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc, uint8\_t cmd\_size, uint16\_t mask, uint8\_t needs\_medium);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00247}00247 \textcolor{keyword}{static} uint8\_t \mbox{\hyperlink{ustorage__fs_8c_a3af8988426cb3227555f2c8e9d63b25a}{ustorage\_fs\_do\_cmd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00249}\mbox{\hyperlink{ustorage__fs_8c_a06337af168d4f5f68f802b40d6f869be}{00249}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{ustorage__fs_8c_a06337af168d4f5f68f802b40d6f869be}{ustorage\_fs\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00250}00250         \textcolor{comment}{/* USB interface */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00251}00251         DEVMETHOD(\mbox{\hyperlink{usb__handle__request_8c_acd7ff252b93f3bd9e87d0f8b3eb3ffa5}{usb\_handle\_request}}, \mbox{\hyperlink{ustorage__fs_8c_a36823f9e0fce3e02855b8692ad2503a9}{ustorage\_fs\_handle\_request}}),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00252}00252 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00253}00253         \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00254}00254         DEVMETHOD(device\_probe, \mbox{\hyperlink{ustorage__fs_8c_a9408e5ec2d394d47a0db57fb79ef839e}{ustorage\_fs\_probe}}),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00255}00255         DEVMETHOD(device\_attach, \mbox{\hyperlink{ustorage__fs_8c_a0dd6f738ee9631f869256d862497ea17}{ustorage\_fs\_attach}}),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00256}00256         DEVMETHOD(device\_detach, \mbox{\hyperlink{ustorage__fs_8c_aad52dd33b34cb1de3dad334628260ca8}{ustorage\_fs\_detach}}),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00257}00257         DEVMETHOD(device\_suspend, \mbox{\hyperlink{ustorage__fs_8c_ab5112453bd4a1eaa829869b0bc0a3261}{ustorage\_fs\_suspend}}),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00258}00258         DEVMETHOD(device\_resume, \mbox{\hyperlink{ustorage__fs_8c_afdb3a8705a6df4d3f79ed87f661864c9}{ustorage\_fs\_resume}}),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00259}00259 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00260}00260         DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00261}00261 \};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00262}00262 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00263}\mbox{\hyperlink{ustorage__fs_8c_a0de694b55426af29beb4eb959e82b69a}{00263}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{ustorage__fs_8c_a0de694b55426af29beb4eb959e82b69a}{ustorage\_fs\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00264}00264         .name = \textcolor{stringliteral}{"{}ustorage\_fs"{}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00265}00265         .methods = \mbox{\hyperlink{ustorage__fs_8c_a06337af168d4f5f68f802b40d6f869be}{ustorage\_fs\_methods}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00266}00266         .size = \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}}),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00267}00267 \};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00268}00268 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00269}\mbox{\hyperlink{ustorage__fs_8c_a252e0a01376d5d4302c5cd1b68931ac1}{00269}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{ustorage__fs_8c_a252e0a01376d5d4302c5cd1b68931ac1}{ustorage\_fs\_devclass}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00270}00270 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00271}\mbox{\hyperlink{ustorage__fs_8c_a8d12690ef393039636615ae52e1f158c}{00271}} \mbox{\hyperlink{ustorage__fs_8c_a8d12690ef393039636615ae52e1f158c}{DRIVER\_MODULE}}(ustorage\_fs, uhub, \mbox{\hyperlink{ustorage__fs_8c_a0de694b55426af29beb4eb959e82b69a}{ustorage\_fs\_driver}}, \mbox{\hyperlink{ustorage__fs_8c_a252e0a01376d5d4302c5cd1b68931ac1}{ustorage\_fs\_devclass}}, NULL, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00272}\mbox{\hyperlink{ustorage__fs_8c_a473fc32255fb5db1be87eb40f3b12eae}{00272}} \mbox{\hyperlink{ustorage__fs_8c_a473fc32255fb5db1be87eb40f3b12eae}{MODULE\_VERSION}}(ustorage\_fs, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00273}\mbox{\hyperlink{ustorage__fs_8c_a47886a0f94323eb79fa11cee7086ec1b}{00273}} \mbox{\hyperlink{ustorage__fs_8c_a47886a0f94323eb79fa11cee7086ec1b}{MODULE\_DEPEND}}(ustorage\_fs, \mbox{\hyperlink{usb__if_8m_adfa3f6da9c4881e494b180c4ebb06470}{usb}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00274}00274 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00275}\mbox{\hyperlink{ustorage__fs_8c_a25e7ef3fe7e8458af344889d90effb77}{00275}} \textcolor{keyword}{static} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__config}{usb\_config}} \mbox{\hyperlink{ustorage__fs_8c_a25e7ef3fe7e8458af344889d90effb77}{ustorage\_fs\_bbb\_config}}[\mbox{\hyperlink{ustorage__fs_8c_aa1895628185475bd721d7ad4ec9578ea}{USTORAGE\_FS\_T\_BBB\_MAX}}] = \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00276}00276         [\mbox{\hyperlink{ustorage__fs_8c_accdd89d1bbe1093a6c7594713482a256}{USTORAGE\_FS\_T\_BBB\_COMMAND}}] = \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00277}00277                 .\mbox{\hyperlink{structusb__config_a5bd5d569870291a54d9bed8377ed8b10}{type}} = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00278}00278                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00279}00279                 .direction = \mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00280}00280                 .bufsize = \textcolor{keyword}{sizeof}(ustorage\_fs\_bbb\_cbw\_t),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00281}00281                 .\mbox{\hyperlink{structusb__config_ad6cf53d455b808964f881c91074d2696}{callback}} = \&\mbox{\hyperlink{ustorage__fs_8c_a6f2ead658203bb2b973d0f2ff570ada0}{ustorage\_fs\_t\_bbb\_command\_callback}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00282}00282                 .\mbox{\hyperlink{structusb__config_a45b9e9ae72187e9854d90fbf8542c2ce}{usb\_mode}} = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806bada6c05f1ad342e782a92990170fca2cc}{USB\_MODE\_DEVICE}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00283}00283         \},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00284}00284 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00285}00285         [\mbox{\hyperlink{ustorage__fs_8c_a262d4f620f4f8c4a511ad7914c97a39d}{USTORAGE\_FS\_T\_BBB\_DATA\_DUMP}}] = \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00286}00286                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00287}00287                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00288}00288                 .direction = \mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00289}00289                 .bufsize = 0,   \textcolor{comment}{/* use wMaxPacketSize */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00290}00290                 .flags = \{.proxy\_buffer = 1,.short\_xfer\_ok = 1,\},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00291}00291                 .callback = \&\mbox{\hyperlink{ustorage__fs_8c_af82809290354247be3bc492260d73d10}{ustorage\_fs\_t\_bbb\_data\_dump\_callback}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00292}00292                 .usb\_mode = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806bada6c05f1ad342e782a92990170fca2cc}{USB\_MODE\_DEVICE}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00293}00293         \},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00294}00294 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00295}00295         [\mbox{\hyperlink{ustorage__fs_8c_ada56a71a3d76619041458afc0005773f}{USTORAGE\_FS\_T\_BBB\_DATA\_READ}}] = \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00296}00296                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00297}00297                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00298}00298                 .direction = \mbox{\hyperlink{usb_8h_a9a98e1bc9388db2ab5213e9d6496e851}{UE\_DIR\_OUT}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00299}00299                 .bufsize = \mbox{\hyperlink{ustorage__fs_8c_aa1eea8cf48cd6202c8f1af3d2281dfc7}{USTORAGE\_FS\_BULK\_SIZE}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00300}00300                 .flags = \{.proxy\_buffer = 1,.short\_xfer\_ok = 1\},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00301}00301                 .callback = \&\mbox{\hyperlink{ustorage__fs_8c_af95185cc80e31f37b3fe2ae6e1aa16bf}{ustorage\_fs\_t\_bbb\_data\_read\_callback}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00302}00302                 .usb\_mode = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806bada6c05f1ad342e782a92990170fca2cc}{USB\_MODE\_DEVICE}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00303}00303         \},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00304}00304 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00305}00305         [\mbox{\hyperlink{ustorage__fs_8c_a42d3987f781dc102b007fa85957b4dda}{USTORAGE\_FS\_T\_BBB\_DATA\_WRITE}}] = \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00306}00306                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00307}00307                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00308}00308                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00309}00309                 .bufsize = \mbox{\hyperlink{ustorage__fs_8c_aa1eea8cf48cd6202c8f1af3d2281dfc7}{USTORAGE\_FS\_BULK\_SIZE}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00310}00310                 .flags = \{.proxy\_buffer = 1,.short\_xfer\_ok = 1,.ext\_buffer = 1\},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00311}00311                 .callback = \&\mbox{\hyperlink{ustorage__fs_8c_ab75719aad77161b05e0538e50e7583ab}{ustorage\_fs\_t\_bbb\_data\_write\_callback}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00312}00312                 .usb\_mode = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806bada6c05f1ad342e782a92990170fca2cc}{USB\_MODE\_DEVICE}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00313}00313         \},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00314}00314 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00315}00315         [\mbox{\hyperlink{ustorage__fs_8c_a0d8aba5cd0104a73f937a0c69b182804}{USTORAGE\_FS\_T\_BBB\_STATUS}}] = \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00316}00316                 .type = \mbox{\hyperlink{usb_8h_a25240fc009aa67bb7a2b635d2e9401e4}{UE\_BULK}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00317}00317                 .endpoint = \mbox{\hyperlink{usb_8h_a1e8d1f402536e634471569b83f603197}{UE\_ADDR\_ANY}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00318}00318                 .direction = \mbox{\hyperlink{usb_8h_a72bb077a860132c175c166f344c75893}{UE\_DIR\_IN}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00319}00319                 .bufsize = \textcolor{keyword}{sizeof}(ustorage\_fs\_bbb\_csw\_t),}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00320}00320                 .\mbox{\hyperlink{structusb__config_a0e7feb3ff903ed490f21c1e5b128fc71}{flags}} = \{.\mbox{\hyperlink{structusb__xfer__flags_a295c379f07c6ff99b213195edc70e3a2}{short\_xfer\_ok}} = 1\},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00321}00321                 .callback = \&\mbox{\hyperlink{ustorage__fs_8c_afd417effaea6e4a7142e63f19c84b705}{ustorage\_fs\_t\_bbb\_status\_callback}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00322}00322                 .usb\_mode = \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806bada6c05f1ad342e782a92990170fca2cc}{USB\_MODE\_DEVICE}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00323}00323         \},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00324}00324 \};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00325}00325 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00326}00326 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00327}00327 \textcolor{comment}{ * USB device probe/attach/detach}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00328}00328 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00329}00329 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00330}00330 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00331}\mbox{\hyperlink{ustorage__fs_8c_aed5c27223b3db4da274b84d3d2efe2d2}{00331}} \mbox{\hyperlink{ustorage__fs_8c_a9408e5ec2d394d47a0db57fb79ef839e}{ustorage\_fs\_probe}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00332}00332 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00333}00333         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00334}00334         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__interface__descriptor}{usb\_interface\_descriptor}} *\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00335}00335 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00336}00336         \textcolor{keywordflow}{if} (uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a246691e99681281d3113d63e81b7e4f0}{usb\_mode}} != \mbox{\hyperlink{usb_8h_a9bc559812598988121896dceb483806bada6c05f1ad342e782a92990170fca2cc}{USB\_MODE\_DEVICE}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00337}00337                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00338}00338         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00339}00339         \textcolor{comment}{/* Check for a standards compliant device */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00340}00340         \textcolor{keywordtype}{id} = \mbox{\hyperlink{usb__device_8c_a4b209681fa34e4570ab0544d0ae9002f}{usbd\_get\_interface\_descriptor}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_aaf4432c55ec34c0e4eb0cb3ddfb08ffd}{iface}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00341}00341         \textcolor{keywordflow}{if} ((\textcolor{keywordtype}{id} == NULL) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00342}00342             (\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>bInterfaceClass != \mbox{\hyperlink{usb_8h_ae81b41321fc379102099b7f2e5c9739e}{UICLASS\_MASS}}) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00343}00343             (\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>bInterfaceSubClass != \mbox{\hyperlink{usb_8h_a46b53cbd6c85c0370cb95f6c794f3cb6}{UISUBCLASS\_SCSI}}) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00344}00344             (\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}}-\/>bInterfaceProtocol != \mbox{\hyperlink{usb_8h_a1dd4ef2dd3103277eab1c96c2a8ccae3}{UIPROTO\_MASS\_BBB}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00345}00345                 \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00346}00346         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00347}00347         \textcolor{keywordflow}{return} (BUS\_PROBE\_GENERIC);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00348}00348 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00349}00349 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00350}00350 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00351}\mbox{\hyperlink{ustorage__fs_8c_ac1441c86df5aec246bd996ee7f573f32}{00351}} \mbox{\hyperlink{ustorage__fs_8c_a0dd6f738ee9631f869256d862497ea17}{ustorage\_fs\_attach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00352}00352 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00353}00353         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00354}00354         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__attach__arg}{usb\_attach\_arg}} *uaa = device\_get\_ivars(dev);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00355}00355         \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__interface__descriptor}{usb\_interface\_descriptor}} *\mbox{\hyperlink{if__usievar_8h_a1e6927fa1486224044e568f9c370519b}{id}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00356}00356         \textcolor{keywordtype}{int} err;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00357}00357         \textcolor{keywordtype}{int} unit;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00358}00358 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00359}00359         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00360}00360 \textcolor{comment}{         * NOTE: the softc struct is cleared in device\_set\_driver.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00361}00361 \textcolor{comment}{         * We can safely call ustorage\_fs\_detach without specifically}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00362}00362 \textcolor{comment}{         * initializing the struct.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00363}00363 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00364}00364 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00365}00365         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a556c8d1cc8022c575541bbbdc5f009da}{sc\_dev}} = dev;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00366}00366         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a6e36915fab6e253c68496ea1fe2781d0}{sc\_udev}} = uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00367}00367         unit = device\_get\_unit(dev);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00368}00368 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00369}00369         \textcolor{comment}{/* enable power saving mode */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00370}00370         \mbox{\hyperlink{usb__hub_8c_a0fe52cb0293b8d1de260b88e4558bd00}{usbd\_set\_power\_mode}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}}, \mbox{\hyperlink{usb_8h_a79c6b1aa1092c1f425f4159590403382}{USB\_POWER\_MODE\_SAVE}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00371}00371 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00372}00372         \textcolor{keywordflow}{if} (unit == 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00373}00373                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{ustorage__fs_8c_ad3b193e6ec3768900e2a96949e31fbb5}{ustorage\_fs\_ramdisk}} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00374}00374                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00375}00375 \textcolor{comment}{                         * allocate a memory image for our ramdisk until}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00376}00376 \textcolor{comment}{                         * further}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00377}00377 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00378}00378                         \mbox{\hyperlink{ustorage__fs_8c_ad3b193e6ec3768900e2a96949e31fbb5}{ustorage\_fs\_ramdisk}} =}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00379}00379                             malloc(\mbox{\hyperlink{ustorage__fs_8c_a9230cb01ef34424c57a7c55025f09c0e}{USTORAGE\_FS\_RAM\_SECT}} << 9, M\_USB,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00380}00380                             M\_ZERO | M\_WAITOK);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00381}00381                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00382}00382                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a83080e56ecca9b0f8240dab238b4f807}{sc\_lun}}[0].\mbox{\hyperlink{structustorage__fs__lun_a8085151a917f01b68593431564d6e6c4}{memory\_image}} = \mbox{\hyperlink{ustorage__fs_8c_ad3b193e6ec3768900e2a96949e31fbb5}{ustorage\_fs\_ramdisk}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00383}00383                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a83080e56ecca9b0f8240dab238b4f807}{sc\_lun}}[0].\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}} = \mbox{\hyperlink{ustorage__fs_8c_a9230cb01ef34424c57a7c55025f09c0e}{USTORAGE\_FS\_RAM\_SECT}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00384}00384                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a83080e56ecca9b0f8240dab238b4f807}{sc\_lun}}[0].\mbox{\hyperlink{structustorage__fs__lun_a419bbb2c5cac21c0c1b71c449a5c0478}{removable}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00385}00385         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00386}00386 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00387}00387         \mbox{\hyperlink{usb__util_8c_a2f65a197990caa1a69a16691ce4dc66a}{device\_set\_usb\_desc}}(dev);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00388}00388 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00389}00389         mtx\_init(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}}, \textcolor{stringliteral}{"{}USTORAGE\_FS lock"{}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00390}00390             NULL, (MTX\_DEF | MTX\_RECURSE));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00391}00391 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00392}00392         \textcolor{comment}{/* get interface index */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00393}00393 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00394}00394         \textcolor{keywordtype}{id} = \mbox{\hyperlink{usb__device_8c_a4b209681fa34e4570ab0544d0ae9002f}{usbd\_get\_interface\_descriptor}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_aaf4432c55ec34c0e4eb0cb3ddfb08ffd}{iface}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00395}00395         \textcolor{keywordflow}{if} (\textcolor{keywordtype}{id} == NULL) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00396}00396                 device\_printf(dev, \textcolor{stringliteral}{"{}failed to get "{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00397}00397                     \textcolor{stringliteral}{"{}interface number\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00398}00398                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00399}00399         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00400}00400         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9310552931e7e0ffbc700afb2b7dd66a}{sc\_iface\_no}} = \textcolor{keywordtype}{id}-\/>bInterfaceNumber;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00401}00401 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00402}00402         err = \mbox{\hyperlink{usb__transfer_8c_a7494c04fae5c5e7ef1af436308670a21}{usbd\_transfer\_setup}}(uaa-\/>\mbox{\hyperlink{structusb__attach__arg_ac86557d3eaf77874d436ce38648b0276}{device}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00403}00403             \&uaa-\/>\mbox{\hyperlink{structusb__attach__arg_a66c2afc71fce73cc432f7d58593e1f26}{info}}.\mbox{\hyperlink{structusbd__lookup__info_a50a68740a4c82f1a9b999d4a7994b550}{bIfaceIndex}}, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}, \mbox{\hyperlink{ustorage__fs_8c_a25e7ef3fe7e8458af344889d90effb77}{ustorage\_fs\_bbb\_config}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00404}00404             \mbox{\hyperlink{ustorage__fs_8c_aa1895628185475bd721d7ad4ec9578ea}{USTORAGE\_FS\_T\_BBB\_MAX}}, sc, \&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00405}00405         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00406}00406                 device\_printf(dev, \textcolor{stringliteral}{"{}could not setup required "{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00407}00407                     \textcolor{stringliteral}{"{}transfers, \%s\(\backslash\)n"{}}, \mbox{\hyperlink{usb__error_8c_a2391eb446dce3e4368cacf781857774e}{usbd\_errstr}}(err));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00408}00408                 \textcolor{keywordflow}{goto} detach;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00409}00409         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00410}00410 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00411}00411         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}} = \mbox{\hyperlink{usb__transfer_8c_a5c51a0e41cb978b9e01e032ce56f7d5a}{usbd\_xfer\_get\_frame\_buffer}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}[}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00412}00412             \mbox{\hyperlink{ustorage__fs_8c_accdd89d1bbe1093a6c7594713482a256}{USTORAGE\_FS\_T\_BBB\_COMMAND}}], 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00413}00413         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}} = \mbox{\hyperlink{usb__transfer_8c_a5c51a0e41cb978b9e01e032ce56f7d5a}{usbd\_xfer\_get\_frame\_buffer}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}[}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00414}00414             \mbox{\hyperlink{ustorage__fs_8c_a0d8aba5cd0104a73f937a0c69b182804}{USTORAGE\_FS\_T\_BBB\_STATUS}}], 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00415}00415         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a2968f304eeac7af426a993b56c476446}{sc\_dma\_ptr}} = \mbox{\hyperlink{usb__transfer_8c_a5c51a0e41cb978b9e01e032ce56f7d5a}{usbd\_xfer\_get\_frame\_buffer}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}[}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00416}00416             \mbox{\hyperlink{ustorage__fs_8c_ada56a71a3d76619041458afc0005773f}{USTORAGE\_FS\_T\_BBB\_DATA\_READ}}], 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00417}00417 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00418}00418         \textcolor{comment}{/* start Mass Storage State Machine */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00419}00419 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00420}00420         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00421}00421         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc, \mbox{\hyperlink{ustorage__fs_8c_accdd89d1bbe1093a6c7594713482a256}{USTORAGE\_FS\_T\_BBB\_COMMAND}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00422}00422         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00423}00423 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00424}00424         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00425}00425 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00426}00426 detach:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00427}00427         \mbox{\hyperlink{ustorage__fs_8c_aad52dd33b34cb1de3dad334628260ca8}{ustorage\_fs\_detach}}(dev);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00428}00428         \textcolor{keywordflow}{return} (ENXIO);                 \textcolor{comment}{/* failure */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00429}00429 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00430}00430 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00431}00431 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00432}\mbox{\hyperlink{ustorage__fs_8c_a8bc4fca073df255afdaab7b7b13a734d}{00432}} \mbox{\hyperlink{ustorage__fs_8c_aad52dd33b34cb1de3dad334628260ca8}{ustorage\_fs\_detach}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00433}00433 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00434}00434         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00435}00435 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00436}00436         \textcolor{comment}{/* teardown our statemachine */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00437}00437 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00438}00438         \mbox{\hyperlink{usb__transfer_8c_a2f5ab55bfe7f356bb7a7505ff35c9741}{usbd\_transfer\_unsetup}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}, \mbox{\hyperlink{ustorage__fs_8c_aa1895628185475bd721d7ad4ec9578ea}{USTORAGE\_FS\_T\_BBB\_MAX}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00439}00439 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00440}00440         mtx\_destroy(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00441}00441 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00442}00442         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00443}00443 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00444}00444 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00445}00445 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00446}\mbox{\hyperlink{ustorage__fs_8c_a89dfb372c8b862f9687ce9fd52635910}{00446}} \mbox{\hyperlink{ustorage__fs_8c_ab5112453bd4a1eaa829869b0bc0a3261}{ustorage\_fs\_suspend}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00447}00447 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00448}00448         device\_printf(dev, \textcolor{stringliteral}{"{}suspending\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00449}00449         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00450}00450 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00451}00451 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00452}00452 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00453}\mbox{\hyperlink{ustorage__fs_8c_a40583fb13c2975b1f5609bb91836bb96}{00453}} \mbox{\hyperlink{ustorage__fs_8c_afdb3a8705a6df4d3f79ed87f661864c9}{ustorage\_fs\_resume}}(device\_t dev)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00454}00454 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00455}00455         device\_printf(dev, \textcolor{stringliteral}{"{}resuming\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00456}00456         \textcolor{keywordflow}{return} (0);                     \textcolor{comment}{/* success */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00457}00457 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00458}00458 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00459}00459 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00460}00460 \textcolor{comment}{ * Generic functions to handle transfers}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00461}00461 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00462}00462 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00463}00463 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00464}\mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{00464}} \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc, uint8\_t xfer\_index)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00465}00465 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00466}00466         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}[xfer\_index]) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00467}00467                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a730eaa6377ceb22743d2e7961541ca7a}{sc\_last\_xfer\_index}} = xfer\_index;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00468}00468                 \mbox{\hyperlink{usb__transfer_8c_a7a1f2d22a70b832e8cc31366adec443d}{usbd\_transfer\_start}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}[xfer\_index]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00469}00469         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00470}00470 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00471}00471 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00472}00472 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00473}\mbox{\hyperlink{ustorage__fs_8c_a5030252f5b42cf345be517c3ddee994e}{00473}} \mbox{\hyperlink{ustorage__fs_8c_a5030252f5b42cf345be517c3ddee994e}{ustorage\_fs\_transfer\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00474}00474 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00475}00475         \mbox{\hyperlink{usb__transfer_8c_abe245d973df0cfd6fb96b884d33ebce3}{usbd\_transfer\_stop}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}[sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a730eaa6377ceb22743d2e7961541ca7a}{sc\_last\_xfer\_index}}]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00476}00476         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00477}00477         \mbox{\hyperlink{usb__transfer_8c_aa525d15cc84d40dafaaecf86537e2c7f}{usbd\_transfer\_drain}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_afd07c0d12bdeef63f4154c500e9dd457}{sc\_xfer}}[sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a730eaa6377ceb22743d2e7961541ca7a}{sc\_last\_xfer\_index}}]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00478}00478         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00479}00479 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00480}00480 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00481}00481 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00482}\mbox{\hyperlink{ustorage__fs_8c_adb6db1111c9580b005f881e24bb7d9b0}{00482}} \mbox{\hyperlink{ustorage__fs_8c_a36823f9e0fce3e02855b8692ad2503a9}{ustorage\_fs\_handle\_request}}(device\_t dev,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00483}00483     \textcolor{keyword}{const} \textcolor{keywordtype}{void} *preq, \textcolor{keywordtype}{void} **\mbox{\hyperlink{usb__if_8m_a074c17a419327b41805af2dd7cb152e7}{pptr}}, uint16\_t *\mbox{\hyperlink{usb__if_8m_aaba3806a5156b2c2a6d6f95f0d95ed03}{plen}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00484}00484     uint16\_t \mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}}, uint8\_t *\mbox{\hyperlink{usb__if_8m_a8a16a0091a5793ece040278427496b23}{pstate}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00485}00485 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00486}00486         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc = device\_get\_softc(dev);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00487}00487         \textcolor{keyword}{const} \textcolor{keyword}{struct }\mbox{\hyperlink{structusb__device__request}{usb\_device\_request}} *\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}} = preq;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00488}00488         uint8\_t is\_complete = *\mbox{\hyperlink{usb__if_8m_a8a16a0091a5793ece040278427496b23}{pstate}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00489}00489 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00490}00490         \textcolor{keywordflow}{if} (!is\_complete) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00491}00491                 \textcolor{keywordflow}{if} ((\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bmRequestType == \mbox{\hyperlink{usb_8h_ac338c3af82b085859b50582e10fa7cb7}{UT\_WRITE\_CLASS\_INTERFACE}}) \&\&}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00492}00492                     (\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bRequest == \mbox{\hyperlink{ustorage__fs_8c_ab4366a21c8add102c374fe8baeddadcb}{UR\_BBB\_RESET}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00493}00493                         *\mbox{\hyperlink{usb__if_8m_aaba3806a5156b2c2a6d6f95f0d95ed03}{plen}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00494}00494                         mtx\_lock(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00495}00495                         \mbox{\hyperlink{ustorage__fs_8c_a5030252f5b42cf345be517c3ddee994e}{ustorage\_fs\_transfer\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00496}00496                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00497}00497                         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00498}00498                             \mbox{\hyperlink{ustorage__fs_8c_accdd89d1bbe1093a6c7594713482a256}{USTORAGE\_FS\_T\_BBB\_COMMAND}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00499}00499                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a137ee37da02d9f7f6d0b578f2bff6f1a}{sc\_mtx}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00500}00500                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00501}00501                 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} ((\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bmRequestType == \mbox{\hyperlink{usb_8h_a4f2e0216ffe1d8145cd1385e42c9a707}{UT\_READ\_CLASS\_INTERFACE}}) \&\&}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00502}00502                            (\mbox{\hyperlink{usb__if_8m_accfb270fc1884a0d1e4b9a0fb6234f14}{req}}-\/>bRequest == \mbox{\hyperlink{ustorage__fs_8c_a6950b30cda57ceb3ff2d75caea266f1b}{UR\_BBB\_GET\_MAX\_LUN}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00503}00503                         \textcolor{keywordflow}{if} (\mbox{\hyperlink{usb__if_8m_ac681806181c80437cfab37335f62ff39}{offset}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00504}00504                                 *\mbox{\hyperlink{usb__if_8m_aaba3806a5156b2c2a6d6f95f0d95ed03}{plen}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00505}00505                                 *\mbox{\hyperlink{usb__if_8m_a074c17a419327b41805af2dd7cb152e7}{pptr}} = \&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_aa12e2966cbe7837afc2a2f45159aab33}{sc\_last\_lun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00506}00506                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00507}00507                                 *\mbox{\hyperlink{usb__if_8m_aaba3806a5156b2c2a6d6f95f0d95ed03}{plen}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00508}00508                         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00509}00509                         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00510}00510                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00511}00511         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00512}00512         \textcolor{keywordflow}{return} (ENXIO);                 \textcolor{comment}{/* use builtin handler */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00513}00513 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00514}00514 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00515}00515 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00516}\mbox{\hyperlink{ustorage__fs_8c_a35162cfb271995a99a9adf316fe9398a}{00516}} \mbox{\hyperlink{ustorage__fs_8c_a6f2ead658203bb2b973d0f2ff570ada0}{ustorage\_fs\_t\_bbb\_command\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00517}00517 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00518}00518         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00519}00519         uint32\_t tag;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00520}00520         uint8\_t err = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00521}00521 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00522}00522         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00523}00523 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00524}00524         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00525}00525         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00526}00526 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00527}00527                 tag = \mbox{\hyperlink{usb__endian_8h_aad306e3f757f924966cddfe6dfa9dc44}{UGETDW}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>dCBWSignature);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00528}00528 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00529}00529                 \textcolor{keywordflow}{if} (tag != \mbox{\hyperlink{ustorage__fs_8c_a15cfcf912acb56af1b66380542dcf7f6}{CBWSIGNATURE}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00530}00530                         \textcolor{comment}{/* do nothing */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00531}00531                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid signature 0x\%08x\(\backslash\)n"{}}, tag);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00532}00532                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00533}00533                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00534}00534                 tag = \mbox{\hyperlink{usb__endian_8h_aad306e3f757f924966cddfe6dfa9dc44}{UGETDW}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>dCBWTag);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00535}00535 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00536}00536                 \textcolor{comment}{/* echo back tag */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00537}00537                 \mbox{\hyperlink{usb__endian_8h_a864b3f3abc2ce39bc4c60fadac2a7303}{USETDW}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>dCSWTag, tag);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00538}00538 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00539}00539                 \textcolor{comment}{/* reset status */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00540}00540                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>bCSWStatus = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00541}00541 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00542}00542                 \textcolor{comment}{/* reset data offset, data length and data remainder */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00543}00543                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ad20b6a7e083750c5f9479a62b01600e3}{offset}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00544}00544                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} =}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00545}00545                     \mbox{\hyperlink{usb__endian_8h_aad306e3f757f924966cddfe6dfa9dc44}{UGETDW}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>dCBWDataTransferLength);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00546}00546 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00547}00547                 \textcolor{comment}{/* reset data flags */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00548}00548                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a2f3399a91c1477c39485ba8f53082afb}{data\_short}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00549}00549 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00550}00550                 \textcolor{comment}{/* extract LUN */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00551}00551                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4364c870d6d5340302c1cc772928cc9c}{lun}} = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>bCBWLUN;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00552}00552 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00553}00553                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00554}00554                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_a665390e734d124195aa8d263d475c73a}{DIR\_NONE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00555}00555                 \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00556}00556                         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>bCBWFlags \& \mbox{\hyperlink{ustorage__fs_8c_ae8a2116019faea706c66bc3638995400}{CBWFLAGS\_IN}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00557}00557                                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00558}00558                         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00559}00559                                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00560}00560                         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00561}00561                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00562}00562 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00563}00563                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{cmd\_len}} = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>bCDBLength;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00564}00564                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{cmd\_len}} > \textcolor{keyword}{sizeof}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB)) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00565}00565                     (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{cmd\_len}} == 0)) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00566}00566                         \textcolor{comment}{/* just halt -\/ this is invalid */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00567}00567                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}invalid command length \%d bytes\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00568}00568                             sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{cmd\_len}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00569}00569                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00570}00570                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00571}00571 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00572}00572                 err = \mbox{\hyperlink{ustorage__fs_8c_a3af8988426cb3227555f2c8e9d63b25a}{ustorage\_fs\_do\_cmd}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00573}00573                 \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00574}00574                         \textcolor{comment}{/* got an error */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00575}00575                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}command failed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00576}00576                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00577}00577                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00578}00578                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} > 0) \&\&}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00579}00579                     (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}} != sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00580}00580                         \textcolor{comment}{/* contradicting data transfer direction */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00581}00581                         err = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00582}00582                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}data direction mismatch\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00583}00583                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00584}00584                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00585}00585                 \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00586}00586                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00587}00587                         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc, \mbox{\hyperlink{ustorage__fs_8c_ada56a71a3d76619041458afc0005773f}{USTORAGE\_FS\_T\_BBB\_DATA\_READ}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00588}00588                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00589}00589                 \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00590}00590                         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc, \mbox{\hyperlink{ustorage__fs_8c_a42d3987f781dc102b007fa85957b4dda}{USTORAGE\_FS\_T\_BBB\_DATA\_WRITE}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00591}00591                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00592}00592                 \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00593}00593                         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00594}00594                             \mbox{\hyperlink{ustorage__fs_8c_a0d8aba5cd0104a73f937a0c69b182804}{USTORAGE\_FS\_T\_BBB\_STATUS}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00595}00595                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00596}00596                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00597}00597                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00598}00598 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00599}00599         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00600}00600 tr\_setup:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00601}00601                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00602}00602                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00603}00603                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00604}00604                         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}stall pipe\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00605}00605                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00606}00606                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00607}00607                     \textcolor{keyword}{sizeof}(ustorage\_fs\_bbb\_cbw\_t));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00608}00608                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00609}00609                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00610}00610 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00611}00611         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00612}00612                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}error\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00613}00613                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00614}00614                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00615}00615                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00616}00616                 \textcolor{comment}{/* If the pipe is already stalled, don't do another stall */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00617}00617                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{usb__transfer_8c_a9072c9b566e9debc3256945558cf9860}{usbd\_xfer\_is\_stalled}}(xfer))}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00618}00618                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00619}00619 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00620}00620                 \textcolor{comment}{/* try again */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00621}00621                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00622}00622         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00623}00623         \textcolor{keywordflow}{if} (err) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00624}00624                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>bCSWStatus == 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00625}00625                         \textcolor{comment}{/* set some default error code */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00626}00626                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>bCSWStatus = \mbox{\hyperlink{ustorage__fs_8c_aee89dc947347ceec52385e1428cdf087}{CSWSTATUS\_FAILED}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00627}00627                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00628}00628                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}} == \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00629}00629                         \textcolor{comment}{/* dump all data */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00630}00630                         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00631}00631                             \mbox{\hyperlink{ustorage__fs_8c_a262d4f620f4f8c4a511ad7914c97a39d}{USTORAGE\_FS\_T\_BBB\_DATA\_DUMP}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00632}00632                         \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00633}00633                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00634}00634                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}} == \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00635}00635                         \textcolor{comment}{/* need to stall before status */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00636}00636                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00637}00637                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00638}00638                 \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc, \mbox{\hyperlink{ustorage__fs_8c_a0d8aba5cd0104a73f937a0c69b182804}{USTORAGE\_FS\_T\_BBB\_STATUS}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00639}00639         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00640}00640 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00641}00641 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00642}00642 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00643}\mbox{\hyperlink{ustorage__fs_8c_a7142b027a8cd3bb05c0682a500d40bb3}{00643}} \mbox{\hyperlink{ustorage__fs_8c_af82809290354247be3bc492260d73d10}{ustorage\_fs\_t\_bbb\_data\_dump\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00644}00644 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00645}00645         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00646}00646         uint32\_t max\_bulk = \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00647}00647         \textcolor{keywordtype}{int} actlen, sumlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00648}00648 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00649}00649         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, \&sumlen, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00650}00650 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00651}00651         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00652}00652 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00653}00653         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00654}00654         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00655}00655                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} -\/= actlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00656}00656                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ad20b6a7e083750c5f9479a62b01600e3}{offset}} += actlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00657}00657 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00658}00658                 \textcolor{keywordflow}{if} (actlen != sumlen || sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00659}00659                         \textcolor{comment}{/* short transfer or end of data */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00660}00660                         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00661}00661                             \mbox{\hyperlink{ustorage__fs_8c_a0d8aba5cd0104a73f937a0c69b182804}{USTORAGE\_FS\_T\_BBB\_STATUS}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00662}00662                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00663}00663                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00664}00664                 \textcolor{comment}{/* Fallthrough */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00665}00665 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00666}00666         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00667}00667 tr\_setup:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00668}00668                 \textcolor{keywordflow}{if} (max\_bulk > sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00669}00669                         max\_bulk = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00670}00670                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00671}00671                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00672}00672                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00673}00673                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00674}00674                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00675}00675                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0, max\_bulk);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00676}00676                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00677}00677                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00678}00678 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00679}00679         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00680}00680                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00681}00681                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00682}00682                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00683}00683                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00684}00684 \textcolor{comment}{                 * If the pipe is already stalled, don't do another stall:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00685}00685 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00686}00686                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{usb__transfer_8c_a9072c9b566e9debc3256945558cf9860}{usbd\_xfer\_is\_stalled}}(xfer))}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00687}00687                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00688}00688 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00689}00689                 \textcolor{comment}{/* try again */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00690}00690                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00691}00691         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00692}00692 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00693}00693 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00694}00694 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00695}\mbox{\hyperlink{ustorage__fs_8c_ab8407de3d8b974d980f6768edc63550b}{00695}} \mbox{\hyperlink{ustorage__fs_8c_af95185cc80e31f37b3fe2ae6e1aa16bf}{ustorage\_fs\_t\_bbb\_data\_read\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00696}00696 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00697}00697         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00698}00698         uint32\_t max\_bulk = \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00699}00699         \textcolor{keywordtype}{int} actlen, sumlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00700}00700 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00701}00701         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, \&sumlen, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00702}00702 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00703}00703         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00704}00704 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00705}00705         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00706}00706         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00707}00707                 \textcolor{comment}{/* XXX copy data from DMA buffer */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00708}00708                 memcpy(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}}, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a2968f304eeac7af426a993b56c476446}{sc\_dma\_ptr}}, actlen);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00709}00709 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00710}00710                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} -\/= actlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00711}00711                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}} += actlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00712}00712                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ad20b6a7e083750c5f9479a62b01600e3}{offset}} += actlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00713}00713 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00714}00714                 \textcolor{keywordflow}{if} (actlen != sumlen || sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00715}00715                         \textcolor{comment}{/* short transfer or end of data */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00716}00716                         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00717}00717                             \mbox{\hyperlink{ustorage__fs_8c_a0d8aba5cd0104a73f937a0c69b182804}{USTORAGE\_FS\_T\_BBB\_STATUS}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00718}00718                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00719}00719                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00720}00720                 \textcolor{comment}{/* Fallthrough */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00721}00721 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00722}00722         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00723}00723 tr\_setup:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00724}00724                 \textcolor{keywordflow}{if} (max\_bulk > sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00725}00725                         max\_bulk = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00726}00726                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00727}00727                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00728}00728                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00729}00729                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00730}00730                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00731}00731 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00732}00732                 \mbox{\hyperlink{usb__transfer_8c_a30d239cbfe3c02ec7da6e6dfe5055762}{usbd\_xfer\_set\_frame\_data}}(xfer, 0, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a2968f304eeac7af426a993b56c476446}{sc\_dma\_ptr}}, max\_bulk);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00733}00733                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00734}00734                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00735}00735 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00736}00736         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00737}00737                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00738}00738                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00739}00739                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00740}00740                 \textcolor{comment}{/* If the pipe is already stalled, don't do another stall */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00741}00741                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{usb__transfer_8c_a9072c9b566e9debc3256945558cf9860}{usbd\_xfer\_is\_stalled}}(xfer))}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00742}00742                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00743}00743 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00744}00744                 \textcolor{comment}{/* try again */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00745}00745                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00746}00746         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00747}00747 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00748}00748 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00749}00749 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00750}\mbox{\hyperlink{ustorage__fs_8c_aad99dec82861caf852b341a635c34a74}{00750}} \mbox{\hyperlink{ustorage__fs_8c_ab75719aad77161b05e0538e50e7583ab}{ustorage\_fs\_t\_bbb\_data\_write\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00751}00751 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00752}00752         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00753}00753         uint32\_t max\_bulk = \mbox{\hyperlink{usb__transfer_8c_ae34a7cc2f01c6dfb68bca6fd0b72647e}{usbd\_xfer\_max\_len}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00754}00754         \textcolor{keywordtype}{int} actlen, sumlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00755}00755 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00756}00756         \mbox{\hyperlink{usb__transfer_8c_ac0c68320222f26c2a3eba47b46c47899}{usbd\_xfer\_status}}(xfer, \&actlen, \&sumlen, NULL, NULL);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00757}00757 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00758}00758         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00759}00759 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00760}00760         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00761}00761         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00762}00762                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} -\/= actlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00763}00763                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}} += actlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00764}00764                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ad20b6a7e083750c5f9479a62b01600e3}{offset}} += actlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00765}00765 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00766}00766                 \textcolor{keywordflow}{if} (actlen != sumlen || sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} == 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00767}00767                         \textcolor{comment}{/* short transfer or end of data */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00768}00768                         \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00769}00769                             \mbox{\hyperlink{ustorage__fs_8c_a0d8aba5cd0104a73f937a0c69b182804}{USTORAGE\_FS\_T\_BBB\_STATUS}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00770}00770                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00771}00771                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00772}00772         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00773}00773 tr\_setup:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00774}00774                 \textcolor{keywordflow}{if} (max\_bulk >= sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00775}00775                         max\_bulk = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00776}00776                         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a2f3399a91c1477c39485ba8f53082afb}{data\_short}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00777}00777                                 \mbox{\hyperlink{usb__transfer_8c_a082882e3b111da906360d70571c27185}{usbd\_xfer\_set\_flag}}(xfer, \mbox{\hyperlink{usbdi_8h_a460c943d044267cf1a6f7bb0270a32cd}{USB\_FORCE\_SHORT\_XFER}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00778}00778                         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00779}00779                                 \mbox{\hyperlink{usb__transfer_8c_aac106827b5e245e018342e191160ba35}{usbd\_xfer\_clr\_flag}}(xfer, \mbox{\hyperlink{usbdi_8h_a460c943d044267cf1a6f7bb0270a32cd}{USB\_FORCE\_SHORT\_XFER}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00780}00780                 \} \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00781}00781                         \mbox{\hyperlink{usb__transfer_8c_aac106827b5e245e018342e191160ba35}{usbd\_xfer\_clr\_flag}}(xfer, \mbox{\hyperlink{usbdi_8h_a460c943d044267cf1a6f7bb0270a32cd}{USB\_FORCE\_SHORT\_XFER}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00782}00782 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00783}00783                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00784}00784                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00785}00785                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00786}00786                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00787}00787 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00788}00788                 \textcolor{comment}{/* XXX copy data to DMA buffer */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00789}00789                 memcpy(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a2968f304eeac7af426a993b56c476446}{sc\_dma\_ptr}}, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}}, max\_bulk);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00790}00790 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00791}00791                 \mbox{\hyperlink{usb__transfer_8c_a30d239cbfe3c02ec7da6e6dfe5055762}{usbd\_xfer\_set\_frame\_data}}(xfer, 0, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a2968f304eeac7af426a993b56c476446}{sc\_dma\_ptr}}, max\_bulk);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00792}00792                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00793}00793                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00794}00794 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00795}00795         \textcolor{keywordflow}{default}:                        \textcolor{comment}{/* Error */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00796}00796                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00797}00797                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00798}00798                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00799}00799                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00800}00800 \textcolor{comment}{                 * If the pipe is already stalled, don't do another}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00801}00801 \textcolor{comment}{                 * stall}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00802}00802 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00803}00803                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{usb__transfer_8c_a9072c9b566e9debc3256945558cf9860}{usbd\_xfer\_is\_stalled}}(xfer))}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00804}00804                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00805}00805 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00806}00806                 \textcolor{comment}{/* try again */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00807}00807                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00808}00808         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00809}00809 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00810}00810 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00811}00811 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00812}\mbox{\hyperlink{ustorage__fs_8c_afb1b882c8c63056b6e84ec1070a4dcae}{00812}} \mbox{\hyperlink{ustorage__fs_8c_afd417effaea6e4a7142e63f19c84b705}{ustorage\_fs\_t\_bbb\_status\_callback}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structusb__xfer}{usb\_xfer}} *xfer, \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945}{usb\_error\_t}} \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00813}00813 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00814}00814         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc = \mbox{\hyperlink{usb__transfer_8c_ab75ef6d82c4a000a3d16c133d1d589b0}{usbd\_xfer\_softc}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00815}00815 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00816}00816         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00817}00817 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00818}00818         \textcolor{keywordflow}{switch} (\mbox{\hyperlink{usbdi_8h_adc2dd35bd0dd6a42d3abd4230796a7b0}{USB\_GET\_STATE}}(xfer)) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00819}00819         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a8f0386217ba77be3e47721fae9aa9b3d}{USB\_ST\_TRANSFERRED}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00820}00820                 \mbox{\hyperlink{ustorage__fs_8c_a2bbe0408439cbeafd50b85bdd1332d24}{ustorage\_fs\_transfer\_start}}(sc, \mbox{\hyperlink{ustorage__fs_8c_accdd89d1bbe1093a6c7594713482a256}{USTORAGE\_FS\_T\_BBB\_COMMAND}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00821}00821                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00822}00822 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00823}00823         \textcolor{keywordflow}{case} \mbox{\hyperlink{usbdi_8h_a3aa7120c3ecab31972b8fe219530f552}{USB\_ST\_SETUP}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00824}00824 tr\_setup:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00825}00825                 \mbox{\hyperlink{usb__endian_8h_a864b3f3abc2ce39bc4c60fadac2a7303}{USETDW}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>dCSWSignature, \mbox{\hyperlink{ustorage__fs_8c_a6d29dee6ca7f61ee7407eb0c9df8fe0a}{CSWSIGNATURE}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00826}00826                 \mbox{\hyperlink{usb__endian_8h_a864b3f3abc2ce39bc4c60fadac2a7303}{USETDW}}(sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>dCSWDataResidue, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00827}00827 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00828}00828                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00829}00829                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00830}00830                         \mbox{\hyperlink{usb__transfer_8c_abadf9cb2f8e81a5133af0c8030039de3}{usbd\_xfer\_set\_stall}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00831}00831                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00832}00832                 \mbox{\hyperlink{usb__transfer_8c_a31786497f0f4222203b1e993d52af753}{usbd\_xfer\_set\_frame\_len}}(xfer, 0,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00833}00833                     \textcolor{keyword}{sizeof}(ustorage\_fs\_bbb\_csw\_t));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00834}00834                 \mbox{\hyperlink{usb__transfer_8c_a10c440b0b97cac293b4df9d558f15bac}{usbd\_transfer\_submit}}(xfer);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00835}00835                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00836}00836 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00837}00837         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00838}00838                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} == \mbox{\hyperlink{usbdi_8h_a5daf16538c7ea36dad2de85182c72945abe72c3e4b6644141519a28f1ef97f717}{USB\_ERR\_CANCELLED}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00839}00839                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00840}00840                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00841}00841                 \textcolor{comment}{/* If the pipe is already stalled, don't do another stall */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00842}00842                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{usb__transfer_8c_a9072c9b566e9debc3256945558cf9860}{usbd\_xfer\_is\_stalled}}(xfer))}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00843}00843                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6e9a5bfac8f74dbee16b41998d6d59df}{data\_error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00844}00844 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00845}00845                 \textcolor{comment}{/* try again */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00846}00846                 \textcolor{keywordflow}{goto} tr\_setup;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00847}00847         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00848}00848 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00849}00849 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00850}00850 \textcolor{comment}{/* SCSI commands that we recognize */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00851}\mbox{\hyperlink{ustorage__fs_8c_a73e50e305800473bfff81432a2e6d14f}{00851}} \textcolor{preprocessor}{\#define SC\_FORMAT\_UNIT                  0x04}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00852}\mbox{\hyperlink{ustorage__fs_8c_aae584232af12ed88ea34a2bf47fb117f}{00852}} \textcolor{preprocessor}{\#define SC\_INQUIRY                      0x12}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00853}\mbox{\hyperlink{ustorage__fs_8c_abec665786b8b91299dc34d9561074db7}{00853}} \textcolor{preprocessor}{\#define SC\_MODE\_SELECT\_6                0x15}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00854}\mbox{\hyperlink{ustorage__fs_8c_a9b9a1ffa21861c90d08012589cc1899f}{00854}} \textcolor{preprocessor}{\#define SC\_MODE\_SELECT\_10               0x55}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00855}\mbox{\hyperlink{ustorage__fs_8c_a2ed139b7fdbbcb720ba53330734b2c34}{00855}} \textcolor{preprocessor}{\#define SC\_MODE\_SENSE\_6                 0x1a}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00856}\mbox{\hyperlink{ustorage__fs_8c_a5db66d30cfa4873b80008e2c85f56faa}{00856}} \textcolor{preprocessor}{\#define SC\_MODE\_SENSE\_10                0x5a}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00857}\mbox{\hyperlink{ustorage__fs_8c_a5eb65d59d1177e0e67703b0981601f40}{00857}} \textcolor{preprocessor}{\#define SC\_PREVENT\_ALLOW\_MEDIUM\_REMOVAL 0x1e}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00858}\mbox{\hyperlink{ustorage__fs_8c_a1703e2b24d288f8a58c41b593c7999d5}{00858}} \textcolor{preprocessor}{\#define SC\_READ\_6                       0x08}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00859}\mbox{\hyperlink{ustorage__fs_8c_acf0377189aacf40e50cab9b0b956edd0}{00859}} \textcolor{preprocessor}{\#define SC\_READ\_10                      0x28}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00860}\mbox{\hyperlink{ustorage__fs_8c_a104b58c1ff8edaa46939c8c2a308fe9c}{00860}} \textcolor{preprocessor}{\#define SC\_READ\_12                      0xa8}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00861}\mbox{\hyperlink{ustorage__fs_8c_ac216daacc2c7da0290a214ae38229246}{00861}} \textcolor{preprocessor}{\#define SC\_READ\_CAPACITY                0x25}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00862}\mbox{\hyperlink{ustorage__fs_8c_a5e8e6e5af68fe5aed2e87b5c3b27c77e}{00862}} \textcolor{preprocessor}{\#define SC\_READ\_FORMAT\_CAPACITIES       0x23}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00863}\mbox{\hyperlink{ustorage__fs_8c_af9b3ce6b2596a6a0d492b3f6989858da}{00863}} \textcolor{preprocessor}{\#define SC\_RELEASE                      0x17}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00864}\mbox{\hyperlink{ustorage__fs_8c_ae3528cede8cde69eabe7337b443ec852}{00864}} \textcolor{preprocessor}{\#define SC\_REQUEST\_SENSE                0x03}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00865}\mbox{\hyperlink{ustorage__fs_8c_a10d5d3c175ce21d2774837995d8a90bb}{00865}} \textcolor{preprocessor}{\#define SC\_RESERVE                      0x16}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00866}\mbox{\hyperlink{ustorage__fs_8c_afe04be7df9778882c0afbb5ec3178af9}{00866}} \textcolor{preprocessor}{\#define SC\_SEND\_DIAGNOSTIC              0x1d}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00867}\mbox{\hyperlink{ustorage__fs_8c_ad78f8289751cb62c5fbb9d507cafd7d2}{00867}} \textcolor{preprocessor}{\#define SC\_START\_STOP\_UNIT              0x1b}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00868}\mbox{\hyperlink{ustorage__fs_8c_afcf1f810c699cccf3ddfe32522c5ab4a}{00868}} \textcolor{preprocessor}{\#define SC\_SYNCHRONIZE\_CACHE            0x35}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00869}\mbox{\hyperlink{ustorage__fs_8c_a0ed01bd6799e21d78f9344e85d29318c}{00869}} \textcolor{preprocessor}{\#define SC\_TEST\_UNIT\_READY              0x00}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00870}\mbox{\hyperlink{ustorage__fs_8c_abbd6d6288e2759e50009f9e70c0371fc}{00870}} \textcolor{preprocessor}{\#define SC\_VERIFY                       0x2f}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00871}\mbox{\hyperlink{ustorage__fs_8c_a8d080159075572af5fc9be7fbece8f4e}{00871}} \textcolor{preprocessor}{\#define SC\_WRITE\_6                      0x0a}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00872}\mbox{\hyperlink{ustorage__fs_8c_a68b349957c29d9e28f52d8eea651b906}{00872}} \textcolor{preprocessor}{\#define SC\_WRITE\_10                     0x2a}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00873}\mbox{\hyperlink{ustorage__fs_8c_a6be3b299a152817fc1bc625c850d9000}{00873}} \textcolor{preprocessor}{\#define SC\_WRITE\_12                     0xaa}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00874}00874 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00875}00875 \textcolor{comment}{/* SCSI Sense Key/Additional Sense Code/ASC Qualifier values */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00876}\mbox{\hyperlink{ustorage__fs_8c_a0ea3bc3520fd838b03bf8874dcfb7a33}{00876}} \textcolor{preprocessor}{\#define SS\_NO\_SENSE                             0}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00877}\mbox{\hyperlink{ustorage__fs_8c_af9db359fafd563e24623bb0c3ce3873c}{00877}} \textcolor{preprocessor}{\#define SS\_COMMUNICATION\_FAILURE                0x040800}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00878}\mbox{\hyperlink{ustorage__fs_8c_a0debcafb2e293a1d17aca281f54d7f43}{00878}} \textcolor{preprocessor}{\#define SS\_INVALID\_COMMAND                      0x052000}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00879}\mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{00879}} \textcolor{preprocessor}{\#define SS\_INVALID\_FIELD\_IN\_CDB                 0x052400}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00880}\mbox{\hyperlink{ustorage__fs_8c_ad48de92b661361f0b28a294f1961462f}{00880}} \textcolor{preprocessor}{\#define SS\_LOGICAL\_BLOCK\_ADDRESS\_OUT\_OF\_RANGE   0x052100}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00881}\mbox{\hyperlink{ustorage__fs_8c_aab8c023290e7e5d16542426563367489}{00881}} \textcolor{preprocessor}{\#define SS\_LOGICAL\_UNIT\_NOT\_SUPPORTED           0x052500}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00882}\mbox{\hyperlink{ustorage__fs_8c_aee4247268695e6687a95766578201e68}{00882}} \textcolor{preprocessor}{\#define SS\_MEDIUM\_NOT\_PRESENT                   0x023a00}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00883}\mbox{\hyperlink{ustorage__fs_8c_a490304789443a3b1901e67247593e5c1}{00883}} \textcolor{preprocessor}{\#define SS\_MEDIUM\_REMOVAL\_PREVENTED             0x055302}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00884}\mbox{\hyperlink{ustorage__fs_8c_a812609511d28ef8e4c475a8d958fe57f}{00884}} \textcolor{preprocessor}{\#define SS\_NOT\_READY\_TO\_READY\_TRANSITION        0x062800}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00885}\mbox{\hyperlink{ustorage__fs_8c_a12bcc1b8e8fff8f80a449c83d9afcf12}{00885}} \textcolor{preprocessor}{\#define SS\_RESET\_OCCURRED                       0x062900}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00886}\mbox{\hyperlink{ustorage__fs_8c_a3f5dfb2fb2034d2af12faf36576e70a2}{00886}} \textcolor{preprocessor}{\#define SS\_SAVING\_PARAMETERS\_NOT\_SUPPORTED      0x053900}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00887}\mbox{\hyperlink{ustorage__fs_8c_a2b6c4c3b78f6a70f19ca7c03032cde35}{00887}} \textcolor{preprocessor}{\#define SS\_UNRECOVERED\_READ\_ERROR               0x031100}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00888}\mbox{\hyperlink{ustorage__fs_8c_adf983f6c5b60f62c9a6439dfce9b5058}{00888}} \textcolor{preprocessor}{\#define SS\_WRITE\_ERROR                          0x030c02}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00889}\mbox{\hyperlink{ustorage__fs_8c_a8fd74bf2fcf12ba0cad677675d0707c5}{00889}} \textcolor{preprocessor}{\#define SS\_WRITE\_PROTECTED                      0x072700}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00890}00890 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00891}\mbox{\hyperlink{ustorage__fs_8c_a8eac3109a3617db741e3762103116dd4}{00891}} \textcolor{preprocessor}{\#define SK(x)           ((uint8\_t) ((x) >> 16)) }\textcolor{comment}{/* Sense Key byte, etc. */}\textcolor{preprocessor}{}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00892}\mbox{\hyperlink{ustorage__fs_8c_a30a817fc8fb9b54365faf80da9ff0e91}{00892}} \textcolor{preprocessor}{\#define ASC(x)          ((uint8\_t) ((x) >> 8))}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00893}\mbox{\hyperlink{ustorage__fs_8c_a8115aabfc43930da9359f5bfa17e3c94}{00893}} \textcolor{preprocessor}{\#define ASCQ(x)         ((uint8\_t) (x))}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00894}00894 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00895}00895 \textcolor{comment}{/* Routines for unaligned data access */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00896}00896 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00897}00897 \textcolor{keyword}{static} uint16\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00898}\mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{00898}} \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(uint8\_t *buf)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00899}00899 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00900}00900         \textcolor{keywordflow}{return} ((uint16\_t)buf[0] << 8) | ((uint16\_t)buf[1]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00901}00901 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00902}00902 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00903}00903 \textcolor{keyword}{static} uint32\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00904}\mbox{\hyperlink{ustorage__fs_8c_ae9b1d434a7addefba708fdf8e14eddea}{00904}} \mbox{\hyperlink{ustorage__fs_8c_ae9b1d434a7addefba708fdf8e14eddea}{get\_be32}}(uint8\_t *buf)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00905}00905 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00906}00906         \textcolor{keywordflow}{return} ((uint32\_t)buf[0] << 24) | ((uint32\_t)buf[1] << 16) |}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00907}00907         ((uint32\_t)buf[2] << 8) | ((uint32\_t)buf[3]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00908}00908 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00909}00909 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00910}00910 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00911}\mbox{\hyperlink{ustorage__fs_8c_a58d9e734d228efbd11066a6ad749779d}{00911}} \mbox{\hyperlink{ustorage__fs_8c_a58d9e734d228efbd11066a6ad749779d}{put\_be16}}(uint8\_t *buf, uint16\_t \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00912}00912 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00913}00913         buf[0] = \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} >> 8;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00914}00914         buf[1] = \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00915}00915 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00916}00916 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00917}00917 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00918}\mbox{\hyperlink{ustorage__fs_8c_a36266dde01aa32d79e74e53546af7596}{00918}} \mbox{\hyperlink{ustorage__fs_8c_a36266dde01aa32d79e74e53546af7596}{put\_be32}}(uint8\_t *buf, uint32\_t \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00919}00919 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00920}00920         buf[0] = \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} >> 24;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00921}00921         buf[1] = \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} >> 16;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00922}00922         buf[2] = \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} >> 8;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00923}00923         buf[3] = \mbox{\hyperlink{if__rum_8c_ae1f13e96d928504e11ec4da744f67f9b}{val}} \& 0xff;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00924}00924 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00925}00925 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00926}00926 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00927}00927 \textcolor{comment}{ *      ustorage\_fs\_verify}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00928}00928 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00929}00929 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00930}00930 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00931}00931 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00932}00932 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00933}00933 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00934}\mbox{\hyperlink{ustorage__fs_8c_af8fc6e9407990450b58451ce0598e3f1}{00934}} \mbox{\hyperlink{ustorage__fs_8c_af8fc6e9407990450b58451ce0598e3f1}{ustorage\_fs\_verify}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00935}00935 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00936}00936         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00937}00937         uint32\_t lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00938}00938         uint32\_t vlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00939}00939         uint64\_t file\_offset;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00940}00940         uint64\_t amount\_left;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00941}00941 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00942}00942         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00943}00943 \textcolor{comment}{         * Get the starting Logical Block Address}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00944}00944 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00945}00945         lba = \mbox{\hyperlink{ustorage__fs_8c_ae9b1d434a7addefba708fdf8e14eddea}{get\_be32}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[2]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00946}00946 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00947}00947         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00948}00948 \textcolor{comment}{         * We allow DPO (Disable Page Out = don't save data in the cache)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00949}00949 \textcolor{comment}{         * but we don't implement it.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00950}00950 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00951}00951         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1] \& \string~0x10) != 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00952}00952                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{SS\_INVALID\_FIELD\_IN\_CDB}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00953}00953                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00954}00954         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00955}00955         vlen = \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[7]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00956}00956         \textcolor{keywordflow}{if} (vlen == 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00957}00957                 \textcolor{keywordflow}{goto} done;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00958}00958         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00959}00959         \textcolor{comment}{/* No default reply */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00960}00960 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00961}00961         \textcolor{comment}{/* Prepare to carry out the file verify */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00962}00962         amount\_left = vlen;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00963}00963         amount\_left <<= 9;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00964}00964         file\_offset = lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00965}00965         file\_offset <<= 9;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00966}00966 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00967}00967         \textcolor{comment}{/* Range check */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00968}00968         vlen += lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00969}00969 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00970}00970         \textcolor{keywordflow}{if} ((vlen < lba) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00971}00971             (vlen > currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}}) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00972}00972             (lba >= currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00973}00973                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ad48de92b661361f0b28a294f1961462f}{SS\_LOGICAL\_BLOCK\_ADDRESS\_OUT\_OF\_RANGE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00974}00974                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00975}00975         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00976}00976         \textcolor{comment}{/* XXX TODO: verify that data is readable */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00977}00977 done:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00978}00978         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 0, -\/1U));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00979}00979 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00980}00980 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00981}00981 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00982}00982 \textcolor{comment}{ *      ustorage\_fs\_inquiry}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00983}00983 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00984}00984 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00985}00985 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00986}00986 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00987}00987 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00988}00988 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00989}\mbox{\hyperlink{ustorage__fs_8c_a43d453ab225bcf03519281c3a9074963}{00989}} \mbox{\hyperlink{ustorage__fs_8c_a43d453ab225bcf03519281c3a9074963}{ustorage\_fs\_inquiry}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00990}00990 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00991}00991         uint8\_t *buf = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00992}00992 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00993}00993         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00994}00994 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00995}00995         \textcolor{keywordflow}{if} (!sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00996}00996                 \textcolor{comment}{/* Unsupported LUNs are okay */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00997}00997                 memset(buf, 0, 36);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00998}00998                 buf[0] = 0x7f;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l00999}00999                 \textcolor{comment}{/* Unsupported, no device -\/ type */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01000}01000                 \textcolor{keywordflow}{return} (\mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 36, -\/1U));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01001}01001         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01002}01002         memset(buf, 0, 8);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01003}01003         \textcolor{comment}{/* Non -\/ removable, direct -\/ access device */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01004}01004         \textcolor{keywordflow}{if} (currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a419bbb2c5cac21c0c1b71c449a5c0478}{removable}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01005}01005                 buf[1] = 0x80;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01006}01006         buf[2] = 2;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01007}01007         \textcolor{comment}{/* ANSI SCSI level 2 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01008}01008         buf[3] = 2;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01009}01009         \textcolor{comment}{/* SCSI -\/ 2 INQUIRY data format */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01010}01010         buf[4] = 31;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01011}01011         \textcolor{comment}{/* Additional length */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01012}01012         \textcolor{comment}{/* No special options */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01013}01013         \textcolor{comment}{/* Copy in ID string */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01014}01014         memcpy(buf + 8, \mbox{\hyperlink{ustorage__fs_8c_a47249cc55e310fb474721e9ad84fd422}{USTORAGE\_FS\_ID\_STRING}}, 28);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01015}01015 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01016}01016 \textcolor{preprocessor}{\#if (USTORAGE\_QDATA\_MAX < 36)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01017}01017 \textcolor{preprocessor}{\#error "{}(USTORAGE\_QDATA\_MAX < 36)"{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01018}01018 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01019}01019         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 36, -\/1U));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01020}01020 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01021}01021 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01022}01022 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01023}01023 \textcolor{comment}{ *      ustorage\_fs\_request\_sense}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01024}01024 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01025}01025 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01026}01026 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01027}01027 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01028}01028 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01029}01029 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01030}\mbox{\hyperlink{ustorage__fs_8c_a41331b7a198942c12038d652c62304bd}{01030}} \mbox{\hyperlink{ustorage__fs_8c_a41331b7a198942c12038d652c62304bd}{ustorage\_fs\_request\_sense}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01031}01031 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01032}01032         uint8\_t *buf = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01033}01033         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01034}01034         uint32\_t sd;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01035}01035         uint32\_t sdinfo;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01036}01036         uint8\_t valid;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01037}01037 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01038}01038         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01039}01039 \textcolor{comment}{         * From the SCSI-\/2 spec., section 7.9 (Unit attention condition):}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01040}01040 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01041}01041 \textcolor{comment}{         * If a REQUEST SENSE command is received from an initiator}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01042}01042 \textcolor{comment}{         * with a pending unit attention condition (before the target}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01043}01043 \textcolor{comment}{         * generates the contingent allegiance condition), then the}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01044}01044 \textcolor{comment}{         * target shall either:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01045}01045 \textcolor{comment}{         *   a) report any pending sense data and preserve the unit}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01046}01046 \textcolor{comment}{         *      attention condition on the logical unit, or,}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01047}01047 \textcolor{comment}{         *   b) report the unit attention condition, may discard any}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01048}01048 \textcolor{comment}{         *      pending sense data, and clear the unit attention}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01049}01049 \textcolor{comment}{         *      condition on the logical unit for that initiator.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01050}01050 \textcolor{comment}{         *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01051}01051 \textcolor{comment}{         * FSG normally uses option a); enable this code to use option b).}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01052}01052 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01053}01053 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01054}01054         \textcolor{keywordflow}{if} (currlun \&\& currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a596ff4c4cb155d5a0bfd0448579960ec}{unit\_attention\_data}} != \mbox{\hyperlink{ustorage__fs_8c_a0ea3bc3520fd838b03bf8874dcfb7a33}{SS\_NO\_SENSE}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01055}01055                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a596ff4c4cb155d5a0bfd0448579960ec}{unit\_attention\_data}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01056}01056                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a596ff4c4cb155d5a0bfd0448579960ec}{unit\_attention\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a0ea3bc3520fd838b03bf8874dcfb7a33}{SS\_NO\_SENSE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01057}01057         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01058}01058 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01059}01059 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01060}01060         \textcolor{keywordflow}{if} (!currlun) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01061}01061                 \textcolor{comment}{/* Unsupported LUNs are okay */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01062}01062                 sd = \mbox{\hyperlink{ustorage__fs_8c_aab8c023290e7e5d16542426563367489}{SS\_LOGICAL\_UNIT\_NOT\_SUPPORTED}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01063}01063                 sdinfo = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01064}01064                 valid = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01065}01065         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01066}01066                 sd = currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01067}01067                 sdinfo = currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a656ce36cd61057d53f93cb9a81062295}{sense\_data\_info}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01068}01068                 valid = currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_ad50231eac0b226fba1cc3557fad3c61b}{info\_valid}} << 7;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01069}01069                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a0ea3bc3520fd838b03bf8874dcfb7a33}{SS\_NO\_SENSE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01070}01070                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a656ce36cd61057d53f93cb9a81062295}{sense\_data\_info}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01071}01071                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_ad50231eac0b226fba1cc3557fad3c61b}{info\_valid}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01072}01072         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01073}01073 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01074}01074         memset(buf, 0, 18);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01075}01075         buf[0] = valid | 0x70;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01076}01076         \textcolor{comment}{/* Valid, current error */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01077}01077         buf[2] = \mbox{\hyperlink{ustorage__fs_8c_a8eac3109a3617db741e3762103116dd4}{SK}}(sd);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01078}01078         \mbox{\hyperlink{ustorage__fs_8c_a36266dde01aa32d79e74e53546af7596}{put\_be32}}(\&buf[3], sdinfo);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01079}01079         \textcolor{comment}{/* Sense information */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01080}01080         buf[7] = 18 -\/ 8;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01081}01081         \textcolor{comment}{/* Additional sense length */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01082}01082         buf[12] = \mbox{\hyperlink{ustorage__fs_8c_a30a817fc8fb9b54365faf80da9ff0e91}{ASC}}(sd);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01083}01083         buf[13] = \mbox{\hyperlink{ustorage__fs_8c_a8115aabfc43930da9359f5bfa17e3c94}{ASCQ}}(sd);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01084}01084 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01085}01085 \textcolor{preprocessor}{\#if (USTORAGE\_QDATA\_MAX < 18)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01086}01086 \textcolor{preprocessor}{\#error "{}(USTORAGE\_QDATA\_MAX < 18)"{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01087}01087 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01088}01088         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 18, -\/1U));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01089}01089 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01090}01090 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01091}01091 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01092}01092 \textcolor{comment}{ *      ustorage\_fs\_read\_capacity}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01093}01093 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01094}01094 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01095}01095 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01096}01096 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01097}01097 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01098}01098 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01099}\mbox{\hyperlink{ustorage__fs_8c_a1939a7d976484826439601002488fd56}{01099}} \mbox{\hyperlink{ustorage__fs_8c_a1939a7d976484826439601002488fd56}{ustorage\_fs\_read\_capacity}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01100}01100 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01101}01101         uint8\_t *buf = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01102}01102         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01103}01103         uint32\_t lba = \mbox{\hyperlink{ustorage__fs_8c_ae9b1d434a7addefba708fdf8e14eddea}{get\_be32}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[2]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01104}01104         uint8\_t pmi = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[8];}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01105}01105 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01106}01106         \textcolor{comment}{/* Check the PMI and LBA fields */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01107}01107         \textcolor{keywordflow}{if} ((pmi > 1) || ((pmi == 0) \&\& (lba != 0))) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01108}01108                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{SS\_INVALID\_FIELD\_IN\_CDB}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01109}01109                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01110}01110         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01111}01111         \textcolor{comment}{/* Max logical block */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01112}01112         \mbox{\hyperlink{ustorage__fs_8c_a36266dde01aa32d79e74e53546af7596}{put\_be32}}(\&buf[0], currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}} -\/ 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01113}01113         \textcolor{comment}{/* Block length */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01114}01114         \mbox{\hyperlink{ustorage__fs_8c_a36266dde01aa32d79e74e53546af7596}{put\_be32}}(\&buf[4], 512);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01115}01115 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01116}01116 \textcolor{preprocessor}{\#if (USTORAGE\_QDATA\_MAX < 8)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01117}01117 \textcolor{preprocessor}{\#error "{}(USTORAGE\_QDATA\_MAX < 8)"{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01118}01118 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01119}01119         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 8, -\/1U));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01120}01120 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01121}01121 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01122}01122 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01123}01123 \textcolor{comment}{ *      ustorage\_fs\_mode\_sense}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01124}01124 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01125}01125 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01126}01126 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01127}01127 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01128}01128 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01129}01129 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01130}\mbox{\hyperlink{ustorage__fs_8c_ade6edfc049059629dfd3cfa89da407f1}{01130}} \mbox{\hyperlink{ustorage__fs_8c_ade6edfc049059629dfd3cfa89da407f1}{ustorage\_fs\_mode\_sense}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01131}01131 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01132}01132         uint8\_t *buf = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01133}01133         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01134}01134         uint8\_t *buf0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01135}01135         uint16\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01136}01136         uint16\_t limit;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01137}01137         uint8\_t mscmnd = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0];}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01138}01138         uint8\_t pc;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01139}01139         uint8\_t page\_code;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01140}01140         uint8\_t changeable\_values;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01141}01141         uint8\_t all\_pages;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01142}01142 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01143}01143         buf0 = buf;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01144}01144 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01145}01145         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1] \& \string~0x08) != 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01146}01146                 \textcolor{comment}{/* Mask away DBD */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01147}01147                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{SS\_INVALID\_FIELD\_IN\_CDB}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01148}01148                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01149}01149         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01150}01150         pc = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[2] >> 6;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01151}01151         page\_code = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[2] \& 0x3f;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01152}01152         \textcolor{keywordflow}{if} (pc == 3) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01153}01153                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a3f5dfb2fb2034d2af12faf36576e70a2}{SS\_SAVING\_PARAMETERS\_NOT\_SUPPORTED}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01154}01154                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01155}01155         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01156}01156         changeable\_values = (pc == 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01157}01157         all\_pages = (page\_code == 0x3f);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01158}01158 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01159}01159         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01160}01160 \textcolor{comment}{         * Write the mode parameter header.  Fixed values are: default}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01161}01161 \textcolor{comment}{         * medium type, no cache control (DPOFUA), and no block descriptors.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01162}01162 \textcolor{comment}{         * The only variable value is the WriteProtect bit.  We will fill in}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01163}01163 \textcolor{comment}{         * the mode data length later.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01164}01164 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01165}01165         memset(buf, 0, 8);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01166}01166         \textcolor{keywordflow}{if} (mscmnd == \mbox{\hyperlink{ustorage__fs_8c_a2ed139b7fdbbcb720ba53330734b2c34}{SC\_MODE\_SENSE\_6}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01167}01167                 buf[2] = (currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_aee7b0140a74ef80b921bbd36719cc50b}{read\_only}} ? 0x80 : 0x00);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01168}01168                 \textcolor{comment}{/* WP, DPOFUA */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01169}01169                 buf += 4;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01170}01170                 limit = 255;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01171}01171         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01172}01172                 \textcolor{comment}{/* SC\_MODE\_SENSE\_10 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01173}01173                 buf[3] = (currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_aee7b0140a74ef80b921bbd36719cc50b}{read\_only}} ? 0x80 : 0x00);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01174}01174                 \textcolor{comment}{/* WP, DPOFUA */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01175}01175                 buf += 8;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01176}01176                 limit = 65535;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01177}01177                 \textcolor{comment}{/* Should really be mod\_data.buflen */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01178}01178         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01179}01179 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01180}01180         \textcolor{comment}{/* No block descriptors */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01181}01181 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01182}01182         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01183}01183 \textcolor{comment}{         * The mode pages, in numerical order.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01184}01184 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01185}01185         \textcolor{keywordflow}{if} ((page\_code == 0x08) || all\_pages) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01186}01186                 buf[0] = 0x08;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01187}01187                 \textcolor{comment}{/* Page code */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01188}01188                 buf[1] = 10;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01189}01189                 \textcolor{comment}{/* Page length */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01190}01190                 memset(buf + 2, 0, 10);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01191}01191                 \textcolor{comment}{/* None of the fields are changeable */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01192}01192 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01193}01193                 \textcolor{keywordflow}{if} (!changeable\_values) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01194}01194                         buf[2] = 0x04;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01195}01195                         \textcolor{comment}{/* Write cache enable, */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01196}01196                         \textcolor{comment}{/* Read cache not disabled */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01197}01197                         \textcolor{comment}{/* No cache retention priorities */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01198}01198                         \mbox{\hyperlink{ustorage__fs_8c_a58d9e734d228efbd11066a6ad749779d}{put\_be16}}(\&buf[4], 0xffff);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01199}01199                         \textcolor{comment}{/* Don 't disable prefetch */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01200}01200                         \textcolor{comment}{/* Minimum prefetch = 0 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01201}01201                         \mbox{\hyperlink{ustorage__fs_8c_a58d9e734d228efbd11066a6ad749779d}{put\_be16}}(\&buf[8], 0xffff);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01202}01202                         \textcolor{comment}{/* Maximum prefetch */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01203}01203                         \mbox{\hyperlink{ustorage__fs_8c_a58d9e734d228efbd11066a6ad749779d}{put\_be16}}(\&buf[10], 0xffff);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01204}01204                         \textcolor{comment}{/* Maximum prefetch ceiling */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01205}01205                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01206}01206                 buf += 12;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01207}01207         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01208}01208         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01209}01209 \textcolor{comment}{         * Check that a valid page was requested and the mode data length}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01210}01210 \textcolor{comment}{         * isn't too long.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01211}01211 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01212}01212         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = buf -\/ buf0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01213}01213         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} > limit) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01214}01214                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{SS\_INVALID\_FIELD\_IN\_CDB}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01215}01215                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01216}01216         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01217}01217         \textcolor{comment}{/* Store the mode data length */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01218}01218         \textcolor{keywordflow}{if} (mscmnd == \mbox{\hyperlink{ustorage__fs_8c_a2ed139b7fdbbcb720ba53330734b2c34}{SC\_MODE\_SENSE\_6}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01219}01219                 buf0[0] = \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} -\/ 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01220}01220         \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01221}01221                 \mbox{\hyperlink{ustorage__fs_8c_a58d9e734d228efbd11066a6ad749779d}{put\_be16}}(buf0, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} -\/ 2);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01222}01222 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01223}01223 \textcolor{preprocessor}{\#if (USTORAGE\_QDATA\_MAX < 24)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01224}01224 \textcolor{preprocessor}{\#error "{}(USTORAGE\_QDATA\_MAX < 24)"{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01225}01225 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01226}01226         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, -\/1U));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01227}01227 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01228}01228 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01229}01229 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01230}01230 \textcolor{comment}{ *      ustorage\_fs\_start\_stop}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01231}01231 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01232}01232 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01233}01233 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01234}01234 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01235}01235 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01236}01236 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01237}\mbox{\hyperlink{ustorage__fs_8c_a1f5b2ce705ab2e9775545c4d7c201dc6}{01237}} \mbox{\hyperlink{ustorage__fs_8c_a1f5b2ce705ab2e9775545c4d7c201dc6}{ustorage\_fs\_start\_stop}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01238}01238 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01239}01239         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01240}01240         uint8\_t loej;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01241}01241         uint8\_t start;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01242}01242         uint8\_t immed;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01243}01243 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01244}01244         \textcolor{keywordflow}{if} (!currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a419bbb2c5cac21c0c1b71c449a5c0478}{removable}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01245}01245                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a0debcafb2e293a1d17aca281f54d7f43}{SS\_INVALID\_COMMAND}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01246}01246                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01247}01247         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01248}01248         immed = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1] \& 0x01;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01249}01249         loej = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4] \& 0x02;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01250}01250         start = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4] \& 0x01;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01251}01251 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01252}01252         \textcolor{keywordflow}{if} (immed || loej || start) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01253}01253                 \textcolor{comment}{/* compile fix */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01254}01254         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01255}01255         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01256}01256 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01257}01257 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01258}01258 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01259}01259 \textcolor{comment}{ *      ustorage\_fs\_prevent\_allow}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01260}01260 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01261}01261 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01262}01262 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01263}01263 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01264}01264 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01265}01265 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01266}\mbox{\hyperlink{ustorage__fs_8c_a6b5da2d93c6a02a64fb9ad44e321749e}{01266}} \mbox{\hyperlink{ustorage__fs_8c_a6b5da2d93c6a02a64fb9ad44e321749e}{ustorage\_fs\_prevent\_allow}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01267}01267 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01268}01268         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01269}01269         uint8\_t prevent;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01270}01270 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01271}01271         \textcolor{keywordflow}{if} (!currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a419bbb2c5cac21c0c1b71c449a5c0478}{removable}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01272}01272                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a0debcafb2e293a1d17aca281f54d7f43}{SS\_INVALID\_COMMAND}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01273}01273                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01274}01274         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01275}01275         prevent = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4] \& 0x01;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01276}01276         \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4] \& \string~0x01) != 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01277}01277                 \textcolor{comment}{/* Mask away Prevent */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01278}01278                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{SS\_INVALID\_FIELD\_IN\_CDB}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01279}01279                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01280}01280         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01281}01281         \textcolor{keywordflow}{if} (currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a88bed54b5cc610e641bad1a198bf9d11}{prevent\_medium\_removal}} \&\& !prevent) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01282}01282                 \textcolor{comment}{//fsync\_sub(currlun);}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01283}01283         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01284}01284         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a88bed54b5cc610e641bad1a198bf9d11}{prevent\_medium\_removal}} = prevent;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01285}01285         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01286}01286 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01287}01287 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01288}01288 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01289}01289 \textcolor{comment}{ *      ustorage\_fs\_read\_format\_capacities}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01290}01290 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01291}01291 \textcolor{comment}{ * Returns:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01292}01292 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01293}01293 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01294}01294 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01295}01295 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01296}\mbox{\hyperlink{ustorage__fs_8c_a44340bafe5eda6d617a19604a82cfc00}{01296}} \mbox{\hyperlink{ustorage__fs_8c_a44340bafe5eda6d617a19604a82cfc00}{ustorage\_fs\_read\_format\_capacities}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01297}01297 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01298}01298         uint8\_t *buf = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01299}01299         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01300}01300 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01301}01301         buf[0] = buf[1] = buf[2] = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01302}01302         buf[3] = 8;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01303}01303         \textcolor{comment}{/* Only the Current / Maximum Capacity Descriptor */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01304}01304         buf += 4;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01305}01305 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01306}01306         \textcolor{comment}{/* Number of blocks */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01307}01307         \mbox{\hyperlink{ustorage__fs_8c_a36266dde01aa32d79e74e53546af7596}{put\_be32}}(\&buf[0], currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01308}01308         \textcolor{comment}{/* Block length */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01309}01309         \mbox{\hyperlink{ustorage__fs_8c_a36266dde01aa32d79e74e53546af7596}{put\_be32}}(\&buf[4], 512);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01310}01310         \textcolor{comment}{/* Current capacity */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01311}01311         buf[4] = 0x02;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01312}01312 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01313}01313 \textcolor{preprocessor}{\#if (USTORAGE\_QDATA\_MAX < 12)}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01314}01314 \textcolor{preprocessor}{\#error "{}(USTORAGE\_QDATA\_MAX < 12)"{}}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01315}01315 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01316}01316         \textcolor{keywordflow}{return} (\mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 12, -\/1U));}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01317}01317 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01318}01318 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01319}01319 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01320}01320 \textcolor{comment}{ *      ustorage\_fs\_mode\_select}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01321}01321 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01322}01322 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01323}01323 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01324}01324 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01325}01325 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01326}01326 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01327}\mbox{\hyperlink{ustorage__fs_8c_af058bbd372130879d8170f05c70f13cd}{01327}} \mbox{\hyperlink{ustorage__fs_8c_af058bbd372130879d8170f05c70f13cd}{ustorage\_fs\_mode\_select}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01328}01328 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01329}01329         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01330}01330 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01331}01331         \textcolor{comment}{/* We don't support MODE SELECT */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01332}01332         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a0debcafb2e293a1d17aca281f54d7f43}{SS\_INVALID\_COMMAND}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01333}01333         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01334}01334 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01335}01335 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01336}01336 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01337}01337 \textcolor{comment}{ *      ustorage\_fs\_synchronize\_cache}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01338}01338 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01339}01339 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01340}01340 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01341}01341 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01342}01342 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01343}01343 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01344}\mbox{\hyperlink{ustorage__fs_8c_a5b93d5ee3e59f10dc97597ab060bae68}{01344}} \mbox{\hyperlink{ustorage__fs_8c_a5b93d5ee3e59f10dc97597ab060bae68}{ustorage\_fs\_synchronize\_cache}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01345}01345 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01346}01346 \textcolor{preprocessor}{\#if 0}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01347}01347         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01348}01348         uint8\_t rc;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01349}01349 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01350}01350         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01351}01351 \textcolor{comment}{         * We ignore the requested LBA and write out all dirty data buffers.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01352}01352 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01353}01353         rc = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01354}01354         \textcolor{keywordflow}{if} (rc) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01355}01355                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_adf983f6c5b60f62c9a6439dfce9b5058}{SS\_WRITE\_ERROR}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01356}01356         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01357}01357 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01358}01358         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01359}01359 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01360}01360 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01361}01361 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01362}01362 \textcolor{comment}{ *      ustorage\_fs\_read -\/ read data from disk}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01363}01363 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01364}01364 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01365}01365 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01366}01366 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01367}01367 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01368}01368 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01369}\mbox{\hyperlink{ustorage__fs_8c_a5922137d46d7364e4ec5a7915cc45c4e}{01369}} \mbox{\hyperlink{ustorage__fs_8c_a5922137d46d7364e4ec5a7915cc45c4e}{ustorage\_fs\_read}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01370}01370 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01371}01371         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01372}01372         uint64\_t file\_offset;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01373}01373         uint32\_t lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01374}01374         uint32\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01375}01375 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01376}01376         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01377}01377 \textcolor{comment}{         * Get the starting Logical Block Address and check that it's not}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01378}01378 \textcolor{comment}{         * too big}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01379}01379 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01380}01380         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0] == \mbox{\hyperlink{ustorage__fs_8c_a1703e2b24d288f8a58c41b593c7999d5}{SC\_READ\_6}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01381}01381                 lba = (((uint32\_t)sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1]) << 16) |}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01382}01382                     \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[2]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01383}01383         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01384}01384                 lba = \mbox{\hyperlink{ustorage__fs_8c_ae9b1d434a7addefba708fdf8e14eddea}{get\_be32}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[2]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01385}01385 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01386}01386                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01387}01387 \textcolor{comment}{                 * We allow DPO (Disable Page Out = don't save data in the}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01388}01388 \textcolor{comment}{                 * cache) and FUA (Force Unit Access = don't read from the}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01389}01389 \textcolor{comment}{                 * cache), but we don't implement them.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01390}01390 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01391}01391                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1] \& \string~0x18) != 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01392}01392                         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{SS\_INVALID\_FIELD\_IN\_CDB}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01393}01393                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01394}01394                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01395}01395         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01396}01396         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} >> 9;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01397}01397         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} += lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01398}01398 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01399}01399         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} < lba) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01400}01400             (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} > currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}}) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01401}01401             (lba >= currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01402}01402                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ad48de92b661361f0b28a294f1961462f}{SS\_LOGICAL\_BLOCK\_ADDRESS\_OUT\_OF\_RANGE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01403}01403                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01404}01404         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01405}01405         file\_offset = lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01406}01406         file\_offset <<= 9;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01407}01407 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01408}01408         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}} = currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a8085151a917f01b68593431564d6e6c4}{memory\_image}} + file\_offset;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01409}01409 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01410}01410         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01411}01411 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01412}01412 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01413}01413 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01414}01414 \textcolor{comment}{ *      ustorage\_fs\_write -\/ write data to disk}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01415}01415 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01416}01416 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01417}01417 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01418}01418 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01419}01419 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01420}01420 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01421}\mbox{\hyperlink{ustorage__fs_8c_a2c609e8f819e2c279c969d10c1aeaa02}{01421}} \mbox{\hyperlink{ustorage__fs_8c_a2c609e8f819e2c279c969d10c1aeaa02}{ustorage\_fs\_write}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01422}01422 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01423}01423         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01424}01424         uint64\_t file\_offset;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01425}01425         uint32\_t lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01426}01426         uint32\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01427}01427 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01428}01428         \textcolor{keywordflow}{if} (currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_aee7b0140a74ef80b921bbd36719cc50b}{read\_only}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01429}01429                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a8fd74bf2fcf12ba0cad677675d0707c5}{SS\_WRITE\_PROTECTED}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01430}01430                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01431}01431         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01432}01432         \textcolor{comment}{/* XXX clear SYNC */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01433}01433 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01434}01434         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01435}01435 \textcolor{comment}{         * Get the starting Logical Block Address and check that it's not}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01436}01436 \textcolor{comment}{         * too big.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01437}01437 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01438}01438         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0] == \mbox{\hyperlink{ustorage__fs_8c_a8d080159075572af5fc9be7fbece8f4e}{SC\_WRITE\_6}})}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01439}01439                 lba = (((uint32\_t)sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1]) << 16) |}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01440}01440                     \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[2]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01441}01441         \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01442}01442                 lba = \mbox{\hyperlink{ustorage__fs_8c_ae9b1d434a7addefba708fdf8e14eddea}{get\_be32}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[2]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01443}01443 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01444}01444                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01445}01445 \textcolor{comment}{                 * We allow DPO (Disable Page Out = don't save data in the}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01446}01446 \textcolor{comment}{                 * cache) and FUA (Force Unit Access = write directly to the}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01447}01447 \textcolor{comment}{                 * medium).  We don't implement DPO; we implement FUA by}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01448}01448 \textcolor{comment}{                 * performing synchronous output.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01449}01449 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01450}01450                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1] \& \string~0x18) != 0) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01451}01451                         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{SS\_INVALID\_FIELD\_IN\_CDB}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01452}01452                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01453}01453                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01454}01454                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1] \& 0x08) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01455}01455                         \textcolor{comment}{/* FUA */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01456}01456                         \textcolor{comment}{/* XXX set SYNC flag here */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01457}01457                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01458}01458         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01459}01459 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01460}01460         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} >> 9;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01461}01461         \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} += lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01462}01462 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01463}01463         \textcolor{keywordflow}{if} ((\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} < lba) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01464}01464             (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} > currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}}) ||}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01465}01465             (lba >= currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a77c01bc32d0ed6ce8ec75c8ec21b4805}{num\_sectors}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01466}01466                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ad48de92b661361f0b28a294f1961462f}{SS\_LOGICAL\_BLOCK\_ADDRESS\_OUT\_OF\_RANGE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01467}01467                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01468}01468         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01469}01469         file\_offset = lba;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01470}01470         file\_offset <<= 9;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01471}01471 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01472}01472         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}} = currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a8085151a917f01b68593431564d6e6c4}{memory\_image}} + file\_offset;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01473}01473 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01474}01474         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01475}01475 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01476}01476 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01477}01477 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01478}01478 \textcolor{comment}{ *      ustorage\_fs\_min\_len}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01479}01479 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01480}01480 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01481}01481 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01482}01482 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01483}01483 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01484}01484 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01485}\mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{01485}} \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc, uint32\_t \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}, uint32\_t mask)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01486}01486 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01487}01487         \textcolor{keywordflow}{if} (\mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}} != sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01488}01488                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_ab1e906021eb952515d095f6d5e66bae8}{cbw\_dir}} == \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01489}01489                         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01490}01490 \textcolor{comment}{                         * there must be something wrong about this SCSI}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01491}01491 \textcolor{comment}{                         * command}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01492}01492 \textcolor{comment}{                         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01493}01493                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>bCSWStatus = \mbox{\hyperlink{ustorage__fs_8c_a05601fcfef35de03cf867dc6c6f5410a}{CSWSTATUS\_PHASE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01494}01494                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01495}01495                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01496}01496                 \textcolor{comment}{/* compute the minimum length */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01497}01497 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01498}01498                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} > \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01499}01499                         \textcolor{comment}{/* data ends prematurely */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01500}01500                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} = \mbox{\hyperlink{ehci_8h_a8aed22e2c7b283705ec82e0120515618}{len}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01501}01501                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a2f3399a91c1477c39485ba8f53082afb}{data\_short}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01502}01502                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01503}01503                 \textcolor{comment}{/* check length alignment */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01504}01504 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01505}01505                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} \& \string~mask) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01506}01506                         \textcolor{comment}{/* data ends prematurely */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01507}01507                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}} \&= mask;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01508}01508                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a2f3399a91c1477c39485ba8f53082afb}{data\_short}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01509}01509                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01510}01510         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01511}01511         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01512}01512 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01513}01513 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01514}01514 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01515}01515 \textcolor{comment}{ *      ustorage\_fs\_check\_cmd -\/ check command routine}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01516}01516 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01517}01517 \textcolor{comment}{ * Check whether the command is properly formed and whether its data}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01518}01518 \textcolor{comment}{ * size and direction agree with the values we already have.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01519}01519 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01520}01520 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01521}01521 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01522}01522 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01523}01523 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01524}01524 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01525}\mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{01525}} \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc, uint8\_t min\_cmd\_size,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01526}01526     uint16\_t mask, uint8\_t needs\_medium)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01527}01527 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01528}01528         \textcolor{keyword}{struct }\mbox{\hyperlink{structustorage__fs__lun}{ustorage\_fs\_lun}} *currlun;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01529}01529         uint8\_t lun = (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1] >> 5);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01530}01530         uint8\_t i;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01531}01531 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01532}01532         \textcolor{comment}{/* Verify the length of the command itself */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01533}01533         \textcolor{keywordflow}{if} (min\_cmd\_size > sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{cmd\_len}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01534}01534                 \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}\%u > \%u\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01535}01535                     min\_cmd\_size, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{cmd\_len}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01536}01536                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>bCSWStatus = \mbox{\hyperlink{ustorage__fs_8c_a05601fcfef35de03cf867dc6c6f5410a}{CSWSTATUS\_PHASE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01537}01537                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01538}01538         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01539}01539         \textcolor{comment}{/* Mask away the LUN */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01540}01540         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[1] \&= 0x1f;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01541}01541 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01542}01542         \textcolor{comment}{/* Check if LUN is correct */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01543}01543         \textcolor{keywordflow}{if} (lun != sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4364c870d6d5340302c1cc772928cc9c}{lun}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01544}01544         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01545}01545         \textcolor{comment}{/* Check the LUN */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01546}01546         \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4364c870d6d5340302c1cc772928cc9c}{lun}} <= sc-\/>\mbox{\hyperlink{structustorage__fs__softc_aa12e2966cbe7837afc2a2f45159aab33}{sc\_last\_lun}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01547}01547                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}} = currlun =}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01548}01548                     sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a83080e56ecca9b0f8240dab238b4f807}{sc\_lun}} + sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4364c870d6d5340302c1cc772928cc9c}{lun}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01549}01549                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0] != \mbox{\hyperlink{ustorage__fs_8c_ae3528cede8cde69eabe7337b443ec852}{SC\_REQUEST\_SENSE}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01550}01550                         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a0ea3bc3520fd838b03bf8874dcfb7a33}{SS\_NO\_SENSE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01551}01551                         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a656ce36cd61057d53f93cb9a81062295}{sense\_data\_info}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01552}01552                         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_ad50231eac0b226fba1cc3557fad3c61b}{info\_valid}} = 0;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01553}01553                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01554}01554                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01555}01555 \textcolor{comment}{                 * If a unit attention condition exists, only INQUIRY}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01556}01556 \textcolor{comment}{                 * and REQUEST SENSE commands are allowed. Anything}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01557}01557 \textcolor{comment}{                 * else must fail!}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01558}01558 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01559}01559                 \textcolor{keywordflow}{if} ((currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a596ff4c4cb155d5a0bfd0448579960ec}{unit\_attention\_data}} != \mbox{\hyperlink{ustorage__fs_8c_a0ea3bc3520fd838b03bf8874dcfb7a33}{SS\_NO\_SENSE}}) \&\&}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01560}01560                     (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0] != \mbox{\hyperlink{ustorage__fs_8c_aae584232af12ed88ea34a2bf47fb117f}{SC\_INQUIRY}}) \&\&}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01561}01561                     (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0] != \mbox{\hyperlink{ustorage__fs_8c_ae3528cede8cde69eabe7337b443ec852}{SC\_REQUEST\_SENSE}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01562}01562                         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a596ff4c4cb155d5a0bfd0448579960ec}{unit\_attention\_data}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01563}01563                         currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a596ff4c4cb155d5a0bfd0448579960ec}{unit\_attention\_data}} = \mbox{\hyperlink{ustorage__fs_8c_a0ea3bc3520fd838b03bf8874dcfb7a33}{SS\_NO\_SENSE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01564}01564                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01565}01565                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01566}01566         \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01567}01567                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}} = currlun = NULL;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01568}01568 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01569}01569                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01570}01570 \textcolor{comment}{                 * INQUIRY and REQUEST SENSE commands are explicitly allowed}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01571}01571 \textcolor{comment}{                 * to use unsupported LUNs; all others may not.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01572}01572 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01573}01573                 \textcolor{keywordflow}{if} ((sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0] != \mbox{\hyperlink{ustorage__fs_8c_aae584232af12ed88ea34a2bf47fb117f}{SC\_INQUIRY}}) \&\&}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01574}01574                     (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0] != \mbox{\hyperlink{ustorage__fs_8c_ae3528cede8cde69eabe7337b443ec852}{SC\_REQUEST\_SENSE}})) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01575}01575                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01576}01576                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01577}01577         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01578}01578 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01579}01579         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01580}01580 \textcolor{comment}{         * Check that only command bytes listed in the mask are}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01581}01581 \textcolor{comment}{         * non-\/zero.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01582}01582 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01583}01583         \textcolor{keywordflow}{for} (i = 0; i != min\_cmd\_size; i++) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01584}01584                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[i] \&\& !(mask \& (1UL << i))) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01585}01585                         \textcolor{keywordflow}{if} (currlun) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01586}01586                                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_ae6e41d37132047f8c8f7b00632ef417b}{SS\_INVALID\_FIELD\_IN\_CDB}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01587}01587                         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01588}01588                         \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01589}01589                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01590}01590         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01591}01591 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01592}01592         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01593}01593 \textcolor{comment}{         * If the medium isn't mounted and the command needs to access}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01594}01594 \textcolor{comment}{         * it, return an error.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01595}01595 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01596}01596         \textcolor{keywordflow}{if} (currlun \&\& (!currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a8085151a917f01b68593431564d6e6c4}{memory\_image}}) \&\& needs\_medium) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01597}01597                 currlun-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} = \mbox{\hyperlink{ustorage__fs_8c_aee4247268695e6687a95766578201e68}{SS\_MEDIUM\_NOT\_PRESENT}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01598}01598                 \textcolor{keywordflow}{return} (1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01599}01599         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01600}01600         \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01601}01601 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01602}01602 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01603}01603 \textcolor{comment}{/*-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01604}01604 \textcolor{comment}{ *      ustorage\_fs\_do\_cmd -\/ do command}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01605}01605 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01606}01606 \textcolor{comment}{ * Return values:}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01607}01607 \textcolor{comment}{ *    0: Success}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01608}01608 \textcolor{comment}{ * Else: Failure}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01609}01609 \textcolor{comment}{ *-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/*/}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01610}01610 \textcolor{keyword}{static} uint8\_t}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01611}\mbox{\hyperlink{ustorage__fs_8c_a3af8988426cb3227555f2c8e9d63b25a}{01611}} \mbox{\hyperlink{ustorage__fs_8c_a3af8988426cb3227555f2c8e9d63b25a}{ustorage\_fs\_do\_cmd}}(\textcolor{keyword}{struct} \mbox{\hyperlink{structustorage__fs__softc}{ustorage\_fs\_softc}} *sc)}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01612}01612 \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01613}01613         uint8\_t \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01614}01614         uint8\_t i;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01615}01615         uint32\_t temp;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01616}01616         \textcolor{keyword}{const} uint32\_t mask9 = (0xFFFFFFFFUL >> 9) << 9;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01617}01617 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01618}01618         \textcolor{comment}{/* set default data transfer pointer */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01619}01619         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a5c95ea94d9b24bdb1002f2f63d6f93d9}{data\_ptr}} = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_acb0f9945bd163041f05b0fcfe8d49660}{sc\_qdata}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01620}01620 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01621}01621         \mbox{\hyperlink{umass_8c_aa786fc43d4857c3ab9f2c777b4e6f9c5}{DPRINTF}}(\textcolor{stringliteral}{"{}cmd\_data[0]=0x\%02x, data\_rem=0x\%08x\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01622}01622             sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0], sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a6ad6db07767e66ecd78cb391eaa62274}{data\_rem}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01623}01623 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01624}01624         \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[0]) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01625}01625         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_aae584232af12ed88ea34a2bf47fb117f}{SC\_INQUIRY}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01626}01626                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01627}01627                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4], -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01628}01628                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01629}01629                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01630}01630                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01631}01631                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01632}01632                     (1UL << 4) | 1, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01633}01633                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01634}01634                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01635}01635                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01636}01636                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a43d453ab225bcf03519281c3a9074963}{ustorage\_fs\_inquiry}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01637}01637 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01638}01638                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01639}01639 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01640}01640         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_abec665786b8b91299dc34d9561074db7}{SC\_MODE\_SELECT\_6}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01641}01641                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01642}01642                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4], -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01643}01643                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01644}01644                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01645}01645                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01646}01646                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01647}01647                     (1UL << 1) | (1UL << 4) | 1, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01648}01648                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01649}01649                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01650}01650                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01651}01651                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_af058bbd372130879d8170f05c70f13cd}{ustorage\_fs\_mode\_select}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01652}01652 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01653}01653                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01654}01654 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01655}01655         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a9b9a1ffa21861c90d08012589cc1899f}{SC\_MODE\_SELECT\_10}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01656}01656                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01657}01657                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01658}01658                     \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[7]), -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01659}01659                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01660}01660                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01661}01661                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01662}01662                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 10,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01663}01663                     (1UL << 1) | (3UL << 7) | 1, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01664}01664                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01665}01665                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01666}01666                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01667}01667                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_af058bbd372130879d8170f05c70f13cd}{ustorage\_fs\_mode\_select}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01668}01668 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01669}01669                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01670}01670 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01671}01671         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a2ed139b7fdbbcb720ba53330734b2c34}{SC\_MODE\_SENSE\_6}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01672}01672                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01673}01673                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4], -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01674}01674                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01675}01675                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01676}01676                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01677}01677                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01678}01678                     (1UL << 1) | (1UL << 2) | (1UL << 4) | 1, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01679}01679                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01680}01680                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01681}01681                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01682}01682                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_ade6edfc049059629dfd3cfa89da407f1}{ustorage\_fs\_mode\_sense}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01683}01683 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01684}01684                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01685}01685 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01686}01686         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a5db66d30cfa4873b80008e2c85f56faa}{SC\_MODE\_SENSE\_10}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01687}01687                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01688}01688                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01689}01689                     \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[7]), -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01690}01690                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01691}01691                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01692}01692                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01693}01693                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 10,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01694}01694                     (1UL << 1) | (1UL << 2) | (3UL << 7) | 1, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01695}01695                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01696}01696                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01697}01697                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01698}01698                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_ade6edfc049059629dfd3cfa89da407f1}{ustorage\_fs\_mode\_sense}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01699}01699 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01700}01700                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01701}01701 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01702}01702         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a5eb65d59d1177e0e67703b0981601f40}{SC\_PREVENT\_ALLOW\_MEDIUM\_REMOVAL}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01703}01703                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 0, -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01704}01704                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01705}01705                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01706}01706                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01707}01707                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01708}01708                     (1UL << 4) | 1, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01709}01709                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01710}01710                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01711}01711                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01712}01712                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a6b5da2d93c6a02a64fb9ad44e321749e}{ustorage\_fs\_prevent\_allow}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01713}01713 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01714}01714                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01715}01715 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01716}01716         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a1703e2b24d288f8a58c41b593c7999d5}{SC\_READ\_6}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01717}01717                 i = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4];}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01718}01718                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01719}01719                 temp = ((i == 0) ? 256UL : i);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01720}01720                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, temp << 9, mask9);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01721}01721                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01722}01722                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01723}01723                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01724}01724                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01725}01725                     (7UL << 1) | (1UL << 4) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01726}01726                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01727}01727                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01728}01728                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01729}01729                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a5922137d46d7364e4ec5a7915cc45c4e}{ustorage\_fs\_read}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01730}01730 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01731}01731                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01732}01732 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01733}01733         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_acf0377189aacf40e50cab9b0b956edd0}{SC\_READ\_10}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01734}01734                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01735}01735                 temp = \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[7]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01736}01736                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, temp << 9, mask9);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01737}01737                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01738}01738                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01739}01739                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01740}01740                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 10,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01741}01741                     (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01742}01742                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01743}01743                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01744}01744                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01745}01745                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a5922137d46d7364e4ec5a7915cc45c4e}{ustorage\_fs\_read}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01746}01746 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01747}01747                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01748}01748 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01749}01749         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a104b58c1ff8edaa46939c8c2a308fe9c}{SC\_READ\_12}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01750}01750                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01751}01751                 temp = \mbox{\hyperlink{ustorage__fs_8c_ae9b1d434a7addefba708fdf8e14eddea}{get\_be32}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[6]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01752}01752                 \textcolor{keywordflow}{if} (temp >= (1UL << (32 -\/ 9))) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01753}01753                         \textcolor{comment}{/* numerical overflow */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01754}01754                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>bCSWStatus = \mbox{\hyperlink{ustorage__fs_8c_aee89dc947347ceec52385e1428cdf087}{CSWSTATUS\_FAILED}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01755}01755                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01756}01756                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01757}01757                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01758}01758                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, temp << 9, mask9);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01759}01759                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01760}01760                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01761}01761                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01762}01762                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 12,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01763}01763                     (1UL << 1) | (0xfUL << 2) | (0xfUL << 6) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01764}01764                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01765}01765                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01766}01766                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01767}01767                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a5922137d46d7364e4ec5a7915cc45c4e}{ustorage\_fs\_read}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01768}01768 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01769}01769                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01770}01770 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01771}01771         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_ac216daacc2c7da0290a214ae38229246}{SC\_READ\_CAPACITY}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01772}01772                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01773}01773                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 10,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01774}01774                     (0xfUL << 2) | (1UL << 8) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01775}01775                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01776}01776                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01777}01777                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01778}01778                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a1939a7d976484826439601002488fd56}{ustorage\_fs\_read\_capacity}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01779}01779 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01780}01780                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01781}01781 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01782}01782         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a5e8e6e5af68fe5aed2e87b5c3b27c77e}{SC\_READ\_FORMAT\_CAPACITIES}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01783}01783                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01784}01784                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01785}01785                     \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[7]), -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01786}01786                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01787}01787                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01788}01788                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01789}01789                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 10,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01790}01790                     (3UL << 7) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01791}01791                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01792}01792                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01793}01793                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01794}01794                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a44340bafe5eda6d617a19604a82cfc00}{ustorage\_fs\_read\_format\_capacities}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01795}01795 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01796}01796                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01797}01797 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01798}01798         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_ae3528cede8cde69eabe7337b443ec852}{SC\_REQUEST\_SENSE}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01799}01799                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_ac084b6b62ecc11b60fc1c4cc0b775ae1}{DIR\_WRITE}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01800}01800                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4], -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01801}01801                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01802}01802                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01803}01803                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01804}01804                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01805}01805                     (1UL << 4) | 1, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01806}01806                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01807}01807                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01808}01808                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01809}01809                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a41331b7a198942c12038d652c62304bd}{ustorage\_fs\_request\_sense}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01810}01810 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01811}01811                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01812}01812 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01813}01813         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_ad78f8289751cb62c5fbb9d507cafd7d2}{SC\_START\_STOP\_UNIT}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01814}01814                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 0, -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01815}01815                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01816}01816                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01817}01817                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01818}01818                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01819}01819                     (1UL << 1) | (1UL << 4) | 1, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01820}01820                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01821}01821                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01822}01822                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01823}01823                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a1f5b2ce705ab2e9775545c4d7c201dc6}{ustorage\_fs\_start\_stop}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01824}01824 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01825}01825                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01826}01826 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01827}01827         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_afcf1f810c699cccf3ddfe32522c5ab4a}{SC\_SYNCHRONIZE\_CACHE}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01828}01828                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 0, -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01829}01829                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01830}01830                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01831}01831                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01832}01832                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 10,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01833}01833                     (0xfUL << 2) | (3UL << 7) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01834}01834                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01835}01835                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01836}01836                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01837}01837                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a5b93d5ee3e59f10dc97597ab060bae68}{ustorage\_fs\_synchronize\_cache}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01838}01838 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01839}01839                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01840}01840 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01841}01841         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a0ed01bd6799e21d78f9344e85d29318c}{SC\_TEST\_UNIT\_READY}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01842}01842                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 0, -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01843}01843                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01844}01844                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01845}01845                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01846}01846                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01847}01847                     0 | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01848}01848                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01849}01849 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01850}01850                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01851}01851 \textcolor{comment}{                 * Although optional, this command is used by MS-\/Windows.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01852}01852 \textcolor{comment}{                 * We support a minimal version: BytChk must be 0.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01853}01853 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01854}01854         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_abbd6d6288e2759e50009f9e70c0371fc}{SC\_VERIFY}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01855}01855                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 0, -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01856}01856                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01857}01857                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01858}01858                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01859}01859                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 10,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01860}01860                     (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01861}01861                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01862}01862                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01863}01863                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01864}01864                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_af8fc6e9407990450b58451ce0598e3f1}{ustorage\_fs\_verify}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01865}01865 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01866}01866                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01867}01867 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01868}01868         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a8d080159075572af5fc9be7fbece8f4e}{SC\_WRITE\_6}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01869}01869                 i = sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[4];}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01870}01870                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01871}01871                 temp = ((i == 0) ? 256UL : i);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01872}01872                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, temp << 9, mask9);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01873}01873                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01874}01874                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01875}01875                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01876}01876                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 6,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01877}01877                     (7UL << 1) | (1UL << 4) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01878}01878                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01879}01879                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01880}01880                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01881}01881                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a2c609e8f819e2c279c969d10c1aeaa02}{ustorage\_fs\_write}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01882}01882 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01883}01883                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01884}01884 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01885}01885         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a68b349957c29d9e28f52d8eea651b906}{SC\_WRITE\_10}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01886}01886                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01887}01887                 temp = \mbox{\hyperlink{ustorage__fs_8c_a981addbc8c8f77bece9d676c2563eb12}{get\_be16}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[7]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01888}01888                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, temp << 9, mask9);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01889}01889                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01890}01890                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01891}01891                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01892}01892                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 10,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01893}01893                     (1UL << 1) | (0xfUL << 2) | (3UL << 7) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01894}01894                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01895}01895                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01896}01896                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01897}01897                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a2c609e8f819e2c279c969d10c1aeaa02}{ustorage\_fs\_write}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01898}01898 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01899}01899                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01900}01900 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01901}01901         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a6be3b299a152817fc1bc625c850d9000}{SC\_WRITE\_12}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01902}01902                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_a4f7b63e0ae0d3b178cb18b6004f4037a}{cmd\_dir}} = \mbox{\hyperlink{ustorage__fs_8c_a63ac557544e4f6e3c6928e8a73dd2d77}{DIR\_READ}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01903}01903                 temp = \mbox{\hyperlink{ustorage__fs_8c_ae9b1d434a7addefba708fdf8e14eddea}{get\_be32}}(\&sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a03875b1478a0ce38bced50873b26f693}{sc\_cbw}}-\/>CBWCDB[6]);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01904}01904                 \textcolor{keywordflow}{if} (temp > (mask9 >> 9)) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01905}01905                         \textcolor{comment}{/* numerical overflow */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01906}01906                         sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a9955f5d3e6b010e4b48b5817bd95d259}{sc\_csw}}-\/>bCSWStatus = \mbox{\hyperlink{ustorage__fs_8c_aee89dc947347ceec52385e1428cdf087}{CSWSTATUS\_FAILED}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01907}01907                         \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01908}01908                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01909}01909                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01910}01910                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, temp << 9, mask9);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01911}01911                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01912}01912                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01913}01913                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01914}01914                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, 12,}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01915}01915                     (1UL << 1) | (0xfUL << 2) | (0xfUL << 6) | 1, 1);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01916}01916                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01917}01917                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01918}01918                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01919}01919                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a2c609e8f819e2c279c969d10c1aeaa02}{ustorage\_fs\_write}}(sc);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01920}01920 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01921}01921                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01922}01922 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01923}01923                 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01924}01924 \textcolor{comment}{                 * Some mandatory commands that we recognize but don't}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01925}01925 \textcolor{comment}{                 * implement.  They don't mean much in this setting.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01926}01926 \textcolor{comment}{                 * It's left as an exercise for anyone interested to}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01927}01927 \textcolor{comment}{                 * implement RESERVE and RELEASE in terms of Posix}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01928}01928 \textcolor{comment}{                 * locks.}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01929}01929 \textcolor{comment}{                 */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01930}01930         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a73e50e305800473bfff81432a2e6d14f}{SC\_FORMAT\_UNIT}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01931}01931         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_af9b3ce6b2596a6a0d492b3f6989858da}{SC\_RELEASE}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01932}01932         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_a10d5d3c175ce21d2774837995d8a90bb}{SC\_RESERVE}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01933}01933         \textcolor{keywordflow}{case} \mbox{\hyperlink{ustorage__fs_8c_afe04be7df9778882c0afbb5ec3178af9}{SC\_SEND\_DIAGNOSTIC}}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01934}01934                 \textcolor{comment}{/* Fallthrough */}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01935}01935 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01936}01936         \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01937}01937                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_adecee3b45ee056369a2c7add69be18e8}{ustorage\_fs\_min\_len}}(sc, 0, -\/1U);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01938}01938                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01939}01939                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01940}01940                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01941}01941                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = \mbox{\hyperlink{ustorage__fs_8c_a7d4889682183c0dab7dcdd48649c507e}{ustorage\_fs\_check\_cmd}}(sc, sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aab704ac134e6d0f5454ef8e66b6a9688}{cmd\_len}},}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01942}01942                     0xff, 0);}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01943}01943                 \textcolor{keywordflow}{if} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}}) \{}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01944}01944                         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01945}01945                 \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01946}01946                 sc-\/>\mbox{\hyperlink{structustorage__fs__softc_a1e56473e32c4356b61206a7483541dc5}{sc\_transfer}}.\mbox{\hyperlink{structustorage__fs__softc_aa6839626d18bc41ffeb27aa88cf70bb1}{currlun}}-\/>\mbox{\hyperlink{structustorage__fs__lun_a530e0c8d332522513c4fd75f1e47626c}{sense\_data}} =}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01947}01947                     \mbox{\hyperlink{ustorage__fs_8c_a0debcafb2e293a1d17aca281f54d7f43}{SS\_INVALID\_COMMAND}};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01948}01948                 \mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}} = 1;}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01949}01949 }
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01950}01950                 \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01951}01951         \}}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01952}01952         \textcolor{keywordflow}{return} (\mbox{\hyperlink{if__runreg_8h_a9f8f252ecb5b3fb46dafe827231faf70}{error}});}
\DoxyCodeLine{\Hypertarget{ustorage__fs_8c_source_l01953}01953 \}}

\end{DoxyCode}
