diff options
Diffstat (limited to 'scripts/mod/file2alias.c')
-rw-r--r-- | scripts/mod/file2alias.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 78691d51a479..62c517f4b592 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -131,6 +131,15 @@ static inline void add_wildcard(char *str) | |||
131 | strcat(str + len, "*"); | 131 | strcat(str + len, "*"); |
132 | } | 132 | } |
133 | 133 | ||
134 | static inline void add_uuid(char *str, __u8 uuid[16]) | ||
135 | { | ||
136 | int len = strlen(str); | ||
137 | int i; | ||
138 | |||
139 | for (i = 0; i < 16; i++) | ||
140 | sprintf(str + len + (i << 1), "%02x", uuid[i]); | ||
141 | } | ||
142 | |||
134 | /** | 143 | /** |
135 | * Check that sizeof(device_id type) are consistent with size of section | 144 | * Check that sizeof(device_id type) are consistent with size of section |
136 | * in .o file. If in-consistent then userspace and kernel does not agree | 145 | * in .o file. If in-consistent then userspace and kernel does not agree |
@@ -1160,13 +1169,18 @@ static int do_cpu_entry(const char *filename, void *symval, char *alias) | |||
1160 | } | 1169 | } |
1161 | ADD_TO_DEVTABLE("cpu", cpu_feature, do_cpu_entry); | 1170 | ADD_TO_DEVTABLE("cpu", cpu_feature, do_cpu_entry); |
1162 | 1171 | ||
1163 | /* Looks like: mei:S */ | 1172 | /* Looks like: mei:S:uuid */ |
1164 | static int do_mei_entry(const char *filename, void *symval, | 1173 | static int do_mei_entry(const char *filename, void *symval, |
1165 | char *alias) | 1174 | char *alias) |
1166 | { | 1175 | { |
1167 | DEF_FIELD_ADDR(symval, mei_cl_device_id, name); | 1176 | DEF_FIELD_ADDR(symval, mei_cl_device_id, name); |
1177 | DEF_FIELD_ADDR(symval, mei_cl_device_id, uuid); | ||
1178 | |||
1179 | sprintf(alias, MEI_CL_MODULE_PREFIX); | ||
1180 | sprintf(alias + strlen(alias), "%s:", (*name)[0] ? *name : "*"); | ||
1181 | add_uuid(alias, *uuid); | ||
1168 | 1182 | ||
1169 | sprintf(alias, MEI_CL_MODULE_PREFIX "%s", *name); | 1183 | strcat(alias, ":*"); |
1170 | 1184 | ||
1171 | return 1; | 1185 | return 1; |
1172 | } | 1186 | } |