USB storage drivers分析之一

/drivers/usb/storage/Makefile

#
# Makefile for the USB Mass Storage device drivers.
#
# 15 Aug 2000, Christoph Hellwig <[email protected]>
# Rewritten to use lists instead of if-statements.
#

ccflags-y := -Idrivers/scsi

obj-$(CONFIG_USB_UAS) += uas.o
obj-$(CONFIG_USB_STORAGE) += usb-storage.o

好好分析下面这个价相关文件开始

usb-storage-y := scsiglue.o protocol.o transport.o usb.o
usb-storage-y += initializers.o sierra_ms.o option_ms.o

usb-storage-$(CONFIG_USB_STORAGE_DEBUG) += debug.o

ifeq ($(CONFIG_USB_LIBUSUAL),)
usb-storage-y += usual-tables.o
else
obj-$(CONFIG_USB) += usb-libusual.o
usb-libusual-y := libusual.o usual-tables.o
endif

obj-$(CONFIG_USB_STORAGE_ALAUDA) += ums-alauda.o
obj-$(CONFIG_USB_STORAGE_CYPRESS_ATACB) += ums-cypress.o
obj-$(CONFIG_USB_STORAGE_DATAFAB) += ums-datafab.o
obj-$(CONFIG_USB_STORAGE_ENE_UB6250) += ums-eneub6250.o
obj-$(CONFIG_USB_STORAGE_FREECOM) += ums-freecom.o
obj-$(CONFIG_USB_STORAGE_ISD200) += ums-isd200.o
obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += ums-jumpshot.o
obj-$(CONFIG_USB_STORAGE_KARMA) += ums-karma.o
obj-$(CONFIG_USB_STORAGE_ONETOUCH) += ums-onetouch.o
obj-$(CONFIG_USB_STORAGE_REALTEK) += ums-realtek.o
obj-$(CONFIG_USB_STORAGE_SDDR09) += ums-sddr09.o
obj-$(CONFIG_USB_STORAGE_SDDR55) += ums-sddr55.o
obj-$(CONFIG_USB_STORAGE_USBAT) += ums-usbat.o

ums-alauda-y := alauda.o
ums-cypress-y := cypress_atacb.o
ums-datafab-y := datafab.o
ums-eneub6250-y := ene_ub6250.o
ums-freecom-y := freecom.o
ums-isd200-y := isd200.o
ums-jumpshot-y := jumpshot.o
ums-karma-y := karma.o
ums-onetouch-y := onetouch.o
ums-realtek-y := realtek_cr.o
ums-sddr09-y := sddr09.o
ums-sddr55-y := sddr55.o
ums-usbat-y := shuttle_usbat.o

/drivers/usb/storage/Kconfig

#
# USB Storage driver configuration
#

comment "NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may"
comment "also be needed; see USB_STORAGE Help for more info"
depends on USB

config USB_STORAGE
tristate "USB Mass Storage support"
depends on USB && SCSI
---help---
Say Y here if you want to connect USB mass storage devices to your
computer‘s USB port. This is the driver you need for USB
floppy drives, USB hard disks, USB tape drives, USB CD-ROMs,
USB flash devices, and memory sticks, along with
similar devices. This driver may also be used for some cameras
and card readers.

This option depends on ‘SCSI‘ support being enabled, but you
probably also need ‘SCSI device support: SCSI disk support‘
(BLK_DEV_SD) for most USB storage devices.

To compile this driver as a module, choose M here: the
module will be called usb-storage.

config USB_STORAGE_DEBUG
bool "USB Mass Storage verbose debug"
depends on USB_STORAGE
help
Say Y here in order to have the USB Mass Storage code generate
verbose debugging messages.

config USB_STORAGE_REALTEK
tristate "Realtek Card Reader support"
depends on USB_STORAGE
help
Say Y here to include additional code to support the power-saving function
for Realtek RTS51xx USB card readers.

If this driver is compiled as a module, it will be named ums-realtek.

config USB_STORAGE_DATAFAB
tristate "Datafab Compact Flash Reader support"
depends on USB_STORAGE
help
Support for certain Datafab CompactFlash readers.
Datafab has a web page at <http://www.datafab.com/>.

If this driver is compiled as a module, it will be named ums-datafab.

config USB_STORAGE_FREECOM
tristate "Freecom USB/ATAPI Bridge support"
depends on USB_STORAGE
help
Support for the Freecom USB to IDE/ATAPI adaptor.
Freecom has a web page at <http://www.freecom.de/>.

If this driver is compiled as a module, it will be named ums-freecom.

config USB_STORAGE_ISD200
tristate "ISD-200 USB/ATA Bridge support"
depends on USB_STORAGE
---help---
Say Y here if you want to use USB Mass Store devices based
on the In-Systems Design ISD-200 USB/ATA bridge.

Some of the products that use this chip are:

- Archos Jukebox 6000
- ISD SmartCable for Storage
- Taiwan Skymaster CD530U/DEL-0241 IDE bridge
- Sony CRX10U CD-R/RW drive
- CyQ‘ve CQ8060A CDRW drive
- Planex eXtreme Drive RX-25HU USB-IDE cable (not model RX-25U)

If this driver is compiled as a module, it will be named ums-isd200.

config USB_STORAGE_USBAT
tristate "USBAT/USBAT02-based storage support"
depends on USB_STORAGE
help
Say Y here to include additional code to support storage devices
based on the SCM/Shuttle USBAT/USBAT02 processors.

Devices reported to work with this driver include:
- CompactFlash reader included with Kodak DC3800 camera
- Dane-Elec Zmate CompactFlash reader
- Delkin Efilm reader2
- HP 8200e/8210e/8230e CD-Writer Plus drives
- I-JAM JS-50U
- Jessops CompactFlash JESDCFRU BLACK
- Kingston Technology PCREAD-USB/CF
- Maxell UA4 CompactFlash reader
- Memorex UCF-100
- Microtech ZiO! ICS-45 CF2
- RCA LYRA MP3 portable
- Sandisk ImageMate SDDR-05b

If this driver is compiled as a module, it will be named ums-usbat.

config USB_STORAGE_SDDR09
tristate "SanDisk SDDR-09 (and other SmartMedia, including DPCM) support"
depends on USB_STORAGE
help
Say Y here to include additional code to support the Sandisk SDDR-09
SmartMedia reader in the USB Mass Storage driver.
Also works for the Microtech Zio! CompactFlash/SmartMedia reader.

If this driver is compiled as a module, it will be named ums-sddr09.

config USB_STORAGE_SDDR55
tristate "SanDisk SDDR-55 SmartMedia support"
depends on USB_STORAGE
help
Say Y here to include additional code to support the Sandisk SDDR-55
SmartMedia reader in the USB Mass Storage driver.

If this driver is compiled as a module, it will be named ums-sddr55.

config USB_STORAGE_JUMPSHOT
tristate "Lexar Jumpshot Compact Flash Reader"
depends on USB_STORAGE
help
Say Y here to include additional code to support the Lexar Jumpshot
USB CompactFlash reader.

If this driver is compiled as a module, it will be named ums-jumpshot.

config USB_STORAGE_ALAUDA
tristate "Olympus MAUSB-10/Fuji DPC-R1 support"
depends on USB_STORAGE
help
Say Y here to include additional code to support the Olympus MAUSB-10
and Fujifilm DPC-R1 USB Card reader/writer devices.

These devices are based on the Alauda chip and support both
XD and SmartMedia cards.

If this driver is compiled as a module, it will be named ums-alauda.

config USB_STORAGE_ONETOUCH
tristate "Support OneTouch Button on Maxtor Hard Drives"
depends on USB_STORAGE
depends on INPUT=y || INPUT=USB_STORAGE
help
Say Y here to include additional code to support the Maxtor OneTouch
USB hard drive‘s onetouch button.

This code registers the button on the front of Maxtor OneTouch USB
hard drive‘s as an input device. An action can be associated with
this input in any keybinding software. (e.g. gnome‘s keyboard short-
cuts)

If this driver is compiled as a module, it will be named ums-onetouch.

config USB_STORAGE_KARMA
tristate "Support for Rio Karma music player"
depends on USB_STORAGE
help
Say Y here to include additional code to support the Rio Karma
USB interface.

This code places the Rio Karma into mass storage mode, enabling
it to be mounted as an ordinary filesystem. Performing an eject
on the resulting scsi device node returns the Karma to normal
operation.

If this driver is compiled as a module, it will be named ums-karma.

config USB_STORAGE_CYPRESS_ATACB
tristate "SAT emulation on Cypress USB/ATA Bridge with ATACB"
depends on USB_STORAGE
---help---
Say Y here if you want to use SAT (ata pass through) on devices based
on the Cypress USB/ATA bridge supporting ATACB. This will allow you
to use tools to tune and monitor your drive (like hdparm or smartctl).

If you say no here your device will still work with the standard usb
mass storage class.

If this driver is compiled as a module, it will be named ums-cypress.

config USB_STORAGE_ENE_UB6250
tristate "USB ENE card reader support"
depends on USB && SCSI
depends on USB_STORAGE
---help---
Say Y here if you wish to control a ENE SD Card reader.
To use SM/MS card, please build driver/staging/keucr/keucr.ko

This option depends on ‘SCSI‘ support being enabled, but you
probably also need ‘SCSI device support: SCSI disk support‘
(BLK_DEV_SD) for most USB storage devices.

To compile this driver as a module, choose M here: the
module will be called ums-eneub6250.

config USB_UAS
tristate "USB Attached SCSI"
depends on USB && SCSI
help
The USB Attached SCSI protocol is supported by some USB
storage devices. It permits higher performance by supporting
multiple outstanding commands.

If you don‘t know whether you have a UAS device, it is safe to
say ‘Y‘ or ‘M‘ here and the kernel will use the right driver.

If you compile this driver as a module, it will be named uas.

config USB_LIBUSUAL
bool "The shared table of common (or usual) storage devices"
depends on USB
help
This module contains a table of common (or usual) devices
for usb-storage and ub drivers, and allows to switch binding
of these devices without rebuilding modules.

Typical syntax of /etc/modprobe.conf is:

options libusual bias="ub"

If unsure, say N.

时间: 2024-11-05 21:51:51

USB storage drivers分析之一的相关文章

Linux USB驱动框架分析 【转】

转自:http://blog.chinaunix.net/uid-11848011-id-96188.html 初次接触与OS相关的设备驱动编写,感觉还挺有意思的,为了不至于忘掉看过的东西,笔记跟总结当然不可缺,更何况我决定为嵌入式卖命了.好,言归正传,我说一说这段时间的收获,跟大家分享一下Linux的驱动开发.但这次只先针对Linux的USB子系统作分析,因为周五研讨老板催货.当然,还会顺带提一下其他的驱动程序写法. 事实上,Linux的设备驱动都遵循一个惯例——表征驱动程序(用driver更

7 Linux usb驱动框架分析

现象:将USB设备接入PC,PC右下角上会弹出"发现xx新设备",例如"发现andriod phone"若PC上没有安装该设备的驱动程序,则会弹出对话框提示"安装驱动程序". 问1:没有安装设备的驱动程序之前,为什么PC还能发现andriod phone设备呢? 答1:windows系统中已经安装了USB的"总线驱动程序",是"总线驱动程序"发现了新的设备,而提示我们安装的是"设备驱动程序&quo

USB Mass Storage协议分析

目录 简介 指令数据和状态协议 CBW指令格式 CSWCommand Status Wrapper状态格式 SCSI命令集 Format Unit Inquiry MODE SELECT 简介 USB Mass storage Device协议即海量存储设备协议适用于硬盘,U盘等大容量存储设备.协议使用的接口端点有BulkIn.BulkOut和Interrupt端点.该设备类又包含6个独立的子类以及3种传输协议. bInterfaceSubClass 命令集 描述 01h RBC 通常,Flas

Linux下USB驱动框架分析【转】

转自:http://blog.csdn.net/brucexu1978/article/details/17583407 版权声明:本文为博主原创文章,未经博主允许不得转载. http://www.cnblogs.com/general001/articles/2319552.html http://blog.csdn.net/uruita/article/details/7263290:MODULE_DEVICE_TABLE http://blog.chinaunix.net/uid-2590

Linux USB驱动框架分析(2)【转】

转自:http://blog.chinaunix.net/uid-23046336-id-3243543.html 看了http://blog.chinaunix.net/uid-11848011-id-96188.html的驱动框架分析,感觉受益匪浅.对于一些内容,我自己查漏补缺. 首先我们按照顺序,看内核模块的注册以及释放函数如下: 点击(此处)折叠或打开 static int __init usb_skel_init(void) { int result; /* register this

linux下usb转串口驱动分析【转】

转自:http://blog.csdn.net/txxm520/article/details/8934706 首先说一下linux的风格,个人理解 1. linux大小结构体其实是面向对象的方法,(如果把struct 比作类,kmalloc就是类的实例化,结构体里面的函数指针就是方法,还有重构,多态) 2. 在linux里面,设备是对象,驱动也是对象,并且这两个是分开的 现在我们来看驱动的总体架构 并不用太在意这个图,对用户来说usb_serial设备就是普通的串口设备 我们可以看驱动里面几个

Linux下 USB设备驱动分析(原创)

之前做过STM32的usb HID复合设备,闲来看看linux下USB设备驱动是怎么一回事, 参考资料基于韦东山JZ2440开发板,以下,有错误欢迎指出. 1.准备知识 1.1USB相关概念: USB枚举过程:https://blog.csdn.net/go_str/article/details/80802452 USB其它概念: (1)usb是主从结构,usb的传输都是主机发起: (2)usb右四种传输类型:控制.批量.中断.实时传输. (3)usb数据是通过端点进行通讯的,0端点既能输入也

USB的简单分析

USB2.0 USB版本 最大传输速率 速率称号 最大输出电流 推出时间 USB1.0 1.5Mbps(192KB/s) 低速(Low-Speed) 500mA 1996年1月 USB1.1 12Mbps(1.5MB/s) 全速(Full-Speed) 500mA 1998年9月 USB2.0 480Mbps(60MB/s) 高速(High-Speed) 500mA 2000年4月 USB3.0 5-10Gbps(640MB/s) 超速(Super-Speed) 900mA 2008年11月 U

kvm初体验之七:attach usb storage device to a VM

1. virsh attach-disk vm1 /dev/sdb sdc 将host上的/dev/sdb挂载到vm1的/dev/sdc上 2. virsh detach-disk vm1 sdc 将vm1上的/dev/sdc卸载