From ea20901db721ca9220f25e03b91471eb47739bbe Mon Sep 17 00:00:00 2001 From: Kazutaka YOKOTA Date: Sun, 19 Mar 2000 04:37:18 +0000 Subject: [PATCH] Missing pieces of the last commit ;-( --- sys/dev/atkbdc/atkbdc_isa.c | 43 +++++++++++++++++++++++++++--------- sys/dev/atkbdc/atkbdc_subr.c | 43 +++++++++++++++++++++++++++--------- sys/isa/atkbdc_isa.c | 43 +++++++++++++++++++++++++++--------- 3 files changed, 96 insertions(+), 33 deletions(-) diff --git a/sys/dev/atkbdc/atkbdc_isa.c b/sys/dev/atkbdc/atkbdc_isa.c index 1d64ce22674f..b5d5e0029481 100644 --- a/sys/dev/atkbdc/atkbdc_isa.c +++ b/sys/dev/atkbdc/atkbdc_isa.c @@ -48,8 +48,11 @@ MALLOC_DEFINE(M_ATKBDDEV, "atkbddev", "AT Keyboard device"); /* children */ typedef struct atkbdc_device { int flags; /* configuration flags */ - int port; /* port number (same as the controller's) */ int irq; /* ISA IRQ mask */ + u_int32_t vendorid; + u_int32_t serial; + u_int32_t logicalid; + u_int32_t compatid; } atkbdc_device_t; /* kbdc */ @@ -210,9 +213,9 @@ atkbdc_attach(device_t dev) /* * Add all devices configured to be attached to atkbdc0. */ - for (i = resource_query_string(-1, "at", "atkbdc0"); + for (i = resource_query_string(-1, "at", device_get_nameunit(dev)); i != -1; - i = resource_query_string(i, "at", "atkbdc0")) { + i = resource_query_string(i, "at", device_get_nameunit(dev))) { atkbdc_add_device(dev, resource_query_name(i), resource_query_unit(i)); } @@ -220,9 +223,9 @@ atkbdc_attach(device_t dev) /* * and atkbdc? */ - for (i = resource_query_string(-1, "at", "atkbdc"); + for (i = resource_query_string(-1, "at", device_get_name(dev)); i != -1; - i = resource_query_string(i, "at", "atkbdc")) { + i = resource_query_string(i, "at", device_get_name(dev))) { atkbdc_add_device(dev, resource_query_name(i), resource_query_unit(i)); } @@ -257,15 +260,24 @@ atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) ivar = (atkbdc_device_t *)device_get_ivars(dev); switch (index) { - case KBDC_IVAR_PORT: - *val = (u_long)ivar->port; - break; case KBDC_IVAR_IRQ: *val = (u_long)ivar->irq; break; case KBDC_IVAR_FLAGS: *val = (u_long)ivar->flags; break; + case KBDC_IVAR_VENDORID: + *val = (u_long)ivar->vendorid; + break; + case KBDC_IVAR_SERIAL: + *val = (u_long)ivar->serial; + break; + case KBDC_IVAR_LOGICALID: + *val = (u_long)ivar->logicalid; + break; + case KBDC_IVAR_COMPATID: + *val = (u_long)ivar->compatid; + break; default: return ENOENT; } @@ -279,15 +291,24 @@ atkbdc_write_ivar(device_t bus, device_t dev, int index, u_long val) ivar = (atkbdc_device_t *)device_get_ivars(dev); switch (index) { - case KBDC_IVAR_PORT: - ivar->port = (int)val; - break; case KBDC_IVAR_IRQ: ivar->irq = (int)val; break; case KBDC_IVAR_FLAGS: ivar->flags = (int)val; break; + case KBDC_IVAR_VENDORID: + ivar->vendorid = (u_int32_t)val; + break; + case KBDC_IVAR_SERIAL: + ivar->serial = (u_int32_t)val; + break; + case KBDC_IVAR_LOGICALID: + ivar->logicalid = (u_int32_t)val; + break; + case KBDC_IVAR_COMPATID: + ivar->compatid = (u_int32_t)val; + break; default: return ENOENT; } diff --git a/sys/dev/atkbdc/atkbdc_subr.c b/sys/dev/atkbdc/atkbdc_subr.c index 1d64ce22674f..b5d5e0029481 100644 --- a/sys/dev/atkbdc/atkbdc_subr.c +++ b/sys/dev/atkbdc/atkbdc_subr.c @@ -48,8 +48,11 @@ MALLOC_DEFINE(M_ATKBDDEV, "atkbddev", "AT Keyboard device"); /* children */ typedef struct atkbdc_device { int flags; /* configuration flags */ - int port; /* port number (same as the controller's) */ int irq; /* ISA IRQ mask */ + u_int32_t vendorid; + u_int32_t serial; + u_int32_t logicalid; + u_int32_t compatid; } atkbdc_device_t; /* kbdc */ @@ -210,9 +213,9 @@ atkbdc_attach(device_t dev) /* * Add all devices configured to be attached to atkbdc0. */ - for (i = resource_query_string(-1, "at", "atkbdc0"); + for (i = resource_query_string(-1, "at", device_get_nameunit(dev)); i != -1; - i = resource_query_string(i, "at", "atkbdc0")) { + i = resource_query_string(i, "at", device_get_nameunit(dev))) { atkbdc_add_device(dev, resource_query_name(i), resource_query_unit(i)); } @@ -220,9 +223,9 @@ atkbdc_attach(device_t dev) /* * and atkbdc? */ - for (i = resource_query_string(-1, "at", "atkbdc"); + for (i = resource_query_string(-1, "at", device_get_name(dev)); i != -1; - i = resource_query_string(i, "at", "atkbdc")) { + i = resource_query_string(i, "at", device_get_name(dev))) { atkbdc_add_device(dev, resource_query_name(i), resource_query_unit(i)); } @@ -257,15 +260,24 @@ atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) ivar = (atkbdc_device_t *)device_get_ivars(dev); switch (index) { - case KBDC_IVAR_PORT: - *val = (u_long)ivar->port; - break; case KBDC_IVAR_IRQ: *val = (u_long)ivar->irq; break; case KBDC_IVAR_FLAGS: *val = (u_long)ivar->flags; break; + case KBDC_IVAR_VENDORID: + *val = (u_long)ivar->vendorid; + break; + case KBDC_IVAR_SERIAL: + *val = (u_long)ivar->serial; + break; + case KBDC_IVAR_LOGICALID: + *val = (u_long)ivar->logicalid; + break; + case KBDC_IVAR_COMPATID: + *val = (u_long)ivar->compatid; + break; default: return ENOENT; } @@ -279,15 +291,24 @@ atkbdc_write_ivar(device_t bus, device_t dev, int index, u_long val) ivar = (atkbdc_device_t *)device_get_ivars(dev); switch (index) { - case KBDC_IVAR_PORT: - ivar->port = (int)val; - break; case KBDC_IVAR_IRQ: ivar->irq = (int)val; break; case KBDC_IVAR_FLAGS: ivar->flags = (int)val; break; + case KBDC_IVAR_VENDORID: + ivar->vendorid = (u_int32_t)val; + break; + case KBDC_IVAR_SERIAL: + ivar->serial = (u_int32_t)val; + break; + case KBDC_IVAR_LOGICALID: + ivar->logicalid = (u_int32_t)val; + break; + case KBDC_IVAR_COMPATID: + ivar->compatid = (u_int32_t)val; + break; default: return ENOENT; } diff --git a/sys/isa/atkbdc_isa.c b/sys/isa/atkbdc_isa.c index 1d64ce22674f..b5d5e0029481 100644 --- a/sys/isa/atkbdc_isa.c +++ b/sys/isa/atkbdc_isa.c @@ -48,8 +48,11 @@ MALLOC_DEFINE(M_ATKBDDEV, "atkbddev", "AT Keyboard device"); /* children */ typedef struct atkbdc_device { int flags; /* configuration flags */ - int port; /* port number (same as the controller's) */ int irq; /* ISA IRQ mask */ + u_int32_t vendorid; + u_int32_t serial; + u_int32_t logicalid; + u_int32_t compatid; } atkbdc_device_t; /* kbdc */ @@ -210,9 +213,9 @@ atkbdc_attach(device_t dev) /* * Add all devices configured to be attached to atkbdc0. */ - for (i = resource_query_string(-1, "at", "atkbdc0"); + for (i = resource_query_string(-1, "at", device_get_nameunit(dev)); i != -1; - i = resource_query_string(i, "at", "atkbdc0")) { + i = resource_query_string(i, "at", device_get_nameunit(dev))) { atkbdc_add_device(dev, resource_query_name(i), resource_query_unit(i)); } @@ -220,9 +223,9 @@ atkbdc_attach(device_t dev) /* * and atkbdc? */ - for (i = resource_query_string(-1, "at", "atkbdc"); + for (i = resource_query_string(-1, "at", device_get_name(dev)); i != -1; - i = resource_query_string(i, "at", "atkbdc")) { + i = resource_query_string(i, "at", device_get_name(dev))) { atkbdc_add_device(dev, resource_query_name(i), resource_query_unit(i)); } @@ -257,15 +260,24 @@ atkbdc_read_ivar(device_t bus, device_t dev, int index, u_long *val) ivar = (atkbdc_device_t *)device_get_ivars(dev); switch (index) { - case KBDC_IVAR_PORT: - *val = (u_long)ivar->port; - break; case KBDC_IVAR_IRQ: *val = (u_long)ivar->irq; break; case KBDC_IVAR_FLAGS: *val = (u_long)ivar->flags; break; + case KBDC_IVAR_VENDORID: + *val = (u_long)ivar->vendorid; + break; + case KBDC_IVAR_SERIAL: + *val = (u_long)ivar->serial; + break; + case KBDC_IVAR_LOGICALID: + *val = (u_long)ivar->logicalid; + break; + case KBDC_IVAR_COMPATID: + *val = (u_long)ivar->compatid; + break; default: return ENOENT; } @@ -279,15 +291,24 @@ atkbdc_write_ivar(device_t bus, device_t dev, int index, u_long val) ivar = (atkbdc_device_t *)device_get_ivars(dev); switch (index) { - case KBDC_IVAR_PORT: - ivar->port = (int)val; - break; case KBDC_IVAR_IRQ: ivar->irq = (int)val; break; case KBDC_IVAR_FLAGS: ivar->flags = (int)val; break; + case KBDC_IVAR_VENDORID: + ivar->vendorid = (u_int32_t)val; + break; + case KBDC_IVAR_SERIAL: + ivar->serial = (u_int32_t)val; + break; + case KBDC_IVAR_LOGICALID: + ivar->logicalid = (u_int32_t)val; + break; + case KBDC_IVAR_COMPATID: + ivar->compatid = (u_int32_t)val; + break; default: return ENOENT; }