Add command for handling DDR ECC registers on MPC8349EE MDS board.
[oweals/u-boot.git] / common / usb_storage.c
index 6cf62e40dd63c150764328f2c2467c4068fab939..99e4ab0d2335a88642ec5a82e2c3da61d5bb90f2 100644 (file)
@@ -1,12 +1,19 @@
 /*
- * (C) Copyright 2001
- * Denis Peter, MPL AG Switzerland
+ * Most of this source has been derived from the Linux USB
+ * project:
+ *   (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
+ *   (c) 2000 David L. Brown, Jr. (usb-storage@davidb.org)
+ *   (c) 1999 Michael Gee (michael@linuxspecific.com)
+ *   (c) 2000 Yggdrasil Computing, Inc.
+ *
+ *
+ * Adapted for U-Boot:
+ *   (C) Copyright 2001 Denis Peter, MPL AG Switzerland
  *
  * For BBB support (C) Copyright 2003
  * Gary Jennejohn, DENX Software Engineering <gj@denx.de>
  *
- * Most of this source has been derived from the Linux USB
- * project. BBB support based on /sys/dev/usb/umass.c from
+ * BBB support based on /sys/dev/usb/umass.c from
  * FreeBSD.
  *
  * See file CREDITS for list of people who contributed to this
@@ -483,7 +490,7 @@ int usb_stor_BBB_comdat(ccb *srb, struct us_data *us)
  */
 int usb_stor_CB_comdat(ccb *srb, struct us_data *us)
 {
-       int result;
+       int result = 0;
        int dir_in,retry;
        unsigned int pipe;
        unsigned long status;
@@ -521,7 +528,7 @@ int usb_stor_CB_comdat(ccb *srb, struct us_data *us)
 
                USB_STOR_PRINTF("CB_transport: control msg returned %d, direction is %s to go 0x%lx\n",result,dir_in ? "IN" : "OUT",srb->datalen);
                if (srb->datalen) {
-                       result = us_one_transfer(us, pipe, srb->pdata,srb->datalen);
+                       result = us_one_transfer(us, pipe, (char *)srb->pdata,srb->datalen);
                        USB_STOR_PRINTF("CBI attempted to transfer data, result is %d status %lX, len %d\n", result,us->pusb_dev->status,us->pusb_dev->act_len);
                        if(!(us->pusb_dev->status & USB_ST_NAK_REC))
                                break;
@@ -840,7 +847,7 @@ static int usb_request_sense(ccb *srb,struct us_data *ss)
 {
        char *ptr;
 
-       ptr=srb->pdata;
+       ptr=(char *)srb->pdata;
        memset(&srb->cmd[0],0,12);
        srb->cmd[0]=SCSI_REQ_SENSE;
        srb->cmd[1]=srb->lun<<5;
@@ -850,7 +857,7 @@ static int usb_request_sense(ccb *srb,struct us_data *ss)
        srb->cmdlen=12;
        ss->transport(srb,ss);
        USB_STOR_PRINTF("Request Sense returned %02X %02X %02X\n",srb->sense_buf[2],srb->sense_buf[12],srb->sense_buf[13]);
-       srb->pdata=ptr;
+       srb->pdata=(uchar *)ptr;
        return 0;
 }