aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage/sddr09.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2008-12-01 10:36:15 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-07 13:00:06 -0500
commitc20b15fde50c32174af4b48851e5ddadba36330e (patch)
tree1a06cf7037f9b1c5290e9c754881c11bc2966947 /drivers/usb/storage/sddr09.c
parentf1632df36b9467b75b7abfd2799aef67ec74a60a (diff)
USB: usb-storage: merge DPCM support into SDDR09
The DPCM subdriver is a little peculiar, in that it's meant to support devices where LUN 0 is Compact Flash and uses the CB transport whereas LUN 1 is SmartMedia and uses the SDDR09 transport. Thus DPCM isn't really a transport in itself; it's more like a demultiplexer. Much of the DPCM code is part of the SDDR09 subdriver already, and the remaining part is fairly small. This patch (as1182) moves that extra piece into sddr09.c, thereby eliminating dpcm.c. Also eliminated is the Kconfig entry for DPCM support; it is now listed as part of the SDDR09 entry. In order to make sure that the semantics are the same as before, each unusual_devs entry for DPCM is now present twice: once with DPCM support if SDDR09 is configured (as before), and once with the SINGLE_LUN flag and CB support otherwise. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/sddr09.c')
-rw-r--r--drivers/usb/storage/sddr09.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c
index c5a54b872c24..531ae5c5abf3 100644
--- a/drivers/usb/storage/sddr09.c
+++ b/drivers/usb/storage/sddr09.c
@@ -45,6 +45,7 @@
45 45
46#include <scsi/scsi.h> 46#include <scsi/scsi.h>
47#include <scsi/scsi_cmnd.h> 47#include <scsi/scsi_cmnd.h>
48#include <scsi/scsi_device.h>
48 49
49#include "usb.h" 50#include "usb.h"
50#include "transport.h" 51#include "transport.h"
@@ -1446,6 +1447,48 @@ usb_stor_sddr09_dpcm_init(struct us_data *us) {
1446} 1447}
1447 1448
1448/* 1449/*
1450 * Transport for the Microtech DPCM-USB
1451 */
1452int dpcm_transport(struct scsi_cmnd *srb, struct us_data *us)
1453{
1454 int ret;
1455
1456 US_DEBUGP("dpcm_transport: LUN=%d\n", srb->device->lun);
1457
1458 switch (srb->device->lun) {
1459 case 0:
1460
1461 /*
1462 * LUN 0 corresponds to the CompactFlash card reader.
1463 */
1464 ret = usb_stor_CB_transport(srb, us);
1465 break;
1466
1467 case 1:
1468
1469 /*
1470 * LUN 1 corresponds to the SmartMedia card reader.
1471 */
1472
1473 /*
1474 * Set the LUN to 0 (just in case).
1475 */
1476 srb->device->lun = 0;
1477 ret = sddr09_transport(srb, us);
1478 srb->device->lun = 1;
1479 break;
1480
1481 default:
1482 US_DEBUGP("dpcm_transport: Invalid LUN %d\n",
1483 srb->device->lun);
1484 ret = USB_STOR_TRANSPORT_ERROR;
1485 break;
1486 }
1487 return ret;
1488}
1489
1490
1491/*
1449 * Transport for the Sandisk SDDR-09 1492 * Transport for the Sandisk SDDR-09
1450 */ 1493 */
1451int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us) 1494int sddr09_transport(struct scsi_cmnd *srb, struct us_data *us)