From ecbe41ff4e6c3b0a6d53f26fd1f6e4d98f007a9b Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Mon, 27 Jun 2005 16:28:12 -0700 Subject: [PATCH] --- yaml --- r: 3751 b: refs/heads/master c: 90829cfe1df2466c98a831f6c44f71026665cec1 h: refs/heads/master i: 3749: 7536ccb546ca3b26f1b950965a5b0684fde465b1 3747: 6de93ac7ecef1724331f3ac0e2f7f0827f8931ca 3743: d756042f06951c6acb535a421ca968fde378dd5a v: v3 --- [refs] | 2 +- trunk/scripts/mod/file2alias.c | 39 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c28272bc535f..a6e369513db6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a5b5577898d9330a78dea1c9e75da1540c36bf72 +refs/heads/master: 90829cfe1df2466c98a831f6c44f71026665cec1 diff --git a/trunk/scripts/mod/file2alias.c b/trunk/scripts/mod/file2alias.c index 32197efe67ed..908bff6d1eef 100644 --- a/trunk/scripts/mod/file2alias.c +++ b/trunk/scripts/mod/file2alias.c @@ -287,6 +287,42 @@ static int do_pnp_card_entry(const char *filename, return 1; } +/* Looks like: pcmcia:mNcNfNfnNpfnNvaNvbNvcNvdN. */ +static int do_pcmcia_entry(const char *filename, + struct pcmcia_device_id *id, char *alias) +{ + unsigned int i; + + id->manf_id = TO_NATIVE(id->manf_id); + id->card_id = TO_NATIVE(id->card_id); + id->func_id = TO_NATIVE(id->func_id); + id->function = TO_NATIVE(id->function); + id->device_no = TO_NATIVE(id->device_no); + for (i=0; i<4; i++) { + id->prod_id_hash[i] = TO_NATIVE(id->prod_id_hash[i]); + } + + strcpy(alias, "pcmcia:"); + ADD(alias, "m", id->match_flags & PCMCIA_DEV_ID_MATCH_MANF_ID, + id->manf_id); + ADD(alias, "c", id->match_flags & PCMCIA_DEV_ID_MATCH_CARD_ID, + id->card_id); + ADD(alias, "f", id->match_flags & PCMCIA_DEV_ID_MATCH_FUNC_ID, + id->func_id); + ADD(alias, "fn", id->match_flags & PCMCIA_DEV_ID_MATCH_FUNCTION, + id->function); + ADD(alias, "pfn", id->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO, + id->device_no); + ADD(alias, "pa", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID1, id->prod_id_hash[0]); + ADD(alias, "pb", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID2, id->prod_id_hash[1]); + ADD(alias, "pc", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID3, id->prod_id_hash[2]); + ADD(alias, "pd", id->match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID4, id->prod_id_hash[3]); + + return 1; +} + + + /* Ignore any prefix, eg. v850 prepends _ */ static inline int sym_is(const char *symbol, const char *name) { @@ -362,6 +398,9 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, else if (sym_is(symname, "__mod_pnp_card_device_table")) do_table(symval, sym->st_size, sizeof(struct pnp_card_device_id), do_pnp_card_entry, mod); + else if (sym_is(symname, "__mod_pcmcia_device_table")) + do_table(symval, sym->st_size, sizeof(struct pcmcia_device_id), + do_pcmcia_entry, mod); } /* Now add out buffered information to the generated C source */