diff options
author | Robert Baldyga <r.baldyga@samsung.com> | 2014-06-25 02:26:48 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-06-30 13:53:32 -0400 |
commit | 0ebe991042c927e68a50e206ad6244483f66301c (patch) | |
tree | 51a256680829d639815f77f1c14d11db80dbed29 /tools | |
parent | d2999e1b10fb740371a896b33fa1e6d89669ffba (diff) |
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: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c | 12 | ||||
-rw-r--r-- | tools/usb/ffs-aio-example/simple/device_app/aio_simple.c | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c b/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c index a349a872781b..4b8279f373d5 100644 --- a/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c +++ b/tools/usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c | |||
@@ -27,7 +27,9 @@ | |||
27 | /******************** Descriptors and Strings *******************************/ | 27 | /******************** Descriptors and Strings *******************************/ |
28 | 28 | ||
29 | static const struct { | 29 | static const struct { |
30 | struct usb_functionfs_descs_head header; | 30 | struct usb_functionfs_descs_head_v2 header; |
31 | __le32 fs_count; | ||
32 | __le32 hs_count; | ||
31 | struct { | 33 | struct { |
32 | struct usb_interface_descriptor intf; | 34 | struct usb_interface_descriptor intf; |
33 | struct usb_endpoint_descriptor_no_audio bulk_sink; | 35 | struct usb_endpoint_descriptor_no_audio bulk_sink; |
@@ -35,11 +37,12 @@ static const struct { | |||
35 | } __attribute__ ((__packed__)) fs_descs, hs_descs; | 37 | } __attribute__ ((__packed__)) fs_descs, hs_descs; |
36 | } __attribute__ ((__packed__)) descriptors = { | 38 | } __attribute__ ((__packed__)) descriptors = { |
37 | .header = { | 39 | .header = { |
38 | .magic = htole32(FUNCTIONFS_DESCRIPTORS_MAGIC), | 40 | .magic = htole32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2), |
41 | .flags = htole32(FUNCTIONFS_HAS_FS_DESC | | ||
42 | FUNCTIONFS_HAS_HS_DESC), | ||
39 | .length = htole32(sizeof(descriptors)), | 43 | .length = htole32(sizeof(descriptors)), |
40 | .fs_count = htole32(3), | ||
41 | .hs_count = htole32(3), | ||
42 | }, | 44 | }, |
45 | .fs_count = htole32(3), | ||
43 | .fs_descs = { | 46 | .fs_descs = { |
44 | .intf = { | 47 | .intf = { |
45 | .bLength = sizeof(descriptors.fs_descs.intf), | 48 | .bLength = sizeof(descriptors.fs_descs.intf), |
@@ -61,6 +64,7 @@ static const struct { | |||
61 | .bmAttributes = USB_ENDPOINT_XFER_BULK, | 64 | .bmAttributes = USB_ENDPOINT_XFER_BULK, |
62 | }, | 65 | }, |
63 | }, | 66 | }, |
67 | .hs_count = htole32(3), | ||
64 | .hs_descs = { | 68 | .hs_descs = { |
65 | .intf = { | 69 | .intf = { |
66 | .bLength = sizeof(descriptors.hs_descs.intf), | 70 | .bLength = sizeof(descriptors.hs_descs.intf), |
diff --git a/tools/usb/ffs-aio-example/simple/device_app/aio_simple.c b/tools/usb/ffs-aio-example/simple/device_app/aio_simple.c index 28c22cb51249..2d6f59be4e7b 100644 --- a/tools/usb/ffs-aio-example/simple/device_app/aio_simple.c +++ b/tools/usb/ffs-aio-example/simple/device_app/aio_simple.c | |||
@@ -25,7 +25,9 @@ | |||
25 | /******************** Descriptors and Strings *******************************/ | 25 | /******************** Descriptors and Strings *******************************/ |
26 | 26 | ||
27 | static const struct { | 27 | static const struct { |
28 | struct usb_functionfs_descs_head header; | 28 | struct usb_functionfs_descs_head_v2 header; |
29 | __le32 fs_count; | ||
30 | __le32 hs_count; | ||
29 | struct { | 31 | struct { |
30 | struct usb_interface_descriptor intf; | 32 | struct usb_interface_descriptor intf; |
31 | struct usb_endpoint_descriptor_no_audio bulk_sink; | 33 | struct usb_endpoint_descriptor_no_audio bulk_sink; |
@@ -33,11 +35,12 @@ static const struct { | |||
33 | } __attribute__ ((__packed__)) fs_descs, hs_descs; | 35 | } __attribute__ ((__packed__)) fs_descs, hs_descs; |
34 | } __attribute__ ((__packed__)) descriptors = { | 36 | } __attribute__ ((__packed__)) descriptors = { |
35 | .header = { | 37 | .header = { |
36 | .magic = htole32(FUNCTIONFS_DESCRIPTORS_MAGIC), | 38 | .magic = htole32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2), |
39 | .flags = htole32(FUNCTIONFS_HAS_FS_DESC | | ||
40 | FUNCTIONFS_HAS_HS_DESC), | ||
37 | .length = htole32(sizeof(descriptors)), | 41 | .length = htole32(sizeof(descriptors)), |
38 | .fs_count = htole32(3), | ||
39 | .hs_count = htole32(3), | ||
40 | }, | 42 | }, |
43 | .fs_count = htole32(3), | ||
41 | .fs_descs = { | 44 | .fs_descs = { |
42 | .intf = { | 45 | .intf = { |
43 | .bLength = sizeof(descriptors.fs_descs.intf), | 46 | .bLength = sizeof(descriptors.fs_descs.intf), |
@@ -59,6 +62,7 @@ static const struct { | |||
59 | .bmAttributes = USB_ENDPOINT_XFER_BULK, | 62 | .bmAttributes = USB_ENDPOINT_XFER_BULK, |
60 | }, | 63 | }, |
61 | }, | 64 | }, |
65 | .hs_count = htole32(3), | ||
62 | .hs_descs = { | 66 | .hs_descs = { |
63 | .intf = { | 67 | .intf = { |
64 | .bLength = sizeof(descriptors.hs_descs.intf), | 68 | .bLength = sizeof(descriptors.hs_descs.intf), |