summaryrefslogtreecommitdiff
path: root/sys/dev/puc
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2006-07-31 11:06:37 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2006-07-31 11:06:37 +0000
commita16dbc750c4b285cb2735adb48fe6a70eda9e335 (patch)
tree7f6e8403646ec0915bd64005bbf88141086ae9a2 /sys/dev/puc
parentddc115564e2b438356fee3b26bba010e42273466 (diff)
puc@cardbus (only added (commented out) to whom has puc@pci enabled)
tested on puc@pci by fkr and meself on the cardbus. still needs a bit more work but generally works. deraadt@ ok and some input from miod@
Diffstat (limited to 'sys/dev/puc')
-rw-r--r--sys/dev/puc/com_puc.c33
-rw-r--r--sys/dev/puc/lpt_puc.c21
2 files changed, 39 insertions, 15 deletions
diff --git a/sys/dev/puc/com_puc.c b/sys/dev/puc/com_puc.c
index bf6c0078a01..fe4e98318b5 100644
--- a/sys/dev/puc/com_puc.c
+++ b/sys/dev/puc/com_puc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com_puc.c,v 1.12 2006/06/01 01:28:40 fkr Exp $ */
+/* $OpenBSD: com_puc.c,v 1.13 2006/07/31 11:06:36 mickey Exp $ */
/*
* Copyright (c) 1997 - 1999, Jason Downs. All rights reserved.
@@ -40,13 +40,11 @@
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/syslog.h>
-#include <sys/types.h>
#include <sys/device.h>
#include <machine/intr.h>
#include <machine/bus.h>
-#include <dev/pci/pcivar.h>
#include <dev/pci/pucvar.h>
#include "com.h"
@@ -67,16 +65,17 @@
int com_puc_match(struct device *, void *, void *);
void com_puc_attach(struct device *, struct device *, void *);
+int com_puc_detach(struct device *, int );
#if NCOM > 0
struct cfattach com_puc_ca = {
- sizeof(struct com_softc), com_puc_match, com_puc_attach
+ sizeof(struct com_softc), com_puc_match, com_puc_attach, com_puc_detach
};
#endif
#if NPCCOM > 0
struct cfattach pccom_puc_ca = {
- sizeof(struct com_softc), com_puc_match, com_puc_attach
+ sizeof(struct com_softc), com_puc_match, com_puc_attach, com_puc_detach
};
#endif
@@ -103,10 +102,9 @@ com_puc_attach(parent, self, aux)
const char *intrstr;
/* Grab a PCI interrupt. */
- intrstr = pci_intr_string(pa->pc, pa->intrhandle);
- sc->sc_ih = pci_intr_establish(pa->pc, pa->intrhandle,
- IPL_TTY, comintr, sc,
- sc->sc_dev.dv_xname);
+ intrstr = pa->intr_string(pa);
+ sc->sc_ih = pa->intr_establish(pa, IPL_TTY, comintr, sc,
+ sc->sc_dev.dv_xname);
if (sc->sc_ih == NULL) {
printf(": couldn't establish interrupt");
if (intrstr != NULL)
@@ -123,9 +121,26 @@ com_puc_attach(parent, self, aux)
if (pa->flags)
sc->sc_frequency = pa->flags & PUC_COM_CLOCKMASK;
+printf(" %x ", pa->hwtype);
+ if (pa->hwtype)
+ sc->sc_uarttype = pa->hwtype;
sc->sc_hwflags = 0;
sc->sc_swflags = 0;
com_attach_subr(sc);
}
+
+int
+com_puc_detach(struct device *self, int flags)
+{
+ /* struct com_softc *sc = (void *)self; */
+ int error;
+
+ if ((error = com_detach(self, flags)) != 0)
+ return (error);
+
+ /* cardbus_intr_disestablish(psc->sc_cc, psc->sc_cf, csc->cc_ih); */
+
+ return (0);
+}
diff --git a/sys/dev/puc/lpt_puc.c b/sys/dev/puc/lpt_puc.c
index 4f375d3c513..9b8d8576ee1 100644
--- a/sys/dev/puc/lpt_puc.c
+++ b/sys/dev/puc/lpt_puc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpt_puc.c,v 1.3 2002/03/14 01:27:01 millert Exp $ */
+/* $OpenBSD: lpt_puc.c,v 1.4 2006/07/31 11:06:36 mickey Exp $ */
/* $NetBSD: lpt_puc.c,v 1.1 1998/06/26 18:52:41 cgd Exp $ */
/*
@@ -45,16 +45,16 @@
#include <machine/bus.h>
-#include <dev/pci/pcivar.h>
#include <dev/pci/pucvar.h>
#include <dev/ic/lptreg.h>
#include <dev/ic/lptvar.h>
int lpt_puc_probe(struct device *, void *, void *);
void lpt_puc_attach(struct device *, struct device *, void *);
+int lpt_puc_detach(struct device *, int);
struct cfattach lpt_puc_ca = {
- sizeof(struct lpt_softc), lpt_puc_probe, lpt_puc_attach
+ sizeof(struct lpt_softc), lpt_puc_probe, lpt_puc_attach, lpt_puc_detach
};
int
@@ -85,9 +85,9 @@ lpt_puc_attach(parent, self, aux)
sc->sc_iot = aa->t;
sc->sc_ioh = aa->h;
- intrstr = pci_intr_string(aa->pc, aa->intrhandle);
- sc->sc_ih = pci_intr_establish(aa->pc, aa->intrhandle, IPL_TTY,
- lptintr, sc, sc->sc_dev.dv_xname);
+ intrstr = aa->intr_string(aa);
+ sc->sc_ih = aa->intr_establish(aa, IPL_TTY, lptintr, sc,
+ sc->sc_dev.dv_xname);
if (sc->sc_ih == NULL) {
printf(": couldn't establish interrupt");
if (intrstr != NULL)
@@ -101,3 +101,12 @@ lpt_puc_attach(parent, self, aux)
lpt_attach_common(sc);
}
+
+int
+lpt_puc_detach(struct device *self, int flags)
+{
+
+ /* cardbus_intr_disestablish(psc->sc_cc, psc->sc_cf, csc->cc_ih); */
+
+ return (0);
+}