1. 24 Dec, 2014 4 commits
  2. 23 Dec, 2014 1 commit
    • Greg Kroah-Hartman's avatar
      greybus: add module support · df671553
      Greg Kroah-Hartman authored
      Modules in the greybus system sit above the interface, so insert them
      early in the sysfs tree.  We dynamically create them when we have an
      interface that references a module, as we don't get a "module create"
      message directly.  They also dynamically go away when the last interface
      associated with a module is removed.
      
      Naming scheme for modules/interfaces/bundles/connections is bumped up by
      one ':', and now looks like the following:
      
      /sys/bus/greybus $ tree
      .
      ├── devices
      │   ├── 7 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-1/7
      │   ├── 7:7 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-1/7/7:7
      │   ├── 7:7:0 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-1/7/7:7/7:7:0
      │   └── 7:7:0:1 -> ../../../devices/pci0000:00/0000:00:14.0/usb1/1-1/7/7:7/7:7:0/7:7:0:1
      ├── drivers
      ├── drivers_autoprobe
      ├── drivers_probe
      └── uevent
      
      6 directories, 3 files
      /sys/bus/greybus $ grep . devices/*/uevent
      devices/7/uevent:DEVTYPE=greybus_module
      devices/7:7/uevent:DEVTYPE=greybus_interface
      devices/7:7:0/uevent:DEVTYPE=greybus_bundle
      devices/7:7:0:1/uevent:DEVTYPE=greybus_connection
      
      We still have some "confusion" about interface ids and module ids, which
      will be cleaned up later when the svc control protocol changes die down,
      right now we just name a module after the interface as we don't have any
      modules that have multiple interfaces in our systems.
      
      This has been tested with gbsim.
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      df671553
  3. 19 Dec, 2014 9 commits
  4. 13 Dec, 2014 3 commits
  5. 12 Dec, 2014 13 commits
  6. 10 Dec, 2014 2 commits
  7. 09 Dec, 2014 1 commit
  8. 08 Dec, 2014 1 commit
  9. 03 Dec, 2014 6 commits
    • Alex Elder's avatar
      greybus: record type in operation structure · 82b5e3fe
      Alex Elder authored
      I've gone back and forth on this, but now that I'm looking at
      asynchronous operations I know that the asynchronous callback will
      want to know what type of operation it is handling, and right now
      that's only available in the message header.
      
      So record an operation's type in the operation structure, and use
      it in a few spots where the header type was being used previously.
      Pass the type to gb_operation_create_incoming() so it can fill
      it in after the operation has been created.
      
      Clean up the crap comments above the definition of the operation
      structure.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      82b5e3fe
    • Alex Elder's avatar
      greybus: use null pointer for empty payload · 746e0ef9
      Alex Elder authored
      Currently message->payload always points to the address immediately
      following the header in a message.  If the payload length is 0, this
      is not a valid pointer.
      
      Change the code to assign a null pointer to the payload in this
      case.  I have verified that no code dereferences the payload pointer
      unless the payload is known to have non-zero size.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      746e0ef9
    • Alex Elder's avatar
      greybus: only record message payload size · 7cfa6995
      Alex Elder authored
      An asynchronous operation will want to know how big the response
      message it receives is.  Rather than require the sender to record
      that information, expose a new field "payload_size" available to
      the protocol code for this purpose.
      
      An operation message consists of a header and a payload.  The size
      of the message can be derived from the size of the payload, so
      record only the payload size and not the size of the whole message.
      Reorder the fields in a message structure.
      
      Update the description of the message header structure.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      7cfa6995
    • Alex Elder's avatar
      greybus: don't let i2c code assume non-null payload pointer · 7a9366aa
      Alex Elder authored
      This is in preparation for an upcoming patch, which makes the
      payload pointer be NULL when a message has zero bytes of payload.
      
      It ensures a null payload pointer never gets dereferenced.  To do
      this we pass the response structure to gb_i2c_transfer_response()
      rather than just its data, and if it's null, returning immediately.
      
      Rearrange the logic in gb_i2c_transfer_operation() a bit.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      7a9366aa
    • Alex Elder's avatar
      greybus: set up connection->private properly · 93bbe859
      Alex Elder authored
      The connection->private pointer should refer to a protocol-specific
      data structure.  Change two protocol drivers (USB and vibrator) so
      they now set this.
      
      In addition, because the setup routine may need access to the
      data structure, the private pointer should be set early--as
      early as possible.  Make the UART, i2c, and GPIO protocol drivers
      set the private pointer earlier.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      93bbe859
    • Alex Elder's avatar
      greybus: fix an error message · 62749a05
      Alex Elder authored
      The error message printed by gb_operation_sync() if the operation
      fails is wrong.  Fix it.
      Signed-off-by: default avatarAlex Elder <elder@linaro.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
      62749a05