Linux 2.4.0-test7-pre7
[davej-history.git] / drivers / usb / storage / dpcm.c
blob73b1a84b46cf6684825f82caf092a2e41d1acf84
1 /* Driver for Microtech DPCM-USB CompactFlash/SmartMedia reader
3 * $Id: dpcm.c,v 1.1 2000/08/08 01:26:12 webbb Exp $
5 * DPCM driver v0.1:
7 * First release
9 * Current development and maintainance by:
10 * (c) 2000 Brian Webb (webbb@earthlink.net)
12 * This device contains both a CompactFlash card reader, which
13 * usest the Control/Bulk w/o Interrupt protocol and
14 * a SmartMedia card reader that uses the same protocol
15 * as the SDDR09.
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.
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.
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.
32 #include "transport.h"
33 #include "protocol.h"
34 #include "usb.h"
35 #include "debug.h"
36 #include "dpcm.h"
37 #include "sddr09.h"
41 * Transport for the Microtech DPCM-USB
44 int dpcm_transport(Scsi_Cmnd *srb, struct us_data *us)
46 int ret;
48 if(srb == NULL)
49 return USB_STOR_TRANSPORT_ERROR;
51 US_DEBUGP("dpcm_transport: LUN=%d\n", srb->lun);
53 switch(srb->lun) {
54 case 0:
57 * LUN 0 corresponds to the CompactFlash card reader.
59 return usb_stor_CB_transport(srb, us);
61 #ifdef CONFIG_USB_STORAGE_SDDR09
62 case 1:
65 * LUN 1 corresponds to the SmartMedia card reader.
69 * Set the LUN to 0 (just in case).
71 srb->lun = 0; us->srb->lun = 0;
72 ret = sddr09_transport(srb, us);
73 srb->lun = 1; us->srb->lun = 1;
75 return ret;
76 #endif
78 default:
79 US_DEBUGP("dpcm_transport: Invalid LUN %d\n", srb->lun);
80 return USB_STOR_TRANSPORT_ERROR;