Commit 0ebe9910 authored by Robert Baldyga's avatar Robert Baldyga Committed by Felipe Balbi

tools: ffs-aio-example: convert to new descriptor format

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: default avatarMichal Nazarewicz <mina86@mina86.com>
Signed-off-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d2999e1b
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
/******************** Descriptors and Strings *******************************/ /******************** Descriptors and Strings *******************************/
static const struct { static const struct {
struct usb_functionfs_descs_head header; struct usb_functionfs_descs_head_v2 header;
__le32 fs_count;
__le32 hs_count;
struct { struct {
struct usb_interface_descriptor intf; struct usb_interface_descriptor intf;
struct usb_endpoint_descriptor_no_audio bulk_sink; struct usb_endpoint_descriptor_no_audio bulk_sink;
...@@ -35,11 +37,12 @@ static const struct { ...@@ -35,11 +37,12 @@ static const struct {
} __attribute__ ((__packed__)) fs_descs, hs_descs; } __attribute__ ((__packed__)) fs_descs, hs_descs;
} __attribute__ ((__packed__)) descriptors = { } __attribute__ ((__packed__)) descriptors = {
.header = { .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)), .length = htole32(sizeof(descriptors)),
.fs_count = htole32(3),
.hs_count = htole32(3),
}, },
.fs_count = htole32(3),
.fs_descs = { .fs_descs = {
.intf = { .intf = {
.bLength = sizeof(descriptors.fs_descs.intf), .bLength = sizeof(descriptors.fs_descs.intf),
...@@ -61,6 +64,7 @@ static const struct { ...@@ -61,6 +64,7 @@ static const struct {
.bmAttributes = USB_ENDPOINT_XFER_BULK, .bmAttributes = USB_ENDPOINT_XFER_BULK,
}, },
}, },
.hs_count = htole32(3),
.hs_descs = { .hs_descs = {
.intf = { .intf = {
.bLength = sizeof(descriptors.hs_descs.intf), .bLength = sizeof(descriptors.hs_descs.intf),
......
...@@ -25,7 +25,9 @@ ...@@ -25,7 +25,9 @@
/******************** Descriptors and Strings *******************************/ /******************** Descriptors and Strings *******************************/
static const struct { static const struct {
struct usb_functionfs_descs_head header; struct usb_functionfs_descs_head_v2 header;
__le32 fs_count;
__le32 hs_count;
struct { struct {
struct usb_interface_descriptor intf; struct usb_interface_descriptor intf;
struct usb_endpoint_descriptor_no_audio bulk_sink; struct usb_endpoint_descriptor_no_audio bulk_sink;
...@@ -33,11 +35,12 @@ static const struct { ...@@ -33,11 +35,12 @@ static const struct {
} __attribute__ ((__packed__)) fs_descs, hs_descs; } __attribute__ ((__packed__)) fs_descs, hs_descs;
} __attribute__ ((__packed__)) descriptors = { } __attribute__ ((__packed__)) descriptors = {
.header = { .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)), .length = htole32(sizeof(descriptors)),
.fs_count = htole32(3),
.hs_count = htole32(3),
}, },
.fs_count = htole32(3),
.fs_descs = { .fs_descs = {
.intf = { .intf = {
.bLength = sizeof(descriptors.fs_descs.intf), .bLength = sizeof(descriptors.fs_descs.intf),
...@@ -59,6 +62,7 @@ static const struct { ...@@ -59,6 +62,7 @@ static const struct {
.bmAttributes = USB_ENDPOINT_XFER_BULK, .bmAttributes = USB_ENDPOINT_XFER_BULK,
}, },
}, },
.hs_count = htole32(3),
.hs_descs = { .hs_descs = {
.intf = { .intf = {
.bLength = sizeof(descriptors.hs_descs.intf), .bLength = sizeof(descriptors.hs_descs.intf),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment