// SPDX-License-Identifier: GPL-2.0 /* * /proc/bus/pnp interface for Plug and Play devices * * Written by David Hinds, dahinds@users.sourceforge.net * Modified by Thomas Hood * * The .../devices and .../<node> and .../boot/<node> files are * utilized by the lspnp and setpnp utilities, supplied with the * pcmcia-cs package. * http://pcmcia-cs.sourceforge.net * * The .../escd file is utilized by the lsescd utility written by * Gunther Mayer. * * The .../legacy_device_resources file is not used yet. * * The other files are human-readable.
*/
int pnpbios_interface_attach_device(struct pnp_bios_node *node)
{ char name[3];
sprintf(name, "%02x", node->handle);
if (!proc_pnp) return -EIO; if (!pnpbios_dont_use_current_config) {
proc_create_data(name, 0644, proc_pnp, &pnpbios_proc_ops,
(void *)(long)(node->handle));
}
if (!proc_pnp_boot) return -EIO; if (proc_create_data(name, 0644, proc_pnp_boot, &pnpbios_proc_ops,
(void *)(long)(node->handle + 0x100))) return 0; return -EIO;
}
/* * When this is called, pnpbios functions are assumed to * work and the pnpbios_dont_use_current_config flag * should already have been set to the appropriate value
*/ int __init pnpbios_proc_init(void)
{
proc_pnp = proc_mkdir("bus/pnp", NULL); if (!proc_pnp) return -EIO;
proc_pnp_boot = proc_mkdir("boot", proc_pnp); if (!proc_pnp_boot) return -EIO;
proc_create_single("devices", 0, proc_pnp, pnp_devices_proc_show);
proc_create_single("configuration_info", 0, proc_pnp,
pnpconfig_proc_show);
proc_create_single("escd_info", 0, proc_pnp, escd_info_proc_show);
proc_create_single("escd", S_IRUSR, proc_pnp, escd_proc_show);
proc_create_single("legacy_device_resources", 0, proc_pnp,
pnp_legacyres_proc_show); return 0;
}
void __exit pnpbios_proc_exit(void)
{ int i; char name[3];
if (!proc_pnp) return;
for (i = 0; i < 0xff; i++) {
sprintf(name, "%02x", i); if (!pnpbios_dont_use_current_config)
remove_proc_entry(name, proc_pnp);
remove_proc_entry(name, proc_pnp_boot);
}
remove_proc_entry("legacy_device_resources", proc_pnp);
remove_proc_entry("escd", proc_pnp);
remove_proc_entry("escd_info", proc_pnp);
remove_proc_entry("configuration_info", proc_pnp);
remove_proc_entry("devices", proc_pnp);
remove_proc_entry("boot", proc_pnp);
remove_proc_entry("bus/pnp", NULL);
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.