diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-01-05 23:35:54 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-01-05 23:35:54 +0100 |
commit | b45eec0ed447830ed54e1f271931ab25919eaaf7 (patch) | |
tree | 177c358f1aee88e50c28e35ee6a21296d7075101 /usb/device/dfu/dfu.h | |
parent | f04ca88a272a4edd89228119e502af262b59558d (diff) |
various DFU fixes
* make RET_* constants public as DFU_RET_*
* support GET_DESCRIPTOR on the DFU interface descriptor
* use static buffer for getstatus()
Diffstat (limited to 'usb/device/dfu/dfu.h')
-rw-r--r-- | usb/device/dfu/dfu.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/usb/device/dfu/dfu.h b/usb/device/dfu/dfu.h index 4d5aa5b..34afa4a 100644 --- a/usb/device/dfu/dfu.h +++ b/usb/device/dfu/dfu.h @@ -25,6 +25,17 @@ struct USBStringDescriptor { #ifdef BOARD_USB_DFU +#include <usb/common/dfu/usb_dfu.h> + +/* for board-specific config */ +#include <board.h> + +struct dfu_desc { + USBConfigurationDescriptor ucfg; + USBInterfaceDescriptor uif[BOARD_DFU_NUM_IF]; + struct usb_dfu_func_descriptor func_dfu; +} __attribute__ ((packed)); + /* USB DFU functional descriptor */ #define DFU_FUNC_DESC { \ .bLength = USB_DT_DFU_SIZE, \ @@ -84,6 +95,9 @@ extern const struct USBStringDescriptor USBDFU_string3; (const unsigned char *) &USBDFU_string2, \ (const unsigned char *) &USBDFU_string3, +const struct dfu_desc dfu_cfg_descriptor; +const USBDDriverDescriptors dfu_descriptors; + #else /* BOARD_USB_DFU */ /* no DFU bootloader is being used */ @@ -115,4 +129,8 @@ void USBDFU_DFU_RequestHandler(const USBGenericRequest *request); void USBDFU_Initialize(const USBDDriverDescriptors *pDescriptors, unsigned char *pInterfaces); +#define DFU_RET_NOTHING 0 +#define DFU_RET_ZLP 1 +#define DFU_RET_STALL 2 + #endif |