aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/file2alias.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 9cf2400580a7..5758aab0d8bb 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -828,6 +828,19 @@ static int do_zorro_entry(const char *filename, struct zorro_device_id *id,
828 return 1; 828 return 1;
829} 829}
830 830
831/* looks like: "pnp:dD" */
832static int do_isapnp_entry(const char *filename,
833 struct isapnp_device_id *id, char *alias)
834{
835 sprintf(alias, "pnp:d%c%c%c%x%x%x%x*",
836 'A' + ((id->vendor >> 2) & 0x3f) - 1,
837 'A' + (((id->vendor & 3) << 3) | ((id->vendor >> 13) & 7)) - 1,
838 'A' + ((id->vendor >> 8) & 0x1f) - 1,
839 (id->function >> 4) & 0x0f, id->function & 0x0f,
840 (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f);
841 return 1;
842}
843
831/* Ignore any prefix, eg. some architectures prepend _ */ 844/* Ignore any prefix, eg. some architectures prepend _ */
832static inline int sym_is(const char *symbol, const char *name) 845static inline int sym_is(const char *symbol, const char *name)
833{ 846{
@@ -983,6 +996,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
983 do_table(symval, sym->st_size, 996 do_table(symval, sym->st_size,
984 sizeof(struct zorro_device_id), "zorro", 997 sizeof(struct zorro_device_id), "zorro",
985 do_zorro_entry, mod); 998 do_zorro_entry, mod);
999 else if (sym_is(symname, "__mod_isapnp_device_table"))
1000 do_table(symval, sym->st_size,
1001 sizeof(struct isapnp_device_id), "isa",
1002 do_isapnp_entry, mod);
986 free(zeros); 1003 free(zeros);
987} 1004}
988 1005