summaryrefslogtreecommitdiffstats
path: root/uClinux-2.4.20-uc1/drivers/usb/storage/transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'uClinux-2.4.20-uc1/drivers/usb/storage/transport.c')
-rw-r--r--uClinux-2.4.20-uc1/drivers/usb/storage/transport.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/uClinux-2.4.20-uc1/drivers/usb/storage/transport.c b/uClinux-2.4.20-uc1/drivers/usb/storage/transport.c
index 2955b17..9f41101 100644
--- a/uClinux-2.4.20-uc1/drivers/usb/storage/transport.c
+++ b/uClinux-2.4.20-uc1/drivers/usb/storage/transport.c
@@ -368,6 +368,9 @@ int usb_stor_control_msg(struct us_data *us, unsigned int pipe,
if (!dr)
return -ENOMEM;
+#ifdef CONFIG_BOARD_W90N745
+ dr = (struct usb_ctrlrequest *)((unsigned long)dr | 0x80000000);
+#endif
/* fill in the structure */
dr->bRequestType = requesttype;
dr->bRequest = request;
@@ -708,12 +711,21 @@ void usb_stor_invoke_transport(Scsi_Cmnd *srb, struct us_data *us)
memcpy(old_cmnd, srb->cmnd, MAX_COMMAND_SIZE);
/* set the command and the LUN */
+#ifndef CONFIG_BOARD_W90N745
srb->cmnd[0] = REQUEST_SENSE;
srb->cmnd[1] = old_cmnd[1] & 0xE0;
srb->cmnd[2] = 0;
srb->cmnd[3] = 0;
srb->cmnd[4] = 18;
srb->cmnd[5] = 0;
+#else
+ ((unsigned char *)((unsigned long)srb->cmnd | 0x80000000))[0] = REQUEST_SENSE;
+ ((unsigned char *)((unsigned long)srb->cmnd | 0x80000000))[1] = old_cmnd[1] & 0xE0;
+ ((unsigned char *)((unsigned long)srb->cmnd | 0x80000000))[2] = 0;
+ ((unsigned char *)((unsigned long)srb->cmnd | 0x80000000))[3] = 0;
+ ((unsigned char *)((unsigned long)srb->cmnd | 0x80000000))[4] = 18;
+ ((unsigned char *)((unsigned long)srb->cmnd | 0x80000000))[5] = 0;
+#endif
/* set the transfer direction */
old_sc_data_direction = srb->sc_data_direction;
@@ -739,7 +751,11 @@ void usb_stor_invoke_transport(Scsi_Cmnd *srb, struct us_data *us)
srb->request_bufflen = old_request_bufflen;
srb->use_sg = old_sg;
srb->sc_data_direction = old_sc_data_direction;
+#ifndef CONFIG_BOARD_W90N745
memcpy(srb->cmnd, old_cmnd, MAX_COMMAND_SIZE);
+#else
+ memcpy(((unsigned char *)((unsigned long)srb->cmnd | 0x80000000)), old_cmnd, MAX_COMMAND_SIZE);
+#endif
if (temp_result == USB_STOR_TRANSPORT_ABORTED) {
US_DEBUGP("-- auto-sense aborted\n");
@@ -826,10 +842,17 @@ void usb_stor_CBI_irq(struct urb *urb)
}
/* was this a command-completion interrupt? */
+#ifndef CONFIG_BOARD_W90N745
if (us->irqbuf[0] && (us->subclass != US_SC_UFI)) {
US_DEBUGP("-- not a command-completion IRQ\n");
return;
}
+#else
+ if (((unsigned char *)((unsigned long)us->irqbuf | 0x80000000))[0] && (us->subclass != US_SC_UFI)) {
+ US_DEBUGP("-- not a command-completion IRQ\n");
+ return;
+ }
+#endif
/* was this a wanted interrupt? */
if (!atomic_read(us->ip_wanted)) {
@@ -841,8 +864,13 @@ void usb_stor_CBI_irq(struct urb *urb)
atomic_set(us->ip_wanted, 0);
/* copy the valid data */
+#ifndef CONFIG_BOARD_W90N745
us->irqdata[0] = us->irqbuf[0];
us->irqdata[1] = us->irqbuf[1];
+#else
+ us->irqdata[0] = ((unsigned char *)((unsigned long)us->irqbuf | 0x80000000))[0];
+ us->irqdata[1] = ((unsigned char *)((unsigned long)us->irqbuf | 0x80000000))[1];
+#endif
/* wake up the command thread */
US_DEBUGP("-- Current value of ip_waitq is: %d\n",
@@ -942,7 +970,11 @@ int usb_stor_CBI_transport(Scsi_Cmnd *srb, struct us_data *us)
srb->cmnd[0] == INQUIRY)
return USB_STOR_TRANSPORT_GOOD;
else
+#ifndef CONFIG_BOARD_W90N745
if (((unsigned char*)us->irq_urb->transfer_buffer)[0])
+#else
+ if (((unsigned char*)((unsigned long)us->irq_urb->transfer_buffer | 0x80000000))[0])
+#endif
return USB_STOR_TRANSPORT_FAILED;
else
return USB_STOR_TRANSPORT_GOOD;
@@ -1046,6 +1078,9 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
if (!data) {
return 0;
}
+#ifdef CONFIG_BOARD_W90N745
+ data = (unsigned char *)((unsigned long)data | 0x80000000);
+#endif
/* issue the command -- use usb_control_msg() because
* the state machine is not yet alive */
@@ -1102,6 +1137,10 @@ int usb_stor_Bulk_transport(Scsi_Cmnd *srb, struct us_data *us)
return USB_STOR_TRANSPORT_ERROR;
}
+#ifdef CONFIG_BOARD_W90N745
+ bcb = (struct bulk_cb_wrap *)((unsigned long)bcb | 0x80000000);
+ bcs = (struct bulk_cs_wrap *)((unsigned long)bcs | 0x80000000);
+#endif
/* set up the command wrapper */
bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
bcb->DataTransferLength = cpu_to_le32(usb_stor_transfer_length(srb));
@@ -1286,9 +1325,15 @@ int usb_stor_CB_reset(struct us_data *us)
if (!us->pusb_dev)
return SUCCESS;
+#ifndef CONFIG_BOARD_W90N745
memset(cmd, 0xFF, sizeof(cmd));
cmd[0] = SEND_DIAGNOSTIC;
cmd[1] = 4;
+#else
+ memset((unsigned char*)((unsigned long)cmd | 0x80000000),0xFF,sizeof(cmd));
+ ((unsigned char*)((unsigned long)cmd | 0x80000000))[0] = SEND_DIAGNOSTIC;
+ ((unsigned char*)((unsigned long)cmd | 0x80000000))[1] = 4;
+#endif
result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev,0),
US_CBI_ADSC,
USB_TYPE_CLASS | USB_RECIP_INTERFACE,