summaryrefslogtreecommitdiffstats
path: root/sys/net/if_atmsubr.c
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-07-29 13:04:52 +0000
committerharti <harti@FreeBSD.org>2003-07-29 13:04:52 +0000
commit324ea0e22ca12645e9e2724b13ec558a2d0cc063 (patch)
tree834d779d371a4c84697aab84b4ecee08fcdcf947 /sys/net/if_atmsubr.c
parent03e09c0e2d9c327f27848a56b682ade532e528e6 (diff)
downloadFreeBSD-src-324ea0e22ca12645e9e2724b13ec558a2d0cc063.zip
FreeBSD-src-324ea0e22ca12645e9e2724b13ec558a2d0cc063.tar.gz
Implement a mechanism by which ATM drivers can inform interested
parts of the system about certain kinds of events, like changes in the ABR rate, changes in the carrier state, PVC changes. The main consumers of these events are the harp(4) pseudo-driver and the ILMI daemon via ng_atm(4).
Diffstat (limited to 'sys/net/if_atmsubr.c')
-rw-r--r--sys/net/if_atmsubr.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/net/if_atmsubr.c b/sys/net/if_atmsubr.c
index 55393a7..02a463f 100644
--- a/sys/net/if_atmsubr.c
+++ b/sys/net/if_atmsubr.c
@@ -85,7 +85,7 @@ void (*ng_atm_input_p)(struct ifnet *, struct mbuf **,
struct atm_pseudohdr *, void *);
void (*ng_atm_input_orphan_p)(struct ifnet *, struct mbuf *,
struct atm_pseudohdr *, void *);
-void (*ng_atm_message_p)(struct ifnet *, u_int32_t, u_int32_t);
+void (*ng_atm_event_p)(struct ifnet *, uint32_t, void *);
/*
* Harp pseudo interface hooks
@@ -94,6 +94,7 @@ void (*atm_harp_input_p)(struct ifnet *ifp, struct mbuf **m,
struct atm_pseudohdr *ah, void *rxhand);
void (*atm_harp_attach_p)(struct ifnet *);
void (*atm_harp_detach_p)(struct ifnet *);
+void (*atm_harp_event_p)(struct ifnet *, uint32_t, void *);
SYSCTL_NODE(_hw, OID_AUTO, atm, CTLFLAG_RW, 0, "ATM hardware");
@@ -461,6 +462,19 @@ atm_getvccs(struct atmio_vcc **table, u_int size, u_int start,
return (vccs);
}
+/*
+ * Driver or channel state has changed. Inform whoever is interested
+ * in these events.
+ */
+void
+atm_event(struct ifnet *ifp, u_int event, void *arg)
+{
+ if (ng_atm_event_p != NULL)
+ (*ng_atm_event_p)(ifp, event, arg);
+ if (atm_harp_event_p != NULL)
+ (*atm_harp_event_p)(ifp, event, arg);
+}
+
static moduledata_t atm_mod = {
"atm",
NULL,
OpenPOWER on IntegriCloud