/*
* Copyright (c) 2002 Valeriy E. Ushakov
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* TODO:
* . on OFW machines stdin is keyboard node, not 8042 node
* . on OBP machines 8042 node is faked by boot's prompatch
* and PROM's stdin points to zs keyboard (add prom patch?)
* . we probably want the stdout node to control whether
* console goes to serial
*/
isconsole = 1;
/*
* We can not choose the device class interrupt level freely,
* so we debounce via a softinterrupt.
*/
jsc->jsc_int_cookie = softint_establish(SOFTINT_SERIAL,
pckbcintr_soft, &jsc->jsc_pckbc);
if (jsc->jsc_int_cookie == NULL) {
aprint_error_dev(sc->sc_dv,
"unable to establish %s soft interrupt\n",
pckbc_slot_names[slot]);
return;
}
res = bus_intr_establish(sc->id->t_iot, jsc->jsc_intr,
IPL_SERIAL, jsc_pckbdintr, jsc);
if (res == NULL)
aprint_error_dev(sc->sc_dv,
"unable to establish %s slot interrupt\n",
pckbc_slot_names[slot]);
else
jsc->jsc_established = 1;
}
static int
jsc_pckbdintr(void *vsc)
{
struct pckbc_js_softc *jsc = vsc;
/*
* This interrupt is not shared on javastations, avoid "stray"
* warnings. XXX - why do "stray interrupt" warnings happen if
* we don't claim the interrupt always?
*/
return 1;
}
/*
* MD hook for use without MI wscons.
* Called by pckbc_cnattach().
*/
int
pckbport_machdep_cnattach(pckbport_tag_t constag, pckbport_slot_t slot)
{