diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-07-04 18:44:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-07-04 18:44:54 +0000 |
commit | cb78fc5628eb65cc93dede84c3fc31caba6cbd8c (patch) | |
tree | c4a287f28e3281a59e84168a95ce78c04f1bda89 /sys/dev/cardbus/com_cardbus.c | |
parent | 3ed76de4177fb4807b6bd65aeb1555804c510d2a (diff) |
broadcom never ceases to amaze us. the fifos on their 16550a
serial chips are apparently 15 bytes not 16 bytes. reported to me by
the option driver author
Diffstat (limited to 'sys/dev/cardbus/com_cardbus.c')
-rw-r--r-- | sys/dev/cardbus/com_cardbus.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/sys/dev/cardbus/com_cardbus.c b/sys/dev/cardbus/com_cardbus.c index 07e9975303d..53fee276b92 100644 --- a/sys/dev/cardbus/com_cardbus.c +++ b/sys/dev/cardbus/com_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: com_cardbus.c,v 1.12 2005/06/29 18:22:49 deraadt Exp $ */ +/* $OpenBSD: com_cardbus.c,v 1.13 2005/07/04 18:44:53 deraadt Exp $ */ /* $NetBSD: com_cardbus.c,v 1.4 2000/04/17 09:21:59 joda Exp $ */ /* @@ -86,6 +86,7 @@ struct com_cardbus_softc { cardbustag_t cc_tag; cardbusreg_t cc_reg; int cc_type; + u_char cc_bug; }; #define DEVNAME(CSC) ((CSC)->cc_com.sc_dev.dv_xname) @@ -100,7 +101,7 @@ void com_cardbus_disable(struct com_softc *); struct csdev *com_cardbus_find_csdev(struct cardbus_attach_args *); int com_cardbus_gofigure(struct cardbus_attach_args *, struct com_cardbus_softc *); -void com_cardbus_attach2(struct com_softc *); +void com_cardbus_attach2(struct com_softc *, u_char); #if NCOM_CARDBUS struct cfattach com_cardbus_ca = { @@ -114,11 +115,14 @@ struct cfattach pccom_cardbus_ca = { }; #endif +#define BUG_BROADCOM 0x01 + static struct csdev { - int vendor; - int product; + u_short vendor; + u_short product; cardbusreg_t reg; - int type; + u_char type; + u_char bug; } csdevs[] = { { PCI_VENDOR_XIRCOM, PCI_PRODUCT_XIRCOM_MODEM56, CARDBUS_BASE0_REG, CARDBUS_MAPREG_TYPE_IO }, @@ -131,7 +135,7 @@ static struct csdev { { PCI_VENDOR_3COM, PCI_PRODUCT_3COM_GLOBALMODEM56, CARDBUS_BASE0_REG, CARDBUS_MAPREG_TYPE_IO }, { PCI_VENDOR_BROADCOM, PCI_PRODUCT_BROADCOM_SERIAL, - CARDBUS_BASE0_REG, CARDBUS_MAPREG_TYPE_IO } + CARDBUS_BASE0_REG, CARDBUS_MAPREG_TYPE_IO, BUG_BROADCOM } }; static const int ncsdevs = sizeof(csdevs) / sizeof(csdevs[0]); @@ -163,7 +167,7 @@ com_cardbus_match(struct device *parent, void *match, void *aux) (ca->ca_cis.funce.serial.uart_type == 0 || /* 8250 */ ca->ca_cis.funce.serial.uart_type == 1 || /* 16450 */ ca->ca_cis.funce.serial.uart_type == 2)) /* 16550 */ - return (1); + return (1); return (0); } @@ -181,6 +185,7 @@ com_cardbus_gofigure(struct cardbus_attach_args *ca, if (cp != NULL) { csc->cc_reg = cp->reg; csc->cc_type = cp->type; + csc->cc_bug = cp->bug; return (0); } @@ -285,7 +290,7 @@ com_cardbus_attach(struct device *parent, struct device *self, void *aux) if (com_cardbus_enable(sc)) printf(": function enable failed\n"); sc->enabled = 1; - com_cardbus_attach2(sc); + com_cardbus_attach2(sc, csc->cc_bug); } void @@ -383,8 +388,7 @@ com_cardbus_detach(struct device *self, int flags) * XXX This should be handled by a generic attach */ void -com_cardbus_attach2(sc) - struct com_softc *sc; +com_cardbus_attach2(struct com_softc *sc, u_char bug) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -492,6 +496,12 @@ com_cardbus_attach2(sc) printf("ns16550, no working fifo\n"); break; case COM_UART_16550A: + if (bug & BUG_BROADCOM) { + printf("Broadcom ns16550a, 15 byte fifo\n"); + SET(sc->sc_hwflags, COM_HW_FIFO); + sc->sc_fifolen = 15; + break; + } printf("ns16550a, 16 byte fifo\n"); SET(sc->sc_hwflags, COM_HW_FIFO); sc->sc_fifolen = 16; |