From 909e313a8003a9d9281125f040dfe7f6d540d53c Mon Sep 17 00:00:00 2001 From: martin Date: Mon, 25 Mar 2002 14:44:46 +0000 Subject: [PATCH] Remove a leftover from the BRI registry at layer 2. Initialize layer 2's idea of it's BRI id after attaching. --- sys/dev/ic/isic.c | 10 +++++++--- sys/dev/pci/isic_pci_avm_fritz_pci.c | 9 ++++++--- sys/netisdn/i4b_l2.h | 5 ++--- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/sys/dev/ic/isic.c b/sys/dev/ic/isic.c index 6651e4db3e6a..78d9c03fa445 100644 --- a/sys/dev/ic/isic.c +++ b/sys/dev/ic/isic.c @@ -27,14 +27,14 @@ * i4b_isic.c - global isic stuff * ============================== * - * $Id: isic.c,v 1.5 2002/03/25 12:07:33 martin Exp $ + * $Id: isic.c,v 1.6 2002/03/25 14:44:46 martin Exp $ * * last edit-date: [Fri Jan 5 11:36:10 2001] * *---------------------------------------------------------------------------*/ #include -__KERNEL_RCSID(0, "$NetBSD: isic.c,v 1.5 2002/03/25 12:07:33 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic.c,v 1.6 2002/03/25 14:44:46 martin Exp $"); #include #include @@ -273,9 +273,13 @@ isic_recover(struct isic_softc *sc) int isic_attach_bri(struct isic_softc *sc, const char *cardname, const struct isdn_layer1_bri_driver *dchan_driver) { - sc->sc_l3token = isdn_attach_bri(sc->sc_dev.dv_xname, cardname, &sc->sc_l2, &isic_l3_driver); + struct isdn_l3_driver * drv; + + drv = isdn_attach_bri(sc->sc_dev.dv_xname, cardname, &sc->sc_l2, &isic_l3_driver); + sc->sc_l3token = drv; sc->sc_l2.driver = dchan_driver; sc->sc_l2.l1_token = sc; + sc->sc_l2.bri = drv->bri; isdn_layer2_status_ind(&sc->sc_l2, STI_ATTACH, 1); return 1; } diff --git a/sys/dev/pci/isic_pci_avm_fritz_pci.c b/sys/dev/pci/isic_pci_avm_fritz_pci.c index cf790c0e8e6b..92145c341a8f 100644 --- a/sys/dev/pci/isic_pci_avm_fritz_pci.c +++ b/sys/dev/pci/isic_pci_avm_fritz_pci.c @@ -35,14 +35,14 @@ * Fritz!Card PCI specific routines for isic driver * ------------------------------------------------ * - * $Id: isic_pci_avm_fritz_pci.c,v 1.7 2002/03/24 20:35:53 martin Exp $ + * $Id: isic_pci_avm_fritz_pci.c,v 1.8 2002/03/25 14:44:46 martin Exp $ * * last edit-date: [Fri Jan 5 11:38:58 2001] * *---------------------------------------------------------------------------*/ #include -__KERNEL_RCSID(0, "$NetBSD: isic_pci_avm_fritz_pci.c,v 1.7 2002/03/24 20:35:53 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: isic_pci_avm_fritz_pci.c,v 1.8 2002/03/25 14:44:46 martin Exp $"); #include "opt_isicpci.h" #ifdef ISICPCI_AVM_A1 @@ -804,6 +804,7 @@ void isic_attach_fritzPci(struct pci_isic_softc *psc, struct pci_attach_args *pa) { struct isic_softc *sc = &psc->sc_isic; + struct isdn_l3_drvier *drv; u_int v; /* setup io mappings */ @@ -936,10 +937,12 @@ isic_attach_fritzPci(struct pci_isic_softc *psc, struct pci_attach_args *pa) sc->sc_freeflag2 = 0; /* init higher protocol layers */ - sc->sc_l3token = isdn_attach_bri(sc->sc_dev.dv_xname, + drv = isdn_attach_bri(sc->sc_dev.dv_xname, "AVM Fritz!PCI", &sc->sc_l2, &ifpci_l3_driver); + sc->sc_l3token = drv; sc->sc_l2.driver = &isic_std_driver; sc->sc_l2.l1_token = sc; + sc->sc_l2.bri = drv->bri; isdn_layer2_status_ind(&sc->sc_l2, STI_ATTACH, 1); } diff --git a/sys/netisdn/i4b_l2.h b/sys/netisdn/i4b_l2.h index 07a5a8226ff4..bc8f3c4eef1b 100644 --- a/sys/netisdn/i4b_l2.h +++ b/sys/netisdn/i4b_l2.h @@ -1,4 +1,4 @@ -/* $NetBSD: i4b_l2.h,v 1.3 2002/03/24 20:35:58 martin Exp $ */ +/* $NetBSD: i4b_l2.h,v 1.4 2002/03/25 14:44:46 martin Exp $ */ /* * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved. @@ -29,7 +29,7 @@ * i4b_l2.h - ISDN layer 2 (Q.921) definitions * --------------------------------------------- * - * $Id: i4b_l2.h,v 1.3 2002/03/24 20:35:58 martin Exp $ + * $Id: i4b_l2.h,v 1.4 2002/03/25 14:44:46 martin Exp $ * * $FreeBSD$ * @@ -41,7 +41,6 @@ #define _I4B_L2_H_ typedef struct l2_softc { - SIMPLEQ_ENTRY(l2_softc) briq; const struct isdn_layer1_bri_driver * driver; void* l1_token; int bri;