diff options
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/file2alias.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 91c15da2680b..d802b5afae89 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -525,6 +525,20 @@ static int do_ssb_entry(const char *filename, | |||
525 | return 1; | 525 | return 1; |
526 | } | 526 | } |
527 | 527 | ||
528 | /* Looks like: virtio:dNvN */ | ||
529 | static int do_virtio_entry(const char *filename, struct virtio_device_id *id, | ||
530 | char *alias) | ||
531 | { | ||
532 | id->device = TO_NATIVE(id->device); | ||
533 | id->vendor = TO_NATIVE(id->vendor); | ||
534 | |||
535 | strcpy(alias, "virtio:"); | ||
536 | ADD(alias, "d", 1, id->device); | ||
537 | ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor); | ||
538 | |||
539 | return 1; | ||
540 | } | ||
541 | |||
528 | /* Ignore any prefix, eg. v850 prepends _ */ | 542 | /* Ignore any prefix, eg. v850 prepends _ */ |
529 | static inline int sym_is(const char *symbol, const char *name) | 543 | static inline int sym_is(const char *symbol, const char *name) |
530 | { | 544 | { |
@@ -651,6 +665,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
651 | do_table(symval, sym->st_size, | 665 | do_table(symval, sym->st_size, |
652 | sizeof(struct ssb_device_id), "ssb", | 666 | sizeof(struct ssb_device_id), "ssb", |
653 | do_ssb_entry, mod); | 667 | do_ssb_entry, mod); |
668 | else if (sym_is(symname, "__mod_virtio_device_table")) | ||
669 | do_table(symval, sym->st_size, | ||
670 | sizeof(struct virtio_device_id), "virtio", | ||
671 | do_virtio_entry, mod); | ||
654 | free(zeros); | 672 | free(zeros); |
655 | } | 673 | } |
656 | 674 | ||