aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2009-02-12 14:47:54 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 19:20:34 -0400
commit32d5493eb83a217c3b1eba4b98cd6d19864f71a8 (patch)
tree13f1ee0b36639b15932602000971531fbeba06d0 /drivers
parent0ff71883b2d60136430458413c135d545c69b0c4 (diff)
usb-storage: make isd200 a separate module
This patch (as1208) converts usb-storage's isd200 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')
-rw-r--r--drivers/usb/storage/Kconfig4
-rw-r--r--drivers/usb/storage/Makefile3
-rw-r--r--drivers/usb/storage/isd200.c94
-rw-r--r--drivers/usb/storage/isd200.h31
-rw-r--r--drivers/usb/storage/unusual_devs.h42
-rw-r--r--drivers/usb/storage/unusual_isd200.h57
-rw-r--r--drivers/usb/storage/usb.c10
-rw-r--r--drivers/usb/storage/usual-tables.c1
8 files changed, 154 insertions, 88 deletions
diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
index 7be8899f2559..fc356a770a76 100644
--- a/drivers/usb/storage/Kconfig
+++ b/drivers/usb/storage/Kconfig
@@ -46,7 +46,7 @@ config USB_STORAGE_FREECOM
46 Freecom has a web page at <http://www.freecom.de/>. 46 Freecom has a web page at <http://www.freecom.de/>.
47 47
48config USB_STORAGE_ISD200 48config USB_STORAGE_ISD200
49 bool "ISD-200 USB/ATA Bridge support" 49 tristate "ISD-200 USB/ATA Bridge support"
50 depends on USB_STORAGE 50 depends on USB_STORAGE
51 ---help--- 51 ---help---
52 Say Y here if you want to use USB Mass Store devices based 52 Say Y here if you want to use USB Mass Store devices based
@@ -61,6 +61,8 @@ config USB_STORAGE_ISD200
61 - CyQ've CQ8060A CDRW drive 61 - CyQ've CQ8060A CDRW drive
62 - Planex eXtreme Drive RX-25HU USB-IDE cable (not model RX-25U) 62 - Planex eXtreme Drive RX-25HU USB-IDE cable (not model RX-25U)
63 63
64 If this driver is compiled as a module, it will be named ums-isd200.
65
64config USB_STORAGE_USBAT 66config USB_STORAGE_USBAT
65 bool "USBAT/USBAT02-based storage support" 67 bool "USBAT/USBAT02-based storage support"
66 depends on USB_STORAGE 68 depends on USB_STORAGE
diff --git a/drivers/usb/storage/Makefile b/drivers/usb/storage/Makefile
index a52740a95602..b47f94e59fdc 100644
--- a/drivers/usb/storage/Makefile
+++ b/drivers/usb/storage/Makefile
@@ -13,7 +13,6 @@ usb-storage-obj-$(CONFIG_USB_STORAGE_DEBUG) += debug.o
13usb-storage-obj-$(CONFIG_USB_STORAGE_USBAT) += shuttle_usbat.o 13usb-storage-obj-$(CONFIG_USB_STORAGE_USBAT) += shuttle_usbat.o
14usb-storage-obj-$(CONFIG_USB_STORAGE_SDDR55) += sddr55.o 14usb-storage-obj-$(CONFIG_USB_STORAGE_SDDR55) += sddr55.o
15usb-storage-obj-$(CONFIG_USB_STORAGE_FREECOM) += freecom.o 15usb-storage-obj-$(CONFIG_USB_STORAGE_FREECOM) += freecom.o
16usb-storage-obj-$(CONFIG_USB_STORAGE_ISD200) += isd200.o
17usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB) += datafab.o 16usb-storage-obj-$(CONFIG_USB_STORAGE_DATAFAB) += datafab.o
18usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o 17usb-storage-obj-$(CONFIG_USB_STORAGE_JUMPSHOT) += jumpshot.o
19usb-storage-obj-$(CONFIG_USB_STORAGE_ALAUDA) += alauda.o 18usb-storage-obj-$(CONFIG_USB_STORAGE_ALAUDA) += alauda.o
@@ -30,6 +29,8 @@ else
30 obj-$(CONFIG_USB) += libusual.o usual-tables.o 29 obj-$(CONFIG_USB) += libusual.o usual-tables.o
31endif 30endif
32 31
32obj-$(CONFIG_USB_STORAGE_ISD200) += ums-isd200.o
33obj-$(CONFIG_USB_STORAGE_SDDR09) += ums-sddr09.o 33obj-$(CONFIG_USB_STORAGE_SDDR09) += ums-sddr09.o
34 34
35ums-isd200-objs := isd200.o
35ums-sddr09-objs := sddr09.o 36ums-sddr09-objs := sddr09.o
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c
index 383abf2516a5..df943008538c 100644
--- a/drivers/usb/storage/isd200.c
+++ b/drivers/usb/storage/isd200.c
@@ -44,6 +44,7 @@
44 44
45#include <linux/jiffies.h> 45#include <linux/jiffies.h>
46#include <linux/errno.h> 46#include <linux/errno.h>
47#include <linux/module.h>
47#include <linux/slab.h> 48#include <linux/slab.h>
48#include <linux/hdreg.h> 49#include <linux/hdreg.h>
49#include <linux/scatterlist.h> 50#include <linux/scatterlist.h>
@@ -57,7 +58,50 @@
57#include "protocol.h" 58#include "protocol.h"
58#include "debug.h" 59#include "debug.h"
59#include "scsiglue.h" 60#include "scsiglue.h"
60#include "isd200.h" 61
62
63static int isd200_Initialization(struct us_data *us);
64
65
66/*
67 * The table of devices
68 */
69#define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
70 vendorName, productName, useProtocol, useTransport, \
71 initFunction, flags) \
72{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
73 .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
74
75struct usb_device_id isd200_usb_ids[] = {
76# include "unusual_isd200.h"
77 { } /* Terminating entry */
78};
79MODULE_DEVICE_TABLE(usb, isd200_usb_ids);
80
81#undef UNUSUAL_DEV
82#undef USUAL_DEV
83
84/*
85 * The flags table
86 */
87#define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, \
88 vendor_name, product_name, use_protocol, use_transport, \
89 init_function, Flags) \
90{ \
91 .vendorName = vendor_name, \
92 .productName = product_name, \
93 .useProtocol = use_protocol, \
94 .useTransport = use_transport, \
95 .initFunction = init_function, \
96}
97
98static struct us_unusual_dev isd200_unusual_dev_list[] = {
99# include "unusual_isd200.h"
100 { } /* Terminating entry */
101};
102
103#undef UNUSUAL_DEV
104#undef USUAL_DEV
61 105
62 106
63/* Timeout defines (in Seconds) */ 107/* Timeout defines (in Seconds) */
@@ -1518,7 +1562,7 @@ static int isd200_init_info(struct us_data *us)
1518 * Initialization for the ISD200 1562 * Initialization for the ISD200
1519 */ 1563 */
1520 1564
1521int isd200_Initialization(struct us_data *us) 1565static int isd200_Initialization(struct us_data *us)
1522{ 1566{
1523 US_DEBUGP("ISD200 Initialization...\n"); 1567 US_DEBUGP("ISD200 Initialization...\n");
1524 1568
@@ -1549,7 +1593,7 @@ int isd200_Initialization(struct us_data *us)
1549 * 1593 *
1550 */ 1594 */
1551 1595
1552void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us) 1596static void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us)
1553{ 1597{
1554 int sendToTransport = 1, orig_bufflen; 1598 int sendToTransport = 1, orig_bufflen;
1555 union ata_cdb ataCdb; 1599 union ata_cdb ataCdb;
@@ -1570,3 +1614,47 @@ void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us)
1570 1614
1571 isd200_srb_set_bufflen(srb, orig_bufflen); 1615 isd200_srb_set_bufflen(srb, orig_bufflen);
1572} 1616}
1617
1618static int isd200_probe(struct usb_interface *intf,
1619 const struct usb_device_id *id)
1620{
1621 struct us_data *us;
1622 int result;
1623
1624 result = usb_stor_probe1(&us, intf, id,
1625 (id - isd200_usb_ids) + isd200_unusual_dev_list);
1626 if (result)
1627 return result;
1628
1629 us->protocol_name = "ISD200 ATA/ATAPI";
1630 us->proto_handler = isd200_ata_command;
1631
1632 result = usb_stor_probe2(us);
1633 return result;
1634}
1635
1636static struct usb_driver isd200_driver = {
1637 .name = "ums-isd200",
1638 .probe = isd200_probe,
1639 .disconnect = usb_stor_disconnect,
1640 .suspend = usb_stor_suspend,
1641 .resume = usb_stor_resume,
1642 .reset_resume = usb_stor_reset_resume,
1643 .pre_reset = usb_stor_pre_reset,
1644 .post_reset = usb_stor_post_reset,
1645 .id_table = isd200_usb_ids,
1646 .soft_unbind = 1,
1647};
1648
1649static int __init isd200_init(void)
1650{
1651 return usb_register(&isd200_driver);
1652}
1653
1654static void __exit isd200_exit(void)
1655{
1656 usb_deregister(&isd200_driver);
1657}
1658
1659module_init(isd200_init);
1660module_exit(isd200_exit);
diff --git a/drivers/usb/storage/isd200.h b/drivers/usb/storage/isd200.h
deleted file mode 100644
index 0a35f4fa78f8..000000000000
--- a/drivers/usb/storage/isd200.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/* Header File for In-System Design, Inc. ISD200 ASIC
2 *
3 * First release
4 *
5 * Current development and maintenance by:
6 * (c) 2000 In-System Design, Inc. (support@in-system.com)
7 *
8 * See isd200.c for more information.
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_ISD200_H
26#define _USB_ISD200_H
27
28extern void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us);
29extern int isd200_Initialization(struct us_data *us);
30
31#endif
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
index 1fe7062f1cda..83ce1d33554a 100644
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -632,14 +632,6 @@ UNUSUAL_DEV( 0x054c, 0x0025, 0x0100, 0x0100,
632 US_SC_DEVICE, US_PR_DEVICE, NULL, 632 US_SC_DEVICE, US_PR_DEVICE, NULL,
633 US_FL_SINGLE_LUN ), 633 US_FL_SINGLE_LUN ),
634 634
635#ifdef CONFIG_USB_STORAGE_ISD200
636UNUSUAL_DEV( 0x054c, 0x002b, 0x0100, 0x0110,
637 "Sony",
638 "Portable USB Harddrive V2",
639 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
640 0 ),
641#endif
642
643/* Submitted by Olaf Hering, <olh@suse.de> SuSE Bugzilla #49049 */ 635/* Submitted by Olaf Hering, <olh@suse.de> SuSE Bugzilla #49049 */
644UNUSUAL_DEV( 0x054c, 0x002c, 0x0501, 0x2000, 636UNUSUAL_DEV( 0x054c, 0x002c, 0x0501, 0x2000,
645 "Sony", 637 "Sony",
@@ -785,32 +777,6 @@ UNUSUAL_DEV( 0x05ab, 0x0060, 0x1104, 0x1110,
785 US_SC_SCSI, US_PR_BULK, NULL, 777 US_SC_SCSI, US_PR_BULK, NULL,
786 US_FL_NEED_OVERRIDE ), 778 US_FL_NEED_OVERRIDE ),
787 779
788#ifdef CONFIG_USB_STORAGE_ISD200
789UNUSUAL_DEV( 0x05ab, 0x0031, 0x0100, 0x0110,
790 "In-System",
791 "USB/IDE Bridge (ATA/ATAPI)",
792 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
793 0 ),
794
795UNUSUAL_DEV( 0x05ab, 0x0301, 0x0100, 0x0110,
796 "In-System",
797 "Portable USB Harddrive V2",
798 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
799 0 ),
800
801UNUSUAL_DEV( 0x05ab, 0x0351, 0x0100, 0x0110,
802 "In-System",
803 "Portable USB Harddrive V2",
804 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
805 0 ),
806
807UNUSUAL_DEV( 0x05ab, 0x5701, 0x0100, 0x0110,
808 "In-System",
809 "USB Storage Adapter V2",
810 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
811 0 ),
812#endif
813
814/* Submitted by Sven Anderson <sven-linux@anderson.de> 780/* Submitted by Sven Anderson <sven-linux@anderson.de>
815 * There are at least four ProductIDs used for iPods, so I added 0x1202 and 781 * There are at least four ProductIDs used for iPods, so I added 0x1202 and
816 * 0x1204. They just need the US_FL_FIX_CAPACITY. As the bcdDevice appears 782 * 0x1204. They just need the US_FL_FIX_CAPACITY. As the bcdDevice appears
@@ -1375,14 +1341,6 @@ UNUSUAL_DEV( 0x0bc2, 0x3010, 0x0000, 0x0000,
1375 US_SC_DEVICE, US_PR_DEVICE, NULL, 1341 US_SC_DEVICE, US_PR_DEVICE, NULL,
1376 US_FL_SANE_SENSE ), 1342 US_FL_SANE_SENSE ),
1377 1343
1378#ifdef CONFIG_USB_STORAGE_ISD200
1379UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110,
1380 "ATI",
1381 "USB Cable 205",
1382 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
1383 0 ),
1384#endif
1385
1386#ifdef CONFIG_USB_STORAGE_DATAFAB 1344#ifdef CONFIG_USB_STORAGE_DATAFAB
1387UNUSUAL_DEV( 0x0c0b, 0xa109, 0x0000, 0xffff, 1345UNUSUAL_DEV( 0x0c0b, 0xa109, 0x0000, 0xffff,
1388 "Acomdata", 1346 "Acomdata",
diff --git a/drivers/usb/storage/unusual_isd200.h b/drivers/usb/storage/unusual_isd200.h
new file mode 100644
index 000000000000..0d99dde3382a
--- /dev/null
+++ b/drivers/usb/storage/unusual_isd200.h
@@ -0,0 +1,57 @@
1/* Unusual Devices File for In-System Design, Inc. ISD200 ASIC
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_ISD200) || \
19 defined(CONFIG_USB_STORAGE_ISD200_MODULE)
20
21UNUSUAL_DEV( 0x054c, 0x002b, 0x0100, 0x0110,
22 "Sony",
23 "Portable USB Harddrive V2",
24 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
25 0),
26
27UNUSUAL_DEV( 0x05ab, 0x0031, 0x0100, 0x0110,
28 "In-System",
29 "USB/IDE Bridge (ATA/ATAPI)",
30 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
31 0),
32
33UNUSUAL_DEV( 0x05ab, 0x0301, 0x0100, 0x0110,
34 "In-System",
35 "Portable USB Harddrive V2",
36 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
37 0),
38
39UNUSUAL_DEV( 0x05ab, 0x0351, 0x0100, 0x0110,
40 "In-System",
41 "Portable USB Harddrive V2",
42 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
43 0),
44
45UNUSUAL_DEV( 0x05ab, 0x5701, 0x0100, 0x0110,
46 "In-System",
47 "USB Storage Adapter V2",
48 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
49 0),
50
51UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110,
52 "ATI",
53 "USB Cable 205",
54 US_SC_ISD200, US_PR_BULK, isd200_Initialization,
55 0),
56
57#endif /* defined(CONFIG_USB_STORAGE_ISD200) || ... */
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 33cce41a5e8a..e65cbba452b0 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -75,9 +75,6 @@
75#ifdef CONFIG_USB_STORAGE_FREECOM 75#ifdef CONFIG_USB_STORAGE_FREECOM
76#include "freecom.h" 76#include "freecom.h"
77#endif 77#endif
78#ifdef CONFIG_USB_STORAGE_ISD200
79#include "isd200.h"
80#endif
81#ifdef CONFIG_USB_STORAGE_DATAFAB 78#ifdef CONFIG_USB_STORAGE_DATAFAB
82#include "datafab.h" 79#include "datafab.h"
83#endif 80#endif
@@ -721,13 +718,6 @@ static void get_protocol(struct us_data *us)
721 us->proto_handler = usb_stor_ufi_command; 718 us->proto_handler = usb_stor_ufi_command;
722 break; 719 break;
723 720
724#ifdef CONFIG_USB_STORAGE_ISD200
725 case US_SC_ISD200:
726 us->protocol_name = "ISD200 ATA/ATAPI";
727 us->proto_handler = isd200_ata_command;
728 break;
729#endif
730
731#ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB 721#ifdef CONFIG_USB_STORAGE_CYPRESS_ATACB
732 case US_SC_CYP_ATACB: 722 case US_SC_CYP_ATACB:
733 us->protocol_name = "Transparent SCSI with Cypress ATACB"; 723 us->protocol_name = "Transparent SCSI with Cypress ATACB";
diff --git a/drivers/usb/storage/usual-tables.c b/drivers/usb/storage/usual-tables.c
index f808c5262d0c..61ebddcc9ae0 100644
--- a/drivers/usb/storage/usual-tables.c
+++ b/drivers/usb/storage/usual-tables.c
@@ -77,6 +77,7 @@ struct ignore_entry {
77} 77}
78 78
79static struct ignore_entry ignore_ids[] = { 79static struct ignore_entry ignore_ids[] = {
80# include "unusual_isd200.h"
80# include "unusual_sddr09.h" 81# include "unusual_sddr09.h"
81 { } /* Terminating entry */ 82 { } /* Terminating entry */
82}; 83};