From 2df0c5212aa6321492e2e4535dbb4e328e4490f9 Mon Sep 17 00:00:00 2001 From: Hartmut Brandt Date: Tue, 29 Jul 2003 14:07:19 +0000 Subject: [PATCH] Generate events for carrier state, PVC state changes and flow control changes. Still have to figure out, how to get at the ABR information. --- sys/dev/hatm/if_hatm.c | 6 ++++++ sys/dev/hatm/if_hatm_ioctl.c | 11 +++-------- sys/dev/hatm/if_hatm_tx.c | 12 ++++-------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/sys/dev/hatm/if_hatm.c b/sys/dev/hatm/if_hatm.c index 9af2b496569..d423ec4a6c6 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 633aee31b30..973f60dd3af 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 14c1e8a32b8..284cb9c7849 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); } }