diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2012-02-25 12:28:11 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-28 14:08:33 -0500 |
commit | 775dafdcd330d021cee984459fbdacfc01d29f69 (patch) | |
tree | 21e2c7f53b3603e24ab8973e7543babf56541ee3 /drivers/usb/gadget/file_storage.c | |
parent | b8db6d6402ddca1c78a27407fbd10a6ccb23ab14 (diff) |
usb/gadget: use common defines within the storage gadget
This replaces the remaining defines which are available in "public"
include/ directory and are re-defined by the storage gadget.
This is patch is basicaly search & replace followed by the removal of
the defines.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget/file_storage.c')
-rw-r--r-- | drivers/usb/gadget/file_storage.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index 15e6e8e55ef6..4fac56927741 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c | |||
@@ -855,7 +855,7 @@ static int class_setup_req(struct fsg_dev *fsg, | |||
855 | if (transport_is_bbb()) { | 855 | if (transport_is_bbb()) { |
856 | switch (ctrl->bRequest) { | 856 | switch (ctrl->bRequest) { |
857 | 857 | ||
858 | case USB_BULK_RESET_REQUEST: | 858 | case US_BULK_RESET_REQUEST: |
859 | if (ctrl->bRequestType != (USB_DIR_OUT | | 859 | if (ctrl->bRequestType != (USB_DIR_OUT | |
860 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) | 860 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) |
861 | break; | 861 | break; |
@@ -871,7 +871,7 @@ static int class_setup_req(struct fsg_dev *fsg, | |||
871 | value = DELAYED_STATUS; | 871 | value = DELAYED_STATUS; |
872 | break; | 872 | break; |
873 | 873 | ||
874 | case USB_BULK_GET_MAX_LUN_REQUEST: | 874 | case US_BULK_GET_MAX_LUN: |
875 | if (ctrl->bRequestType != (USB_DIR_IN | | 875 | if (ctrl->bRequestType != (USB_DIR_IN | |
876 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) | 876 | USB_TYPE_CLASS | USB_RECIP_INTERFACE)) |
877 | break; | 877 | break; |
@@ -2125,7 +2125,7 @@ static int send_status(struct fsg_dev *fsg) | |||
2125 | struct fsg_lun *curlun = fsg->curlun; | 2125 | struct fsg_lun *curlun = fsg->curlun; |
2126 | struct fsg_buffhd *bh; | 2126 | struct fsg_buffhd *bh; |
2127 | int rc; | 2127 | int rc; |
2128 | u8 status = USB_STATUS_PASS; | 2128 | u8 status = US_BULK_STAT_OK; |
2129 | u32 sd, sdinfo = 0; | 2129 | u32 sd, sdinfo = 0; |
2130 | 2130 | ||
2131 | /* Wait for the next buffer to become available */ | 2131 | /* Wait for the next buffer to become available */ |
@@ -2146,11 +2146,11 @@ static int send_status(struct fsg_dev *fsg) | |||
2146 | 2146 | ||
2147 | if (fsg->phase_error) { | 2147 | if (fsg->phase_error) { |
2148 | DBG(fsg, "sending phase-error status\n"); | 2148 | DBG(fsg, "sending phase-error status\n"); |
2149 | status = USB_STATUS_PHASE_ERROR; | 2149 | status = US_BULK_STAT_PHASE; |
2150 | sd = SS_INVALID_COMMAND; | 2150 | sd = SS_INVALID_COMMAND; |
2151 | } else if (sd != SS_NO_SENSE) { | 2151 | } else if (sd != SS_NO_SENSE) { |
2152 | DBG(fsg, "sending command-failure status\n"); | 2152 | DBG(fsg, "sending command-failure status\n"); |
2153 | status = USB_STATUS_FAIL; | 2153 | status = US_BULK_STAT_FAIL; |
2154 | VDBG(fsg, " sense data: SK x%02x, ASC x%02x, ASCQ x%02x;" | 2154 | VDBG(fsg, " sense data: SK x%02x, ASC x%02x, ASCQ x%02x;" |
2155 | " info x%x\n", | 2155 | " info x%x\n", |
2156 | SK(sd), ASC(sd), ASCQ(sd), sdinfo); | 2156 | SK(sd), ASC(sd), ASCQ(sd), sdinfo); |
@@ -2160,12 +2160,12 @@ static int send_status(struct fsg_dev *fsg) | |||
2160 | struct bulk_cs_wrap *csw = bh->buf; | 2160 | struct bulk_cs_wrap *csw = bh->buf; |
2161 | 2161 | ||
2162 | /* Store and send the Bulk-only CSW */ | 2162 | /* Store and send the Bulk-only CSW */ |
2163 | csw->Signature = cpu_to_le32(USB_BULK_CS_SIG); | 2163 | csw->Signature = cpu_to_le32(US_BULK_CS_SIGN); |
2164 | csw->Tag = fsg->tag; | 2164 | csw->Tag = fsg->tag; |
2165 | csw->Residue = cpu_to_le32(fsg->residue); | 2165 | csw->Residue = cpu_to_le32(fsg->residue); |
2166 | csw->Status = status; | 2166 | csw->Status = status; |
2167 | 2167 | ||
2168 | bh->inreq->length = USB_BULK_CS_WRAP_LEN; | 2168 | bh->inreq->length = US_BULK_CS_WRAP_LEN; |
2169 | bh->inreq->zero = 0; | 2169 | bh->inreq->zero = 0; |
2170 | start_transfer(fsg, fsg->bulk_in, bh->inreq, | 2170 | start_transfer(fsg, fsg->bulk_in, bh->inreq, |
2171 | &bh->inreq_busy, &bh->state); | 2171 | &bh->inreq_busy, &bh->state); |
@@ -2616,9 +2616,9 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) | |||
2616 | return -EINVAL; | 2616 | return -EINVAL; |
2617 | 2617 | ||
2618 | /* Is the CBW valid? */ | 2618 | /* Is the CBW valid? */ |
2619 | if (req->actual != USB_BULK_CB_WRAP_LEN || | 2619 | if (req->actual != US_BULK_CB_WRAP_LEN || |
2620 | cbw->Signature != cpu_to_le32( | 2620 | cbw->Signature != cpu_to_le32( |
2621 | USB_BULK_CB_SIG)) { | 2621 | US_BULK_CB_SIGN)) { |
2622 | DBG(fsg, "invalid CBW: len %u sig 0x%x\n", | 2622 | DBG(fsg, "invalid CBW: len %u sig 0x%x\n", |
2623 | req->actual, | 2623 | req->actual, |
2624 | le32_to_cpu(cbw->Signature)); | 2624 | le32_to_cpu(cbw->Signature)); |
@@ -2638,7 +2638,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) | |||
2638 | } | 2638 | } |
2639 | 2639 | ||
2640 | /* Is the CBW meaningful? */ | 2640 | /* Is the CBW meaningful? */ |
2641 | if (cbw->Lun >= FSG_MAX_LUNS || cbw->Flags & ~USB_BULK_IN_FLAG || | 2641 | if (cbw->Lun >= FSG_MAX_LUNS || cbw->Flags & ~US_BULK_FLAG_IN || |
2642 | cbw->Length <= 0 || cbw->Length > MAX_COMMAND_SIZE) { | 2642 | cbw->Length <= 0 || cbw->Length > MAX_COMMAND_SIZE) { |
2643 | DBG(fsg, "non-meaningful CBW: lun = %u, flags = 0x%x, " | 2643 | DBG(fsg, "non-meaningful CBW: lun = %u, flags = 0x%x, " |
2644 | "cmdlen %u\n", | 2644 | "cmdlen %u\n", |
@@ -2656,7 +2656,7 @@ static int received_cbw(struct fsg_dev *fsg, struct fsg_buffhd *bh) | |||
2656 | /* Save the command for later */ | 2656 | /* Save the command for later */ |
2657 | fsg->cmnd_size = cbw->Length; | 2657 | fsg->cmnd_size = cbw->Length; |
2658 | memcpy(fsg->cmnd, cbw->CDB, fsg->cmnd_size); | 2658 | memcpy(fsg->cmnd, cbw->CDB, fsg->cmnd_size); |
2659 | if (cbw->Flags & USB_BULK_IN_FLAG) | 2659 | if (cbw->Flags & US_BULK_FLAG_IN) |
2660 | fsg->data_dir = DATA_DIR_TO_HOST; | 2660 | fsg->data_dir = DATA_DIR_TO_HOST; |
2661 | else | 2661 | else |
2662 | fsg->data_dir = DATA_DIR_FROM_HOST; | 2662 | fsg->data_dir = DATA_DIR_FROM_HOST; |
@@ -2685,7 +2685,7 @@ static int get_next_command(struct fsg_dev *fsg) | |||
2685 | } | 2685 | } |
2686 | 2686 | ||
2687 | /* Queue a request to read a Bulk-only CBW */ | 2687 | /* Queue a request to read a Bulk-only CBW */ |
2688 | set_bulk_out_req_length(fsg, bh, USB_BULK_CB_WRAP_LEN); | 2688 | set_bulk_out_req_length(fsg, bh, US_BULK_CB_WRAP_LEN); |
2689 | start_transfer(fsg, fsg->bulk_out, bh->outreq, | 2689 | start_transfer(fsg, fsg->bulk_out, bh->outreq, |
2690 | &bh->outreq_busy, &bh->state); | 2690 | &bh->outreq_busy, &bh->state); |
2691 | 2691 | ||