summaryrefslogtreecommitdiffstats
path: root/sys/dev/hatm
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-07-29 14:07:19 +0000
committerharti <harti@FreeBSD.org>2003-07-29 14:07:19 +0000
commit8bbb21db05703efb147312fe9f540b4904eb5051 (patch)
treed8a9695244d697fd452cd82156a8f60e14d51526 /sys/dev/hatm
parent8d0166bd1fdfccea6334aff0b40004390f2e5bc8 (diff)
downloadFreeBSD-src-8bbb21db05703efb147312fe9f540b4904eb5051.zip
FreeBSD-src-8bbb21db05703efb147312fe9f540b4904eb5051.tar.gz
Generate events for carrier state, PVC state changes and flow control
changes. Still have to figure out, how to get at the ABR information.
Diffstat (limited to 'sys/dev/hatm')
-rw-r--r--sys/dev/hatm/if_hatm.c6
-rw-r--r--sys/dev/hatm/if_hatm_ioctl.c11
-rw-r--r--sys/dev/hatm/if_hatm_tx.c12
3 files changed, 13 insertions, 16 deletions
diff --git a/sys/dev/hatm/if_hatm.c b/sys/dev/hatm/if_hatm.c
index 9af2b49..d423ec4 100644
--- a/sys/dev/hatm/if_hatm.c
+++ b/sys/dev/hatm/if_hatm.c
@@ -2230,6 +2230,9 @@ hatm_initialize(struct hatm_softc *sc)
sc->ifatm.ifnet.if_baudrate = 53 * 8 * sc->ifatm.mib.pcr;
sc->utopia.flags &= ~UTP_FL_POLL_CARRIER;
+
+ ATMEV_SEND_IFSTATE_CHANGED(&sc->ifatm,
+ sc->utopia.carrier == UTP_CARR_OK);
}
/*
@@ -2250,6 +2253,9 @@ hatm_stop(struct hatm_softc *sc)
return;
sc->ifatm.ifnet.if_flags &= ~IFF_RUNNING;
+ ATMEV_SEND_IFSTATE_CHANGED(&sc->ifatm,
+ sc->utopia.carrier == UTP_CARR_OK);
+
sc->utopia.flags |= UTP_FL_POLL_CARRIER;
/*
diff --git a/sys/dev/hatm/if_hatm_ioctl.c b/sys/dev/hatm/if_hatm_ioctl.c
index 633aee3..973f60d 100644
--- a/sys/dev/hatm/if_hatm_ioctl.c
+++ b/sys/dev/hatm/if_hatm_ioctl.c
@@ -217,13 +217,11 @@ hatm_open_vcc(struct hatm_softc *sc, struct atmio_openvcc *arg)
if (!(vcc->param.flags & ATMIO_FLAG_NORX))
hatm_rx_vcc_open(sc, cid);
-#ifdef notyet
/* inform management about non-NG and NG-PVCs */
if (!(vcc->param.flags & ATMIO_FLAG_NG) ||
(vcc->param.flags & ATMIO_FLAG_PVC))
- atm_message(&sc->ifatm.ifnet, ATM_MSG_VCC_CHANGED,
- (1 << 24) | (arg->param.vpi << 16) | arg->param.vci);
-#endif
+ ATMEV_SEND_VCC_CHANGED(&sc->ifatm, arg->param.vpi,
+ arg->param.vci, 1);
/* don't free below */
vcc = NULL;
@@ -280,13 +278,10 @@ hatm_vcc_closed(struct hatm_softc *sc, u_int cid)
{
struct hevcc *vcc = sc->vccs[cid];
-#ifdef notyet
/* inform management about non-NG and NG-PVCs */
if (!(vcc->param.flags & ATMIO_FLAG_NG) ||
(vcc->param.flags & ATMIO_FLAG_PVC))
- atm_message(&sc->ifatm.ifnet, ATM_MSG_VCC_CHANGED,
- (0 << 24) | (HE_VPI(cid) << 16) | HE_VCI(cid));
-#endif
+ ATMEV_SEND_VCC_CHANGED(&sc->ifatm, HE_VPI(cid), HE_VCI(cid), 0);
sc->open_vccs--;
uma_zfree(sc->vcc_zone, vcc);
diff --git a/sys/dev/hatm/if_hatm_tx.c b/sys/dev/hatm/if_hatm_tx.c
index 14c1e8a..284cb9c 100644
--- a/sys/dev/hatm/if_hatm_tx.c
+++ b/sys/dev/hatm/if_hatm_tx.c
@@ -251,10 +251,8 @@ hatm_load_txbuf(void *uarg, bus_dma_segment_t *segs, int nseg,
if (arg->vcc->ntpds + tpds_needed > arg->sc->max_tpd) {
arg->sc->istats.flow_closed++;
arg->vcc->vflags |= HE_VCC_FLOW_CTRL;
-#ifdef notyet
- atm_message(&arg->sc->ifatm.ifnet, ATM_MSG_FLOW_CONTROL,
- (1 << 24) | (arg->vpi << 16) | arg->vci);
-#endif
+ ATMEV_SEND_FLOW_CONTROL(&arg->sc->ifatm,
+ arg->vpi, arg->vci, 1);
arg->error = 1;
return;
}
@@ -486,10 +484,8 @@ hatm_tx_complete(struct hatm_softc *sc, struct tpd *tpd, uint32_t flags)
if ((vcc->vflags & HE_VCC_FLOW_CTRL) &&
vcc->ntpds <= HE_CONFIG_TPD_FLOW_ENB) {
vcc->vflags &= ~HE_VCC_FLOW_CTRL;
-#ifdef notyet
- atm_message(&sc->ifatm.ifnet, ATM_MSG_FLOW_CONTROL,
- (0 << 24) | (HE_VPI(tpd->cid) << 16) | HE_VCI(tpd->cid));
-#endif
+ ATMEV_SEND_FLOW_CONTROL(&sc->ifatm,
+ HE_VPI(tpd->cid), HE_VCI(tpd->cid), 0);
}
}
OpenPOWER on IntegriCloud