On Tue, Jun 24 2014, Robert Baldyga <r.bald...@samsung.com> wrote:
> 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.
>
> Signed-off-by: Robert Baldyga <r.bald...@samsung.com>

Acked-by: Michal Nazarewicz <min...@mina86.com>

> ---
>  .../usb/ffs-aio-example/multibuff/device_app/aio_multibuff.c | 12 
> ++++++++----
>  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 87216a0..1a7b92c 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 @@
>  /******************** 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 = cpu_to_le32(FUNCTIONFS_HAS_FS_DESC |
> +                                  FUNCTIONFS_HAS_HS_DESC),
>               .length = htole32(sizeof(descriptors)),
> -             .fs_count = 3,
> -             .hs_count = 3,
>       },
> +     .fs_count = cpu_to_le32(3),

I would separate this fix into separate patch and cc stable on it.
I can take care of it if you want.

>       .fs_descs = {
>               .intf = {
>                       .bLength = sizeof(descriptors.fs_descs.intf),
> @@ -61,6 +64,7 @@ static const struct {
>                       .bmAttributes = USB_ENDPOINT_XFER_BULK,
>               },
>       },
> +     .hs_count = cpu_to_le32(3),
>       .hs_descs = {
>               .intf = {
>                       .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 f558664..068c797 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 @@
>  /******************** 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 = cpu_to_le32(FUNCTIONFS_HAS_FS_DESC |
> +                                  FUNCTIONFS_HAS_HS_DESC),
>               .length = htole32(sizeof(descriptors)),
> -             .fs_count = 3,
> -             .hs_count = 3,
>       },
> +     .fs_count = cpu_to_le32(3),
>       .fs_descs = {
>               .intf = {
>                       .bLength = sizeof(descriptors.fs_descs.intf),
> @@ -59,6 +62,7 @@ static const struct {
>                       .bmAttributes = USB_ENDPOINT_XFER_BULK,
>               },
>       },
> +     .hs_count = cpu_to_le32(3),
>       .hs_descs = {
>               .intf = {
>                       .bLength = sizeof(descriptors.hs_descs.intf),
> -- 
> 1.9.1
>
>

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +--<m...@google.com>--<xmpp:min...@jabber.org>--ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to