Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 197574
b: refs/heads/master
c: fedb3d2
h: refs/heads/master
v: v3
  • Loading branch information
Ondrej Zary authored and Rusty Russell committed May 19, 2010
1 parent 4a6cd71 commit 159c0d6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 031ffd1711bd8bf334ebcbe8ebe34845e6d4678f
refs/heads/master: fedb3d27d9e8606b3867b5ae49d6258458a07a72
17 changes: 17 additions & 0 deletions trunk/scripts/mod/file2alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,19 @@ static int do_zorro_entry(const char *filename, struct zorro_device_id *id,
return 1;
}

/* looks like: "pnp:dD" */
static int do_isapnp_entry(const char *filename,
struct isapnp_device_id *id, char *alias)
{
sprintf(alias, "pnp:d%c%c%c%x%x%x%x*",
'A' + ((id->vendor >> 2) & 0x3f) - 1,
'A' + (((id->vendor & 3) << 3) | ((id->vendor >> 13) & 7)) - 1,
'A' + ((id->vendor >> 8) & 0x1f) - 1,
(id->function >> 4) & 0x0f, id->function & 0x0f,
(id->function >> 12) & 0x0f, (id->function >> 8) & 0x0f);
return 1;
}

/* Ignore any prefix, eg. some architectures prepend _ */
static inline int sym_is(const char *symbol, const char *name)
{
Expand Down Expand Up @@ -957,6 +970,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info,
do_table(symval, sym->st_size,
sizeof(struct zorro_device_id), "zorro",
do_zorro_entry, mod);
else if (sym_is(symname, "__mod_isapnp_device_table"))
do_table(symval, sym->st_size,
sizeof(struct isapnp_device_id), "isa",
do_isapnp_entry, mod);
free(zeros);
}

Expand Down

0 comments on commit 159c0d6

Please sign in to comment.