diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2009-02-12 14:48:08 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 19:20:34 -0400 |
commit | 26d6818f19d0ab018f28a20d699511c1efdf508b (patch) | |
tree | 78c8307da63551997421dd54ac362365cada39d4 /drivers/usb/storage | |
parent | fcdb51401f7f695b7fb782721b2e33372c5a06ce (diff) |
usb-storage: make shuttle_usbat a separate module
This patch (as1211) converts usb-storage's shuttle_usbat subdriver
into a separate module.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage')
-rw-r--r-- | drivers/usb/storage/Kconfig | 4 | ||||
-rw-r--r-- | drivers/usb/storage/Makefile | 3 | ||||
-rw-r--r-- | drivers/usb/storage/shuttle_usbat.c | 199 | ||||
-rw-r--r-- | drivers/usb/storage/shuttle_usbat.h | 123 | ||||
-rw-r--r-- | drivers/usb/storage/unusual_devs.h | 28 | ||||
-rw-r--r-- | drivers/usb/storage/unusual_usbat.h | 43 | ||||
-rw-r--r-- | drivers/usb/storage/usb.c | 12 | ||||
-rw-r--r-- | drivers/usb/storage/usual-tables.c | 1 |
8 files changed, 227 insertions, 186 deletions
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig index 2c73fa97d94d..44c6b1940f77 100644 --- a/drivers/usb/storage/Kconfig +++ b/drivers/usb/storage/Kconfig | |||
@@ -64,7 +64,7 @@ config USB_STORAGE_ISD200 | |||
64 | If this driver is compiled as a module, it will be named ums-isd200. | 64 | If this driver is compiled as a module, it will be named ums-isd200. |
65 | 65 | ||
66 | config USB_STORAGE_USBAT | 66 | config USB_STORAGE_USBAT |
67 | bool "USBAT/USBAT02-based storage support" | 67 | tristate "USBAT/USBAT02-based storage support" |
68 | depends on USB_STORAGE | 68 | depends on USB_STORAGE |
69 | help | 69 | help |
70 | Say Y here to include additional code to support storage devices | 70 | Say Y here to include additional code to support storage devices |
@@ -84,6 +84,8 @@ config USB_STORAGE_USBAT | |||
84 | - RCA LYRA MP3 portable | 84 | - RCA LYRA MP3 portable |
85 | - Sandisk ImageMate SDDR-05b | 85 | - Sandisk ImageMate SDDR-05b |
86 | 86 | ||
87 | If this driver is compiled as a module, it will be named ums-usbat. | ||
88 | |||
87 | config USB_STORAGE_SDDR09 | 89 | config USB_STORAGE_SDDR09 |
88 | tristate "SanDisk SDDR-09 (and other SmartMedia, including DPCM) support" | 90 | tristate "SanDisk SDDR-09 (and other SmartMedia, including DPCM) support" |
89 | depends on USB_STORAGE | 91 | depends on USB_STORAGE |
diff --git a/drivers/usb/storage/Makefile b/drivers/usb/storage/Makefile index 0650f022e561..2387368cb7ae 100644 --- a/drivers/usb/storage/Makefile +++ b/drivers/usb/storage/Makefile | |||
@@ -10,7 +10,6 @@ EXTRA_CFLAGS := -Idrivers/scsi | |||
10 | obj-$(CONFIG_USB_STORAGE) += usb-storage.o | 10 | obj-$(CONFIG_USB_STORAGE) += usb-storage.o |
11 | 11 | ||
12 | usb-storage-obj-$(CONFIG_USB_STORAGE_DEBUG) += debug.o | 12 | usb-storage-obj-$(CONFIG_USB_STORAGE_DEBUG) += debug.o |
13 | usb-storage-obj-$(CONFIG_USB_STORAGE_USBAT) += shuttle_usbat.o | ||
14 | usb-storage-obj-$(CONFIG_USB_STORAGE_FREECOM) += freecom.o | 13 | usb-storage-obj-$(CONFIG_USB_STORAGE_FREECOM) += freecom.o |
15 | usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB) += datafab.o | 14 | usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB) += datafab.o |
16 | usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o | 15 | usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o |
@@ -31,8 +30,10 @@ obj-$(CONFIG_USB_STORAGE_CYPRESS_ATACB) += ums-cypress.o | |||
31 | obj-$(CONFIG_USB_STORAGE_ISD200) += ums-isd200.o | 30 | obj-$(CONFIG_USB_STORAGE_ISD200) += ums-isd200.o |
32 | obj-$(CONFIG_USB_STORAGE_SDDR09) += ums-sddr09.o | 31 | obj-$(CONFIG_USB_STORAGE_SDDR09) += ums-sddr09.o |
33 | obj-$(CONFIG_USB_STORAGE_SDDR55) += ums-sddr55.o | 32 | obj-$(CONFIG_USB_STORAGE_SDDR55) += ums-sddr55.o |
33 | obj-$(CONFIG_USB_STORAGE_USBAT) += ums-usbat.o | ||
34 | 34 | ||
35 | ums-cypress-objs := cypress_atacb.o | 35 | ums-cypress-objs := cypress_atacb.o |
36 | ums-isd200-objs := isd200.o | 36 | ums-isd200-objs := isd200.o |
37 | ums-sddr09-objs := sddr09.o | 37 | ums-sddr09-objs := sddr09.o |
38 | ums-sddr55-objs := sddr55.o | 38 | ums-sddr55-objs := sddr55.o |
39 | ums-usbat-objs := shuttle_usbat.o | ||
diff --git a/drivers/usb/storage/shuttle_usbat.c b/drivers/usb/storage/shuttle_usbat.c index ae6d64810d2a..d4fe0bb327a7 100644 --- a/drivers/usb/storage/shuttle_usbat.c +++ b/drivers/usb/storage/shuttle_usbat.c | |||
@@ -42,6 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | 43 | ||
44 | #include <linux/errno.h> | 44 | #include <linux/errno.h> |
45 | #include <linux/module.h> | ||
45 | #include <linux/slab.h> | 46 | #include <linux/slab.h> |
46 | #include <linux/cdrom.h> | 47 | #include <linux/cdrom.h> |
47 | 48 | ||
@@ -52,7 +53,97 @@ | |||
52 | #include "transport.h" | 53 | #include "transport.h" |
53 | #include "protocol.h" | 54 | #include "protocol.h" |
54 | #include "debug.h" | 55 | #include "debug.h" |
55 | #include "shuttle_usbat.h" | 56 | |
57 | |||
58 | /* Supported device types */ | ||
59 | #define USBAT_DEV_HP8200 0x01 | ||
60 | #define USBAT_DEV_FLASH 0x02 | ||
61 | |||
62 | #define USBAT_EPP_PORT 0x10 | ||
63 | #define USBAT_EPP_REGISTER 0x30 | ||
64 | #define USBAT_ATA 0x40 | ||
65 | #define USBAT_ISA 0x50 | ||
66 | |||
67 | /* Commands (need to be logically OR'd with an access type */ | ||
68 | #define USBAT_CMD_READ_REG 0x00 | ||
69 | #define USBAT_CMD_WRITE_REG 0x01 | ||
70 | #define USBAT_CMD_READ_BLOCK 0x02 | ||
71 | #define USBAT_CMD_WRITE_BLOCK 0x03 | ||
72 | #define USBAT_CMD_COND_READ_BLOCK 0x04 | ||
73 | #define USBAT_CMD_COND_WRITE_BLOCK 0x05 | ||
74 | #define USBAT_CMD_WRITE_REGS 0x07 | ||
75 | |||
76 | /* Commands (these don't need an access type) */ | ||
77 | #define USBAT_CMD_EXEC_CMD 0x80 | ||
78 | #define USBAT_CMD_SET_FEAT 0x81 | ||
79 | #define USBAT_CMD_UIO 0x82 | ||
80 | |||
81 | /* Methods of accessing UIO register */ | ||
82 | #define USBAT_UIO_READ 1 | ||
83 | #define USBAT_UIO_WRITE 0 | ||
84 | |||
85 | /* Qualifier bits */ | ||
86 | #define USBAT_QUAL_FCQ 0x20 /* full compare */ | ||
87 | #define USBAT_QUAL_ALQ 0x10 /* auto load subcount */ | ||
88 | |||
89 | /* USBAT Flash Media status types */ | ||
90 | #define USBAT_FLASH_MEDIA_NONE 0 | ||
91 | #define USBAT_FLASH_MEDIA_CF 1 | ||
92 | |||
93 | /* USBAT Flash Media change types */ | ||
94 | #define USBAT_FLASH_MEDIA_SAME 0 | ||
95 | #define USBAT_FLASH_MEDIA_CHANGED 1 | ||
96 | |||
97 | /* USBAT ATA registers */ | ||
98 | #define USBAT_ATA_DATA 0x10 /* read/write data (R/W) */ | ||
99 | #define USBAT_ATA_FEATURES 0x11 /* set features (W) */ | ||
100 | #define USBAT_ATA_ERROR 0x11 /* error (R) */ | ||
101 | #define USBAT_ATA_SECCNT 0x12 /* sector count (R/W) */ | ||
102 | #define USBAT_ATA_SECNUM 0x13 /* sector number (R/W) */ | ||
103 | #define USBAT_ATA_LBA_ME 0x14 /* cylinder low (R/W) */ | ||
104 | #define USBAT_ATA_LBA_HI 0x15 /* cylinder high (R/W) */ | ||
105 | #define USBAT_ATA_DEVICE 0x16 /* head/device selection (R/W) */ | ||
106 | #define USBAT_ATA_STATUS 0x17 /* device status (R) */ | ||
107 | #define USBAT_ATA_CMD 0x17 /* device command (W) */ | ||
108 | #define USBAT_ATA_ALTSTATUS 0x0E /* status (no clear IRQ) (R) */ | ||
109 | |||
110 | /* USBAT User I/O Data registers */ | ||
111 | #define USBAT_UIO_EPAD 0x80 /* Enable Peripheral Control Signals */ | ||
112 | #define USBAT_UIO_CDT 0x40 /* Card Detect (Read Only) */ | ||
113 | /* CDT = ACKD & !UI1 & !UI0 */ | ||
114 | #define USBAT_UIO_1 0x20 /* I/O 1 */ | ||
115 | #define USBAT_UIO_0 0x10 /* I/O 0 */ | ||
116 | #define USBAT_UIO_EPP_ATA 0x08 /* 1=EPP mode, 0=ATA mode */ | ||
117 | #define USBAT_UIO_UI1 0x04 /* Input 1 */ | ||
118 | #define USBAT_UIO_UI0 0x02 /* Input 0 */ | ||
119 | #define USBAT_UIO_INTR_ACK 0x01 /* Interrupt (ATA/ISA)/Acknowledge (EPP) */ | ||
120 | |||
121 | /* USBAT User I/O Enable registers */ | ||
122 | #define USBAT_UIO_DRVRST 0x80 /* Reset Peripheral */ | ||
123 | #define USBAT_UIO_ACKD 0x40 /* Enable Card Detect */ | ||
124 | #define USBAT_UIO_OE1 0x20 /* I/O 1 set=output/clr=input */ | ||
125 | /* If ACKD=1, set OE1 to 1 also. */ | ||
126 | #define USBAT_UIO_OE0 0x10 /* I/O 0 set=output/clr=input */ | ||
127 | #define USBAT_UIO_ADPRST 0x01 /* Reset SCM chip */ | ||
128 | |||
129 | /* USBAT Features */ | ||
130 | #define USBAT_FEAT_ETEN 0x80 /* External trigger enable */ | ||
131 | #define USBAT_FEAT_U1 0x08 | ||
132 | #define USBAT_FEAT_U0 0x04 | ||
133 | #define USBAT_FEAT_ET1 0x02 | ||
134 | #define USBAT_FEAT_ET2 0x01 | ||
135 | |||
136 | struct usbat_info { | ||
137 | int devicetype; | ||
138 | |||
139 | /* Used for Flash readers only */ | ||
140 | unsigned long sectors; /* total sector count */ | ||
141 | unsigned long ssize; /* sector size in bytes */ | ||
142 | |||
143 | unsigned char sense_key; | ||
144 | unsigned long sense_asc; /* additional sense code */ | ||
145 | unsigned long sense_ascq; /* additional sense code qualifier */ | ||
146 | }; | ||
56 | 147 | ||
57 | #define short_pack(LSB,MSB) ( ((u16)(LSB)) | ( ((u16)(MSB))<<8 ) ) | 148 | #define short_pack(LSB,MSB) ( ((u16)(LSB)) | ( ((u16)(MSB))<<8 ) ) |
58 | #define LSB_of(s) ((s)&0xFF) | 149 | #define LSB_of(s) ((s)&0xFF) |
@@ -63,6 +154,48 @@ static int transferred = 0; | |||
63 | static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us); | 154 | static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us); |
64 | static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us); | 155 | static int usbat_hp8200e_transport(struct scsi_cmnd *srb, struct us_data *us); |
65 | 156 | ||
157 | static int init_usbat_cd(struct us_data *us); | ||
158 | static int init_usbat_flash(struct us_data *us); | ||
159 | |||
160 | |||
161 | /* | ||
162 | * The table of devices | ||
163 | */ | ||
164 | #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \ | ||
165 | vendorName, productName, useProtocol, useTransport, \ | ||
166 | initFunction, flags) \ | ||
167 | { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ | ||
168 | .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } | ||
169 | |||
170 | struct usb_device_id usbat_usb_ids[] = { | ||
171 | # include "unusual_usbat.h" | ||
172 | { } /* Terminating entry */ | ||
173 | }; | ||
174 | MODULE_DEVICE_TABLE(usb, usbat_usb_ids); | ||
175 | |||
176 | #undef UNUSUAL_DEV | ||
177 | |||
178 | /* | ||
179 | * The flags table | ||
180 | */ | ||
181 | #define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, \ | ||
182 | vendor_name, product_name, use_protocol, use_transport, \ | ||
183 | init_function, Flags) \ | ||
184 | { \ | ||
185 | .vendorName = vendor_name, \ | ||
186 | .productName = product_name, \ | ||
187 | .useProtocol = use_protocol, \ | ||
188 | .useTransport = use_transport, \ | ||
189 | .initFunction = init_function, \ | ||
190 | } | ||
191 | |||
192 | static struct us_unusual_dev usbat_unusual_dev_list[] = { | ||
193 | # include "unusual_usbat.h" | ||
194 | { } /* Terminating entry */ | ||
195 | }; | ||
196 | |||
197 | #undef UNUSUAL_DEV | ||
198 | |||
66 | /* | 199 | /* |
67 | * Convenience function to produce an ATA read/write sectors command | 200 | * Convenience function to produce an ATA read/write sectors command |
68 | * Use cmd=0x20 for read, cmd=0x30 for write | 201 | * Use cmd=0x20 for read, cmd=0x30 for write |
@@ -1684,37 +1817,61 @@ static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us) | |||
1684 | return USB_STOR_TRANSPORT_FAILED; | 1817 | return USB_STOR_TRANSPORT_FAILED; |
1685 | } | 1818 | } |
1686 | 1819 | ||
1687 | int init_usbat_cd(struct us_data *us) | 1820 | static int init_usbat_cd(struct us_data *us) |
1688 | { | 1821 | { |
1689 | return init_usbat(us, USBAT_DEV_HP8200); | 1822 | return init_usbat(us, USBAT_DEV_HP8200); |
1690 | } | 1823 | } |
1691 | 1824 | ||
1692 | 1825 | static int init_usbat_flash(struct us_data *us) | |
1693 | int init_usbat_flash(struct us_data *us) | ||
1694 | { | 1826 | { |
1695 | return init_usbat(us, USBAT_DEV_FLASH); | 1827 | return init_usbat(us, USBAT_DEV_FLASH); |
1696 | } | 1828 | } |
1697 | 1829 | ||
1698 | int init_usbat_probe(struct us_data *us) | 1830 | static int usbat_probe(struct usb_interface *intf, |
1831 | const struct usb_device_id *id) | ||
1699 | { | 1832 | { |
1700 | return init_usbat(us, 0); | 1833 | struct us_data *us; |
1834 | int result; | ||
1835 | |||
1836 | result = usb_stor_probe1(&us, intf, id, | ||
1837 | (id - usbat_usb_ids) + usbat_unusual_dev_list); | ||
1838 | if (result) | ||
1839 | return result; | ||
1840 | |||
1841 | /* The actual transport will be determined later by the | ||
1842 | * initialization routine; this is just a placeholder. | ||
1843 | */ | ||
1844 | us->transport_name = "Shuttle USBAT"; | ||
1845 | us->transport = usbat_flash_transport; | ||
1846 | us->transport_reset = usb_stor_CB_reset; | ||
1847 | us->max_lun = 1; | ||
1848 | |||
1849 | result = usb_stor_probe2(us); | ||
1850 | return result; | ||
1701 | } | 1851 | } |
1702 | 1852 | ||
1703 | /* | 1853 | static struct usb_driver usbat_driver = { |
1704 | * Default transport function. Attempts to detect which transport function | 1854 | .name = "ums-usbat", |
1705 | * should be called, makes it the new default, and calls it. | 1855 | .probe = usbat_probe, |
1706 | * | 1856 | .disconnect = usb_stor_disconnect, |
1707 | * This function should never be called. Our usbat_init() function detects the | 1857 | .suspend = usb_stor_suspend, |
1708 | * device type and changes the us->transport ptr to the transport function | 1858 | .resume = usb_stor_resume, |
1709 | * relevant to the device. | 1859 | .reset_resume = usb_stor_reset_resume, |
1710 | * However, we'll support this impossible(?) case anyway. | 1860 | .pre_reset = usb_stor_pre_reset, |
1711 | */ | 1861 | .post_reset = usb_stor_post_reset, |
1712 | int usbat_transport(struct scsi_cmnd *srb, struct us_data *us) | 1862 | .id_table = usbat_usb_ids, |
1863 | .soft_unbind = 1, | ||
1864 | }; | ||
1865 | |||
1866 | static int __init usbat_init(void) | ||
1713 | { | 1867 | { |
1714 | struct usbat_info *info = (struct usbat_info*) (us->extra); | 1868 | return usb_register(&usbat_driver); |
1715 | 1869 | } | |
1716 | if (usbat_set_transport(us, info, 0)) | ||
1717 | return USB_STOR_TRANSPORT_ERROR; | ||
1718 | 1870 | ||
1719 | return us->transport(srb, us); | 1871 | static void __exit usbat_exit(void) |
1872 | { | ||
1873 | usb_deregister(&usbat_driver); | ||
1720 | } | 1874 | } |
1875 | |||
1876 | module_init(usbat_init); | ||
1877 | module_exit(usbat_exit); | ||
diff --git a/drivers/usb/storage/shuttle_usbat.h b/drivers/usb/storage/shuttle_usbat.h deleted file mode 100644 index d8bfc43e9044..000000000000 --- a/drivers/usb/storage/shuttle_usbat.h +++ /dev/null | |||
@@ -1,123 +0,0 @@ | |||
1 | /* Driver for SCM Microsystems USB-ATAPI cable | ||
2 | * Header File | ||
3 | * | ||
4 | * Current development and maintenance by: | ||
5 | * (c) 2000 Robert Baruch (autophile@dol.net) | ||
6 | * (c) 2004, 2005 Daniel Drake <dsd@gentoo.org> | ||
7 | * | ||
8 | * See shuttle_usbat.c for more explanation | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify it | ||
11 | * under the terms of the GNU General Public License as published by the | ||
12 | * Free Software Foundation; either version 2, or (at your option) any | ||
13 | * later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, but | ||
16 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | * General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License along | ||
21 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
22 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
23 | */ | ||
24 | |||
25 | #ifndef _USB_SHUTTLE_USBAT_H | ||
26 | #define _USB_SHUTTLE_USBAT_H | ||
27 | |||
28 | /* Supported device types */ | ||
29 | #define USBAT_DEV_HP8200 0x01 | ||
30 | #define USBAT_DEV_FLASH 0x02 | ||
31 | |||
32 | #define USBAT_EPP_PORT 0x10 | ||
33 | #define USBAT_EPP_REGISTER 0x30 | ||
34 | #define USBAT_ATA 0x40 | ||
35 | #define USBAT_ISA 0x50 | ||
36 | |||
37 | /* Commands (need to be logically OR'd with an access type */ | ||
38 | #define USBAT_CMD_READ_REG 0x00 | ||
39 | #define USBAT_CMD_WRITE_REG 0x01 | ||
40 | #define USBAT_CMD_READ_BLOCK 0x02 | ||
41 | #define USBAT_CMD_WRITE_BLOCK 0x03 | ||
42 | #define USBAT_CMD_COND_READ_BLOCK 0x04 | ||
43 | #define USBAT_CMD_COND_WRITE_BLOCK 0x05 | ||
44 | #define USBAT_CMD_WRITE_REGS 0x07 | ||
45 | |||
46 | /* Commands (these don't need an access type) */ | ||
47 | #define USBAT_CMD_EXEC_CMD 0x80 | ||
48 | #define USBAT_CMD_SET_FEAT 0x81 | ||
49 | #define USBAT_CMD_UIO 0x82 | ||
50 | |||
51 | /* Methods of accessing UIO register */ | ||
52 | #define USBAT_UIO_READ 1 | ||
53 | #define USBAT_UIO_WRITE 0 | ||
54 | |||
55 | /* Qualifier bits */ | ||
56 | #define USBAT_QUAL_FCQ 0x20 /* full compare */ | ||
57 | #define USBAT_QUAL_ALQ 0x10 /* auto load subcount */ | ||
58 | |||
59 | /* USBAT Flash Media status types */ | ||
60 | #define USBAT_FLASH_MEDIA_NONE 0 | ||
61 | #define USBAT_FLASH_MEDIA_CF 1 | ||
62 | |||
63 | /* USBAT Flash Media change types */ | ||
64 | #define USBAT_FLASH_MEDIA_SAME 0 | ||
65 | #define USBAT_FLASH_MEDIA_CHANGED 1 | ||
66 | |||
67 | /* USBAT ATA registers */ | ||
68 | #define USBAT_ATA_DATA 0x10 /* read/write data (R/W) */ | ||
69 | #define USBAT_ATA_FEATURES 0x11 /* set features (W) */ | ||
70 | #define USBAT_ATA_ERROR 0x11 /* error (R) */ | ||
71 | #define USBAT_ATA_SECCNT 0x12 /* sector count (R/W) */ | ||
72 | #define USBAT_ATA_SECNUM 0x13 /* sector number (R/W) */ | ||
73 | #define USBAT_ATA_LBA_ME 0x14 /* cylinder low (R/W) */ | ||
74 | #define USBAT_ATA_LBA_HI 0x15 /* cylinder high (R/W) */ | ||
75 | #define USBAT_ATA_DEVICE 0x16 /* head/device selection (R/W) */ | ||
76 | #define USBAT_ATA_STATUS 0x17 /* device status (R) */ | ||
77 | #define USBAT_ATA_CMD 0x17 /* device command (W) */ | ||
78 | #define USBAT_ATA_ALTSTATUS 0x0E /* status (no clear IRQ) (R) */ | ||
79 | |||
80 | /* USBAT User I/O Data registers */ | ||
81 | #define USBAT_UIO_EPAD 0x80 /* Enable Peripheral Control Signals */ | ||
82 | #define USBAT_UIO_CDT 0x40 /* Card Detect (Read Only) */ | ||
83 | /* CDT = ACKD & !UI1 & !UI0 */ | ||
84 | #define USBAT_UIO_1 0x20 /* I/O 1 */ | ||
85 | #define USBAT_UIO_0 0x10 /* I/O 0 */ | ||
86 | #define USBAT_UIO_EPP_ATA 0x08 /* 1=EPP mode, 0=ATA mode */ | ||
87 | #define USBAT_UIO_UI1 0x04 /* Input 1 */ | ||
88 | #define USBAT_UIO_UI0 0x02 /* Input 0 */ | ||
89 | #define USBAT_UIO_INTR_ACK 0x01 /* Interrupt (ATA/ISA)/Acknowledge (EPP) */ | ||
90 | |||
91 | /* USBAT User I/O Enable registers */ | ||
92 | #define USBAT_UIO_DRVRST 0x80 /* Reset Peripheral */ | ||
93 | #define USBAT_UIO_ACKD 0x40 /* Enable Card Detect */ | ||
94 | #define USBAT_UIO_OE1 0x20 /* I/O 1 set=output/clr=input */ | ||
95 | /* If ACKD=1, set OE1 to 1 also. */ | ||
96 | #define USBAT_UIO_OE0 0x10 /* I/O 0 set=output/clr=input */ | ||
97 | #define USBAT_UIO_ADPRST 0x01 /* Reset SCM chip */ | ||
98 | |||
99 | /* USBAT Features */ | ||
100 | #define USBAT_FEAT_ETEN 0x80 /* External trigger enable */ | ||
101 | #define USBAT_FEAT_U1 0x08 | ||
102 | #define USBAT_FEAT_U0 0x04 | ||
103 | #define USBAT_FEAT_ET1 0x02 | ||
104 | #define USBAT_FEAT_ET2 0x01 | ||
105 | |||
106 | extern int usbat_transport(struct scsi_cmnd *srb, struct us_data *us); | ||
107 | extern int init_usbat_cd(struct us_data *us); | ||
108 | extern int init_usbat_flash(struct us_data *us); | ||
109 | extern int init_usbat_probe(struct us_data *us); | ||
110 | |||
111 | struct usbat_info { | ||
112 | int devicetype; | ||
113 | |||
114 | /* Used for Flash readers only */ | ||
115 | unsigned long sectors; /* total sector count */ | ||
116 | unsigned long ssize; /* sector size in bytes */ | ||
117 | |||
118 | unsigned char sense_key; | ||
119 | unsigned long sense_asc; /* additional sense code */ | ||
120 | unsigned long sense_ascq; /* additional sense code qualifier */ | ||
121 | }; | ||
122 | |||
123 | #endif | ||
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index eff97aed7bfe..6462c4c54dc0 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -85,18 +85,6 @@ UNUSUAL_DEV( 0x03f0, 0x0107, 0x0200, 0x0200, | |||
85 | "CD-Writer+", | 85 | "CD-Writer+", |
86 | US_SC_8070, US_PR_CB, NULL, 0), | 86 | US_SC_8070, US_PR_CB, NULL, 0), |
87 | 87 | ||
88 | #ifdef CONFIG_USB_STORAGE_USBAT | ||
89 | UNUSUAL_DEV( 0x03f0, 0x0207, 0x0001, 0x0001, | ||
90 | "HP", | ||
91 | "CD-Writer+ 8200e", | ||
92 | US_SC_8070, US_PR_USBAT, init_usbat_cd, 0), | ||
93 | |||
94 | UNUSUAL_DEV( 0x03f0, 0x0307, 0x0001, 0x0001, | ||
95 | "HP", | ||
96 | "CD-Writer+ CD-4e", | ||
97 | US_SC_8070, US_PR_USBAT, init_usbat_cd, 0), | ||
98 | #endif | ||
99 | |||
100 | /* Reported by Ben Efros <ben@pc-doctor.com> */ | 88 | /* Reported by Ben Efros <ben@pc-doctor.com> */ |
101 | UNUSUAL_DEV( 0x03f0, 0x070c, 0x0000, 0x0000, | 89 | UNUSUAL_DEV( 0x03f0, 0x070c, 0x0000, 0x0000, |
102 | "HP", | 90 | "HP", |
@@ -506,14 +494,6 @@ UNUSUAL_DEV( 0x04e6, 0x0101, 0x0200, 0x0200, | |||
506 | "CD-RW Device", | 494 | "CD-RW Device", |
507 | US_SC_8020, US_PR_CB, NULL, 0), | 495 | US_SC_8020, US_PR_CB, NULL, 0), |
508 | 496 | ||
509 | #ifdef CONFIG_USB_STORAGE_USBAT | ||
510 | UNUSUAL_DEV( 0x04e6, 0x1010, 0x0000, 0x9999, | ||
511 | "Shuttle/SCM", | ||
512 | "USBAT-02", | ||
513 | US_SC_SCSI, US_PR_USBAT, init_usbat_flash, | ||
514 | US_FL_SINGLE_LUN), | ||
515 | #endif | ||
516 | |||
517 | /* Reported by Dmitry Khlystov <adminimus@gmail.com> */ | 497 | /* Reported by Dmitry Khlystov <adminimus@gmail.com> */ |
518 | UNUSUAL_DEV( 0x04e8, 0x507c, 0x0220, 0x0220, | 498 | UNUSUAL_DEV( 0x04e8, 0x507c, 0x0220, 0x0220, |
519 | "Samsung", | 499 | "Samsung", |
@@ -972,14 +952,6 @@ UNUSUAL_DEV( 0x0781, 0x0002, 0x0009, 0x0009, | |||
972 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 952 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
973 | US_FL_FIX_CAPACITY ), | 953 | US_FL_FIX_CAPACITY ), |
974 | 954 | ||
975 | #ifdef CONFIG_USB_STORAGE_USBAT | ||
976 | UNUSUAL_DEV( 0x0781, 0x0005, 0x0005, 0x0005, | ||
977 | "Sandisk", | ||
978 | "ImageMate SDDR-05b", | ||
979 | US_SC_SCSI, US_PR_USBAT, init_usbat_flash, | ||
980 | US_FL_SINGLE_LUN ), | ||
981 | #endif | ||
982 | |||
983 | UNUSUAL_DEV( 0x0781, 0x0100, 0x0100, 0x0100, | 955 | UNUSUAL_DEV( 0x0781, 0x0100, 0x0100, 0x0100, |
984 | "Sandisk", | 956 | "Sandisk", |
985 | "ImageMate SDDR-12", | 957 | "ImageMate SDDR-12", |
diff --git a/drivers/usb/storage/unusual_usbat.h b/drivers/usb/storage/unusual_usbat.h new file mode 100644 index 000000000000..80e869f10180 --- /dev/null +++ b/drivers/usb/storage/unusual_usbat.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* Unusual Devices File for SCM Microsystems (a.k.a. Shuttle) USB-ATAPI cable | ||
2 | * | ||
3 | * This program is free software; you can redistribute it and/or modify it | ||
4 | * under the terms of the GNU General Public License as published by the | ||
5 | * Free Software Foundation; either version 2, or (at your option) any | ||
6 | * later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, but | ||
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
11 | * General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along | ||
14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
15 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
16 | */ | ||
17 | |||
18 | #if defined(CONFIG_USB_STORAGE_USBAT) || \ | ||
19 | defined(CONFIG_USB_STORAGE_USBAT_MODULE) | ||
20 | |||
21 | UNUSUAL_DEV( 0x03f0, 0x0207, 0x0001, 0x0001, | ||
22 | "HP", | ||
23 | "CD-Writer+ 8200e", | ||
24 | US_SC_8070, US_PR_USBAT, init_usbat_cd, 0), | ||
25 | |||
26 | UNUSUAL_DEV( 0x03f0, 0x0307, 0x0001, 0x0001, | ||
27 | "HP", | ||
28 | "CD-Writer+ CD-4e", | ||
29 | US_SC_8070, US_PR_USBAT, init_usbat_cd, 0), | ||
30 | |||
31 | UNUSUAL_DEV( 0x04e6, 0x1010, 0x0000, 0x9999, | ||
32 | "Shuttle/SCM", | ||
33 | "USBAT-02", | ||
34 | US_SC_SCSI, US_PR_USBAT, init_usbat_flash, | ||
35 | US_FL_SINGLE_LUN), | ||
36 | |||
37 | UNUSUAL_DEV( 0x0781, 0x0005, 0x0005, 0x0005, | ||
38 | "Sandisk", | ||
39 | "ImageMate SDDR-05b", | ||
40 | US_SC_SCSI, US_PR_USBAT, init_usbat_flash, | ||
41 | US_FL_SINGLE_LUN), | ||
42 | |||
43 | #endif /* defined(CONFIG_USB_STORAGE_USBAT) || ... */ | ||
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index 241e1944cf10..3ad22a8142cc 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c | |||
@@ -66,9 +66,6 @@ | |||
66 | #include "debug.h" | 66 | #include "debug.h" |
67 | #include "initializers.h" | 67 | #include "initializers.h" |
68 | 68 | ||
69 | #ifdef CONFIG_USB_STORAGE_USBAT | ||
70 | #include "shuttle_usbat.h" | ||
71 | #endif | ||
72 | #ifdef CONFIG_USB_STORAGE_FREECOM | 69 | #ifdef CONFIG_USB_STORAGE_FREECOM |
73 | #include "freecom.h" | 70 | #include "freecom.h" |
74 | #endif | 71 | #endif |
@@ -610,15 +607,6 @@ static void get_transport(struct us_data *us) | |||
610 | us->transport_reset = usb_stor_Bulk_reset; | 607 | us->transport_reset = usb_stor_Bulk_reset; |
611 | break; | 608 | break; |
612 | 609 | ||
613 | #ifdef CONFIG_USB_STORAGE_USBAT | ||
614 | case US_PR_USBAT: | ||
615 | us->transport_name = "Shuttle USBAT"; | ||
616 | us->transport = usbat_transport; | ||
617 | us->transport_reset = usb_stor_CB_reset; | ||
618 | us->max_lun = 1; | ||
619 | break; | ||
620 | #endif | ||
621 | |||
622 | #ifdef CONFIG_USB_STORAGE_FREECOM | 610 | #ifdef CONFIG_USB_STORAGE_FREECOM |
623 | case US_PR_FREECOM: | 611 | case US_PR_FREECOM: |
624 | us->transport_name = "Freecom"; | 612 | us->transport_name = "Freecom"; |
diff --git a/drivers/usb/storage/usual-tables.c b/drivers/usb/storage/usual-tables.c index be461ee9f005..899a8c8da712 100644 --- a/drivers/usb/storage/usual-tables.c +++ b/drivers/usb/storage/usual-tables.c | |||
@@ -81,6 +81,7 @@ static struct ignore_entry ignore_ids[] = { | |||
81 | # include "unusual_isd200.h" | 81 | # include "unusual_isd200.h" |
82 | # include "unusual_sddr09.h" | 82 | # include "unusual_sddr09.h" |
83 | # include "unusual_sddr55.h" | 83 | # include "unusual_sddr55.h" |
84 | # include "unusual_usbat.h" | ||
84 | { } /* Terminating entry */ | 85 | { } /* Terminating entry */ |
85 | }; | 86 | }; |
86 | 87 | ||