Date: Sun, 2 Nov 2008 18:48:54 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184564 - in head/sys: i386/i386 isa Message-ID: <200811021848.mA2Ims7Y045601@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sun Nov 2 18:48:54 2008 New Revision: 184564 URL: http://svn.freebsd.org/changeset/base/184564 Log: MFp4: Make the ISA bus keep track of more PNP details. Plus a minor style fix while I'm here. More could be done here, but except for some SBCs that don't have ACPI, there's limited value to anybody in doing so. Modified: head/sys/i386/i386/bios.c head/sys/isa/isa_common.c head/sys/isa/isa_common.h head/sys/isa/isavar.h head/sys/isa/pnp.c Modified: head/sys/i386/i386/bios.c ============================================================================== --- head/sys/i386/i386/bios.c Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/i386/i386/bios.c Sun Nov 2 18:48:54 2008 (r184564) @@ -699,9 +699,10 @@ pnpbios_identify(driver_t *driver, devic (!(pd->attrib & PNPATTR_NOCONFIG) && PNPATTR_CONFIG(pd->attrib) != PNPATTR_CONFIG_STATIC) ? ISACFGATTR_DYNAMIC : 0); + isa_set_pnpbios_handle(dev, pd->handle); ISA_SET_CONFIG_CALLBACK(parent, dev, pnpbios_set_config, 0); pnp_parse_resources(dev, &pd->devdata[0], - pd->size - sizeof(struct pnp_sysdev), 0); + pd->size - sizeof(struct pnp_sysdev), 0); if (!device_get_desc(dev)) device_set_desc_copy(dev, pnp_eisaformat(pd->devid)); Modified: head/sys/isa/isa_common.c ============================================================================== --- head/sys/isa/isa_common.c Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/isa/isa_common.c Sun Nov 2 18:48:54 2008 (r184564) @@ -467,9 +467,6 @@ isa_assign_resources(device_t child) return (0); } -/* - * Called after other devices have initialised to probe for isa devices. - */ void isa_probe_children(device_t dev) { @@ -762,6 +759,18 @@ isa_read_ivar(device_t bus, device_t dev *result = idev->id_config_attr; break; + case ISA_IVAR_PNP_CSN: + *result = idev->id_pnp_csn; + break; + + case ISA_IVAR_PNP_LDN: + *result = idev->id_pnp_ldn; + break; + + case ISA_IVAR_PNPBIOS_HANDLE: + *result = idev->id_pnpbios_handle; + break; + default: return (ENOENT); } @@ -1026,6 +1035,13 @@ static int isa_child_location_str(device_t bus, device_t child, char *buf, size_t buflen) { +#if 0 + /* id_pnphandle isn't there yet */ + struct isa_device *idev = DEVTOISA(child); + + if (idev->id_vendorid) + snprintf(buf, buflen, "pnphandle=%d", idev->id_pnphandle); +#endif /* Nothing here yet */ *buf = '\0'; return (0); Modified: head/sys/isa/isa_common.h ============================================================================== --- head/sys/isa/isa_common.h Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/isa/isa_common.h Sun Nov 2 18:48:54 2008 (r184564) @@ -56,6 +56,9 @@ struct isa_device { isa_config_cb *id_config_cb; /* callback function */ void *id_config_arg; /* callback argument */ int id_config_attr; /* pnp config attributes */ + int id_pnpbios_handle; /* pnp handle, if any */ + int id_pnp_csn; /* pnp Card Number */ + int id_pnp_ldn; /* pnp Logical device on card */ }; #define DEVTOISA(dev) ((struct isa_device *) device_get_ivars(dev)) Modified: head/sys/isa/isavar.h ============================================================================== --- head/sys/isa/isavar.h Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/isa/isavar.h Sun Nov 2 18:48:54 2008 (r184564) @@ -48,7 +48,7 @@ typedef void isa_config_cb(void *arg, st #define ISA_ORDER_PNPBIOS 10 /* plug-and-play BIOS inflexible hardware */ #define ISA_ORDER_SENSITIVE 20 /* legacy sensitive hardware */ #define ISA_ORDER_SPECULATIVE 30 /* legacy non-sensitive hardware */ -#define ISA_ORDER_PNP 40 /* plug-and-play hardware */ +#define ISA_ORDER_PNP 40 /* plug-and-play flexible hardware */ /* * Limits on resources that we can manage @@ -125,7 +125,10 @@ enum isa_device_ivars { ISA_IVAR_SERIAL, ISA_IVAR_LOGICALID, ISA_IVAR_COMPATID, - ISA_IVAR_CONFIGATTR + ISA_IVAR_CONFIGATTR, + ISA_IVAR_PNP_CSN, + ISA_IVAR_PNP_LDN, + ISA_IVAR_PNPBIOS_HANDLE }; /* @@ -152,6 +155,9 @@ ISA_ACCESSOR(serial, SERIAL, int) ISA_ACCESSOR(logicalid, LOGICALID, int) ISA_ACCESSOR(compatid, COMPATID, int) ISA_ACCESSOR(configattr, CONFIGATTR, int) +ISA_ACCESSOR(pnp_csn, PNP_CSN, int) +ISA_ACCESSOR(pnp_ldn, PNP_LDN, int) +ISA_ACCESSOR(pnpbios_handle, PNPBIOS_HANDLE, int) /* Device class for ISA bridges. */ extern devclass_t isab_devclass; Modified: head/sys/isa/pnp.c ============================================================================== --- head/sys/isa/pnp.c Sun Nov 2 17:35:15 2008 (r184563) +++ head/sys/isa/pnp.c Sun Nov 2 18:48:54 2008 (r184564) @@ -522,6 +522,8 @@ pnp_create_devices(device_t parent, pnp_ csnldn->ldn = ldn; ISA_SET_CONFIG_CALLBACK(parent, dev, pnp_set_config, csnldn); + isa_set_pnp_csn(dev, csn); + isa_set_pnp_ldn(dev, ldn); ldn++; startres = resp; break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811021848.mA2Ims7Y045601>