Commit 175a917f authored by Kevin Cernekee's avatar Kevin Cernekee Committed by Greg Kroah-Hartman

[PATCH] USB: Desknote/ECS UCR-61S2B card reader (2.5.72 patched)

 This is for 2.5.72 with the US_PR_DEVICE / US_SC_DEVICE patch in place.
 Tested and working.
parent 5ba7b61b
......@@ -41,6 +41,7 @@
#include <linux/errno.h>
#include "initializers.h"
#include "debug.h"
#include "transport.h"
/* This places the Shuttle/SCM USB<->SCSI bridge devices in multi-target
* mode */
......@@ -59,4 +60,50 @@ int usb_stor_euscsi_init(struct us_data *us)
return 0;
}
/* This function is required to activate all four slots on the UCR-61S2B
* flash reader */
int usb_stor_ucr61s2b_init(struct us_data *us)
{
struct bulk_cb_wrap *bcb;
struct bulk_cs_wrap *bcs;
int res, partial;
bcb = kmalloc(sizeof *bcb, in_interrupt() ? GFP_ATOMIC : GFP_NOIO);
if (!bcb) {
return(-1);
}
bcs = kmalloc(sizeof *bcs, in_interrupt() ? GFP_ATOMIC : GFP_NOIO);
if (!bcs) {
kfree(bcb);
return(-1);
}
US_DEBUGP("Sending UCR-61S2B initialization packet...\n");
bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
bcb->Tag = 0;
bcb->DataTransferLength = cpu_to_le32(0);
bcb->Flags = bcb->Lun = 0;
bcb->Length = sizeof(UCR61S2B_INIT);
memset(bcb->CDB, 0, sizeof(bcb->CDB));
memcpy(bcb->CDB, UCR61S2B_INIT, sizeof(UCR61S2B_INIT));
res = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcb,
US_BULK_CB_WRAP_LEN, &partial);
US_DEBUGP("-- result is %d\n", res);
kfree(bcb);
if(res) {
kfree(bcs);
return(res);
}
res = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe, bcs,
US_BULK_CS_WRAP_LEN, &partial);
US_DEBUGP("-- result of status read is %d\n", res);
kfree(bcs);
return(res ? -1 : 0);
}
......@@ -48,3 +48,9 @@ int usb_stor_euscsi_init(struct us_data *us);
#ifdef CONFIG_USB_STORAGE_SDDR09
int sddr09_init(struct us_data *us);
#endif
#define UCR61S2B_INIT "\xec\x0a\x06\x00$PCCHIPS"
/* This function is required to activate all four slots on the UCR-61S2B
* flash reader */
int usb_stor_ucr61s2b_init(struct us_data *us);
......@@ -620,6 +620,16 @@ UNUSUAL_DEV( 0x1065, 0x2136, 0x0000, 0x0001,
US_SC_SCSI, US_PR_BULK, NULL,
US_FL_MODE_XLATE | US_FL_FIX_INQUIRY ),
/* Reported by Kevin Cernekee <kpc-usbdev@gelato.uiuc.edu>
* Tested on hardware version 1.10.
* Entry is needed only for the initializer function override.
*/
UNUSUAL_DEV( 0x1019, 0x0c55, 0x0000, 0x9999,
"Desknote",
"UCR-61S2B",
US_SC_DEVICE, US_PR_DEVICE, usb_stor_ucr61s2b_init,
0 ),
/* Reported by Dan Pilone <pilone@slac.com>
* The device needs the flags only.
* Also reported by Brian Hall <brihall@pcisys.net>, again for flags.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment