UAS gadget based on target

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

 



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.

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.

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.

Sebastian
--
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