tools: ffs-aio-example: convert to new descriptor format
authorRobert Baldyga <r.baldyga@samsung.com>
Wed, 25 Jun 2014 06:26:48 +0000 (08:26 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 30 Jun 2014 17:53:32 +0000 (12:53 -0500)
Since commit [ac8dde11: “Add flags to descriptors block”] functionfs
supports a new descriptor format, so we update example application
to make it using recomended version of descriptors.

Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c
tools/usb/ffs-aio-example/simple/device_app/aio_simple.c

index a349a872781b4cc28149c5c05e51fc9853027475..4b8279f373d532207dcc354685223ef0a3422416 100644 (file)
@@ -27,7 +27,9 @@
 /******************** Descriptors and Strings *******************************/
 
 static const struct {
-       struct usb_functionfs_descs_head header;
+       struct usb_functionfs_descs_head_v2 header;
+       __le32 fs_count;
+       __le32 hs_count;
        struct {
                struct usb_interface_descriptor intf;
                struct usb_endpoint_descriptor_no_audio bulk_sink;
@@ -35,11 +37,12 @@ static const struct {
        } __attribute__ ((__packed__)) fs_descs, hs_descs;
 } __attribute__ ((__packed__)) descriptors = {
        .header = {
-               .magic = htole32(FUNCTIONFS_DESCRIPTORS_MAGIC),
+               .magic = htole32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
+               .flags = htole32(FUNCTIONFS_HAS_FS_DESC |
+                                    FUNCTIONFS_HAS_HS_DESC),
                .length = htole32(sizeof(descriptors)),
-               .fs_count = htole32(3),
-               .hs_count = htole32(3),
        },
+       .fs_count = htole32(3),
        .fs_descs = {
                .intf = {
                        .bLength = sizeof(descriptors.fs_descs.intf),
@@ -61,6 +64,7 @@ static const struct {
                        .bmAttributes = USB_ENDPOINT_XFER_BULK,
                },
        },
+       .hs_count = htole32(3),
        .hs_descs = {
                .intf = {
                        .bLength = sizeof(descriptors.hs_descs.intf),
index 28c22cb51249b21b0f5f3adf453e2f840647f810..2d6f59be4e7b07ebfc5e36b68ae84f737ad7dd3a 100644 (file)
@@ -25,7 +25,9 @@
 /******************** Descriptors and Strings *******************************/
 
 static const struct {
-       struct usb_functionfs_descs_head header;
+       struct usb_functionfs_descs_head_v2 header;
+       __le32 fs_count;
+       __le32 hs_count;
        struct {
                struct usb_interface_descriptor intf;
                struct usb_endpoint_descriptor_no_audio bulk_sink;
@@ -33,11 +35,12 @@ static const struct {
        } __attribute__ ((__packed__)) fs_descs, hs_descs;
 } __attribute__ ((__packed__)) descriptors = {
        .header = {
-               .magic = htole32(FUNCTIONFS_DESCRIPTORS_MAGIC),
+               .magic = htole32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
+               .flags = htole32(FUNCTIONFS_HAS_FS_DESC |
+                                    FUNCTIONFS_HAS_HS_DESC),
                .length = htole32(sizeof(descriptors)),
-               .fs_count = htole32(3),
-               .hs_count = htole32(3),
        },
+       .fs_count = htole32(3),
        .fs_descs = {
                .intf = {
                        .bLength = sizeof(descriptors.fs_descs.intf),
@@ -59,6 +62,7 @@ static const struct {
                        .bmAttributes = USB_ENDPOINT_XFER_BULK,
                },
        },
+       .hs_count = htole32(3),
        .hs_descs = {
                .intf = {
                        .bLength = sizeof(descriptors.hs_descs.intf),