aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mod/file2alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r--scripts/mod/file2alias.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 78691d51a479..84c86f3cd6cd 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -34,6 +34,9 @@ typedef Elf64_Addr kernel_ulong_t;
typedef uint32_t __u32;
typedef uint16_t __u16;
typedef unsigned char __u8;
+typedef struct {
+ __u8 b[16];
+} uuid_le;
/* Big exception to the "don't include kernel headers into userspace, which
* even potentially has different endianness and word sizes, since
@@ -131,6 +134,15 @@ static inline void add_wildcard(char *str)
strcat(str + len, "*");
}
+static inline void add_uuid(char *str, uuid_le uuid)
+{
+ int len = strlen(str);
+ int i;
+
+ for (i = 0; i < 16; i++)
+ sprintf(str + len + (i << 1), "%02x", uuid.b[i]);
+}
+
/**
* Check that sizeof(device_id type) are consistent with size of section
* in .o file. If in-consistent then userspace and kernel does not agree
@@ -1160,13 +1172,18 @@ static int do_cpu_entry(const char *filename, void *symval, char *alias)
}
ADD_TO_DEVTABLE("cpu", cpu_feature, do_cpu_entry);
-/* Looks like: mei:S */
+/* Looks like: mei:S:uuid */
static int do_mei_entry(const char *filename, void *symval,
char *alias)
{
DEF_FIELD_ADDR(symval, mei_cl_device_id, name);
+ DEF_FIELD_ADDR(symval, mei_cl_device_id, uuid);
+
+ sprintf(alias, MEI_CL_MODULE_PREFIX);
+ sprintf(alias + strlen(alias), "%s:", (*name)[0] ? *name : "*");
+ add_uuid(alias, *uuid);
- sprintf(alias, MEI_CL_MODULE_PREFIX "%s", *name);
+ strcat(alias, ":*");
return 1;
}
@@ -1192,6 +1209,19 @@ static int do_rio_entry(const char *filename,
}
ADD_TO_DEVTABLE("rapidio", rio_device_id, do_rio_entry);
+/* Looks like: ulpi:vNpN */
+static int do_ulpi_entry(const char *filename, void *symval,
+ char *alias)
+{
+ DEF_FIELD(symval, ulpi_device_id, vendor);
+ DEF_FIELD(symval, ulpi_device_id, product);
+
+ sprintf(alias, "ulpi:v%04xp%04x", vendor, product);
+
+ return 1;
+}
+ADD_TO_DEVTABLE("ulpi", ulpi_device_id, do_ulpi_entry);
+
/* Does namelen bytes of name exactly match the symbol? */
static bool sym_is(const char *name, unsigned namelen, const char *symbol)
{