Deleted Added
full compact
atkbdc.c (50477) atkbdc.c (56836)
1/*-
2 * Copyright (c) 1996-1999
3 * Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 13 unchanged lines hidden (view full) ---

22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
1/*-
2 * Copyright (c) 1996-1999
3 * Kazutaka YOKOTA (yokota@zodiac.mech.utsunomiya-u.ac.jp)
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 13 unchanged lines hidden (view full) ---

22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE.
29 *
30 * $FreeBSD: head/sys/dev/atkbdc/atkbdc.c 50477 1999-08-28 01:08:13Z peter $
30 * $FreeBSD: head/sys/dev/atkbdc/atkbdc.c 56836 2000-01-29 15:08:56Z peter $
31 * from kbdio.c,v 1.13 1998/09/25 11:55:46 yokota Exp
32 */
33
34#include "atkbdc.h"
35#include "opt_kbd.h"
36
37#include <sys/param.h>
38#include <sys/systm.h>

--- 4 unchanged lines hidden (view full) ---

43#include <machine/clock.h>
44
45#include <dev/kbd/atkbdcreg.h>
46
47#include <isa/isareg.h>
48
49/* constants */
50
31 * from kbdio.c,v 1.13 1998/09/25 11:55:46 yokota Exp
32 */
33
34#include "atkbdc.h"
35#include "opt_kbd.h"
36
37#include <sys/param.h>
38#include <sys/systm.h>

--- 4 unchanged lines hidden (view full) ---

43#include <machine/clock.h>
44
45#include <dev/kbd/atkbdcreg.h>
46
47#include <isa/isareg.h>
48
49/* constants */
50
51#define MAXKBDC MAX(NATKBDC, 1)
51#define MAXKBDC MAX(NATKBDC, 1) /* XXX */
52
53/* macros */
54
55#ifndef MAX
56#define MAX(x, y) ((x) > (y) ? (x) : (y))
57#endif
58
59#define kbdcp(p) ((atkbdc_softc_t *)(p))

--- 25 unchanged lines hidden (view full) ---

85static int removeq(kqueue *q);
86static int wait_while_controller_busy(atkbdc_softc_t *kbdc);
87static int wait_for_data(atkbdc_softc_t *kbdc);
88static int wait_for_kbd_data(atkbdc_softc_t *kbdc);
89static int wait_for_kbd_ack(atkbdc_softc_t *kbdc);
90static int wait_for_aux_data(atkbdc_softc_t *kbdc);
91static int wait_for_aux_ack(atkbdc_softc_t *kbdc);
92
52
53/* macros */
54
55#ifndef MAX
56#define MAX(x, y) ((x) > (y) ? (x) : (y))
57#endif
58
59#define kbdcp(p) ((atkbdc_softc_t *)(p))

--- 25 unchanged lines hidden (view full) ---

85static int removeq(kqueue *q);
86static int wait_while_controller_busy(atkbdc_softc_t *kbdc);
87static int wait_for_data(atkbdc_softc_t *kbdc);
88static int wait_for_kbd_data(atkbdc_softc_t *kbdc);
89static int wait_for_kbd_ack(atkbdc_softc_t *kbdc);
90static int wait_for_aux_data(atkbdc_softc_t *kbdc);
91static int wait_for_aux_ack(atkbdc_softc_t *kbdc);
92
93#if NATKBDC > 0
94
95atkbdc_softc_t
96*atkbdc_get_softc(int unit)
97{
98 atkbdc_softc_t *sc;
99
100 if (unit >= sizeof(atkbdc_softc)/sizeof(atkbdc_softc[0]))
101 return NULL;
102 sc = atkbdc_softc[unit];

--- 17 unchanged lines hidden (view full) ---

120}
121
122int
123atkbdc_attach_unit(int unit, atkbdc_softc_t *sc, int port)
124{
125 return atkbdc_setup(sc, port);
126}
127
93atkbdc_softc_t
94*atkbdc_get_softc(int unit)
95{
96 atkbdc_softc_t *sc;
97
98 if (unit >= sizeof(atkbdc_softc)/sizeof(atkbdc_softc[0]))
99 return NULL;
100 sc = atkbdc_softc[unit];

--- 17 unchanged lines hidden (view full) ---

118}
119
120int
121atkbdc_attach_unit(int unit, atkbdc_softc_t *sc, int port)
122{
123 return atkbdc_setup(sc, port);
124}
125
128#endif /* NATKBDC > 0 */
129
130/* the backdoor to the keyboard controller! XXX */
131int
132atkbdc_configure(void)
133{
134 return atkbdc_setup(atkbdc_softc[0], -1);
135}
136
137static int

--- 884 unchanged lines hidden ---
126/* the backdoor to the keyboard controller! XXX */
127int
128atkbdc_configure(void)
129{
130 return atkbdc_setup(atkbdc_softc[0], -1);
131}
132
133static int

--- 884 unchanged lines hidden ---