summaryrefslogtreecommitdiffstats
path: root/scripts/mod
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2015-05-07 08:54:02 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-24 14:15:54 -0400
commitc93b76b34b4d8dbe8e3443eb27e49ac60034342b (patch)
tree018e5514a107c1db6329900afcfcb5905f55b0ac /scripts/mod
parent41c95b04385863f694fcf96e08994ebc722b7b9f (diff)
mei: bus: report also uuid in module alias
In order to automate modules matching add device uuid which is reported in client enumeration, keep also the name that is needed in for nfc distinguishing radio vendor Report mei:name:uuid Cc: linux-api@vger.kernel.org Cc: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'scripts/mod')
-rw-r--r--scripts/mod/devicetable-offsets.c1
-rw-r--r--scripts/mod/file2alias.c18
2 files changed, 17 insertions, 2 deletions
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index fce36d0f6898..091f6290a651 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -182,6 +182,7 @@ int main(void)
182 182
183 DEVID(mei_cl_device_id); 183 DEVID(mei_cl_device_id);
184 DEVID_FIELD(mei_cl_device_id, name); 184 DEVID_FIELD(mei_cl_device_id, name);
185 DEVID_FIELD(mei_cl_device_id, uuid);
185 186
186 DEVID(rio_device_id); 187 DEVID(rio_device_id);
187 DEVID_FIELD(rio_device_id, did); 188 DEVID_FIELD(rio_device_id, did);
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
134static 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}
1161ADD_TO_DEVTABLE("cpu", cpu_feature, do_cpu_entry); 1170ADD_TO_DEVTABLE("cpu", cpu_feature, do_cpu_entry);
1162 1171
1163/* Looks like: mei:S */ 1172/* Looks like: mei:S:uuid */
1164static int do_mei_entry(const char *filename, void *symval, 1173static 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}