1. 09 Apr, 2015 3 commits
  2. 07 Apr, 2015 13 commits
  3. 06 Apr, 2015 7 commits
  4. 05 Apr, 2015 3 commits
    • Viresh Kumar's avatar
      greybus: Add bundle descriptor type · 83a0cb59
      Viresh Kumar authored
      A bundle corresponds to a device and a greybus driver binds to it. This patch
      adds a type and descriptor for bundle.
      
      This also shuffles the values of 'enum greybus_descriptor_type' to align
      them with Greybus Specifications.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      83a0cb59
    • Viresh Kumar's avatar
      greybus: interface: Fetch interface id instead of module id during setup · c9d9d0d4
      Viresh Kumar authored
      There can be more than one interface on a module and we need to know the
      interface for which the event has occurred.
      
      But at the same time we may not need the module id at all. During initial phase
      when AP is probed, the AP will receive the unique Endo id which shall be enough
      to draw relationships between interface and module ids.
      
      Code for that isn't available today and so lets create another routine to get
      module id (which needs to be fixed separately), which will simply return
      interface id passed to it.
      
      Now that we have interface id, update rest of the code to use it.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      c9d9d0d4
    • Viresh Kumar's avatar
      greybus: Unregister devices to get them freed · 2352a732
      Viresh Kumar authored
      Devices registered with the device-core needs to be freed by calling
      device_unregister(). For module we are calling just put_device() and for
      bundle, connection and interface we are calling device_del().
      
      All of these are incomplete and so none of them get freed, i.e. the
      .release() routine is never called for their devices.
      
      Module being a special case that it needs to maintain a refcount or a
      list of interfaces to trace its usage count. I have chosen refcount.
      
      And so once the refcount is zero, we can Unregister the device and
      module will get free as well.
      
      Because of this bug in freeing devices, their sysfs directories were not
      getting removed properly and after a manifest is parsed with the help of
      gbsim, removing modules was creating problems. The sysfs directory
      'greybus' wasn't getting removed. And inserting the modules again
      resulted in warnings and insmod failure.
      
      WARNING: CPU: 3 PID: 4277 at
      /build/buildd/linux-3.13.0/fs/sysfs/dir.c:486
      sysfs_warn_dup+0x86/0xa0()
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
      2352a732
  5. 04 Apr, 2015 2 commits
  6. 02 Apr, 2015 1 commit
  7. 31 Mar, 2015 4 commits
    • Greg Kroah-Hartman's avatar
      greybus: kernel_ver.h: add sysfs_create_groups() and sysfs_remove_groups() · 66c98986
      Greg Kroah-Hartman authored
      These functions showed up in 3.12 or so, and we are stuck on 3.10 for
      various reasons, so provide backports in kernel_ver.h so that we can
      rely on these functions.
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      66c98986
    • Greg Kroah-Hartman's avatar
      greybus: loopback: use the attribute groups, not group · 7a51b936
      Greg Kroah-Hartman authored
      We should use the attribute groups, not group, for the device, so
      add and remove it.  No one should ever be updating a sysfs group for a
      device, as that can be pretty dangerous if you don't duplicate _all_
      existing attribute for that device, and I don't think we were doing that
      here.
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      7a51b936
    • Greg Kroah-Hartman's avatar
      greybus: loopback: fix build breakage about SZ_4K · 5679f783
      Greg Kroah-Hartman authored
      x86 doesn't include SZ_4K somehow so explicitly include <linux/sizes.h>
      to fix the build breakage.
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      5679f783
    • Alexandre Bailon's avatar
      greybus: Add loopback protocol · 355a7058
      Alexandre Bailon authored
      Add a simple Greybus protocol in order to stress USB and Greybus.
      This protocol currently support 2 requests: ping and transfer.
      
      ping request is useful to measure latency.
      Kernel send a ping request and firmware should respond with a ping.
      
      The transfer request request is useful to stress Greybus and USB.
      Kernel can send data from 0 to 4k and the firmware must send back the data to kernel.
      
      This behaviour of gb-loopback module is controlled via sysfs.
      Curently, connection sysfs folder is updated with new entries:
      - type: Type of loopback message to send
        * 0 => Don't send message
        * 1 => Send ping message continuously (message without payload)
        * 2 => Send transer message continuously (message with payload)
      - size: Size of transfer message payload: 0-4096 bytes
      - ms_wait: Time to wait between two messages: 0-1024 ms
      
      Module also export some statistics about connection:
      - latency: Time to send and receive one message
      - frequency: Number of packet sent per second on this cport
      - throughput: Quantity of data sent and received on this cport
      - error
      All this statistics are cleared everytime type, size or ms_wait entries are updated.
      Signed-off-by: default avatarAlexandre Bailon <abailon@baylibre.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      355a7058
  8. 30 Mar, 2015 7 commits