add spec for the usb_gadget
add spec for the usb_gadget

|root@squsb:~# mount a -t configfs /sys/kernel/config
|root@squsb:~# modprobe dummy_hcd
|root@squsb:~# targetcli
|Welcome to the targetcli shell:
|
| Copyright (c) 2011 by RisingTide Systems LLC.
|
|Visit us at http://www.risingtidesystems.com.
|
|Can't load fabric module qla2xxx.
|Can't load fabric module ib_srpt.
|Loaded iscsi_target_mod kernel module.
|Created '/sys/kernel/config/target/iscsi'.
|Done loading iscsi fabric module.
|Created '/sys/kernel/config/target/loopback'.
|Done loading loopback fabric module.
|Can't load fabric module tcm_fc.
|Created '/sys/kernel/config/target/usb_gadget'.
|Done loading usb_gadget fabric module.
|
|/backstores/rd_mcp> create disk 256M
|Generating a wwn serial.
|Created rd_mcp ramdisk disk with size 256M.
|Entering new node /backstores/rd_mcp/disk
|
|/usb_gadget> create
|Created target naa.60014052d9f751dd.
|Entering new node /usb_gadget/naa.60014052d9f751dd
|/usb_gadget/n...14052d9f751dd> cd luns
|/usb_gadget/n...d9f751dd/luns> create /backstores/rd_mcp/disk
|Selected LUN 0.
|Successfully created LUN 0.
|Entering new node /usb_gadget/naa.60014052d9f751dd/luns/lun0
|/usb_gadget/n...1dd/luns/lun0>
|/usb_gadget/n...1dd/luns/lun0> cd ..
|/usb_gadget/n...d9f751dd/luns> cd ..
|/usb_gadget/n...14052d9f751dd> disable
|The TPGT has been disabled.
|/usb_gadget/n...14052d9f751dd> enable
|The TPGT has been enabled.

after that on the host side:

|[  227.097768] usb 1-1: configuration #1 chosen from 1 choice
|[  227.100157]  gadget: high-speed config #1: Linux Target
|[  227.102934] Using the BOT protocol
|[  227.115756] Using the UAS protocol
|[  227.121483] scsi1 : uas
|[  227.128314] scsi 1:0:0:0: Direct-Access     LIO-ORG  RAMDISK-MCP      4.0  PQ: 0 ANSI: 5 TAG: 1
|[  227.164322] sd 1:0:0:0: [sda] 524288 512-byte logical blocks: (268 MB/256 MiB)
|[  227.204283] sd 1:0:0:0: [sda] Write Protect is off
|[  227.204904] sd 1:0:0:0: [sda] Mode Sense: 2f 00 00 00
|[  227.220285] sd 1:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
|[  227.300319]  sda: unknown partition table
|[  227.376286] sd 1:0:0:0: [sda] Attached SCSI disk

Signed-off-by: Sebastian Andrzej Siewior <265264fed90bdf8e813a354375ec16f47ebdb1c5@linutronix.de>
Signed-off-by: Andy Grover <b7d524d2f5cc5aebadb6b92b08d3ab26911cde33@redhat.com>

mikenawrocki/rtslib-fb,cvubrugier/rtslib-fb,agrover/rtslib-fb,mikenawrocki/rtslib-fb