Re: UAS gadget based on target

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sebastian,

On Wed, 2012-01-11 at 22:03 +0100, Sebastian Andrzej Siewior wrote:
> This was tested with dummy_hcd on a local machine. HS, SS + stream support
> works, command tagging is supported. Ach, it is UAS only right now, BOT is 
> missing.
> 
> The gadget is configured via configfs like the remaining part of the
> target framework. This gadget has a _few_ dependencies to get everything
> working including a few bug fixes in the linux UAS driver for HS or some
> extensions to the target framework itself. Each patch was posted earlier here
> or there. My working tree can be found at in the git repository at:
> 
>   git://git.linutronix.de/users/bigeasy/linux.git target_uas
> 
> it is Linux 3.2 based.

I think this code looks OK for an initial merge into lio-core/master as
the remaining v3.3 pending patches go upstream.

> 
> Here is my script which which I used for testing:
> 
> |#!/bin/sh
> |
> |#modprobe dummy_hcd is_super_speed=1
> |modprobe dummy_hcd
> |modprobe target_core_mod
> |modprobe tcm_usb_gadget
> |mount a -t configfs /sys/kernel/config
> | 
> |CONFIGFS=/sys/kernel/config/;
> |TARGET=$CONFIGFS/target/core/
> |FABRIC=$CONFIGFS/target/usb_gadget/
> |
> |# RD
> |mkdir -p $TARGET/rd_mcp_0/ramdisk
> |echo rd_pages=32768 > $TARGET/rd_mcp_0/ramdisk/control
> |echo 1 > $TARGET/rd_mcp_0/ramdisk/enable
> |
> |# file
> |mkdir -p $TARGET/fileio_0/fileio
> |echo "fd_dev_name=/root/file.bin,fd_dev_size=31457280" > $TARGET/fileio_0/fileio/control
> |echo 1 > $TARGET/fileio_0/fileio/enable
> |
> |mkdir -p $FABRIC/naa.6001405c3214b06a/tpgt_1
> |mkdir $FABRIC/naa.6001405c3214b06a/tpgt_1/lun/lun_0
> |mkdir $FABRIC/naa.6001405c3214b06a/tpgt_1/lun/lun_1
> |echo naa.6001405c3214b06b > $FABRIC/naa.6001405c3214b06a/tpgt_1/nexus
> | 
> |ln -s $TARGET/rd_mcp_0/ramdisk $FABRIC/naa.6001405c3214b06a/tpgt_1/lun/lun_0/virtual_scsi_port
> |ln -s $TARGET/fileio_0/fileio $FABRIC/naa.6001405c3214b06a/tpgt_1/lun/lun_1/virtual_scsi_port
> 
> later to connect the gadget:
> |echo 1 > /sys/kernel/config/target/usb_gadget/naa.6001405c3214b06a/tpgt_1/enable
> 
> This setups a device with two luns.
> 

So the next step is to add a /var/target/fabric/uasp.spec so this code
can be used immediately by rtslib/targetcli.  (jxm CC'ed)

The README for this is available here:

http://www.risingtidesystems.com/git/?p=rtslib.git;a=blob;f=specs/README;hb=HEAD

# cat /var/target/fabric/uasp.spec
# WARNING: This is a draft specfile supplied for testing only.

# The fabric module feature set
features = nexus

# Use naa WWNs.
wwn_type = naa

# Non-standard module naming scheme
kernel_module = tcm_usb_gadget

# The configfs group
configfs_group = usb_gadget


> I believe I addressed all comments which came up on my last RFC. I still 
> have one static tpg because it exposes the gadget framework limitation.
> Once we extend the gadget framework for multi udc support this limitation
> can go away.
> 

So I assume this will be addressed before an mainline merge, yes..?

--nab


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux