summaryrefslogtreecommitdiffstats
path: root/sys/net/if_atm.h
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_atm.h
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_atm.h')
-rw-r--r--sys/net/if_atm.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/sys/net/if_atm.h b/sys/net/if_atm.h
index 1ec3bd2..93fcf9f 100644
--- a/sys/net/if_atm.h
+++ b/sys/net/if_atm.h
@@ -261,6 +261,38 @@ struct atmllc {
(X)->type[1] = ((V) & 0xff); \
} while (0)
+/*
+ * Events that are emitted by the driver. Currently the only consumer
+ * of this is the netgraph node.
+ */
+#define ATMEV_FLOW_CONTROL 0x0001 /* channel busy state changed */
+#define ATMEV_IFSTATE_CHANGED 0x0002 /* up/down or carrier */
+#define ATMEV_VCC_CHANGED 0x0003 /* PVC deleted/create */
+#define ATMEV_ACR_CHANGED 0x0004 /* ABR ACR has changed */
+
+struct atmev_flow_control {
+ uint16_t vpi; /* channel that is changed */
+ uint16_t vci;
+ u_int busy : 1; /* != 0 -> ATM layer busy */
+};
+
+struct atmev_ifstate_changed {
+ u_int running : 1; /* interface is running now */
+ u_int carrier : 1; /* carrier detected (or not) */
+};
+
+struct atmev_vcc_changed {
+ uint16_t vpi; /* channel that is changed */
+ uint16_t vci;
+ u_int up : 1; /* 1 - created, 0 - deleted */
+};
+
+struct atmev_acr_changed {
+ uint16_t vpi; /* channel that is changed */
+ uint16_t vci;
+ uint32_t acr; /* new ACR */
+};
+
#ifdef _KERNEL
void atm_ifattach(struct ifnet *);
void atm_ifdetach(struct ifnet *);
@@ -270,4 +302,42 @@ int atm_output(struct ifnet *, struct mbuf *, struct sockaddr *,
struct rtentry *);
struct atmio_vcctable *atm_getvccs(struct atmio_vcc **, u_int, u_int,
struct mtx *, int);
+
+void atm_event(struct ifnet *, u_int, void *);
+
+#define ATMEV_SEND_FLOW_CONTROL(ATMIF, VPI, VCI, BUSY) \
+ do { \
+ struct atmev_flow_control _arg; \
+ _arg.vpi = (VPI); \
+ _arg.vci = (VCI); \
+ _arg.busy = (BUSY); \
+ atm_event(&(ATMIF)->ifnet, ATMEV_FLOW_CONTROL, &_arg); \
+ } while (0)
+
+#define ATMEV_SEND_VCC_CHANGED(ATMIF, VPI, VCI, UP) \
+ do { \
+ struct atmev_vcc_changed _arg; \
+ _arg.vpi = (VPI); \
+ _arg.vci = (VCI); \
+ _arg.up = (UP); \
+ atm_event(&(ATMIF)->ifnet, ATMEV_VCC_CHANGED, &_arg); \
+ } while (0)
+
+#define ATMEV_SEND_IFSTATE_CHANGED(ATMIF, CARRIER) \
+ do { \
+ struct atmev_ifstate_changed _arg; \
+ _arg.running = (((ATMIF)->ifnet.if_flags & \
+ IFF_RUNNING) != 0); \
+ _arg.carrier = ((CARRIER) != 0); \
+ atm_event(&(ATMIF)->ifnet, ATMEV_IFSTATE_CHANGED, &_arg); \
+ } while (0)
+
+#define ATMEV_SEND_ACR_CHANGED(ATMIF, VPI, VCI, ACR) \
+ do { \
+ struct atmev_acr_changed _arg; \
+ _arg.vpi = (VPI); \
+ _arg.vci = (VCI); \
+ _arg.acr= (ACR); \
+ atm_event(&(ATMIF)->ifnet, ATMEV_ACR_CHANGED, &_arg); \
+ } while (0)
#endif
OpenPOWER on IntegriCloud