20 #include <linux/module.h>
21 #include <linux/kernel.h>
22 #include <linux/slab.h>
23 #include <linux/types.h>
29 #include <asm/uaccess.h>
36 static int pnpconfig_proc_show(
struct seq_file *
m,
void *
v)
44 "ISA_read_data_port 0x%x\n",
45 pnps.revision, pnps.no_csns, pnps.isa_rd_data_port);
56 .open = pnpconfig_proc_open,
62 static int escd_info_proc_show(
struct seq_file *m,
void *v)
71 escd.min_escd_write_size,
72 escd.escd_size, escd.nv_storage_base);
83 .open = escd_info_proc_open,
89 #define MAX_SANE_ESCD_SIZE (32*1024)
90 static int escd_proc_show(
struct seq_file *m,
void *v)
102 "PnPBIOS: %s: ESCD size reported by BIOS escd_info call is too great\n", __func__);
116 (
unsigned char)(tmpbuf[0]) + (
unsigned char)(tmpbuf[1]) * 256;
121 " BIOS read_escd call is too great\n", __func__);
138 .open = escd_proc_open,
144 static int pnp_legacyres_proc_show(
struct seq_file *m,
void *v)
168 .open = pnp_legacyres_proc_open,
174 static int pnp_devices_proc_show(
struct seq_file *m,
void *v)
183 for (nodenum = 0; nodenum < 0xff;) {
184 u8 thisnodenum = nodenum;
188 seq_printf(m,
"%02x\t%08x\t%02x:%02x:%02x\t%04x\n",
192 if (nodenum <= thisnodenum) {
194 "%s Node number 0x%x is out of sequence following node 0x%x. Aborting.\n",
195 "PnPBIOS: proc_read_devices:",
196 (
unsigned int)nodenum,
197 (
unsigned int)thisnodenum);
212 .open = pnp_devices_proc_open,
218 static int pnpbios_proc_show(
struct seq_file *m,
void *v)
222 int boot = (
long)data >> 8;
241 return single_open(file, pnpbios_proc_show, PDE(inode)->data);
244 static ssize_t pnpbios_proc_write(
struct file *file,
const char __user *buf,
247 void *data = PDE(file->
f_path.dentry->d_inode)->data;
249 int boot = (
long)data >> 8;
280 .open = pnpbios_proc_open,
284 .write = pnpbios_proc_write,
297 (
void *)(
long)(node->
handle));
303 (
void *)(
long)(node->
handle + 0x100)))
321 proc_create(
"devices", 0, proc_pnp, &pnp_devices_proc_fops);
322 proc_create(
"configuration_info", 0, proc_pnp, &pnpconfig_proc_fops);
323 proc_create(
"escd_info", 0, proc_pnp, &escd_info_proc_fops);
324 proc_create(
"escd",
S_IRUSR, proc_pnp, &escd_proc_fops);
325 proc_create(
"legacy_device_resources", 0, proc_pnp, &pnp_legacyres_proc_fops);
338 for (i = 0; i < 0xff; i++) {