Re: [PATCH v2 2/6] mei: Switch to use new generic UUID API
From: Andy Shevchenko
Date: Tue Jul 25 2017 - 06:12:07 EST
On Tue, 2017-07-25 at 00:12 +0300, Tomas Winkler wrote:
> From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>
> There are new types and helpers that are supposed to be used in new
> code.
>
> As a preparation to get rid of legacy types and API functions do
> the conversion here.
>
> Cc: Tomas Winkler <tomas.winkler@xxxxxxxxx>
> Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
> Cc: Samuel Ortiz <sameo@xxxxxxxxxxxxxxx>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> Signed-off-by: Tomas Winkler <tomas.winkler@xxxxxxxxx>
> ---
> V2:Â
> ÂÂÂÂ1. Fixed file2alias compilation breakage
> ÂÂÂÂ2. Dropped amt version sample from the patch
> ÂÂÂÂÂÂÂa. We need to see yet how to not break all our user space.
> ÂÂÂÂÂÂÂc. It had some checkpatch issues.
Thanks, though I didn't get a context.
Is it supposed to be injected in my patch series instead of what I have
as patch 2?
>
> Still this is naming mess will require addition re-spin
>
> Âdrivers/misc/mei/bus-fixup.cÂÂÂÂ| 35 +++++++++++++++++++-------------
> ---
> Âdrivers/misc/mei/bus.cÂÂÂÂÂÂÂÂÂÂ| 14 +++++++-------
> Âdrivers/misc/mei/client.cÂÂÂÂÂÂÂ| 21 ++++++++++-----------
> Âdrivers/misc/mei/client.hÂÂÂÂÂÂÂ| 12 ++++++------
> Âdrivers/misc/mei/hbm.cÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/misc/mei/hw.hÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/misc/mei/main.cÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> Âdrivers/nfc/mei_phy.hÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ5 +++--
> Âdrivers/watchdog/mei_wdt.cÂÂÂÂÂÂ|ÂÂ5 +++--
> Âinclude/linux/mei_cl_bus.hÂÂÂÂÂÂ|ÂÂ2 +-
> Âinclude/linux/mod_devicetable.h |ÂÂ8 ++++----
> Âinclude/uapi/linux/mei.hÂÂÂÂÂÂÂÂ|ÂÂ4 +---
> Âsamples/mei/mei-amt-version.cÂÂÂ| 23 ++++++++++++++++++-----
> Âscripts/mod/file2alias.cÂÂÂÂÂÂÂÂ|ÂÂ6 +++---
> Â14 files changed, 78 insertions(+), 63 deletions(-)
>
> diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-
> fixup.c
> index 0208c4b027c5..9eaac4f2d427 100644
> --- a/drivers/misc/mei/bus-fixup.c
> +++ b/drivers/misc/mei/bus-fixup.c
> @@ -27,21 +27,27 @@
> Â#include "mei_dev.h"
> Â#include "client.h"
> Â
> -#define MEI_UUID_NFC_INFO UUID_LE(0xd2de1625, 0x382d, 0x417d, \
> - 0x48, 0xa4, 0xef, 0xab, 0xba, 0x8a, 0x12,
> 0x06)
> +#define MEI_UUID_NFC_INFO
> \
> + GUID_INIT(0xd2de1625, 0x382d, 0x417d,
> \
> + ÂÂ0x48, 0xa4, 0xef, 0xab, 0xba, 0x8a, 0x12, 0x06)
> Â
> -static const uuid_le mei_nfc_info_guid = MEI_UUID_NFC_INFO;
> +static const guid_t mei_nfc_info_guid = MEI_UUID_NFC_INFO;
> Â
> -#define MEI_UUID_NFC_HCI UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \
> - 0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77,
> 0x5c)
> +#define MEI_UUID_NFC_HCI
> \
> + GUID_INIT(0x0bb17a78, 0x2a8e, 0x4c50,
> \
> + ÂÂ0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
> Â
> -#define MEI_UUID_WD UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, \
> - ÂÂÂÂ0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32,
> 0xAB)
> +#define MEI_UUID_WD
> \
> + GUID_INIT(0x05B79A6F, 0x4628, 0x4D7F,
> \
> + ÂÂ0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32, 0xAB)
> Â
> -#define MEI_UUID_MKHIF_FIX UUID_LE(0x55213584, 0x9a29, 0x4916, \
> - 0xba, 0xdf, 0xf, 0xb7, 0xed, 0x68, 0x2a,
> 0xeb)
> +#define MEI_UUID_MKHIF_FIX
> \
> + GUID_INIT(0x55213584, 0x9a29, 0x4916,
> \
> + ÂÂ0xba, 0xdf, 0x0f, 0xb7, 0xed, 0x68, 0x2a, 0xeb)
> Â
> -#define MEI_UUID_ANY NULL_UUID_LE
> +#define MEI_UUID_ANY
> \
> + GUID_INIT(0x00000000, 0x0000, 0x0000,
> \
> + ÂÂ0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
> Â
> Â/**
> Â * number_of_connections - determine whether an client be on the bus
> @@ -391,7 +397,7 @@ static void mei_nfc(struct mei_cl_device *cldev)
> Â
> Âstatic struct mei_fixup {
> Â
> - const uuid_le uuid;
> + const guid_t uuid;
> Â void (*hook)(struct mei_cl_device *cldev);
> Â} mei_fixups[] = {
> Â MEI_FIXUP(MEI_UUID_ANY, number_of_connections),
> @@ -409,15 +415,12 @@ static struct mei_fixup {
> Âvoid mei_cl_bus_dev_fixup(struct mei_cl_device *cldev)
> Â{
> Â struct mei_fixup *f;
> - const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
> + const guid_t *uuid = mei_me_cl_uuid(cldev->me_cl);
> Â int i;
> Â
> Â for (i = 0; i < ARRAY_SIZE(mei_fixups); i++) {
> -
> Â f = &mei_fixups[i];
> - if (uuid_le_cmp(f->uuid, MEI_UUID_ANY) == 0 ||
> - ÂÂÂÂuuid_le_cmp(f->uuid, *uuid) == 0)
> + if (guid_is_null(&f->uuid) || guid_equal(&f->uuid,
> uuid))
> Â f->hook(cldev);
> Â }
> Â}
> -
> diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
> index 40c79089e548..c5165f2ec842 100644
> --- a/drivers/misc/mei/bus.c
> +++ b/drivers/misc/mei/bus.c
> @@ -417,7 +417,7 @@ EXPORT_SYMBOL_GPL(mei_cldev_set_drvdata);
> Â *
> Â * Return: me client uuid
> Â */
> -const uuid_le *mei_cldev_uuid(const struct mei_cl_device *cldev)
> +const guid_t *mei_cldev_uuid(const struct mei_cl_device *cldev)
> Â{
> Â return mei_me_cl_uuid(cldev->me_cl);
> Â}
> @@ -606,7 +606,7 @@ struct mei_cl_device_id *mei_cl_device_find(struct
> mei_cl_device *cldev,
> Â ÂÂÂÂstruct mei_cl_driver
> *cldrv)
> Â{
> Â const struct mei_cl_device_id *id;
> - const uuid_le *uuid;
> + const guid_t *uuid;
> Â u8 version;
> Â bool match;
> Â
> @@ -614,8 +614,8 @@ struct mei_cl_device_id *mei_cl_device_find(struct
> mei_cl_device *cldev,
> Â version = mei_me_cl_ver(cldev->me_cl);
> Â
> Â id = cldrv->id_table;
> - while (uuid_le_cmp(NULL_UUID_LE, id->uuid)) {
> - if (!uuid_le_cmp(*uuid, id->uuid)) {
> + while (!guid_is_null(&id->uuid)) {
> + if (guid_equal(uuid, &id->uuid)) {
> Â match = true;
> Â
> Â if (cldev->name[0])
> @@ -742,7 +742,7 @@ static ssize_t uuid_show(struct device *dev,
> struct device_attribute *a,
> Â ÂÂÂÂÂchar *buf)
> Â{
> Â struct mei_cl_device *cldev = to_mei_cl_device(dev);
> - const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
> + const guid_t *uuid = mei_me_cl_uuid(cldev->me_cl);
> Â
> Â return scnprintf(buf, PAGE_SIZE, "%pUl", uuid);
> Â}
> @@ -762,7 +762,7 @@ static ssize_t modalias_show(struct device *dev,
> struct device_attribute *a,
> Â ÂÂÂÂÂchar *buf)
> Â{
> Â struct mei_cl_device *cldev = to_mei_cl_device(dev);
> - const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
> + const guid_t *uuid = mei_me_cl_uuid(cldev->me_cl);
> Â u8 version = mei_me_cl_ver(cldev->me_cl);
> Â
> Â return scnprintf(buf, PAGE_SIZE, "mei:%s:%pUl:%02X:",
> @@ -790,7 +790,7 @@ ATTRIBUTE_GROUPS(mei_cldev);
> Âstatic int mei_cl_device_uevent(struct device *dev, struct
> kobj_uevent_env *env)
> Â{
> Â struct mei_cl_device *cldev = to_mei_cl_device(dev);
> - const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
> + const guid_t *uuid = mei_me_cl_uuid(cldev->me_cl);
> Â u8 version = mei_me_cl_ver(cldev->me_cl);
> Â
> Â if (add_uevent_var(env, "MEI_CL_VERSION=%d", version))
> diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
> index be64969d986a..a44fb96452a9 100644
> --- a/drivers/misc/mei/client.c
> +++ b/drivers/misc/mei/client.c
> @@ -139,16 +139,16 @@ void mei_me_cl_add(struct mei_device *dev,
> struct mei_me_client *me_cl)
> Â * Locking: dev->me_clients_rwsem
> Â */
> Âstatic struct mei_me_client *__mei_me_cl_by_uuid(struct mei_device
> *dev,
> - const uuid_le *uuid)
> + const guid_t *uuid)
> Â{
> Â struct mei_me_client *me_cl;
> - const uuid_le *pn;
> + const guid_t *pn;
> Â
> Â WARN_ON(!rwsem_is_locked(&dev->me_clients_rwsem));
> Â
> Â list_for_each_entry(me_cl, &dev->me_clients, list) {
> Â pn = &me_cl->props.protocol_name;
> - if (uuid_le_cmp(*uuid, *pn) == 0)
> + if (guid_equal(uuid, pn))
> Â return mei_me_cl_get(me_cl);
> Â }
> Â
> @@ -167,7 +167,7 @@ static struct mei_me_client
> *__mei_me_cl_by_uuid(struct mei_device *dev,
> Â * Locking: dev->me_clients_rwsem
> Â */
> Âstruct mei_me_client *mei_me_cl_by_uuid(struct mei_device *dev,
> - const uuid_le *uuid)
> + const guid_t *uuid)
> Â{
> Â struct mei_me_client *me_cl;
> Â
> @@ -219,17 +219,16 @@ struct mei_me_client *mei_me_cl_by_id(struct
> mei_device *dev, u8 client_id)
> Â * Locking: dev->me_clients_rwsem
> Â */
> Âstatic struct mei_me_client *__mei_me_cl_by_uuid_id(struct mei_device
> *dev,
> - ÂÂÂconst uuid_le *uuid, u8
> client_id)
> + ÂÂÂconst guid_t *uuid, u8
> client_id)
> Â{
> Â struct mei_me_client *me_cl;
> - const uuid_le *pn;
> + const guid_t *pn;
> Â
> Â WARN_ON(!rwsem_is_locked(&dev->me_clients_rwsem));
> Â
> Â list_for_each_entry(me_cl, &dev->me_clients, list) {
> Â pn = &me_cl->props.protocol_name;
> - if (uuid_le_cmp(*uuid, *pn) == 0 &&
> - ÂÂÂÂme_cl->client_id == client_id)
> + if (guid_equal(uuid, pn) && me_cl->client_id ==
> client_id)
> Â return mei_me_cl_get(me_cl);
> Â }
> Â
> @@ -248,7 +247,7 @@ static struct mei_me_client
> *__mei_me_cl_by_uuid_id(struct mei_device *dev,
> Â * Return: me client or null if not found
> Â */
> Âstruct mei_me_client *mei_me_cl_by_uuid_id(struct mei_device *dev,
> - ÂÂÂconst uuid_le *uuid, u8
> client_id)
> + ÂÂÂconst guid_t *uuid, u8
> client_id)
> Â{
> Â struct mei_me_client *me_cl;
> Â
> @@ -267,7 +266,7 @@ struct mei_me_client *mei_me_cl_by_uuid_id(struct
> mei_device *dev,
> Â *
> Â * Locking: called under "dev->device_lock" lock
> Â */
> -void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le
> *uuid)
> +void mei_me_cl_rm_by_uuid(struct mei_device *dev, const guid_t *uuid)
> Â{
> Â struct mei_me_client *me_cl;
> Â
> @@ -288,7 +287,7 @@ void mei_me_cl_rm_by_uuid(struct mei_device *dev,
> const uuid_le *uuid)
> Â *
> Â * Locking: called under "dev->device_lock" lock
> Â */
> -void mei_me_cl_rm_by_uuid_id(struct mei_device *dev, const uuid_le
> *uuid, u8 id)
> +void mei_me_cl_rm_by_uuid_id(struct mei_device *dev, const guid_t
> *uuid, u8 id)
> Â{
> Â struct mei_me_client *me_cl;
> Â
> diff --git a/drivers/misc/mei/client.h b/drivers/misc/mei/client.h
> index 5371df4d8af3..5d996e1e39fa 100644
> --- a/drivers/misc/mei/client.h
> +++ b/drivers/misc/mei/client.h
> @@ -34,13 +34,13 @@ void mei_me_cl_add(struct mei_device *dev, struct
> mei_me_client *me_cl);
> Âvoid mei_me_cl_del(struct mei_device *dev, struct mei_me_client
> *me_cl);
> Â
> Âstruct mei_me_client *mei_me_cl_by_uuid(struct mei_device *dev,
> - const uuid_le *uuid);
> + const guid_t *uuid);
> Âstruct mei_me_client *mei_me_cl_by_id(struct mei_device *dev, u8
> client_id);
> Âstruct mei_me_client *mei_me_cl_by_uuid_id(struct mei_device *dev,
> - ÂÂÂconst uuid_le *uuid, u8
> client_id);
> -void mei_me_cl_rm_by_uuid(struct mei_device *dev, const uuid_le
> *uuid);
> + ÂÂÂconst guid_t *uuid, u8
> client_id);
> +void mei_me_cl_rm_by_uuid(struct mei_device *dev, const guid_t
> *uuid);
> Âvoid mei_me_cl_rm_by_uuid_id(struct mei_device *dev,
> - ÂÂÂÂÂconst uuid_le *uuid, u8 id);
> + ÂÂÂÂÂconst guid_t *uuid, u8 id);
> Âvoid mei_me_cl_rm_all(struct mei_device *dev);
> Â
> Â/**
> @@ -62,7 +62,7 @@ static inline bool mei_me_cl_is_active(const struct
> mei_me_client *me_cl)
> Â *
> Â * Return: me client protocol name
> Â */
> -static inline const uuid_le *mei_me_cl_uuid(const struct
> mei_me_client *me_cl)
> +static inline const guid_t *mei_me_cl_uuid(const struct mei_me_client
> *me_cl)
> Â{
> Â return &me_cl->props.protocol_name;
> Â}
> @@ -177,7 +177,7 @@ static inline bool mei_cl_is_single_recv_buf(const
> struct mei_cl *cl)
> Â *
> Â * Return: return uuid of connected me client
> Â */
> -static inline const uuid_le *mei_cl_uuid(const struct mei_cl *cl)
> +static inline const guid_t *mei_cl_uuid(const struct mei_cl *cl)
> Â{
> Â return mei_me_cl_uuid(cl->me_cl);
> Â}
> diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c
> index fe6595fe94f1..059b8dfef67b 100644
> --- a/drivers/misc/mei/hbm.c
> +++ b/drivers/misc/mei/hbm.c
> @@ -329,7 +329,7 @@ static int mei_hbm_me_cl_add(struct mei_device
> *dev,
> Â ÂÂÂÂÂstruct hbm_props_response *res)
> Â{
> Â struct mei_me_client *me_cl;
> - const uuid_le *uuid = &res->client_properties.protocol_name;
> + const guid_t *uuid = &res->client_properties.protocol_name;
> Â
> Â mei_me_cl_rm_by_uuid(dev, uuid);
> Â
> diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h
> index 5c8286b40b62..e061f449ea75 100644
> --- a/drivers/misc/mei/hw.h
> +++ b/drivers/misc/mei/hw.h
> @@ -288,7 +288,7 @@ struct hbm_host_enum_response {
> Â} __packed;
> Â
> Âstruct mei_client_properties {
> - uuid_le protocol_name;
> + guid_t protocol_name;
> Â u8 protocol_version;
> Â u8 max_number_of_connections;
> Â u8 fixed_address;
> diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
> index e825f013e54e..be576c625f9f 100644
> --- a/drivers/misc/mei/main.c
> +++ b/drivers/misc/mei/main.c
> @@ -342,7 +342,7 @@ static int mei_ioctl_connect_client(struct file
> *file,
> Â returnÂÂ-EBUSY;
> Â
> Â /* find ME client we're trying to connect to */
> - me_cl = mei_me_cl_by_uuid(dev, &data->in_client_uuid);
> + me_cl = mei_me_cl_by_uuid(dev, (guid_t *)&data-
> >in_client_uuid);
> Â if (!me_cl) {
> Â dev_dbg(dev->dev, "Cannot connect to FW Client UUID =
> %pUl\n",
> Â &data->in_client_uuid);
> diff --git a/drivers/nfc/mei_phy.h b/drivers/nfc/mei_phy.h
> index acd3a1fc69e6..bf4775a111e8 100644
> --- a/drivers/nfc/mei_phy.h
> +++ b/drivers/nfc/mei_phy.h
> @@ -5,8 +5,9 @@
> Â#include <net/nfc/hci.h>
> Â#include <linux/uuid.h>
> Â
> -#define MEI_NFC_UUID UUID_LE(0x0bb17a78, 0x2a8e, 0x4c50, \
> - 0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
> +#define MEI_NFC_UUID
> \
> + GUID_INIT(0x0bb17a78, 0x2a8e, 0x4c50,
> \
> + ÂÂ0x94, 0xd4, 0x50, 0x26, 0x67, 0x23, 0x77, 0x5c)
> Â#define MEI_NFC_HEADER_SIZE 10
> Â#define MEI_NFC_MAX_HCI_PAYLOAD 300
> Â
> diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
> index b29c6fde7473..a0f052a96913 100644
> --- a/drivers/watchdog/mei_wdt.c
> +++ b/drivers/watchdog/mei_wdt.c
> @@ -667,8 +667,9 @@ static int mei_wdt_remove(struct mei_cl_device
> *cldev)
> Â return 0;
> Â}
> Â
> -#define MEI_UUID_WD UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, \
> - ÂÂÂÂ0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32,
> 0xAB)
> +#define MEI_UUID_WD
> \
> + GUID_INIT(0x05B79A6F, 0x4628, 0x4D7F,
> \
> + ÂÂ0x89, 0x9D, 0xA9, 0x15, 0x14, 0xCB, 0x32, 0xAB)
> Â
> Âstatic struct mei_cl_device_id mei_wdt_tbl[] = {
> Â { .uuid = MEI_UUID_WD, .version = MEI_CL_VERSION_ANY },
> diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h
> index a0d274fe08f1..81a860bfd076 100644
> --- a/include/linux/mei_cl_bus.h
> +++ b/include/linux/mei_cl_bus.h
> @@ -94,7 +94,7 @@ int mei_cldev_register_rx_cb(struct mei_cl_device
> *cldev, mei_cldev_cb_t rx_cb);
> Âint mei_cldev_register_notif_cb(struct mei_cl_device *cldev,
> Â mei_cldev_cb_t notif_cb);
> Â
> -const uuid_le *mei_cldev_uuid(const struct mei_cl_device *cldev);
> +const guid_t *mei_cldev_uuid(const struct mei_cl_device *cldev);
> Âu8 mei_cldev_ver(const struct mei_cl_device *cldev);
> Â
> Âvoid *mei_cldev_get_drvdata(const struct mei_cl_device *cldev);
> diff --git a/include/linux/mod_devicetable.h
> b/include/linux/mod_devicetable.h
> index 3f74ef2281e8..c36d274b7c91 100644
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> @@ -405,7 +405,7 @@ struct virtio_device_id {
> Â * For Hyper-V devices we use the device guid as the id.
> Â */
> Âstruct hv_vmbus_device_id {
> - uuid_le guid;
> + guid_t guid;
> Â kernel_ulong_t driver_data; /* Data private to the
> driver */
> Â};
> Â
> @@ -627,15 +627,15 @@ struct ipack_device_id {
> Â/**
> Â * struct mei_cl_device_id - MEI client device identifier
> Â * @name: helper name
> - * @uuid: client uuid
> + * @uuid: client GUID
> Â * @version: client protocol version
> Â * @driver_info: information used by the driver.
> Â *
> - * identifies mei client device by uuid and name
> + * identifies mei client device by GUID and name
> Â */
> Âstruct mei_cl_device_id {
> Â char name[MEI_CL_NAME_SIZE];
> - uuid_le uuid;
> + guid_t uuid;
> Â __u8ÂÂÂÂversion;
> Â kernel_ulong_t driver_info;
> Â};
> diff --git a/include/uapi/linux/mei.h b/include/uapi/linux/mei.h
> index 7c3b64f6a215..cf02d56a13e6 100644
> --- a/include/uapi/linux/mei.h
> +++ b/include/uapi/linux/mei.h
> @@ -67,8 +67,6 @@
> Â#ifndef _LINUX_MEI_H
> Â#define _LINUX_MEI_H
> Â
> -#include <linux/uuid.h>
> -
> Â/*
> Â * This IOCTL is used to associate the current file descriptor with a
> Â * FW Client (given by UUID). This opens a communication channel
> @@ -102,7 +100,7 @@ struct mei_client {
> Â */
> Âstruct mei_connect_client_data {
> Â union {
> - uuid_le in_client_uuid;
> + __u8 in_client_uuid[16];
> Â struct mei_client out_client_properties;
> Â };
> Â};
> diff --git a/samples/mei/mei-amt-version.c b/samples/mei/mei-amt-
> version.c
> index 57d0d871dcf7..396915e37d3b 100644
> --- a/samples/mei/mei-amt-version.c
> +++ b/samples/mei/mei-amt-version.c
> @@ -89,8 +89,20 @@
> Â fprintf(stderr, "Error: " fmt, ##ARGS); \
> Â} while (0)
> Â
> +/* FIXME: Use libuuid instead */
> +typedef struct {
> + __u8 b[16];
> +} guid_t;
> +
> +#define GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)
> \
> +((guid_t)
> \
> +{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) &
> 0xff, \
> +ÂÂÂ(b) & 0xff, ((b) >> 8) & 0xff,
> \
> +ÂÂÂ(c) & 0xff, ((c) >> 8) & 0xff,
> \
> +ÂÂÂ(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
> +
> Âstruct mei {
> - uuid_le guid;
> + guid_t guid;
> Â bool initialized;
> Â bool verbose;
> Â unsigned int buf_size;
> @@ -108,8 +120,8 @@ static void mei_deinit(struct mei *cl)
> Â cl->initialized = false;
> Â}
> Â
> -static bool mei_init(struct mei *me, const uuid_le *guid,
> - unsigned char req_protocol_version, bool verbose)
> +static bool mei_init(struct mei *me, const guid_t *guid,
> + ÂÂÂÂÂunsigned char req_protocol_version, bool
> verbose)
> Â{
> Â int result;
> Â struct mei_client *cl;
> @@ -270,8 +282,9 @@ struct amt_host_if_resp_header {
> Â unsigned char data[0];
> Â} __attribute__((packed));
> Â
> -const uuid_le MEI_IAMTHIF = UUID_LE(0x12f80028, 0xb4b7, 0x4b2d,ÂÂ\
> - 0xac, 0xa8, 0x46, 0xe0, 0xff, 0x65,
> 0x81, 0x4c);
> +const guid_t MEI_IAMTHIF =
> + GUID_INIT(0x12f80028, 0xb4b7, 0x4b2d,
> + ÂÂ0xac, 0xa8, 0x46, 0xe0, 0xff, 0x65, 0x81, 0x4c);
> Â
> Â#define AMT_HOST_IF_CODE_VERSIONS_REQUESTÂÂ0x0400001A
> Â#define AMT_HOST_IF_CODE_VERSIONS_RESPONSE 0x0480001A
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 29d6699d5a06..045ec1a10e25 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -36,7 +36,7 @@ typedef uint16_t __u16;
> Âtypedef unsigned char __u8;
> Âtypedef struct {
> Â __u8 b[16];
> -} uuid_le;
> +} guid_t;
> Â
> Â/* Big exception to the "don't include kernel headers into userspace,
> which
> Â * even potentially has different endianness and word sizes, since
> @@ -134,7 +134,7 @@ static inline void add_wildcard(char *str)
> Â strcat(str + len, "*");
> Â}
> Â
> -static inline void add_uuid(char *str, uuid_le uuid)
> +static inline void add_guid(char *str, guid_t uuid)
> Â{
> Â int len = strlen(str);
> Â
> @@ -1230,7 +1230,7 @@ static int do_mei_entry(const char *filename,
> void *symval,
> Â
> Â sprintf(alias, MEI_CL_MODULE_PREFIX);
> Â sprintf(alias + strlen(alias), "%s:",ÂÂ(*name)[0]ÂÂ? *name :
> "*");
> - add_uuid(alias, *uuid);
> + add_guid(alias, *uuid);
> Â ADD(alias, ":", version != MEI_CL_VERSION_ANY, version);
> Â
> Â strcat(alias, ":*");
--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy