diff options
author | Alexandre Bounine <alexandre.bounine@idt.com> | 2013-07-03 18:08:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-03 19:08:05 -0400 |
commit | 3bdbb62fe97537252b22f700009863eeb51aa750 (patch) | |
tree | 7a3150f7496f951ac6de51f2156cf29fc8f9a73f /scripts/mod | |
parent | fdf90abc00979fb2d61dbdba9e855200e236142b (diff) |
rapidio: add udev notification
Add RapidIO-specific modalias generation to enable udev notifications
about RapidIO-specific events.
The RapidIO modalias string format is shown below:
"rapidio:vNNNNdNNNNavNNNNadNNNN"
Where:
v - Device Vendor ID (16 bit),
d - Device ID (16 bit),
av - Assembly Vendor ID (16 bit),
ad - Assembly ID (16 bit),
as they are reported in corresponding Capability Registers (CARs)
of each RapidIO device.
Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Li Yang <leoli@freescale.com>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Andre van Herk <andre.van.herk@Prodrive.nl>
Cc: Micha Nelissen <micha.nelissen@Prodrive.nl>
Cc: Stef van Os <stef.van.os@Prodrive.nl>
Cc: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/devicetable-offsets.c | 6 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 20 |
2 files changed, 26 insertions, 0 deletions
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index e66d4d258e1a..bb5d115ca671 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c | |||
@@ -177,5 +177,11 @@ int main(void) | |||
177 | DEVID(mei_cl_device_id); | 177 | DEVID(mei_cl_device_id); |
178 | DEVID_FIELD(mei_cl_device_id, name); | 178 | DEVID_FIELD(mei_cl_device_id, name); |
179 | 179 | ||
180 | DEVID(rio_device_id); | ||
181 | DEVID_FIELD(rio_device_id, did); | ||
182 | DEVID_FIELD(rio_device_id, vid); | ||
183 | DEVID_FIELD(rio_device_id, asm_did); | ||
184 | DEVID_FIELD(rio_device_id, asm_vid); | ||
185 | |||
180 | return 0; | 186 | return 0; |
181 | } | 187 | } |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 45f9a3377dcd..d9e67b719f08 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -1145,6 +1145,26 @@ static int do_mei_entry(const char *filename, void *symval, | |||
1145 | } | 1145 | } |
1146 | ADD_TO_DEVTABLE("mei", mei_cl_device_id, do_mei_entry); | 1146 | ADD_TO_DEVTABLE("mei", mei_cl_device_id, do_mei_entry); |
1147 | 1147 | ||
1148 | /* Looks like: rapidio:vNdNavNadN */ | ||
1149 | static int do_rio_entry(const char *filename, | ||
1150 | void *symval, char *alias) | ||
1151 | { | ||
1152 | DEF_FIELD(symval, rio_device_id, did); | ||
1153 | DEF_FIELD(symval, rio_device_id, vid); | ||
1154 | DEF_FIELD(symval, rio_device_id, asm_did); | ||
1155 | DEF_FIELD(symval, rio_device_id, asm_vid); | ||
1156 | |||
1157 | strcpy(alias, "rapidio:"); | ||
1158 | ADD(alias, "v", vid != RIO_ANY_ID, vid); | ||
1159 | ADD(alias, "d", did != RIO_ANY_ID, did); | ||
1160 | ADD(alias, "av", asm_vid != RIO_ANY_ID, asm_vid); | ||
1161 | ADD(alias, "ad", asm_did != RIO_ANY_ID, asm_did); | ||
1162 | |||
1163 | add_wildcard(alias); | ||
1164 | return 1; | ||
1165 | } | ||
1166 | ADD_TO_DEVTABLE("rapidio", rio_device_id, do_rio_entry); | ||
1167 | |||
1148 | /* Does namelen bytes of name exactly match the symbol? */ | 1168 | /* Does namelen bytes of name exactly match the symbol? */ |
1149 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) | 1169 | static bool sym_is(const char *name, unsigned namelen, const char *symbol) |
1150 | { | 1170 | { |