31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version this program is distributed in the
    hope that it will be useful but without any warranty without even
    the implied warranty of merchantability or fitness for a particular
    purpose see the gnu general public license for more details you
    should have received a copy of the gnu general public license along
    with this program if not write to the free software foundation inc
    59 temple place suite 330 boston ma 02111 1307 usa

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 1334 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Richard Fontana
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

17 Jul, 2018

1 commit

  • The tools/usb/ffs-test.c file defines cpu_to_le16/32 by using the C
    library htole16/32 function calls. However, cpu_to_le16/32 are used when
    initializing structures, i.e in a context where a function call is not
    allowed.

    It works fine on little endian systems because htole16/32 are defined by
    the C library as no-ops. But on big-endian systems, they are actually
    doing something, which might involve calling a function, causing build
    failures, such as:

    ffs-test.c:48:25: error: initializer element is not constant
    #define cpu_to_le32(x) htole32(x)
    ^~~~~~~
    ffs-test.c:128:12: note: in expansion of macro ‘cpu_to_le32’
    .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
    ^~~~~~~~~~~

    To solve this, we code cpu_to_le16/32 in a way that allows them to be
    used when initializing structures. This fix was imported from
    meta-openembedded/android-tools/fix-big-endian-build.patch written by
    Thomas Petazzoni .

    CC: Thomas Petazzoni
    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Felipe Balbi

    Peter Senna Tschudin
     

24 Jan, 2017

2 commits


02 Sep, 2014

2 commits

  • If ffs-test is used with a kernel prior to 3.14, which do not
    support the new descriptors format, it will fail when trying to
    write the descriptors. Add a function that converts the new
    descriptors to the legacy ones and use it to retry writing the
    descriptors using the legacy format.

    Also add “-l” flag to ffs-test which will cause the tool to
    never try the new format and instead immediatelly try the
    legacy one. This should be useful to test whether parsing
    of the old format still works on given 3.14+ kernel.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Felipe Balbi

    Michal Nazarewicz
     
  • Since commit [ac8dde11: “Add flags to descriptors block”] functionfs
    supports a new, more powerful and extensible, descriptor format.
    Since ffs-test is probably the first thing users of the functionfs
    interface see when they start writing functionfs user space daemons,
    convert it to use the new format thus promoting it.

    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Felipe Balbi

    Michal Nazarewicz
     

01 Jul, 2014

1 commit

  • It appears that no one ever run ffs-test on a big-endian machine,
    since it used cpu-endianess for fs_count and hs_count fields which
    should be in little-endian format. Fix by wrapping the numbers in
    cpu_to_le32.

    Cc: stable@vger.kernel.org
    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Felipe Balbi

    Michal Nazarewicz
     

27 Jun, 2014

1 commit


19 Jun, 2014

1 commit

  • Commit [ac8dde11: “usb: gadget: f_fs: Add flags to descriptors block”]
    which introduced a new descriptor format for FunctionFS removed the
    usb_functionfs_descs_head structure, which is still used by ffs-test.
    tool.

    Convert ffs-test by converting it to use the new header format. For
    testing kernels prior to 3.14 (when the new format was introduced) and
    parsing of the legacy headers in the new kernels, provide a compilation
    flag to make the tool use the old format.

    Finally, include information as to when the legacy FunctionFS headers
    format has been deprecated (which is also when the new one has been
    introduced).

    Reported-by: Lad, Prabhakar
    Signed-off-by: Michal Nazarewicz
    Signed-off-by: Felipe Balbi

    Michal Nazarewicz
     

07 Mar, 2013

1 commit

  • Fixes this build failure:
    gcc -Wall -Wextra -g -lpthread -I../include -o testusb testusb.c
    gcc -Wall -Wextra -g -lpthread -I../include -o ffs-test ffs-test.c
    In file included from ffs-test.c:41:0:
    ../../include/linux/usb/functionfs.h:4:39: fatal error:
    uapi/linux/usb/functionfs.h: No such file or directory
    compilation terminated.
    make: *** [ffs-test] Error 1

    Signed-off-by: Maxin B. John
    Acked-by: Michal Nazarewicz
    Cc: stable # 3.7+
    Signed-off-by: Greg Kroah-Hartman

    Maxin B. John
     

08 May, 2012

1 commit

  • The out functions should only handle actual available data instead of the complete buffer.
    Otherwise for example the ep0_consume function will report ghost events since it tries to decode
    the complete buffer - which may contain partly invalid data.

    Signed-off-by: Matthias Fend
    Cc: stable
    Acked-by: Michal Nazarewicz
    Signed-off-by: Greg Kroah-Hartman

    Matthias Fend
     

23 Mar, 2012

1 commit

  • Pull x86/build changes from Ingo Molnar.

    * 'x86-build-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, build: Fix portability issues when cross-building
    x86, tools: Remove unneeded header files from tools/build.c
    USB: ffs-test: Don't duplicate {get,put}_unaligned*() functions
    x86, efi: Fix endian issues and unaligned accesses
    x86, boot: Restrict CFLAGS for hostprogs
    x86, mkpiggy: Don't open code put_unaligned_le32()
    x86, relocs: Don't open code put_unaligned_le32()
    tools/include: Add byteshift headers for endian access

    Linus Torvalds
     

29 Feb, 2012

1 commit


24 Jan, 2012

1 commit


01 Mar, 2011

1 commit

  • When compiling this program the functionfs.h header cannot be found, producing:
    ffs-test.c:40: fatal error: linux/usb/functionfs.h: No such file or directory

    This patch also fixes the following warning:
    ffs-test.c:453: warning: format ‘%4d’ expects type ‘int’, but argument 3 has type ‘size_t’

    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Greg Kroah-Hartman

    Davidlohr Bueso
     

21 May, 2010

1 commit