From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 10/23] USB: gadget: DFU: Move locally used defines/structs to dfu driver
Date: Mon, 21 Jul 2014 17:14:34 +0200 [thread overview]
Message-ID: <1405955687-27433-11-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1405955687-27433-1-git-send-email-s.hauer@pengutronix.de>
There's no reason to have them under include/
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/usb/gadget/dfu.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++
include/usb/dfu.h | 67 ------------------------------------------------
2 files changed, 66 insertions(+), 67 deletions(-)
diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 5252703..ac8ddb9 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -54,6 +54,72 @@
#include <init.h>
#include <fs.h>
+#define USB_DT_DFU 0x21
+
+struct usb_dfu_func_descriptor {
+ u_int8_t bLength;
+ u_int8_t bDescriptorType;
+ u_int8_t bmAttributes;
+#define USB_DFU_CAN_DOWNLOAD (1 << 0)
+#define USB_DFU_CAN_UPLOAD (1 << 1)
+#define USB_DFU_MANIFEST_TOL (1 << 2)
+#define USB_DFU_WILL_DETACH (1 << 3)
+ u_int16_t wDetachTimeOut;
+ u_int16_t wTransferSize;
+ u_int16_t bcdDFUVersion;
+} __attribute__ ((packed));
+
+#define USB_DT_DFU_SIZE 9
+
+#define USB_TYPE_DFU (USB_TYPE_CLASS|USB_RECIP_INTERFACE)
+
+/* DFU class-specific requests (Section 3, DFU Rev 1.1) */
+#define USB_REQ_DFU_DETACH 0x00
+#define USB_REQ_DFU_DNLOAD 0x01
+#define USB_REQ_DFU_UPLOAD 0x02
+#define USB_REQ_DFU_GETSTATUS 0x03
+#define USB_REQ_DFU_CLRSTATUS 0x04
+#define USB_REQ_DFU_GETSTATE 0x05
+#define USB_REQ_DFU_ABORT 0x06
+
+struct dfu_status {
+ u_int8_t bStatus;
+ u_int8_t bwPollTimeout[3];
+ u_int8_t bState;
+ u_int8_t iString;
+} __attribute__((packed));
+
+#define DFU_STATUS_OK 0x00
+#define DFU_STATUS_errTARGET 0x01
+#define DFU_STATUS_errFILE 0x02
+#define DFU_STATUS_errWRITE 0x03
+#define DFU_STATUS_errERASE 0x04
+#define DFU_STATUS_errCHECK_ERASED 0x05
+#define DFU_STATUS_errPROG 0x06
+#define DFU_STATUS_errVERIFY 0x07
+#define DFU_STATUS_errADDRESS 0x08
+#define DFU_STATUS_errNOTDONE 0x09
+#define DFU_STATUS_errFIRMWARE 0x0a
+#define DFU_STATUS_errVENDOR 0x0b
+#define DFU_STATUS_errUSBR 0x0c
+#define DFU_STATUS_errPOR 0x0d
+#define DFU_STATUS_errUNKNOWN 0x0e
+#define DFU_STATUS_errSTALLEDPKT 0x0f
+
+enum dfu_state {
+ DFU_STATE_appIDLE = 0,
+ DFU_STATE_appDETACH = 1,
+ DFU_STATE_dfuIDLE = 2,
+ DFU_STATE_dfuDNLOAD_SYNC = 3,
+ DFU_STATE_dfuDNBUSY = 4,
+ DFU_STATE_dfuDNLOAD_IDLE = 5,
+ DFU_STATE_dfuMANIFEST_SYNC = 6,
+ DFU_STATE_dfuMANIFEST = 7,
+ DFU_STATE_dfuMANIFEST_WAIT_RST = 8,
+ DFU_STATE_dfuUPLOAD_IDLE = 9,
+ DFU_STATE_dfuERROR = 10,
+};
+
#define USB_DT_DFU_SIZE 9
#define USB_DT_DFU 0x21
diff --git a/include/usb/dfu.h b/include/usb/dfu.h
index 4617534..db50437 100644
--- a/include/usb/dfu.h
+++ b/include/usb/dfu.h
@@ -39,71 +39,4 @@ struct usb_dfu_pdata {
int usb_dfu_register(struct usb_dfu_pdata *);
-#define USB_DT_DFU 0x21
-
-struct usb_dfu_func_descriptor {
- u_int8_t bLength;
- u_int8_t bDescriptorType;
- u_int8_t bmAttributes;
-#define USB_DFU_CAN_DOWNLOAD (1 << 0)
-#define USB_DFU_CAN_UPLOAD (1 << 1)
-#define USB_DFU_MANIFEST_TOL (1 << 2)
-#define USB_DFU_WILL_DETACH (1 << 3)
- u_int16_t wDetachTimeOut;
- u_int16_t wTransferSize;
- u_int16_t bcdDFUVersion;
-} __attribute__ ((packed));
-
-#define USB_DT_DFU_SIZE 9
-
-#define USB_TYPE_DFU (USB_TYPE_CLASS|USB_RECIP_INTERFACE)
-
-/* DFU class-specific requests (Section 3, DFU Rev 1.1) */
-#define USB_REQ_DFU_DETACH 0x00
-#define USB_REQ_DFU_DNLOAD 0x01
-#define USB_REQ_DFU_UPLOAD 0x02
-#define USB_REQ_DFU_GETSTATUS 0x03
-#define USB_REQ_DFU_CLRSTATUS 0x04
-#define USB_REQ_DFU_GETSTATE 0x05
-#define USB_REQ_DFU_ABORT 0x06
-
-struct dfu_status {
- u_int8_t bStatus;
- u_int8_t bwPollTimeout[3];
- u_int8_t bState;
- u_int8_t iString;
-} __attribute__((packed));
-
-#define DFU_STATUS_OK 0x00
-#define DFU_STATUS_errTARGET 0x01
-#define DFU_STATUS_errFILE 0x02
-#define DFU_STATUS_errWRITE 0x03
-#define DFU_STATUS_errERASE 0x04
-#define DFU_STATUS_errCHECK_ERASED 0x05
-#define DFU_STATUS_errPROG 0x06
-#define DFU_STATUS_errVERIFY 0x07
-#define DFU_STATUS_errADDRESS 0x08
-#define DFU_STATUS_errNOTDONE 0x09
-#define DFU_STATUS_errFIRMWARE 0x0a
-#define DFU_STATUS_errVENDOR 0x0b
-#define DFU_STATUS_errUSBR 0x0c
-#define DFU_STATUS_errPOR 0x0d
-#define DFU_STATUS_errUNKNOWN 0x0e
-#define DFU_STATUS_errSTALLEDPKT 0x0f
-
-enum dfu_state {
- DFU_STATE_appIDLE = 0,
- DFU_STATE_appDETACH = 1,
- DFU_STATE_dfuIDLE = 2,
- DFU_STATE_dfuDNLOAD_SYNC = 3,
- DFU_STATE_dfuDNBUSY = 4,
- DFU_STATE_dfuDNLOAD_IDLE = 5,
- DFU_STATE_dfuMANIFEST_SYNC = 6,
- DFU_STATE_dfuMANIFEST = 7,
- DFU_STATE_dfuMANIFEST_WAIT_RST = 8,
- DFU_STATE_dfuUPLOAD_IDLE = 9,
- DFU_STATE_dfuERROR = 10,
-};
-
#endif /* _USB_DFU_H */
-
--
2.0.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2014-07-21 15:15 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-21 15:14 USB Gadget updates Sascha Hauer
2014-07-21 15:14 ` [PATCH 01/23] USB: gadget: Update to 3.15 Sascha Hauer
2014-07-21 15:14 ` [PATCH 02/23] USB: gadget: dequeue descriptor before freeing it Sascha Hauer
2014-07-21 15:14 ` [PATCH 03/23] USB: gadget: composite: Break out of potential endless loop Sascha Hauer
2014-07-21 15:14 ` [PATCH 04/23] USB: gadget: fsl_udc: Warn about freeing queued descriptors Sascha Hauer
2014-07-21 15:14 ` [PATCH 05/23] USB: gadget: usbserial: Always enable console Sascha Hauer
2014-07-21 15:14 ` [PATCH 06/23] param: Add dev_add_param_string Sascha Hauer
2014-07-21 15:14 ` [PATCH 07/23] USB: gadget: specify vendor/product id with device parameters Sascha Hauer
2014-07-21 15:14 ` [PATCH 08/23] USB: gadget: DFU: remove unused code Sascha Hauer
2014-07-21 15:14 ` [PATCH 09/23] USB: gadget: DFU: Use usb_assign_descriptors/usb_free_all_descriptors Sascha Hauer
2014-07-21 15:14 ` Sascha Hauer [this message]
2014-07-21 15:14 ` [PATCH 11/23] Add function to parse a string in dfu format Sascha Hauer
2014-07-21 15:14 ` [PATCH 12/23] USB: gadget: DFU: Move stuff to dfu_bind Sascha Hauer
2014-07-21 15:14 ` [PATCH 13/23] USB: gadget: DFU: use usb_gstrings_attach Sascha Hauer
2014-07-21 15:14 ` [PATCH 14/23] USB: gadget: DFU: free resources when usb_gadget_poll fails Sascha Hauer
2014-07-21 15:14 ` [PATCH 15/23] USB: gadget: DFU: return -EINTR when interrupted Sascha Hauer
2014-07-21 15:14 ` [PATCH 16/23] USB: gadget: DFU: register as USB function Sascha Hauer
2014-07-21 15:14 ` [PATCH 17/23] USB: gadget: DFU: drop app idle state Sascha Hauer
2014-07-21 15:14 ` [PATCH 18/23] Add release string Sascha Hauer
2014-07-21 15:14 ` [PATCH 19/23] USB: gadget: Add Android fastboot support Sascha Hauer
2014-07-22 7:25 ` Holger Schurig
2014-07-22 9:23 ` Sascha Hauer
2014-07-21 15:14 ` [PATCH 20/23] USB: gadget: Add a multi function gadget Sascha Hauer
2014-07-21 15:14 ` [PATCH 21/23] USB: gadget: fsl_udc: Be more tolerant in fsl_ep_dequeue Sascha Hauer
2014-07-21 15:14 ` [PATCH 22/23] Documentation: Add documentation for USB serial console Sascha Hauer
2014-07-21 15:14 ` [PATCH 23/23] Documentation: Add documentation for Fastboot and Composite Multifunction Gadget Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1405955687-27433-11-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox