summaryrefslogtreecommitdiff
path: root/sys/dev/hil
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-02-15 23:45:53 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-02-15 23:45:53 +0000
commitfceb24d4bbc1faaf0834b9c001f43fb4d98a9f44 (patch)
tree121388f5457e42dd7ddd8874cda67ace264e9520 /sys/dev/hil
parent6434bd21eaa615beaa194cf38016480670e6592f (diff)
Provide a "code" locator for hil devices. This will let people ask their
kernels to attach hilkbd0 (console keyboard) or hilms0 (main mouse) to a specific device in the loop, by using UKC or compiling a new kernel. Using this and the previous console changes, it is now possible on a loop with multiple keyboards, to choose which keyboard will be the console keyboard.
Diffstat (limited to 'sys/dev/hil')
-rw-r--r--sys/dev/hil/files.hil4
-rw-r--r--sys/dev/hil/hil.c20
2 files changed, 19 insertions, 5 deletions
diff --git a/sys/dev/hil/files.hil b/sys/dev/hil/files.hil
index c78f9155f77..36a48c9e8b2 100644
--- a/sys/dev/hil/files.hil
+++ b/sys/dev/hil/files.hil
@@ -1,9 +1,9 @@
-# $OpenBSD: files.hil,v 1.2 2003/02/12 01:43:31 miod Exp $
+# $OpenBSD: files.hil,v 1.3 2003/02/15 23:45:52 miod Exp $
#
# Configuration file for machine-independent HIL code.
#
-device hil { }
+device hil { code = -1 }
file dev/hil/hil.c hil needs-flag
device hilkbd: wskbddev
diff --git a/sys/dev/hil/hil.c b/sys/dev/hil/hil.c
index d8fbd8031bd..869ac0d56d8 100644
--- a/sys/dev/hil/hil.c
+++ b/sys/dev/hil/hil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hil.c,v 1.3 2003/02/15 23:42:48 miod Exp $ */
+/* $OpenBSD: hil.c,v 1.4 2003/02/15 23:45:52 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -95,7 +95,7 @@ struct cfdriver hil_cd = {
};
void hilconfig(struct hil_softc *);
-
+int hilsubmatch(struct device *, void *, void *);
void hil_process_int(struct hil_softc *, u_int8_t, u_int8_t);
void polloff(struct hil_softc *);
void pollon(struct hil_softc *);
@@ -161,6 +161,19 @@ hildevprint(void *aux, const char *pnp)
return (UNCONF);
}
+int
+hilsubmatch(struct device *parent, void *vcf, void *aux)
+{
+ struct hil_attach_args *ha = aux;
+ struct cfdata *cf = vcf;
+
+ if (cf->cf_loc[0] != -1 &&
+ cf->cf_loc[0] != ha->ha_code)
+ return (0);
+
+ return ((*cf->cf_attach->ca_match)(parent, vcf, aux));
+}
+
void
hil_attach_deferred(void *v)
{
@@ -251,7 +264,8 @@ hil_attach_deferred(void *v)
ha.ha_infolen = len;
bcopy(sc->sc_cmdbuf, ha.ha_info, len);
- config_found(&sc->sc_dev, &ha, hildevprint);
+ config_found_sm(&sc->sc_dev, &ha, hildevprint,
+ hilsubmatch);
}
}