From d117cb4e193498b16f279437b196dba68e3e8f00 Mon Sep 17 00:00:00 2001 From: Kazutaka YOKOTA Date: Sat, 15 Sep 2001 10:18:56 +0000 Subject: [PATCH] Handle "identifier strings" right. Each ISA PnP card must have a mandatory "card" identifier string. A logical devices on the ISA PnP card may optionally have a "device" identifier string. Do not confuse them. The "card" identifier string is assigned to a logical device as the default description string when the device is found. (If the "card" identifier string has not been found, use the EISA PnP ID string. Strictly speaking, this is an error.) We will override it when a "device" identifier string is found later. --- sys/isa/pnp.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/isa/pnp.c b/sys/isa/pnp.c index de376202250..bf7ca97d8cf 100644 --- a/sys/isa/pnp.c +++ b/sys/isa/pnp.c @@ -513,6 +513,15 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn, scanning -= large_len; if (PNP_LRES_NUM(tag) == PNP_TAG_ID_ANSI) { + if (dev) { + /* + * This is an optional device + * indentifier string. Skipt it + * for now. + */ + continue; + } + /* else mandately card identifier string */ if (large_len > sizeof(buf) - 1) large_len = sizeof(buf) - 1; bcopy(resinfo, buf, large_len); @@ -524,8 +533,6 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn, large_len--; buf[large_len] = '\0'; desc = buf; - if (dev) - device_set_desc_copy(dev, desc); continue; } @@ -565,6 +572,9 @@ pnp_create_devices(device_t parent, pnp_id *p, int csn, dev = BUS_ADD_CHILD(parent, ISA_ORDER_PNP, NULL, -1); if (desc) device_set_desc_copy(dev, desc); + else + device_set_desc_copy(dev, + pnp_eisaformat(logical_id)); isa_set_vendorid(dev, p->vendor_id); isa_set_serial(dev, p->serial); isa_set_logicalid(dev, logical_id);