modules.pnpmap output support
Hi Rusty,
The attached patch makes depmod to output modules.pnpmap file generated from the pnp device table.
The output format is not compatible with the old modules.isapnpmap. The new format shows the pnp id string (e.g. CTL0301) while the old format uses the hex numbers. I don't think it's worthy to keep the compatibility for this (since the new one is more intuitive), but it'd be easy to follow the old style.
ciao,
--
Takashi Iwai <[email protected]> ALSA Developer - www.alsa-project.org
depmod.c +1 -0
@@ -594,6 +594,7 @@ { "modules.usbmap", output_usb_table }, { "modules.ccwmap", output_ccw_table }, { "modules.ieee1394map", output_ieee1394_table }, + { "modules.pnpmap", output_pnp_table }, { "modules.alias", output_aliases }, { "modules.symbols", output_symbols }, };
depmod.h +4 -0
@@ -40,6 +40,10 @@void *ieee1394_table;unsigned int ccw_size;void *ccw_table; +unsigned int pnp_size; +void *pnp_table; +unsigned int pnp_card_size; +void *pnp_card_table;/* File contents and length. */ void *data;
moduleops_core.c +8 -0
@@ -179,6 +179,14 @@ module->ieee1394_size =PERBIT (IEEE1394_DEVICE_SIZE ); module->ieee1394_table =PERBIT (deref_sym)(module->data,"__mod_ieee1394_device_table" ); + + module->pnp_size =PERBIT (PNP_DEVICE_SIZE ); + module->pnp_table =PERBIT (deref_sym)(module->data, +"__mod_pnp_device_table" ); + + module->pnp_card_size =PERBIT (PNP_CARD_DEVICE_SIZE ); + module->pnp_card_table =PERBIT (deref_sym)(module->data, +"__mod_pnp_card_device_table" ); }struct module_ops PERBIT (mod_ops ) = {
tables.c +44 -0
47 lines not on this page · raw message
tables.h +15 -0
@@ -55,11 +55,26 @@#define CCW_DEVICE_SIZE32 (3 * 2 + 2 * 1 + 4)#define CCW_DEVICE_SIZE64 (3 * 2 + 2 * 1 + 8) +struct pnp_device_id { +char id[8 ];/* id string (always 8 letter) */ +}; +#define PNP_DEVICE_SIZE32 8 +#define PNP_DEVICE_SIZE64 8 + +struct pnp_card_device_id { +char id[8 ];/* id string (always 8 letter) */ +unsigned long driver_data;/* grrr... */ +char devid[8 ][8 ]; +}; +#define PNP_CARD_DEVICE_SIZE32 (8 + sizeof(long) + 8 * 8) +#define PNP_CARD_DEVICE_SIZE64 (8 + sizeof(long) + 8 * 8) +/* Functions provided by tables.c */ struct module ;void output_usb_table (struct module *modules,FILE *out);void output_ieee1394_table (struct module *modules,FILE *out);void output_pci_table (struct module *modules,FILE *out);void output_ccw_table (struct module *modules,FILE *out); +void output_pnp_table (struct module *modules,FILE *out);#endif /* MODINITTOOLS_TABLES_H */
In message <[email protected]> you write:
Quoted 1 line
Hi Rusty,
Hi Takashi!
Quoted 8 lines
The attached patch makes depmod to output modules.pnpmap file generated from the pnp device table.
The output format is not compatible with the old modules.isapnpmap. The new format shows the pnp id string (e.g. CTL0301) while the old format uses the hex numbers. I don't think it's worthy to keep the compatibility for this (since the new one is more intuitive), but it'd be easy to follow the old style.
That seems strange. If you don't worry about backwards compatibility, then the new scripts/file2alias.c approach is better, which generates aliases for each module (depmod then collects these into /lib/modules/uname -r/modules.alias for speed).
The tables generated by depmod are purely for backwards compatibility, although it does look like they will be required throughout 2.6 at this stage.
Does that clarify?
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
At Mon, 17 Nov 2003 14:46:16 +1100,
Quoted 20 lines · Rusty Russell
In message <[email protected]> you write:
Quoted 1 line
Hi Rusty,
Hi Takashi!
Quoted 8 lines
The attached patch makes depmod to output modules.pnpmap file generated from the pnp device table.
The output format is not compatible with the old modules.isapnpmap. The new format shows the pnp id string (e.g. CTL0301) while the old format uses the hex numbers. I don't think it's worthy to keep the compatibility for this (since the new one is more intuitive), but it'd be easy to follow the old style.
That seems strange. If you don't worry about backwards compatibility, then the new
scripts/file2alias.capproach is better, which generates aliases for each module (depmod then collects these into/lib/modules/uname -r/modules.alias for speed).
Quoted 5 lines
The tables generated by depmod are purely for backwards compatibility, although it does look like they will be required throughout 2.6 at this stage.
Does that clarify?
ah, ok, that makes sense.
but still, file2alias (as of test9) doesn't output the entries for pnp devices...
Takashi
In message <[email protected]> you write:
Quoted 2 lines
but still, file2alias (as of test9) doesn't output the entries for pnp devices...
Patch welcome. 8)
Thanks,
Rusty.
--
Anyone who quotes me in their sig is an idiot. -- Rusty Russell.