Commit 3944a454 authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: interface: Preserve data received during hotplug event

This shall be used later to find a firmware blob for the interface, lets
save it in the interface structure.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent fd489e1a
...@@ -28,6 +28,12 @@ struct gb_interface { ...@@ -28,6 +28,12 @@ struct gb_interface {
char *product_string; char *product_string;
u64 unique_id; u64 unique_id;
/* Information taken from the hotplug event */
u32 unipro_mfg_id;
u32 unipro_prod_id;
u32 ara_vend_id;
u32 ara_prod_id;
struct gb_module *module; struct gb_module *module;
struct greybus_host_device *hd; struct greybus_host_device *hd;
}; };
......
...@@ -232,10 +232,6 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op) ...@@ -232,10 +232,6 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op)
struct device *dev = &op->connection->dev; struct device *dev = &op->connection->dev;
struct gb_interface *intf; struct gb_interface *intf;
u8 intf_id, device_id; u8 intf_id, device_id;
u32 unipro_mfg_id;
u32 unipro_prod_id;
u32 ara_vend_id;
u32 ara_prod_id;
int ret; int ret;
if (request->payload_size < sizeof(*hotplug)) { if (request->payload_size < sizeof(*hotplug)) {
...@@ -252,10 +248,6 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op) ...@@ -252,10 +248,6 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op)
* XXX have the SVC get acknowledgement before we proceed. * XXX have the SVC get acknowledgement before we proceed.
*/ */
intf_id = hotplug->intf_id; 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); intf = gb_interface_create(hd, intf_id);
if (!intf) { if (!intf) {
...@@ -264,6 +256,11 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op) ...@@ -264,6 +256,11 @@ static int gb_svc_intf_hotplug_recv(struct gb_operation *op)
return -EINVAL; return -EINVAL;
} }
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: * Create a device id for the interface:
* - device id 0 (GB_DEVICE_ID_SVC) belongs to the SVC * - device id 0 (GB_DEVICE_ID_SVC) belongs to the SVC
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment