diff options
author | harti <harti@FreeBSD.org> | 2003-08-07 13:42:31 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2003-08-07 13:42:31 +0000 |
commit | c47985e350989a08effa9ee72e9aa7c100d8d407 (patch) | |
tree | a8d419fc85f7eea9fda691f985b5aa94c0b39423 /sys/dev/hatm/if_hatm_tx.c | |
parent | 136c4125667d7ca587662848cea09e5a072b12e5 (diff) | |
download | FreeBSD-src-c47985e350989a08effa9ee72e9aa7c100d8d407.zip FreeBSD-src-c47985e350989a08effa9ee72e9aa7c100d8d407.tar.gz |
Make the driver preserve open connections accross ifconfig down
and up commands. When configuring the interface down only the
connections that are currently closing are deleted from the connection
table. When the interface is configured up, all connections that
are in the table are re-opened.
Diffstat (limited to 'sys/dev/hatm/if_hatm_tx.c')
-rw-r--r-- | sys/dev/hatm/if_hatm_tx.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/dev/hatm/if_hatm_tx.c b/sys/dev/hatm/if_hatm_tx.c index 38903bd..5e915ee 100644 --- a/sys/dev/hatm/if_hatm_tx.c +++ b/sys/dev/hatm/if_hatm_tx.c @@ -577,9 +577,12 @@ hatm_tx_vcc_can_open(struct hatm_softc *sc, u_int cid, struct hevcc *vcc) if ((idx = free_idx) == HE_REGN_CS_STPER) return (EBUSY); sc->rate_ctrl[idx].rate = rc; - WRITE_MBOX4(sc, HE_REGO_CS_STPER(idx), rc); } vcc->rc = idx; + + /* commit */ + sc->rate_ctrl[idx].refcnt++; + sc->cbr_bw += t->pcr; break; case ATMIO_TRAFFIC_ABR: @@ -649,7 +652,10 @@ hatm_tx_vcc_open(struct hatm_softc *sc, u_int cid) case ATMIO_TRAFFIC_CBR: atmf = hatm_cps2atmf(t->pcr); - sc->rate_ctrl[vcc->rc].refcnt++; + + if (sc->rate_ctrl[vcc->rc].refcnt == 1) + WRITE_MBOX4(sc, HE_REGO_CS_STPER(vcc->rc), + sc->rate_ctrl[vcc->rc].rate); tsr0 |= HE_REGM_TSR0_TRAFFIC_CBR << HE_REGS_TSR0_TRAFFIC; tsr0 |= vcc->rc; @@ -670,7 +676,6 @@ hatm_tx_vcc_open(struct hatm_softc *sc, u_int cid) WRITE_TSR(sc, cid, 9, 0xf, HE_REGM_TSR9_INIT); WRITE_TSR(sc, cid, 0, 0xf, tsr0); - sc->cbr_bw += t->pcr; break; case ATMIO_TRAFFIC_ABR: |