aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 df90f31d14bf..808c20d81f8d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -806,6 +806,19 @@ static int do_zorro_entry(const char *filename, struct zorro_device_id *id,
806 return 1; 806 return 1;
807} 807}
808 808
809/* looks like: "pnp:dD" */
810static int do_isapnp_entry(const char *filename,
811 struct isapnp_device_id *id, char *alias)
812{
813 sprintf(alias, "pnp:d%c%c%c%x%x%x%x*",
814 'A' + ((id->vendor >> 2) & 0x3f) - 1,
815 'A' + (((id->vendor & 3) << 3) | ((id->vendor >> 13) & 7)) - 1,
816 'A' + ((id->vendor >> 8) & 0x1f) - 1,
817 (id->function >> 4) & 0x0f, id->function & 0x0f,
818 (id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f);
819 return 1;
820}
821
809/* Ignore any prefix, eg. some architectures prepend _ */ 822/* Ignore any prefix, eg. some architectures prepend _ */
810static inline int sym_is(const char *symbol, const char *name) 823static inline int sym_is(const char *symbol, const char *name)
811{ 824{
@@ -957,6 +970,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
957 do_table(symval, sym->st_size, 970 do_table(symval, sym->st_size,
958 sizeof(struct zorro_device_id), "zorro", 971 sizeof(struct zorro_device_id), "zorro",
959 do_zorro_entry, mod); 972 do_zorro_entry, mod);
973 else if (sym_is(symname, "__mod_isapnp_device_table"))
974 do_table(symval, sym->st_size,
975 sizeof(struct isapnp_device_id), "isa",
976 do_isapnp_entry, mod);
960 free(zeros); 977 free(zeros);
961} 978}
962 979