From e4107dcf007ab87384808259571f6f682ec87542 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Fri, 17 Jan 1997 23:54:45 +0000 Subject: This mega-merge brings Matt Thomas' 960801 FDDI driver (almost) up to -current. Thanks goes to Ulrike Nitzsche for giving me a chance to test this. Only the PCI driver is tested though. One final patch will follow in a separate commit. This is so that everything up to here can be dragged into 2.2, if we decide so. Reviewed by: joerg Submitted by: Matt Thomas --- sys/dev/pdq/if_fea.c | 35 ++++++++++------------------------- sys/dev/pdq/if_fpa.c | 23 +++++++++++------------ sys/dev/pdq/pdq.c | 7 ++++++- sys/dev/pdq/pdq_ifsubr.c | 11 +++++++---- 4 files changed, 34 insertions(+), 42 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/pdq/if_fea.c b/sys/dev/pdq/if_fea.c index 3c17bf66ac2e..05798e09d2ca 100644 --- a/sys/dev/pdq/if_fea.c +++ b/sys/dev/pdq/if_fea.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_fea.c,v 1.7 1996/07/31 21:38:44 thomas Exp $ + * $Id: if_fea.c,v 1.1.1.1 1997/01/17 23:19:49 joerg Exp $ */ /* @@ -39,9 +39,7 @@ #include #include #include -#if defined(__FreeBSD__) -#include -#elif defined(__bsdi__) || defined(__NetBSD__) +#if defined(__bsdi__) || defined(__NetBSD__) #include #endif @@ -176,7 +174,7 @@ pdq_eisa_devinit( } #if defined(__FreeBSD__) -static int pdq_eisa_shutdown(struct kern_devconf *kdc, int force); +static void pdq_eisa_shutdown(int howto, void *sc); static int pdq_eisa_probe(void); static int pdq_eisa_attach(struct eisa_device *ed); @@ -188,23 +186,13 @@ static struct eisa_driver pdq_eisa_driver = { DATA_SET(eisadriver_set, pdq_eisa_driver); -static struct kern_devconf kdc_pdq_eisa = { - 0, 0, 0, /* filled in by dev_attach */ - "fea", 0, { MDDT_EISA, 0, "net" }, - eisa_generic_externalize, 0, pdq_eisa_shutdown, EISA_EXTERNALLEN, - &kdc_eisa0, /* parent */ - 0, /* parentdata */ - DC_BUSY, /* host adapters are always ``in use'' */ - "DEC DEFEA EISA FDDI Controller", - DC_CLS_NETIF -}; static const char * pdq_eisa_match( eisa_id_t type) { if ((type >> 8) == 0x10a330) - return kdc_pdq_eisa.kdc_description; + return ("DEC DEFEA EISA FDDI Controller"); return NULL; } @@ -223,7 +211,7 @@ pdq_eisa_probe( pdq_eisa_subprobe(PDQ_BUS_EISA, iobase, &maddr, &msize, &irq); eisa_add_mspace(ed, maddr, msize, RESVADDR_NONE); eisa_add_intr(ed, irq); - eisa_registerdev(ed, &pdq_eisa_driver, &kdc_pdq_eisa); + eisa_registerdev(ed, &pdq_eisa_driver); } return count; } @@ -308,20 +296,17 @@ pdq_eisa_attach( bcopy((caddr_t) sc->sc_pdq->pdq_hwaddr.lanaddr_bytes, sc->sc_ac.ac_enaddr, 6); pdq_ifattach(sc, pdq_eisa_ifwatchdog); - - ed->kdc->kdc_state = DC_BUSY; /* host adapters always busy */ + at_shutdown(pdq_eisa_shutdown, (void *) sc, SHUTDOWN_POST_SYNC); return 0; } -static int +static void pdq_eisa_shutdown( - struct kern_devconf *kdc, - int force) + int howto, + void *sc) { - pdq_hwreset(PDQ_EISA_UNIT_TO_SOFTC(kdc->kdc_unit)->sc_pdq); - (void) dev_detach(kdc); - return 0; + pdq_hwreset(((pdq_softc_t *)sc)->sc_pdq); } #endif /* __FreeBSD__ */ diff --git a/sys/dev/pdq/if_fpa.c b/sys/dev/pdq/if_fpa.c index 40757ba8ceb3..4ea3abe331e3 100644 --- a/sys/dev/pdq/if_fpa.c +++ b/sys/dev/pdq/if_fpa.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: if_fpa.c,v 1.9 1996/07/31 21:38:44 thomas Exp $ + * $Id: if_fpa.c,v 1.1.1.1 1997/01/17 23:19:49 joerg Exp $ * */ @@ -40,9 +40,7 @@ #include #include #include -#if defined(__FreeBSD__) -#include -#elif defined(__bsdi__) || defined(__NetBSD__) +#if defined(__bsdi__) || defined(__NetBSD__) #include #endif @@ -161,6 +159,8 @@ pdq_pci_ifintr( #endif /* __FreeBSD && BSD */ #if defined(__FreeBSD__) +static void pdq_pci_shutdown(int, void *); + /* * This is the PCI configuration support. Since the PDQ is available * on both EISA and PCI boards, one must be careful in how defines the @@ -223,17 +223,16 @@ pdq_pci_attach( pdqs_pci[unit] = sc; pdq_ifattach(sc, pdq_pci_ifwatchdog); pci_map_int(config_id, pdq_pci_ifintr, (void*) sc, &net_imask); + at_shutdown(pdq_pci_shutdown, (void *) sc, SHUTDOWN_POST_SYNC); + } -static int +static void pdq_pci_shutdown( - struct kern_devconf *kdc, - int force) + int howto, + void *sc) { - if (kdc->kdc_unit < NFPA) - pdq_hwreset(PDQ_PCI_UNIT_TO_SOFTC(kdc->kdc_unit)->sc_pdq); - (void) dev_detach(kdc); - return 0; + pdq_hwreset(((pdq_softc_t *)sc)->sc_pdq); } static u_long pdq_pci_count; @@ -243,7 +242,7 @@ struct pci_device fpadevice = { pdq_pci_probe, pdq_pci_attach, &pdq_pci_count, - pdq_pci_shutdown, + NULL }; #ifdef DATA_SET diff --git a/sys/dev/pdq/pdq.c b/sys/dev/pdq/pdq.c index ad0b5a7e6088..e183726ba52f 100644 --- a/sys/dev/pdq/pdq.c +++ b/sys/dev/pdq/pdq.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pdq.c,v 1.28 1996/07/31 21:38:44 thomas Exp $ + * $Id: pdq.c,v 1.1.1.1 1997/01/17 23:19:48 joerg Exp $ * */ @@ -39,8 +39,13 @@ #define PDQ_HWSUPPORT /* for pdq.h */ +#if defined(__FreeBSD__) +#include +#include +#else #include "pdqvar.h" #include "pdqreg.h" +#endif #define PDQ_ROUNDUP(n, x) (((n) + ((x) - 1)) & ~((x) - 1)) #define PDQ_CMD_RX_ALIGNMENT 16 diff --git a/sys/dev/pdq/pdq_ifsubr.c b/sys/dev/pdq/pdq_ifsubr.c index 224e4e8e86d4..b6223fb90472 100644 --- a/sys/dev/pdq/pdq_ifsubr.c +++ b/sys/dev/pdq/pdq_ifsubr.c @@ -21,7 +21,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pdq_ifsubr.c,v 1.8 1996/07/31 21:38:44 thomas Exp $ + * $Id: pdq_ifsubr.c,v 1.1.1.1 1997/01/17 23:19:49 joerg Exp $ * */ @@ -41,9 +41,7 @@ #include #include #include -#if defined(__FreeBSD__) -#include -#elif defined(__bsdi__) || defined(__NetBSD__) +#if defined(__bsdi__) || defined(__NetBSD__) #include #endif @@ -84,8 +82,13 @@ #include #include +#if defined(__FreeBSD__) +#include +#include +#else #include "pdqvar.h" #include "pdqreg.h" +#endif #if defined(__bsdi__) && _BSDI_VERSION < 199506 /* XXX */ static void -- cgit v1.3