patch-2.4.22 linux-2.4.22/drivers/usb/storage/initializers.c
Next file: linux-2.4.22/drivers/usb/storage/initializers.h
Previous file: linux-2.4.22/drivers/usb/speedtch.c
Back to the patch index
Back to the overall index
- Lines: 60
- Date:
2003-08-25 04:44:42.000000000 -0700
- Orig file:
linux-2.4.21/drivers/usb/storage/initializers.c
- Orig date:
2000-09-08 16:39:12.000000000 -0700
diff -urN linux-2.4.21/drivers/usb/storage/initializers.c linux-2.4.22/drivers/usb/storage/initializers.c
@@ -39,6 +39,7 @@
#include "initializers.h"
#include "debug.h"
+#include "transport.h"
/* This places the Shuttle/SCM USB<->SCSI bridge devices in multi-target
* mode */
@@ -57,4 +58,51 @@
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)
+{
+ int pipe;
+ 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 = ++(us->tag);
+ 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));
+
+ pipe = usb_sndbulkpipe(us->pusb_dev, us->ep_out);
+ res = usb_stor_bulk_msg(us, bcb, pipe, US_BULK_CB_WRAP_LEN, &partial);
+ US_DEBUGP("-- result is %d\n", res);
+ kfree(bcb);
+
+ if(res) {
+ kfree(bcs);
+ return(res);
+ }
+
+ pipe = usb_rcvbulkpipe(us->pusb_dev, us->ep_in);
+ res = usb_stor_bulk_msg(us, bcs, pipe, US_BULK_CS_WRAP_LEN, &partial);
+ US_DEBUGP("-- result of status read is %d\n", res);
+
+ kfree(bcs);
+
+ return(res ? -1 : 0);
+}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)