Date:2011-06-11 04:15:51 (12 years 9 months ago)
Author:Werner Almesberger
Commit:5f506117354d8763b7d6356d3c00ecc0b64af198
Message:atusb/fw/usb/: DFU_ITF_DESCR also needs a protocol argument

- dfu.h (enum dfu_itf_proto): bInterfaceProtocol values for DFU
functional descriptor
- dfu.h (DFU_ITF_DESCR): added protocol argument
- dfu.c (config_descriptor): pass protocol to DFU_ITF_DESCR
Files: atusb/fw/usb/dfu.c (1 diff)
atusb/fw/usb/dfu.h (3 diffs)

Change Details

atusb/fw/usb/dfu.c
7676
7777    /* Interface #0 */
7878
79    DFU_ITF_DESCR(0)
79    DFU_ITF_DESCR(0, dfu_proto_dfu)
8080};
8181
8282
atusb/fw/usb/dfu.h
6262    dfuERROR
6363};
6464
65enum dfu_itf_proto {
66    dfu_proto_runtime = 1, /* Runtime protocol */
67    dfu_proto_dfu = 2, /* DFU mode protocol */
68};
69
6570
6671#define DFU_DT_FUNCTIONAL 0x21 /* DFU FUNCTIONAL descriptor type */
6772
...... 
7883};
7984
8085
81#define DFU_ITF_DESCR(itf) \
86#define DFU_ITF_DESCR(itf, proto) \
8287    9, /* bLength */ \
8388    USB_DT_INTERFACE, /* bDescriptorType */ \
8489    (itf), /* bInterfaceNumber */ \
...... 
8691    0, /* bNumEndpoints */ \
8792    0xfe, /* bInterfaceClass (application specific) */ \
8893    0x01, /* bInterfaceSubClass (device fw upgrade) */ \
89    0x02, /* bInterfaceProtocol (DFU mode protocol) */ \
94    (proto), /* bInterfaceProtocol (dfu_proto_*) */ \
9095    0, /* iInterface */
9196
9297

Archive Download the corresponding diff file



interactive