From 9435f0f0e18180735ef2cdcb77af913b197d332c Mon Sep 17 00:00:00 2001 From: yokota Date: Sun, 19 Mar 2000 03:25:13 +0000 Subject: - Properly keep track of I/O port resources. - Use bus_space_read/write() to access the ports. --- sys/dev/atkbdc/atkbd.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'sys/dev/atkbdc/atkbd.c') diff --git a/sys/dev/atkbdc/atkbd.c b/sys/dev/atkbdc/atkbd.c index 549dc43..186e894 100644 --- a/sys/dev/atkbdc/atkbd.c +++ b/sys/dev/atkbdc/atkbd.c @@ -36,6 +36,9 @@ #include #include +#include +#include + #ifdef __i386__ #include #include @@ -55,7 +58,7 @@ static timeout_t atkbd_timeout; int -atkbd_probe_unit(int unit, int port, int irq, int flags) +atkbd_probe_unit(int unit, int ctlr, int irq, int flags) { keyboard_switch_t *sw; int args[2]; @@ -65,7 +68,7 @@ atkbd_probe_unit(int unit, int port, int irq, int flags) if (sw == NULL) return ENXIO; - args[0] = port; + args[0] = ctlr; args[1] = irq; error = (*sw->probe)(unit, args, flags); if (error) @@ -74,7 +77,7 @@ atkbd_probe_unit(int unit, int port, int irq, int flags) } int -atkbd_attach_unit(int unit, keyboard_t **kbd, int port, int irq, int flags) +atkbd_attach_unit(int unit, keyboard_t **kbd, int ctlr, int irq, int flags) { keyboard_switch_t *sw; int args[2]; @@ -85,7 +88,7 @@ atkbd_attach_unit(int unit, keyboard_t **kbd, int port, int irq, int flags) return ENXIO; /* reset, initialize and enable the device */ - args[0] = port; + args[0] = ctlr; args[1] = irq; *kbd = NULL; error = (*sw->probe)(unit, args, flags); @@ -311,7 +314,7 @@ static int atkbd_probe(int unit, void *arg, int flags) { KBDC kbdc; - int *data = (int *)arg; + int *data = (int *)arg; /* data[0]: controller, data[1]: irq */ /* XXX */ if (unit == ATKBD_DEFAULT) { @@ -319,7 +322,7 @@ atkbd_probe(int unit, void *arg, int flags) return 0; } - kbdc = kbdc_open(data[0]); + kbdc = atkbdc_open(data[0]); if (kbdc == NULL) return ENXIO; if (probe_keyboard(kbdc, flags)) { @@ -340,7 +343,7 @@ atkbd_init(int unit, keyboard_t **kbdp, void *arg, int flags) fkeytab_t *fkeymap; int fkeymap_size; int delay[2]; - int *data = (int *)arg; + int *data = (int *)arg; /* data[0]: controller, data[1]: irq */ /* XXX */ if (unit == ATKBD_DEFAULT) { @@ -390,11 +393,11 @@ atkbd_init(int unit, keyboard_t **kbdp, void *arg, int flags) } if (!KBD_IS_PROBED(kbd)) { - state->kbdc = kbdc_open(data[0]); + state->kbdc = atkbdc_open(data[0]); if (state->kbdc == NULL) return ENXIO; kbd_init_struct(kbd, ATKBD_DRIVER_NAME, KB_OTHER, unit, flags, - data[0], IO_KBDSIZE); + 0, 0); bcopy(&key_map, keymap, sizeof(key_map)); bcopy(&accent_map, accmap, sizeof(accent_map)); bcopy(fkey_tab, fkeymap, -- cgit v1.1