diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2014-12-16 08:56:32 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-01-12 13:13:25 -0500 |
commit | cdbe287d271637cb90f239d6a826e2aed555c1d7 (patch) | |
tree | 0f8ee3bdb80e9121803da6973c92db018aa7bb17 /Documentation/usb | |
parent | ec91aff7630df1e1864d95f5efd25c212d484837 (diff) |
Documentation: usb: MASS STORAGE function testing
Summary of how to test MASS STORAGE function of USB gadget.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'Documentation/usb')
-rw-r--r-- | Documentation/usb/gadget-testing.txt | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Documentation/usb/gadget-testing.txt b/Documentation/usb/gadget-testing.txt index b13491d1e352..01b9ffe2eabc 100644 --- a/Documentation/usb/gadget-testing.txt +++ b/Documentation/usb/gadget-testing.txt | |||
@@ -8,6 +8,7 @@ provided by gadgets. | |||
8 | 5. FFS function | 8 | 5. FFS function |
9 | 6. HID function | 9 | 6. HID function |
10 | 7. LOOPBACK function | 10 | 7. LOOPBACK function |
11 | 8. MASS STORAGE function | ||
11 | 12 | ||
12 | 13 | ||
13 | 1. ACM function | 14 | 1. ACM function |
@@ -228,3 +229,56 @@ device: run the gadget | |||
228 | host: test-usb | 229 | host: test-usb |
229 | 230 | ||
230 | http://www.linux-usb.org/usbtest/testusb.c | 231 | http://www.linux-usb.org/usbtest/testusb.c |
232 | |||
233 | 8. MASS STORAGE function | ||
234 | ======================== | ||
235 | |||
236 | The function is provided by usb_f_mass_storage.ko module. | ||
237 | |||
238 | Function-specific configfs interface | ||
239 | ------------------------------------ | ||
240 | |||
241 | The function name to use when creating the function directory is "mass_storage". | ||
242 | The MASS STORAGE function provides these attributes in its directory: | ||
243 | files: | ||
244 | |||
245 | stall - Set to permit function to halt bulk endpoints. | ||
246 | Disabled on some USB devices known not to work | ||
247 | correctly. You should set it to true. | ||
248 | num_buffers - Number of pipeline buffers. Valid numbers | ||
249 | are 2..4. Available only if | ||
250 | CONFIG_USB_GADGET_DEBUG_FILES is set. | ||
251 | |||
252 | and a default lun.0 directory corresponding to SCSI LUN #0. | ||
253 | |||
254 | A new lun can be added with mkdir: | ||
255 | |||
256 | $ mkdir functions/mass_storage.0/partition.5 | ||
257 | |||
258 | Lun numbering does not have to be continuous, except for lun #0 which is | ||
259 | created by default. A maximum of 8 luns can be specified and they all must be | ||
260 | named following the <name>.<number> scheme. The numbers can be 0..8. | ||
261 | Probably a good convention is to name the luns "lun.<number>", | ||
262 | although it is not mandatory. | ||
263 | |||
264 | In each lun directory there are the following attribute files: | ||
265 | |||
266 | file - The path to the backing file for the LUN. | ||
267 | Required if LUN is not marked as removable. | ||
268 | ro - Flag specifying access to the LUN shall be | ||
269 | read-only. This is implied if CD-ROM emulation | ||
270 | is enabled as well as when it was impossible | ||
271 | to open "filename" in R/W mode. | ||
272 | removable - Flag specifying that LUN shall be indicated as | ||
273 | being removable. | ||
274 | cdrom - Flag specifying that LUN shall be reported as | ||
275 | being a CD-ROM. | ||
276 | nofua - Flag specifying that FUA flag | ||
277 | in SCSI WRITE(10,12) | ||
278 | |||
279 | Testing the MASS STORAGE function | ||
280 | --------------------------------- | ||
281 | |||
282 | device: connect the gadget, enable it | ||
283 | host: dmesg, see the USB drives appear (if system configured to automatically | ||
284 | mount) | ||