mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
Make open channels persist across ifconfig down and up. All channels
that are not currently closing when the interface is configured down will be brough up as soon as the interface is configured up.
This commit is contained in:
parent
7f325bba26
commit
46cf3cb76f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=118601
@ -211,6 +211,10 @@ patm_initialize(struct patm_softc *sc)
|
||||
IDT_CFG_TXUIE | IDT_CFG_TXSFI | IDT_CFG_PHYIE;
|
||||
patm_nor_write(sc, IDT_NOR_CFG, cfg);
|
||||
|
||||
for (i = 0; i < sc->mmap->max_conn; i++)
|
||||
if (sc->vccs[i] != NULL)
|
||||
patm_load_vc(sc, sc->vccs[i], 1);
|
||||
|
||||
ATMEV_SEND_IFSTATE_CHANGED(&sc->ifatm,
|
||||
sc->utopia.carrier == UTP_CARR_OK);
|
||||
}
|
||||
@ -284,17 +288,21 @@ patm_stop(struct patm_softc *sc)
|
||||
/* freeing partial receive chains and reset vcc state */
|
||||
for (i = 0; i < sc->mmap->max_conn; i++) {
|
||||
if (sc->vccs[i] != NULL) {
|
||||
if (sc->vccs[i]->chain != NULL)
|
||||
if (sc->vccs[i]->chain != NULL) {
|
||||
m_freem(sc->vccs[i]->chain);
|
||||
sc->vccs[i]->chain = NULL;
|
||||
sc->vccs[i]->last = NULL;
|
||||
}
|
||||
|
||||
if (sc->vccs[i]->vcc.flags & ATMIO_FLAG_NG) {
|
||||
if (sc->vccs[i]->vflags & (PATM_VCC_RX_CLOSING |
|
||||
PATM_VCC_TX_CLOSING)) {
|
||||
uma_zfree(sc->vcc_zone, sc->vccs[i]);
|
||||
sc->vccs[i] = NULL;
|
||||
} else {
|
||||
/* keep HARP and NG */
|
||||
sc->vccs[i]->chain = NULL;
|
||||
sc->vccs[i]->last = NULL;
|
||||
sc->vccs[i]->vflags = 0;
|
||||
/* keep */
|
||||
sc->vccs[i]->vflags &= ~PATM_VCC_OPEN;
|
||||
sc->vccs[i]->cps = 0;
|
||||
sc->vccs[i]->scd = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -171,24 +171,10 @@ patm_open_vcc(struct patm_softc *sc, struct atmio_openvcc *arg)
|
||||
|
||||
/* ok - go ahead */
|
||||
sc->vccs[cid] = vcc;
|
||||
|
||||
patm_debug(sc, VCC, "Open VCC: opening");
|
||||
if (!(vcc->vcc.flags & ATMIO_FLAG_NOTX))
|
||||
patm_tx_vcc_open(sc, vcc);
|
||||
if (!(vcc->vcc.flags & ATMIO_FLAG_NORX))
|
||||
patm_rx_vcc_open(sc, vcc);
|
||||
|
||||
/* inform management about non-NG and NG-PVCs */
|
||||
if (!(vcc->vcc.flags & ATMIO_FLAG_NG) ||
|
||||
(vcc->vcc.flags & ATMIO_FLAG_PVC))
|
||||
ATMEV_SEND_VCC_CHANGED(&sc->ifatm, vcc->vcc.vpi,
|
||||
vcc->vcc.vci, 1);
|
||||
|
||||
patm_debug(sc, VCC, "Open VCC: now open");
|
||||
patm_load_vc(sc, vcc, 0);
|
||||
|
||||
/* don't free below */
|
||||
vcc = NULL;
|
||||
|
||||
sc->vccs_open++;
|
||||
|
||||
/* done */
|
||||
@ -199,6 +185,27 @@ patm_open_vcc(struct patm_softc *sc, struct atmio_openvcc *arg)
|
||||
return (error);
|
||||
}
|
||||
|
||||
void
|
||||
patm_load_vc(struct patm_softc *sc, struct patm_vcc *vcc, int reload)
|
||||
{
|
||||
|
||||
patm_debug(sc, VCC, "Open VCC: opening");
|
||||
if (!(vcc->vcc.flags & ATMIO_FLAG_NOTX))
|
||||
patm_tx_vcc_open(sc, vcc);
|
||||
if (!(vcc->vcc.flags & ATMIO_FLAG_NORX))
|
||||
patm_rx_vcc_open(sc, vcc);
|
||||
|
||||
if (!reload) {
|
||||
/* inform management about non-NG and NG-PVCs */
|
||||
if (!(vcc->vcc.flags & ATMIO_FLAG_NG) ||
|
||||
(vcc->vcc.flags & ATMIO_FLAG_PVC))
|
||||
ATMEV_SEND_VCC_CHANGED(&sc->ifatm, vcc->vcc.vpi,
|
||||
vcc->vcc.vci, 1);
|
||||
}
|
||||
|
||||
patm_debug(sc, VCC, "Open VCC: now open");
|
||||
}
|
||||
|
||||
/*
|
||||
* Try to close the given VCC
|
||||
*/
|
||||
|
@ -196,6 +196,7 @@ struct patm_vcc {
|
||||
uint32_t opackets; /* packets sent */
|
||||
uint64_t ibytes; /* bytes received */
|
||||
uint64_t obytes; /* bytes sent */
|
||||
|
||||
struct mbuf *chain; /* currently received chain */
|
||||
struct mbuf *last; /* end of chain */
|
||||
u_int cid; /* index */
|
||||
@ -382,6 +383,9 @@ void patm_intr(void *);
|
||||
/* check RSQ */
|
||||
void patm_intr_rsq(struct patm_softc *sc);
|
||||
|
||||
/* enable the vcc */
|
||||
void patm_load_vc(struct patm_softc *sc, struct patm_vcc *vcc, int reload);
|
||||
|
||||
/* close the given vcc for transmission */
|
||||
void patm_tx_vcc_close(struct patm_softc *, struct patm_vcc *);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user