diff options
Diffstat (limited to 'drivers/usb/storage/isd200.c')
-rw-r--r-- | drivers/usb/storage/isd200.c | 97 |
1 files changed, 94 insertions, 3 deletions
diff --git a/drivers/usb/storage/isd200.c b/drivers/usb/storage/isd200.c index 383abf2516a5..882c57b399f7 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,53 @@ | |||
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 | MODULE_DESCRIPTION("Driver for In-System Design, Inc. ISD200 ASIC"); | ||
63 | MODULE_AUTHOR("Björn Stenberg <bjorn@haxx.se>"); | ||
64 | MODULE_LICENSE("GPL"); | ||
65 | |||
66 | static int isd200_Initialization(struct us_data *us); | ||
67 | |||
68 | |||
69 | /* | ||
70 | * The table of devices | ||
71 | */ | ||
72 | #define UNUSUAL_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \ | ||
73 | vendorName, productName, useProtocol, useTransport, \ | ||
74 | initFunction, flags) \ | ||
75 | { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \ | ||
76 | .driver_info = (flags)|(USB_US_TYPE_STOR<<24) } | ||
77 | |||
78 | struct usb_device_id isd200_usb_ids[] = { | ||
79 | # include "unusual_isd200.h" | ||
80 | { } /* Terminating entry */ | ||
81 | }; | ||
82 | MODULE_DEVICE_TABLE(usb, isd200_usb_ids); | ||
83 | |||
84 | #undef UNUSUAL_DEV | ||
85 | #undef USUAL_DEV | ||
86 | |||
87 | /* | ||
88 | * The flags table | ||
89 | */ | ||
90 | #define UNUSUAL_DEV(idVendor, idProduct, bcdDeviceMin, bcdDeviceMax, \ | ||
91 | vendor_name, product_name, use_protocol, use_transport, \ | ||
92 | init_function, Flags) \ | ||
93 | { \ | ||
94 | .vendorName = vendor_name, \ | ||
95 | .productName = product_name, \ | ||
96 | .useProtocol = use_protocol, \ | ||
97 | .useTransport = use_transport, \ | ||
98 | .initFunction = init_function, \ | ||
99 | } | ||
100 | |||
101 | static struct us_unusual_dev isd200_unusual_dev_list[] = { | ||
102 | # include "unusual_isd200.h" | ||
103 | { } /* Terminating entry */ | ||
104 | }; | ||
105 | |||
106 | #undef UNUSUAL_DEV | ||
107 | #undef USUAL_DEV | ||
61 | 108 | ||
62 | 109 | ||
63 | /* Timeout defines (in Seconds) */ | 110 | /* Timeout defines (in Seconds) */ |
@@ -1518,7 +1565,7 @@ static int isd200_init_info(struct us_data *us) | |||
1518 | * Initialization for the ISD200 | 1565 | * Initialization for the ISD200 |
1519 | */ | 1566 | */ |
1520 | 1567 | ||
1521 | int isd200_Initialization(struct us_data *us) | 1568 | static int isd200_Initialization(struct us_data *us) |
1522 | { | 1569 | { |
1523 | US_DEBUGP("ISD200 Initialization...\n"); | 1570 | US_DEBUGP("ISD200 Initialization...\n"); |
1524 | 1571 | ||
@@ -1549,7 +1596,7 @@ int isd200_Initialization(struct us_data *us) | |||
1549 | * | 1596 | * |
1550 | */ | 1597 | */ |
1551 | 1598 | ||
1552 | void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us) | 1599 | static void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us) |
1553 | { | 1600 | { |
1554 | int sendToTransport = 1, orig_bufflen; | 1601 | int sendToTransport = 1, orig_bufflen; |
1555 | union ata_cdb ataCdb; | 1602 | union ata_cdb ataCdb; |
@@ -1570,3 +1617,47 @@ void isd200_ata_command(struct scsi_cmnd *srb, struct us_data *us) | |||
1570 | 1617 | ||
1571 | isd200_srb_set_bufflen(srb, orig_bufflen); | 1618 | isd200_srb_set_bufflen(srb, orig_bufflen); |
1572 | } | 1619 | } |
1620 | |||
1621 | static int isd200_probe(struct usb_interface *intf, | ||
1622 | const struct usb_device_id *id) | ||
1623 | { | ||
1624 | struct us_data *us; | ||
1625 | int result; | ||
1626 | |||
1627 | result = usb_stor_probe1(&us, intf, id, | ||
1628 | (id - isd200_usb_ids) + isd200_unusual_dev_list); | ||
1629 | if (result) | ||
1630 | return result; | ||
1631 | |||
1632 | us->protocol_name = "ISD200 ATA/ATAPI"; | ||
1633 | us->proto_handler = isd200_ata_command; | ||
1634 | |||
1635 | result = usb_stor_probe2(us); | ||
1636 | return result; | ||
1637 | } | ||
1638 | |||
1639 | static struct usb_driver isd200_driver = { | ||
1640 | .name = "ums-isd200", | ||
1641 | .probe = isd200_probe, | ||
1642 | .disconnect = usb_stor_disconnect, | ||
1643 | .suspend = usb_stor_suspend, | ||
1644 | .resume = usb_stor_resume, | ||
1645 | .reset_resume = usb_stor_reset_resume, | ||
1646 | .pre_reset = usb_stor_pre_reset, | ||
1647 | .post_reset = usb_stor_post_reset, | ||
1648 | .id_table = isd200_usb_ids, | ||
1649 | .soft_unbind = 1, | ||
1650 | }; | ||
1651 | |||
1652 | static int __init isd200_init(void) | ||
1653 | { | ||
1654 | return usb_register(&isd200_driver); | ||
1655 | } | ||
1656 | |||
1657 | static void __exit isd200_exit(void) | ||
1658 | { | ||
1659 | usb_deregister(&isd200_driver); | ||
1660 | } | ||
1661 | |||
1662 | module_init(isd200_init); | ||
1663 | module_exit(isd200_exit); | ||