diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/usb/storage/dpcm.c |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/usb/storage/dpcm.c')
-rw-r--r-- | drivers/usb/storage/dpcm.c | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/drivers/usb/storage/dpcm.c b/drivers/usb/storage/dpcm.c new file mode 100644 index 000000000000..92b69e4c8047 --- /dev/null +++ b/drivers/usb/storage/dpcm.c | |||
@@ -0,0 +1,89 @@ | |||
1 | /* Driver for Microtech DPCM-USB CompactFlash/SmartMedia reader | ||
2 | * | ||
3 | * $Id: dpcm.c,v 1.4 2001/06/11 02:54:25 mdharm Exp $ | ||
4 | * | ||
5 | * DPCM driver v0.1: | ||
6 | * | ||
7 | * First release | ||
8 | * | ||
9 | * Current development and maintenance by: | ||
10 | * (c) 2000 Brian Webb (webbb@earthlink.net) | ||
11 | * | ||
12 | * This device contains both a CompactFlash card reader, which | ||
13 | * uses the Control/Bulk w/o Interrupt protocol and | ||
14 | * a SmartMedia card reader that uses the same protocol | ||
15 | * as the SDDR09. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or modify it | ||
18 | * under the terms of the GNU General Public License as published by the | ||
19 | * Free Software Foundation; either version 2, or (at your option) any | ||
20 | * later version. | ||
21 | * | ||
22 | * This program is distributed in the hope that it will be useful, but | ||
23 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
25 | * General Public License for more details. | ||
26 | * | ||
27 | * You should have received a copy of the GNU General Public License along | ||
28 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
29 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
30 | */ | ||
31 | |||
32 | #include <linux/config.h> | ||
33 | #include <scsi/scsi.h> | ||
34 | #include <scsi/scsi_cmnd.h> | ||
35 | #include <scsi/scsi_device.h> | ||
36 | |||
37 | #include "usb.h" | ||
38 | #include "transport.h" | ||
39 | #include "protocol.h" | ||
40 | #include "debug.h" | ||
41 | #include "dpcm.h" | ||
42 | #include "sddr09.h" | ||
43 | |||
44 | /* | ||
45 | * Transport for the Microtech DPCM-USB | ||
46 | * | ||
47 | */ | ||
48 | int dpcm_transport(struct scsi_cmnd *srb, struct us_data *us) | ||
49 | { | ||
50 | int ret; | ||
51 | |||
52 | if(srb == NULL) | ||
53 | return USB_STOR_TRANSPORT_ERROR; | ||
54 | |||
55 | US_DEBUGP("dpcm_transport: LUN=%d\n", srb->device->lun); | ||
56 | |||
57 | switch(srb->device->lun) { | ||
58 | case 0: | ||
59 | |||
60 | /* | ||
61 | * LUN 0 corresponds to the CompactFlash card reader. | ||
62 | */ | ||
63 | ret = usb_stor_CB_transport(srb, us); | ||
64 | break; | ||
65 | |||
66 | #ifdef CONFIG_USB_STORAGE_SDDR09 | ||
67 | case 1: | ||
68 | |||
69 | /* | ||
70 | * LUN 1 corresponds to the SmartMedia card reader. | ||
71 | */ | ||
72 | |||
73 | /* | ||
74 | * Set the LUN to 0 (just in case). | ||
75 | */ | ||
76 | srb->device->lun = 0; us->srb->device->lun = 0; | ||
77 | ret = sddr09_transport(srb, us); | ||
78 | srb->device->lun = 1; us->srb->device->lun = 1; | ||
79 | break; | ||
80 | |||
81 | #endif | ||
82 | |||
83 | default: | ||
84 | US_DEBUGP("dpcm_transport: Invalid LUN %d\n", srb->device->lun); | ||
85 | ret = USB_STOR_TRANSPORT_ERROR; | ||
86 | break; | ||
87 | } | ||
88 | return ret; | ||
89 | } | ||