OSDN Git Service

greybus: Merge branch 'master' into branch 'svc'.
authorGreg Kroah-Hartman <gregkh@google.com>
Wed, 12 Aug 2015 05:14:06 +0000 (22:14 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 12 Aug 2015 05:14:06 +0000 (22:14 -0700)
This drags in the firmware driver, and the start of some loopback
changes.

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
1  2 
drivers/staging/greybus/Makefile
drivers/staging/greybus/connection.c
drivers/staging/greybus/core.c
drivers/staging/greybus/es1.c
drivers/staging/greybus/es2.c
drivers/staging/greybus/greybus.h
drivers/staging/greybus/greybus_protocols.h
drivers/staging/greybus/svc.c

Simple merge
Simple merge
Simple merge
  #include <asm/unaligned.h>
  
  #include "greybus.h"
 -#include "svc_msg.h"
  #include "kernel_ver.h"
+ #include "connection.h"
  
  /* Memory sizes for the buffers sent to/from the ES1 controller */
 -#define ES1_SVC_MSG_SIZE      (sizeof(struct svc_msg) + SZ_64K)
  #define ES1_GBUF_MSG_SIZE_MAX 2048
  
  static const struct usb_device_id id_table[] = {
  #include <asm/unaligned.h>
  
  #include "greybus.h"
 -#include "svc_msg.h"
  #include "kernel_ver.h"
+ #include "connection.h"
  
  /* Memory sizes for the buffers sent to/from the ES1 controller */
 -#define ES1_SVC_MSG_SIZE      (sizeof(struct svc_msg) + SZ_64K)
  #define ES1_GBUF_MSG_SIZE_MAX 2048
  
  static const struct usb_device_id id_table[] = {
Simple merge
@@@ -261,43 -223,44 +261,40 @@@ static int gb_svc_hello(struct gb_opera
        return 0;
  }
  
 -static int gb_svc_intf_hotplug_recv(struct gb_operation *op)
 +/*
 + * 'struct svc_hotplug' should be freed by svc_process_hotplug() before it
 + * returns, irrespective of success or Failure in bringing up the module.
 + */
 +static void svc_process_hotplug(struct work_struct *work)
  {
 -      struct gb_message *request = op->request;
 -      struct gb_svc_intf_hotplug_request *hotplug = request->payload;
 -      struct gb_svc *svc = op->connection->private;
 -      struct greybus_host_device *hd = op->connection->bundle->intf->hd;
 -      struct device *dev = &op->connection->dev;
 +      struct svc_hotplug *svc_hotplug = container_of(work, struct svc_hotplug,
 +                                                     work);
 +      struct gb_svc_intf_hotplug_request *hotplug = &svc_hotplug->data;
 +      struct gb_connection *connection = svc_hotplug->connection;
 +      struct gb_svc *svc = connection->private;
 +      struct greybus_host_device *hd = connection->bundle->intf->hd;
 +      struct device *dev = &connection->dev;
        struct gb_interface *intf;
        u8 intf_id, device_id;
-       u32 unipro_mfg_id;
-       u32 unipro_prod_id;
-       u32 ara_vend_id;
-       u32 ara_prod_id;
        int ret;
  
 -      if (request->payload_size < sizeof(*hotplug)) {
 -              dev_err(dev, "%s: short hotplug request received\n", __func__);
 -              return -EINVAL;
 -      }
 -
        /*
         * Grab the information we need.
 -       *
 -       * XXX I'd really like to acknowledge receipt, and then
 -       * XXX continue processing the request.  There's no need
 -       * XXX for the SVC to wait.  In fact, it might be best to
 -       * XXX have the SVC get acknowledgement before we proceed.
         */
        intf_id = hotplug->intf_id;
-       unipro_mfg_id = le32_to_cpu(hotplug->data.unipro_mfg_id);
-       unipro_prod_id = le32_to_cpu(hotplug->data.unipro_prod_id);
-       ara_vend_id = le32_to_cpu(hotplug->data.ara_vend_id);
-       ara_prod_id = le32_to_cpu(hotplug->data.ara_prod_id);
  
        intf = gb_interface_create(hd, intf_id);
        if (!intf) {
                dev_err(dev, "%s: Failed to create interface with id %hhu\n",
                        __func__, intf_id);
 -              return -EINVAL;
 +              goto free_svc_hotplug;
        }
  
+       intf->unipro_mfg_id = le32_to_cpu(hotplug->data.unipro_mfg_id);
+       intf->unipro_prod_id = le32_to_cpu(hotplug->data.unipro_prod_id);
+       intf->ara_vend_id = le32_to_cpu(hotplug->data.ara_vend_id);
+       intf->ara_prod_id = le32_to_cpu(hotplug->data.ara_prod_id);
        /*
         * Create a device id for the interface:
         * - device id 0 (GB_DEVICE_ID_SVC) belongs to the SVC