Binary files linux-2.4.2-orig/Documentation/.Configure.help.swp and linux/Documentation/.Configure.help.swp differ diff -Nur linux-2.4.2-orig/Documentation/Configure.help linux/Documentation/Configure.help --- linux-2.4.2-orig/Documentation/Configure.help Tue Feb 27 20:30:40 2001 +++ linux/Documentation/Configure.help Thu Mar 8 22:11:25 2001 @@ -2650,6 +2650,23 @@ If unsure, say Y. +PNPBIOS support +CONFIG_PNPBIOS + The PNPBIOS as defined in "Plug and Play BIOS Specification Version 1.0A + May 5, 1994" is used in Linux to autodetect built-in mainboard resources + (e.g. parallel port resources). + + Other features (e.g. change resources, ESCD, event notification, Docking + station information, ISAPNP services) are not used. + + Note: ACPI is expected to supersede PNPBIOS some day, currently it + co-exists nicely. + + See latest pcmcia-cs (stand-alone package) for a nice "lspnp" tools, + or have a look at /proc/bus/pnp. + + If unsure, say Y. + Support for hot-pluggable devices CONFIG_HOTPLUG Say Y here if you want to plug devices into your computer while diff -Nur linux-2.4.2-orig/arch/i386/defconfig linux/arch/i386/defconfig --- linux-2.4.2-orig/arch/i386/defconfig Tue Feb 27 20:30:41 2001 +++ linux/arch/i386/defconfig Tue Mar 6 23:39:32 2001 @@ -108,6 +108,7 @@ # CONFIG_PNP=y CONFIG_ISAPNP=y +CONFIG_PNPBIOS=y # # Block devices diff -Nur linux-2.4.2-orig/drivers/acpi/Makefile linux/drivers/acpi/Makefile --- linux-2.4.2-orig/drivers/acpi/Makefile Tue Feb 27 20:30:33 2001 +++ linux/drivers/acpi/Makefile Sun Mar 11 21:39:28 2001 @@ -4,7 +4,7 @@ O_TARGET := acpi.o -export-objs := acpi_ksyms.o +export-objs := acpi_ksyms.o pnp_acpi.o export ACPI_CFLAGS ACPI_CFLAGS := -D_LINUX @@ -39,7 +39,7 @@ ifdef CONFIG_ACPI_KERNEL_CONFIG obj-$(CONFIG_ACPI) += acpiconf.o osconf.o else - obj-$(CONFIG_ACPI) += driver.o cmbatt.o cpu.o ec.o acpi_ksyms.o sys.o table.o power.o + obj-$(CONFIG_ACPI) += driver.o cmbatt.o cpu.o ec.o acpi_ksyms.o sys.o table.o power.o pnp_acpi.o endif include $(TOPDIR)/Rules.make diff -Nur linux-2.4.2-orig/drivers/acpi/driver.c linux/drivers/acpi/driver.c --- linux-2.4.2-orig/drivers/acpi/driver.c Tue Feb 27 20:30:43 2001 +++ linux/drivers/acpi/driver.c Sat Mar 3 20:38:49 2001 @@ -46,6 +46,8 @@ #define _COMPONENT OS_DEPENDENT MODULE_NAME ("driver") +int acpi_active=0; + struct acpi_run_entry { void (*callback)(void*); @@ -490,6 +492,8 @@ acpi_ec_init(); acpi_power_init(); + acpi_active=1; + /* * Non-intuitive: 0 means pwr and sleep are implemented using the fixed * feature model, so we install handlers. 1 means a control method @@ -588,6 +592,8 @@ pm_idle = NULL; pm_power_off = NULL; pm_active = 0; + + acpi_active = 0; } module_init(acpi_init); diff -Nur linux-2.4.2-orig/drivers/acpi/include/acglobal.h linux/drivers/acpi/include/acglobal.h --- linux-2.4.2-orig/drivers/acpi/include/acglobal.h Tue Feb 27 20:30:33 2001 +++ linux/drivers/acpi/include/acglobal.h Sat Mar 3 20:38:08 2001 @@ -39,6 +39,8 @@ #define ACPI_EXTERN extern #endif +extern int acpi_active; // is ACPI initialized and active ? + extern NATIVE_CHAR *msg_acpi_error_break; diff -Nur linux-2.4.2-orig/drivers/acpi/pnp_acpi.c linux/drivers/acpi/pnp_acpi.c --- linux-2.4.2-orig/drivers/acpi/pnp_acpi.c Thu Jan 1 01:00:00 1970 +++ linux/drivers/acpi/pnp_acpi.c Thu Mar 8 21:38:07 2001 @@ -0,0 +1,74 @@ +/* + * pnp_acpi.c - PnP Support for on-board devices + * + * Currently customized for parport_pc.c + * + */ + +#include +#include +#include +#include +#include "acpi.h" + + +static ACPI_STATUS found_pnp( ACPI_HANDLE handle, u32 level, void *ctx, void **value); + + +int acpi_register_driver( char *pnpid, void (*callback)(int iolo, int iohi, int irq, int dma)) +{ + if(acpi_active) + acpi_get_devices(pnpid, found_pnp, callback, NULL); + return 0; +} + + +static ACPI_STATUS +found_pnp( + ACPI_HANDLE handle, + u32 level, + void *ctx, + void **value) +{ + ACPI_BUFFER buf; + RESOURCE *res; + int iolo=-1, iohi=-1, irq=-1, dma=-1; + + buf.length = 0; + buf.pointer = NULL; + if (acpi_get_current_resources(handle, &buf) != AE_BUFFER_OVERFLOW) + return AE_OK; + + buf.pointer = kmalloc(buf.length, GFP_KERNEL); + if (!buf.pointer) + return AE_NO_MEMORY; + + if (!ACPI_SUCCESS(acpi_get_current_resources(handle, &buf))) { + kfree(buf.pointer); + return AE_OK; + } + + + res = (RESOURCE*) buf.pointer; + + while ( ((void *)res < buf.pointer + buf.length) && + res->length >0 ) { + if(res->id == 0) irq =res->data.irq.interrupts[0]; + if(res->id == 1) dma =res->data.dma.channels[0]; + if(res->id == 4) { + if(iolo==-1) + iolo= res->data.io.min_base_address; + else + iohi= res->data.io.min_base_address; + } + res = NEXT_RESOURCE(res); + } + + kfree(buf.pointer); + + (( void (*) (int ,int, int, int)) ctx)(iolo,iohi,irq,dma); + return 0; +} + +EXPORT_SYMBOL(acpi_register_driver); + diff -Nur linux-2.4.2-orig/drivers/char/serial.c linux/drivers/char/serial.c --- linux-2.4.2-orig/drivers/char/serial.c Tue Feb 27 20:30:44 2001 +++ linux/drivers/char/serial.c Tue Feb 27 21:17:55 2001 @@ -3845,7 +3845,6 @@ offset = board->first_uart_offset; /* Timedia/SUNIX uses a mixture of BARs and offsets */ - /* Ugh, this is ugly as all hell --- TYT */ if(dev->vendor == PCI_VENDOR_ID_TIMEDIA ) /* 0x1409 */ switch(idx) { case 0: base_idx=0; @@ -4175,12 +4174,17 @@ for (i=0; timedia_data[i].num; i++) { ids = timedia_data[i].ids; for (j=0; ids[j]; j++) { - if (pci_get_subvendor(dev) == ids[j]) { + if (pci_get_subdevice(dev) == ids[j]) { board->num_ports = timedia_data[i].num; + printk("serial: Timedia/Sunix/Exsys PCI with %d ports (%x:%x)\n", + board->num_ports, pci_get_subvendor(dev), + pci_get_subdevice(dev)); return 0; } } } + printk("serial: ignoring unknown Timedia/Sunix card (%x:%x)\n", + pci_get_subvendor(dev),pci_get_subdevice(dev)); return 0; } diff -Nur linux-2.4.2-orig/drivers/parport/parport_pc.c linux/drivers/parport/parport_pc.c --- linux-2.4.2-orig/drivers/parport/parport_pc.c Tue Feb 27 20:30:46 2001 +++ linux/drivers/parport/parport_pc.c Sun Mar 11 21:54:39 2001 @@ -60,6 +60,14 @@ #include #include +#ifdef CONFIG_ACPI +#include +#endif + +#if defined (CONFIG_PNPBIOS) || defined (CONFIG_PNPBIOS_MODULE) +#include +#endif + #define PARPORT_PC_MAX_PORTS PARPORT_MAX /* ECR modes */ @@ -1395,6 +1403,22 @@ } #endif /* CONFIG_PARPORT_PC_SUPERIO */ +static void __devinit set_superio_hint(int io,int irq,int dma) +{ int i=0; + + while((superios[i].io!= 0) && (idata, *lastp=NULL; + int mask,i; + *iolo=-1; + + while ( p < ((char *)node->data + node->size )) { + if(p==lastp) break; + if( p[0] & 0x80 ) {// large item + lastp = p+3; + p = p + p[1] + p[2]*256 + 3; + continue; + } + if ((p[0]>>3) == 0x0f) // end tag + break; + switch (p[0]>>3) { + case 0x04: // irq + mask= p[1] + p[2]*256; + for (i=0;i<16;i++, mask=mask>>1) + if(mask &0x01) *irq=i; + break; + case 0x05: // dma + mask = p[1]; + for (i=0;i<8;i++, mask = mask>>1) + if(mask&0x01) *dma=i; + break; + case 0x08: // io + if(*iolo == -1) + *iolo = p[2] + p[3] *256; + else + *iohi = p[2] + p[3] *256; + } + lastp=p+1; + p = p + (p[0] & 0x07) + 1; + + } +} + +void query_pnpbios(void) +{ struct pnp_bios_node *node; + int num, irq=-1, dma=-1, iolo=-1, iohi=-1; + struct pnp_dev_node_info node_info; + + if (!pnp_bios_present ()) + return; + + if (pnp_bios_dev_node_info(&node_info) != 0) + return; + + node = kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) + return ; + + for (num = 0; num != 0xff; ) { + pnp_bios_get_dev_node((u8 *)&num, (char )0 , node); + + // PNP0400 and PNP0401 compressed to 32bit as per spec + if(node->eisa_id == 0x0104d041 || node->eisa_id == 0x0004d041 ) { + pnp_raw_data_parse(node, &iolo,&iohi, &irq, &dma); + + printk("parport: PNPBIOS found PNP040%s: io=%04x,%04x irq=%d dma=%d\n", + node->eisa_id & 0x01000000 ? "1" :"0", + iolo, iohi, irq, dma); + set_superio_hint(iolo,irq,dma); + } + } + kfree(node); +} +#endif + +#ifdef CONFIG_ACPI +void pnp0400_found(int lo, int hi, int irq, int dma) +{ + printk("parport: ACPI found PNP0400: io=0x%04x irq=%d dma=No\n", + lo, irq ); + set_superio_hint(lo,irq,PARPORT_DMA_NONE); +} + +void pnp0401_found(int lo, int hi, int irq, int dma) +{ + printk("parport: ACPI found PNP0401: io=%04x,%04x irq=%d dma=%d\n", + lo, hi, irq, dma); + set_superio_hint(lo,irq,dma); +} + +#endif + /* This function is called by parport_pc_init if the user didn't * specify any ports to probe. Its job is to find some ports. Order * is important here -- we want ISA ports to be registered first, @@ -2596,6 +2708,16 @@ #ifdef CONFIG_PARPORT_PC_SUPERIO detect_and_report_winbond (); detect_and_report_smsc (); +#endif + +#if defined(CONFIG_PNPBIOS) || defined(CONFIG_PNPBIOS_MODULE) + query_pnpbios(); +#endif + +#ifdef CONFIG_ACPI + /* Ask ACPI */ + acpi_register_driver("PNP0400", &pnp0400_found); + acpi_register_driver("PNP0401", &pnp0401_found); #endif /* Onboard SuperIO chipsets that show themselves on the PCI bus. */ diff -Nur linux-2.4.2-orig/drivers/pnp/Config.in linux/drivers/pnp/Config.in --- linux-2.4.2-orig/drivers/pnp/Config.in Mon Oct 11 19:13:24 1999 +++ linux/drivers/pnp/Config.in Thu Mar 8 21:58:32 2001 @@ -8,4 +8,8 @@ dep_tristate ' ISA Plug and Play support' CONFIG_ISAPNP $CONFIG_PNP +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then +dep_tristate ' PNPBIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS $CONFIG_PNP +fi + endmenu diff -Nur linux-2.4.2-orig/drivers/pnp/Makefile linux/drivers/pnp/Makefile --- linux-2.4.2-orig/drivers/pnp/Makefile Fri Dec 29 23:07:22 2000 +++ linux/drivers/pnp/Makefile Thu Mar 8 21:16:27 2001 @@ -8,17 +8,24 @@ # Note 2! The CFLAGS definitions are now inherited from the # parent makes.. -O_TARGET := pnp.o +O_TARGET := pnp.o -export-objs := isapnp.o -multi-objs := isa-pnp.o +export-objs := isapnp.o pnp_bios.o +multi-objs := isa-pnp.o pnpbios.o proc-$(CONFIG_PROC_FS) = isapnp_proc.o isa-pnp-objs := isapnp.o quirks.o $(proc-y) +procpnp-$(CONFIG_PROC_FS) = pnp_proc.o +pnpbios-objs := pnp_bios.o $(procpnp-y) + obj-$(CONFIG_ISAPNP) += isa-pnp.o +obj-$(CONFIG_PNPBIOS) += pnpbios.o include $(TOPDIR)/Rules.make -isa-pnp.o: $(isa-pnp-objs) - $(LD) $(LD_RFLAG) -r -o $@ $(isa-pnp-objs) +isa-pnp.o: $(isa-pnp-objs) + $(LD) $(LD_RFLAG) -r -o $@ $(isa-pnp-objs) + +pnpbios.o: $(pnpbios-objs) + $(LD) $(LD_RFLAG) -r -o $@ $(pnpbios-objs) diff -Nur linux-2.4.2-orig/drivers/pnp/pnp_bios.c linux/drivers/pnp/pnp_bios.c --- linux-2.4.2-orig/drivers/pnp/pnp_bios.c Thu Jan 1 01:00:00 1970 +++ linux/drivers/pnp/pnp_bios.c Sun Mar 11 22:41:21 2001 @@ -0,0 +1,554 @@ +/* + * PnP bios services + * + * Originally (C) 1998 Christian Schmidt (chr.schmidt@tu-bs.de) + * Modifications (c) 1998 Tom Lees + * Minor reorganizations by David Hinds + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Reference: + * Compaq Computer Corporation, Phoenix Technologies Ltd., Intel + * Corporation. + * Plug and Play BIOS Specification, Version 1.0A, May 5, 1994 + * Plug and Play BIOS Clarification Paper, October 6, 1994 + * + */ + +//#include +#define __NO_VERSION__ +//#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* PnP bios signature: "$PnP" */ +#define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24)) + +#ifdef MODULE +static struct desc_struct *gdt; +#endif + +void pnp_proc_init(); + +#define USE_SPIN_LOCKS + +/* + * This is the standard structure used to identify the entry point + * to the Plug and Play bios + */ +#pragma pack(1) +union pnpbios { + struct { + u32 signature; /* "$PnP" */ + u8 version; /* in BCD */ + u8 length; /* length in bytes, currently 21h */ + u16 control; /* system capabilities */ + u8 checksum; /* all bytes must add up to 0 */ + + u32 eventflag; /* phys. address of the event flag */ + u16 rmoffset; /* real mode entry point */ + u16 rmcseg; + u16 pm16offset; /* 16 bit protected mode entry */ + u32 pm16cseg; + u32 deviceID; /* EISA encoded system ID or 0 */ + u16 rmdseg; /* real mode data segment */ + u32 pm16dseg; /* 16 bit pm data segment base */ + } fields; + char chars[0x21]; /* To calculate the checksum */ +}; +#pragma pack() + +/* + * Local Variables + */ +static struct { + u32 offset; + u16 segment; +} pnp_bios_callpoint; + +static union pnpbios * pnp_bios_inst_struc = NULL; + +/* The PnP entries in the GDT */ +#define PNP_GDT 0x0038 +#define PNP_CS32 (PNP_GDT+0x00) /* segment for calling fn */ +#define PNP_CS16 (PNP_GDT+0x08) /* code segment for bios */ +#define PNP_DS (PNP_GDT+0x10) /* data segment for bios */ +#define PNP_TS1 (PNP_GDT+0x18) /* transfer data segment */ +#define PNP_TS2 (PNP_GDT+0x20) /* another data segment */ + +static struct desc_struct saved_gdt[5]; +static struct desc_struct pnp_gdt[] = { + { 0, 0x00c09a00 }, /* 32-bit code */ + { 0, 0x00809a00 }, /* 16-bit code */ + { 0, 0x00809200 }, /* 16-bit data */ + { 0, 0x00809200 }, /* 16-bit data */ + { 0, 0x00809200 } /* 16-bit data */ +}; + +/* + * GDT abuse: since we want this to work when loaded as a module on a + * normal kernel, we drop the PnP GDT entries on top of the APM stuff + * and protect it with a spin lock ( + */ + +static long gdt_flags; +#ifdef USE_SPIN_LOCKS +static spinlock_t gdt_lock = SPIN_LOCK_UNLOCKED; +#endif + +static void push_pnp_gdt(void) +{ + spin_lock_irqsave(&gdt_lock, gdt_flags); + memcpy(saved_gdt, &gdt[PNP_GDT >> 3], sizeof(saved_gdt)); + memcpy(&gdt[PNP_GDT >> 3], pnp_gdt, sizeof(pnp_gdt)); +} + +static void pop_pnp_gdt(void) +{ + memcpy(pnp_gdt, &gdt[PNP_GDT >> 3], sizeof(pnp_gdt)); + memcpy(&gdt[PNP_GDT >> 3], saved_gdt, sizeof(saved_gdt)); + spin_unlock_irqrestore(&gdt_lock, gdt_flags); +} + +/* + * These are some opcodes for a "static asmlinkage" + * As this code is *not* executed inside the linux kernel segment, but in a + * alias at offset 0, we need a far return that can not be compiled by + * default (please, prove me wrong! this is *really* ugly!) + * This is the only way to get the bios to return into the kernel code, + * because the bios code runs in 16 bit protected mode and therefore can only + * return to the caller if the call is within the first 64kB, and the linux + * kernel begins at offset 1MB... + */ +static u8 pnp_bios_callfunc[] = +{ + 0x52, /* push edx */ + 0x51, /* push ecx */ + 0x53, /* push ebx */ + 0x50, /* push eax */ + 0x66, 0x9a, 0, 0, /* call far pnp_cs16:0, offset */ + (PNP_CS16) & 0xff, (PNP_CS16) >> 8, /* becomes fixed up later */ + 0x83, 0xc4, 0x10, /* add esp, 16 */ + 0xcb}; /* retf */ + +#define Q_SET_SEL(selname, address, size) \ +set_base (gdt [(selname) >> 3], __va((u32)(address))); \ +set_limit (gdt [(selname) >> 3], size) + +#define Q2_SET_SEL(selname, address, size) \ +set_base (gdt [(selname) >> 3], (u32)(address)); \ +set_limit (gdt [(selname) >> 3], size) + +/* + * Callable Functions + */ +#define PNP_GET_NUM_SYS_DEV_NODES 0x00 +#define PNP_GET_SYS_DEV_NODE 0x01 +#define PNP_SET_SYS_DEV_NODE 0x02 +#define PNP_GET_EVENT 0x03 +#define PNP_SEND_MESSAGE 0x04 +#define PNP_GET_DOCKING_STATION_INFORMATION 0x05 +#define PNP_SET_STATIC_ALLOCED_RES_INFO 0x09 +#define PNP_GET_STATIC_ALLOCED_RES_INFO 0x0a +#define PNP_GET_APM_ID_TABLE 0x0b +#define PNP_GET_PNP_ISA_CONFIG_STRUC 0x40 +#define PNP_GET_ESCD_INFO 0x41 +#define PNP_READ_ESCD 0x42 +#define PNP_WRITE_ESCD 0x43 + +/* + * Call pnp bios with function 0x00, "get number of system device nodes" + */ +int pnp_bios_dev_node_info(struct pnp_dev_node_info *data) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, data, sizeof(struct pnp_dev_node_info)); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_GET_NUM_SYS_DEV_NODES), + "b"((2 << 16) | PNP_TS1), + "c"((PNP_DS << 16) | PNP_TS1) + :"memory"); + data->no_nodes &= 0xff; + pop_pnp_gdt(); + return status; +} + +/* + * Call pnp bios with function 0x01, "get system device node" + * Input: *nodenum=desired node, + * static=1: config (dynamic) config, else boot (static) config, + * Output: *nodenum=next node or 0xff if no more nodes + */ +int pnp_bios_get_dev_node(u8 *nodenum, char config, struct pnp_bios_node *data) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, nodenum, sizeof(char)); + Q2_SET_SEL(PNP_TS2, data, 64 * 1024); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_GET_SYS_DEV_NODE), + "b"(PNP_TS1), + "c"(((config ? 1 : 2) <<16) | PNP_TS2), + "d"(PNP_DS) + :"memory"); + pop_pnp_gdt(); + return status; +} + +/* + * Call pnp bios with function 0x02, "set system device node" + * Input: nodenum=desired node, + * static=1: config (dynamic) config, else boot (static) config, + */ +int pnp_bios_set_dev_node(u8 nodenum, char config, struct pnp_bios_node *data) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, data, /* *((u16 *) data)*/ 65536); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(((u32) nodenum << 16) | PNP_SET_SYS_DEV_NODE), + "b"(PNP_TS1 << 16), + "c"((PNP_DS << 16) | (config ? 1 : 2)) + :"memory"); + pop_pnp_gdt(); + return status; +} + +/* + * Call pnp bios with function 0x03, "get event" + */ +#if needed +int pnp_bios_get_event(u16 *event) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, event, sizeof(u16)); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_GET_EVENT), + "b"((PNP_DS << 16) | PNP_TS1) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios with function 0x04, "send message" + */ +#if needed +int pnp_bios_send_message(u16 message) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(((u32) message << 16) | PNP_SEND_MESSAGE), + "b"(PNP_DS) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios with function 0x05, "get docking station information" + */ +#if needed +int pnp_bios_dock_station_info(struct pnp_docking_station_info *data) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, data, sizeof(struct pnp_docking_station_info)); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_GET_DOCKING_STATION_INFORMATION), + "b"((PNP_TS1 << 16) | PNP_DS) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios with function 0x09, "set statically allocated resource + * information" + */ +#if needed +int pnp_bios_set_stat_res(char *info) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, info, *((u16 *) info)); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_SET_STATIC_ALLOCED_RES_INFO), + "b"((PNP_TS1 << 16) | PNP_DS) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios with function 0x0a, "get statically allocated resource + * information" + */ +#if needed +int pnp_bios_get_stat_res(char *info) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, info, 64 * 1024); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_GET_STATIC_ALLOCED_RES_INFO), + "b"((PNP_TS1 << 16) | PNP_DS) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios with function 0x0b, "get APM id table" + */ +#if needed +int pnp_bios_apm_id_table(char *table, u16 *size) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, table, *size); + Q2_SET_SEL(PNP_TS2, size, sizeof(u16)); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_GET_APM_ID_TABLE), + "b"(PNP_TS2), + "c"((PNP_DS << 16) | PNP_TS1) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios with function 0x40, "get isa pnp configuration structure" + */ +#if needed +int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data) +{ + u16 status; + if (!pnp_bios_present ()) + return PNP_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, data, sizeof(struct pnp_isa_config_struc)); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_GET_PNP_ISA_CONFIG_STRUC), + "b"((PNP_DS << 16) | PNP_TS1) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios with function 0x41, "get ESCD info" + */ +#if needed +int pnp_bios_escd_info(struct escd_info_struc *data) +{ + u16 status; + if (!pnp_bios_present ()) + return ESCD_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, data, sizeof(struct escd_info_struc)); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_GET_ESCD_INFO), + "b"((2 << 16) | PNP_TS1), + "c"((4 << 16) | PNP_TS1), + "d"((PNP_DS << 16) | PNP_TS1) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios function 0x42, "read ESCD" + * nvram_base is determined by calling escd_info + */ +#if needed +int pnp_bios_read_escd(char *data, u32 nvram_base) +{ + u16 status; + if (!pnp_bios_present ()) + return ESCD_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, data, 64 * 1024); + set_base(gdt[PNP_TS2 >> 3], nvram_base); + set_limit(gdt[PNP_TS2 >> 3], 64 * 1024); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_READ_ESCD), + "b"((PNP_TS2 << 16) | PNP_TS1), + "c"(PNP_DS) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +/* + * Call pnp bios function 0x43, "write ESCD" + */ +#if needed +int pnp_bios_write_escd(char *data, u32 nvram_base) +{ + u16 status; + if (!pnp_bios_present ()) + return ESCD_FUNCTION_NOT_SUPPORTED; + push_pnp_gdt(); + Q2_SET_SEL(PNP_TS1, data, 64 * 1024); + set_base(gdt[PNP_TS2 >> 3], nvram_base); + set_limit(gdt[PNP_TS2 >> 3], 64 * 1024); + __asm__ __volatile__ + ("lcall %%cs:" SYMBOL_NAME_STR(pnp_bios_callpoint) "\n\t" + :"=a"(status) + :"a"(PNP_WRITE_ESCD), + "b"((PNP_TS2 << 16) | PNP_TS1), + "c"(PNP_DS) + :"memory"); + pop_pnp_gdt(); + return status; +} +#endif + +int pnp_bios_present(void) +{ + return (pnp_bios_inst_struc != NULL); +} + +/* + * Searches the defined area (0xf0000-0xffff0) for a valid PnP BIOS + * structure and, if found one, sets up the selectors and entry points + */ + +void pnp_bios_init(void) +{ + union pnpbios *check; + u8 sum; + int i, length; + +#ifdef MODULE + struct Xgt_desc_struct my_gdt_descr; + __asm__ __volatile__ ("sgdt %0" : : "m" (my_gdt_descr)); + gdt = (struct desc_struct *)my_gdt_descr.address; +#endif + + for (check = (union pnpbios *) __va(0xf0000); + check < (union pnpbios *) __va(0xffff0); + ((void *) (check)) += 16) { + if (check->fields.signature != PNP_SIGNATURE) + continue; + length = check->fields.length; + if (!length) + continue; + for (sum = 0, i = 0; i < length; i++) + sum += check->chars[i]; + if (sum) + continue; + if (check->fields.version < 0x10) { + printk(KERN_WARNING "PnP: unsupported version %d.%d", + check->fields.version >> 4, + check->fields.version & 15); + continue; + } + printk(KERN_INFO "PnP: PNP BIOS installation structure at 0x%p\n", + check); + printk(KERN_INFO "PnP: PNP BIOS version %d.%d, entry at %x:%x, dseg at %x\n", + check->fields.version >> 4, check->fields.version & 15, + check->fields.pm16cseg, check->fields.pm16offset, + check->fields.pm16dseg); + push_pnp_gdt(); + Q2_SET_SEL(PNP_CS32, &pnp_bios_callfunc, + sizeof(pnp_bios_callfunc)); + Q_SET_SEL(PNP_CS16, check->fields.pm16cseg, 64 * 1024); + Q_SET_SEL(PNP_DS, check->fields.pm16dseg, 64 * 1024); + pop_pnp_gdt(); + pnp_bios_callfunc[6] = check->fields.pm16offset & 0xff; + pnp_bios_callfunc[7] = check->fields.pm16offset >> 8; + pnp_bios_callpoint.offset = 0; + pnp_bios_callpoint.segment = PNP_CS32; + pnp_bios_inst_struc = check; + break; + } +} + +int init_module(void) +{ + pnp_bios_init(); + pnp_proc_init(); + return(0); +} + +EXPORT_SYMBOL(pnp_bios_get_dev_node); +EXPORT_SYMBOL(pnp_bios_present); +EXPORT_SYMBOL(pnp_bios_dev_node_info); diff -Nur linux-2.4.2-orig/drivers/pnp/pnp_proc.c linux/drivers/pnp/pnp_proc.c --- linux-2.4.2-orig/drivers/pnp/pnp_proc.c Thu Jan 1 01:00:00 1970 +++ linux/drivers/pnp/pnp_proc.c Wed Mar 7 00:18:55 2001 @@ -0,0 +1,142 @@ +/* + * pnp_proc.c: /proc/bus/pnp interface for Plug and Play devices + * + * Written by David Hinds, dahinds@users.sourceforge.net + */ + +//#include +#define __NO_VERSION__ +//#include + +#include +#include +#include +#include +#include +#include +#include + +static struct proc_dir_entry *proc_pnp = NULL; +static struct proc_dir_entry *proc_pnp_boot = NULL; +static struct pnp_dev_node_info node_info; + +static int proc_read_devices(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + struct pnp_bios_node *node; + u8 num; + char *p = buf; + + if (pos != 0) { + *eof = 1; + return 0; + } + node = kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) return -ENOMEM; + for (num = 0; num != 0xff; ) { + pnp_bios_get_dev_node(&num, 0, node); + p += sprintf(p, "%02x\t%08x\t%02x:%02x:%02x\t%04x\n", + node->handle, node->eisa_id, + node->type_code[0], node->type_code[1], + node->type_code[2], node->flags); + } + kfree(node); + return (p-buf); +} + +static int proc_read_node(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + struct pnp_bios_node *node; + int boot = (long)data >> 8; + u8 num = (long)data; + int len; + + if (pos != 0) { + *eof = 1; + return 0; + } + node = kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) return -ENOMEM; + pnp_bios_get_dev_node(&num, boot, node); + len = node->size - sizeof(struct pnp_bios_node); + memcpy(buf, node->data, len); + kfree(node); + return len; +} + +static int proc_write_node(struct file *file, const char *buf, + unsigned long count, void *data) +{ + struct pnp_bios_node *node; + int boot = (long)data >> 8; + u8 num = (long)data; + + node = kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) return -ENOMEM; + pnp_bios_get_dev_node(&num, boot, node); + if (count != node->size - sizeof(struct pnp_bios_node)) + return -EINVAL; + memcpy(node->data, buf, count); + if (pnp_bios_set_dev_node(node->handle, boot, node) != 0) + return -EINVAL; + kfree(node); + return count; +} + +void pnp_proc_init(void) +{ + struct pnp_bios_node *node; + struct proc_dir_entry *ent; + char name[3]; + u8 num; + + if (!pnp_bios_present()) return; + if (pnp_bios_dev_node_info(&node_info) != 0) + return; + + proc_pnp = proc_mkdir("pnp", proc_bus); + if (!proc_pnp) return; + proc_pnp_boot = proc_mkdir("boot", proc_pnp); + if (!proc_pnp_boot) return; + create_proc_read_entry("devices", 0, proc_pnp, + proc_read_devices, NULL); + + node = kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) return; + for (num = 0; num != 0xff; ) { + //sprintf(name, "%02x", num); + if (pnp_bios_get_dev_node(&num, 0, node) != 0) + break; + sprintf(name, "%02x", node->handle); + ent = create_proc_entry(name, 0, proc_pnp); + if (ent) { + ent->read_proc = proc_read_node; + ent->write_proc = proc_write_node; + ent->data = (void *)(long)(node->handle); + } + ent = create_proc_entry(name, 0, proc_pnp_boot); + if (ent) { + ent->read_proc = proc_read_node; + ent->write_proc = proc_write_node; + ent->data = (void *)(long)(node->handle+0x100); + } + } + kfree(node); +} + +void pnp_proc_done(void) +{ + u8 num; + char name[3]; + + if (!proc_pnp) return; + for (num = 0; num != 0xff; num++) { + sprintf(name, "%02x", num); + remove_proc_entry(name, proc_pnp); + remove_proc_entry(name, proc_pnp_boot); + } + remove_proc_entry("boot", proc_pnp); + remove_proc_entry("devices", proc_pnp); + remove_proc_entry("pnp", proc_bus); +} diff -Nur linux-2.4.2-orig/include/linux/acpi.h linux/include/linux/acpi.h --- linux-2.4.2-orig/include/linux/acpi.h Tue Feb 27 20:30:51 2001 +++ linux/include/linux/acpi.h Sun Mar 11 14:56:42 2001 @@ -160,4 +160,6 @@ #define ACPI_SLP_TYP_DISABLED (~0UL) +int acpi_register_driver(char *pnpid, void (*callback)(int iolo, int iohi, int irq, int dma)); + #endif /* _LINUX_ACPI_H */ diff -Nur linux-2.4.2-orig/include/linux/pnp_bios.h linux/include/linux/pnp_bios.h --- linux-2.4.2-orig/include/linux/pnp_bios.h Thu Jan 1 01:00:00 1970 +++ linux/include/linux/pnp_bios.h Tue Mar 6 23:31:30 2001 @@ -0,0 +1,127 @@ +/* + * Include file for the interface to a PnP BIOS + * + * Original BIOS code (C) 1998 Christian Schmidt (chr.schmidt@tu-bs.de) + * PnP handler parts (c) 1998 Tom Lees + * Minor reorganizations by David Hinds + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * $Original Id: pnp-bios.h,v 0.1 1998/03/19 23:00:00 cs Exp $ + * pnp_bios.h,v 1.1 1999/08/04 15:56:03 root Exp + */ + +#ifndef _LINUX_PNP_BIOS_H +#define _LINUX_PNP_BIOS_H + +/* + * Status codes (warnings and errors) + */ +#define PNP_SUCCESS 0x00 +#define PNP_NOT_SET_STATICALLY 0x7f +#define PNP_UNKNOWN_FUNCTION 0x81 +#define PNP_FUNCTION_NOT_SUPPORTED 0x82 +#define PNP_INVALID_HANDLE 0x83 +#define PNP_BAD_PARAMETER 0x84 +#define PNP_SET_FAILED 0x85 +#define PNP_EVENTS_NOT_PENDING 0x86 +#define PNP_SYSTEM_NOT_DOCKED 0x87 +#define PNP_NO_ISA_PNP_CARDS 0x88 +#define PNP_UNABLE_TO_DETERMINE_DOCK_CAPABILITIES 0x89 +#define PNP_CONFIG_CHANGE_FAILED_NO_BATTERY 0x8a +#define PNP_CONFIG_CHANGE_FAILED_RESOURCE_CONFLICT 0x8b +#define PNP_BUFFER_TOO_SMALL 0x8c +#define PNP_USE_ESCD_SUPPORT 0x8d +#define PNP_MESSAGE_NOT_SUPPORTED 0x8e +#define PNP_HARDWARE_ERROR 0x8f + +#define ESCD_SUCCESS 0x00 +#define ESCD_IO_ERROR_READING 0x55 +#define ESCD_INVALID 0x56 +#define ESCD_BUFFER_TOO_SMALL 0x59 +#define ESCD_NVRAM_TOO_SMALL 0x5a +#define ESCD_FUNCTION_NOT_SUPPORTED 0x81 + +/* + * Events that can be received by "get event" + */ +#define PNPEV_ABOUT_TO_CHANGE_CONFIG 0x0001 +#define PNPEV_DOCK_CHANGED 0x0002 +#define PNPEV_SYSTEM_DEVICE_CHANGED 0x0003 +#define PNPEV_CONFIG_CHANGED_FAILED 0x0004 +#define PNPEV_UNKNOWN_SYSTEM_EVENT 0xffff +/* 0x8000 through 0xfffe are OEM defined */ + +/* + * Messages that should be sent through "send message" + */ +#define PNPMSG_OK 0x00 +#define PNPMSG_ABORT 0x01 +#define PNPMSG_UNDOCK_DEFAULT_ACTION 0x40 +#define PNPMSG_POWER_OFF 0x41 +#define PNPMSG_PNP_OS_ACTIVE 0x42 +#define PNPMSG_PNP_OS_INACTIVE 0x43 +/* 0x8000 through 0xffff are OEM defined */ + +#pragma pack(1) +struct pnp_dev_node_info { + __u16 no_nodes; + __u16 max_node_size; +}; +struct pnp_docking_station_info { + __u32 location_id; + __u32 serial; + __u16 capabilities; +}; +struct pnp_isa_config_struc { + __u8 revision; + __u8 no_csns; + __u16 isa_rd_data_port; + __u16 reserved; +}; +struct escd_info_struc { + __u16 min_escd_write_size; + __u16 escd_size; + __u32 nv_storage_base; +}; +struct pnp_bios_node { + __u16 size; + __u8 handle; + __u32 eisa_id; + __u8 type_code[3]; + __u16 flags; + __u8 data[0]; +}; +#pragma pack() + +#ifdef __KERNEL__ +extern void pnp_bios_init (void); +extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data); +extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data); +extern int pnp_bios_set_dev_node (u8 nodenum, char config, struct pnp_bios_node *data); +extern int pnp_bios_get_event (u16 *message); +extern int pnp_bios_send_message (u16 message); +extern int pnp_bios_dock_station_info (struct pnp_docking_station_info *data); +extern int pnp_bios_set_stat_res (char *info); +extern int pnp_bios_get_stat_res (char *info); +extern int pnp_bios_apm_id_table (char *table, u16 *size); +extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data); +extern int pnp_bios_escd_info (struct escd_info_struc *data); +extern int pnp_bios_read_escd (char *data, u32 nvram_base); +extern int pnp_bios_write_escd (char *data, u32 nvram_base); +extern int pnp_bios_present (void); +#endif /* __KERNEL__ */ + +#endif /* _LINUX_PNP_BIOS_H */ diff -Nur linux-2.4.2-orig/include/linux/pnp_resource.h linux/include/linux/pnp_resource.h --- linux-2.4.2-orig/include/linux/pnp_resource.h Thu Jan 1 01:00:00 1970 +++ linux/include/linux/pnp_resource.h Tue Mar 6 23:31:30 2001 @@ -0,0 +1,148 @@ +#ifndef LINUX_PNP_RESOURCE +#define LINUX_PNP_RESOURCE + +/* ISA Plug and Play Resource Definitions */ + +#define PNP_RES_LARGE_ITEM 0x80 + +/* Small resource items */ +#define PNP_RES_SMTAG_VERSION 0x01 +#define PNP_RES_SMTAG_LDID 0x02 +#define PNP_RES_SMTAG_CDID 0x03 +#define PNP_RES_SMTAG_IRQ 0x04 +#define PNP_RES_SMTAG_DMA 0x05 +#define PNP_RES_SMTAG_DEP_START 0x06 +#define PNP_RES_SMTAG_DEP_END 0x07 +#define PNP_RES_SMTAG_IO 0x08 +#define PNP_RES_SMTAG_IO_FIXED 0x09 +#define PNP_RES_SMTAG_VENDOR 0x0e +#define PNP_RES_SMTAG_END 0x0f + +/* Large resource items */ +#define PNP_RES_LGTAG_MEM 0x01 +#define PNP_RES_LGTAG_ID_ANSI 0x02 +#define PNP_RES_LGTAG_ID_UNICODE 0x03 +#define PNP_RES_LGTAG_VENDOR 0x04 +#define PNP_RES_LGTAG_MEM32 0x05 +#define PNP_RES_LGTAG_MEM32_FIXED 0x06 + +/* Logical device ID flags */ +#define PNP_RES_LDID_BOOT 0x01 + +/* IRQ information */ +#define PNP_RES_IRQ_HIGH_EDGE 0x01 +#define PNP_RES_IRQ_LOW_EDGE 0x02 +#define PNP_RES_IRQ_HIGH_LEVEL 0x04 +#define PNP_RES_IRQ_LOW_LEVEL 0x08 + +/* DMA information */ +#define PNP_RES_DMA_WIDTH_MASK 0x03 +#define PNP_RES_DMA_WIDTH_8 0x00 +#define PNP_RES_DMA_WIDTH_8_16 0x01 +#define PNP_RES_DMA_WIDTH_16 0x02 +#define PNP_RES_DMA_BUSMASTER 0x04 +#define PNP_RES_DMA_COUNT_BYTE 0x08 +#define PNP_RES_DMA_COUNT_WORD 0x10 +#define PNP_RES_DMA_SPEED_MASK 0x60 +#define PNP_RES_DMA_SPEED_COMPAT 0x00 +#define PNP_RES_DMA_SPEED_TYPEA 0x20 +#define PNP_RES_DMA_SPEED_TYPEB 0x40 +#define PNP_RES_DMA_SPEED_TYPEF 0x60 + +/* Resource group priority */ +#define PNP_RES_CONFIG_GOOD 0x00 +#define PNP_RES_CONFIG_ACCEPTABLE 0x01 +#define PNP_RES_CONFIG_SUBOPTIMAL 0x02 + +/* IO information */ +#define PNP_RES_IO_DECODE_16 0x01 + +/* Memory information */ +#define PNP_RES_MEM_WRITEABLE 0x01 +#define PNP_RES_MEM_CACHEABLE 0x02 +#define PNP_RES_MEM_HIGH_ADDRESS 0x04 +#define PNP_RES_MEM_WIDTH_MASK 0x18 +#define PNP_RES_MEM_WIDTH_8 0x00 +#define PNP_RES_MEM_WIDTH_16 0x08 +#define PNP_RES_MEM_WIDTH_8_16 0x10 +#define PNP_RES_MEM_WIDTH_32 0x18 +#define PNP_RES_MEM_SHADOWABLE 0x20 +#define PNP_RES_MEM_EXPANSION_ROM 0x40 + +/* + note: multi-byte data types in these structures are little endian, + and have to be byte swapped before use on big endian platforms. +*/ + +#pragma pack(1) +union pnp_small_resource { + struct { + __u8 pnp, vendor; + } version; + struct { + __u32 id; + __u8 flag0, flag1; + } ldid; + struct { + __u32 id; + } gdid; + struct { + __u16 mask; + __u8 info; + } irq; + struct { + __u8 mask, info; + } dma; + struct { + __u8 priority; + } dep_start; + struct { + __u8 info; + __u16 min, max; + __u8 align, len; + } io; + struct { + __u16 base; + __u8 len; + } io_fixed; + struct { + __u8 checksum; + } end; +}; + +union pnp_large_resource { + struct { + __u8 info; + __u16 min, max, align, len; + } mem; + struct { + __u8 str[0]; + } ansi; + struct { + __u16 country; + __u8 str[0]; + } unicode; + struct { + __u8 info; + __u32 min, max, align, len; + } mem32; + struct { + __u8 info; + __u32 base, len; + } mem32_fixed; +}; + +union pnp_resource { + struct { + __u8 tag; + union pnp_small_resource d; + } sm; + struct { + __u8 tag; + __u16 sz; + union pnp_large_resource d; + } lg; +}; +#pragma pack() + +#endif /* LINUX_PNP_RESOURCE */ diff -Nur linux-2.4.2-orig/init/main.c linux/init/main.c --- linux-2.4.2-orig/init/main.c Thu Jan 4 05:45:26 2001 +++ linux/init/main.c Tue Mar 6 23:25:13 2001 @@ -59,6 +59,10 @@ #include #endif +#ifdef CONFIG_PNPBIOS +#include +#endif + #ifdef CONFIG_IRDA #include #endif @@ -705,6 +709,10 @@ #ifdef CONFIG_ISAPNP isapnp_init(); #endif +#ifdef CONFIG_PNPBIOS + pnp_bios_init(); +#endif + #ifdef CONFIG_TC tc_init(); #endif