greybus: fix vendor and product matching
authorJohan Hovold <johan@hovoldconsulting.com>
Sat, 21 Nov 2015 09:52:02 +0000 (10:52 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Sun, 22 Nov 2015 01:15:35 +0000 (17:15 -0800)
Fix vendor and product matching by matching on the 32-bit Ara vendor and
product ids.

Remove the "fake" 16-bit vendor and product ids and export the Ara ids
using the "vendor" and "product" interface attributes instead.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/firmware.c
drivers/staging/greybus/greybus_id.h
drivers/staging/greybus/interface.h
drivers/staging/greybus/manifest.c
drivers/staging/greybus/svc.c

index a95be08c26d90d39d9e2b938da50748907937846..e99d8d679686c73a301af74b181a0d8b98891a73 100644 (file)
@@ -41,7 +41,7 @@ static int download_firmware(struct gb_firmware *firmware, u8 stage)
        snprintf(firmware_name, sizeof(firmware_name),
                 "ara:%08x:%08x:%08x:%08x:%02x.tftf",
                 intf->unipro_mfg_id, intf->unipro_prod_id,
-                intf->ara_vend_id, intf->ara_prod_id, stage);
+                intf->vendor, intf->product, stage);
 
        return request_firmware(&firmware->fw, firmware_name,
                                &connection->bundle->dev);
index 68d2e959a410198ded160f0b691a9376966833c3..c91e7be0451c2f2e8249379d19dc945ca4fa74d4 100644 (file)
@@ -11,8 +11,8 @@
 
 struct greybus_bundle_id {
        __u16   match_flags;
-       __u16   vendor;
-       __u16   product;
+       __u32   vendor;
+       __u32   product;
        __u8    class;
 
        kernel_ulong_t  driver_info __aligned(sizeof(kernel_ulong_t));
index f0ef4e9a620607b90291ddbeb6703005e3b69655..28d2bac2b7b17dd4b7d291f7276cca0607c22b0e 100644 (file)
@@ -22,16 +22,14 @@ struct gb_interface {
        u8 device_id;           /* Device id allocated for the interface block by the SVC */
 
        /* Information taken from the manifest descriptor */
-       u16 vendor;
-       u16 product;
        char *vendor_string;
        char *product_string;
 
        /* Information taken from the hotplug event */
        u32 unipro_mfg_id;
        u32 unipro_prod_id;
-       u32 ara_vend_id;
-       u32 ara_prod_id;
+       u32 vendor;
+       u32 product;
 
        struct gb_module *module;
        struct gb_host_device *hd;
index 4b4dd9973c17c589d445503f8612845425021b57..c80a849617d7effc9fdc8824927e39a9fa00950a 100644 (file)
@@ -392,11 +392,6 @@ static bool gb_manifest_parse_interface(struct gb_interface *intf,
        if (IS_ERR(intf->product_string))
                goto out_free_vendor_string;
 
-       // FIXME
-       // Vendor, Product and Unique id must come via control protocol
-       intf->vendor = 0xffff;
-       intf->product = 0x0001;
-
        /* Release the interface descriptor, now that we're done with it */
        release_manifest_descriptor(interface_desc);
 
index bd045678493f63e99b3e2b43f043082a2619c58e..1acd0f7efc6bdaa32b90c897ecc85f4efa51c4a2 100644 (file)
@@ -460,8 +460,8 @@ static void svc_process_hotplug(struct work_struct *work)
 
        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);
+       intf->vendor = le32_to_cpu(hotplug->data.ara_vend_id);
+       intf->product = le32_to_cpu(hotplug->data.ara_prod_id);
 
        /*
         * Create a device id for the interface: