1 .\" Copyright (c) 2017 The FreeBSD Foundation
3 .\" This software was developed by Edward Tomasz Napierala under sponsorship
4 .\" from the FreeBSD Foundation.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 .Nd USB device side support for Mass Storage Class Transport
35 This driver can be compiled into the kernel by placing these lines in
36 the kernel configuration file:
37 .Bd -ragged -offset indent
39 .Cd "device usb_template"
44 The driver module can also be loaded at boot by adding this line to
46 .Bd -literal -offset indent
52 driver provides device side support for emulating an USB mass storage
53 device compliant with the USB Mass Storage Class Bulk-Only (BBB) Transport
54 specification, implemented as a
63 must be loaded as a module or compiled into the kernel.
65 The USB Mass Storage template must be chosen by setting the
69 The USB OTG port must be working in USB device-side mode.
70 This happens automatically upon connection to a USB host.
74 LUN configured for the
79 Upon loading, the driver creates a
83 presenting the first LUN mapped for that port - usually LUN 0 - to
89 for details on configuring the LUN.
97 for an automated way to configure it at boot.
99 These variables are available as both
104 .Bl -tag -width indent
105 .It Va hw.usb.cfumass.debug
106 Verbosity level for log messages from the
109 Set to 0 to disable logging or 1 to warn about potential problems.
110 Larger values enable debugging output.
112 .It Va hw.usb.cfumass.ignore_stop
113 Ignore START STOP UNIT SCSI commands with START and LOEJ bits cleared.
114 Some initiators send that command to stop the target when the user
115 attempts to gracefully eject the drive, but fail to start it when the
116 drive is reconnected.
117 Set to 0 to handle the command in a standards-compliant way,
118 1 to ignore it and log a warning, or 2 to ignore it silently.
120 .It Va hw.usb.cfumass.max_lun
121 Max LUN number to report to the initiator (USB host).
122 Must be between 0 and 15.
123 Some initiators incorrectly handle values larger than 0.
136 driver first appeared in
141 driver was developed by
142 .An Edward Tomasz Napierala Aq Mt trasz@FreeBSD.org
143 under sponsorship from the FreeBSD Foundation.