mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
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>
This commit is contained in:
parent
f1632df36b
commit
c20b15fde5
8 changed files with 70 additions and 135 deletions
|
@ -45,6 +45,7 @@
|
|||
|
||||
#include <scsi/scsi.h>
|
||||
#include <scsi/scsi_cmnd.h>
|
||||
#include <scsi/scsi_device.h>
|
||||
|
||||
#include "usb.h"
|
||||
#include "transport.h"
|
||||
|
@ -1445,6 +1446,48 @@ usb_stor_sddr09_dpcm_init(struct us_data *us) {
|
|||
return 0; /* not result */
|
||||
}
|
||||
|
||||
/*
|
||||
* Transport for the Microtech DPCM-USB
|
||||
*/
|
||||
int dpcm_transport(struct scsi_cmnd *srb, struct us_data *us)
|
||||
{
|
||||
int ret;
|
||||
|
||||
US_DEBUGP("dpcm_transport: LUN=%d\n", srb->device->lun);
|
||||
|
||||
switch (srb->device->lun) {
|
||||
case 0:
|
||||
|
||||
/*
|
||||
* LUN 0 corresponds to the CompactFlash card reader.
|
||||
*/
|
||||
ret = usb_stor_CB_transport(srb, us);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
/*
|
||||
* LUN 1 corresponds to the SmartMedia card reader.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Set the LUN to 0 (just in case).
|
||||
*/
|
||||
srb->device->lun = 0;
|
||||
ret = sddr09_transport(srb, us);
|
||||
srb->device->lun = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
US_DEBUGP("dpcm_transport: Invalid LUN %d\n",
|
||||
srb->device->lun);
|
||||
ret = USB_STOR_TRANSPORT_ERROR;
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Transport for the Sandisk SDDR-09
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue