From 25ae331e1251bd9562a10f53fdb2f054f7b21dfe Mon Sep 17 00:00:00 2001 From: andre Date: Mon, 3 May 2004 13:48:35 +0000 Subject: Link state change notification of ethernet media to the routing socket. o Extend the if_data structure with an ifi_link_state field and provide the corresponding defines for the valid states. o The mii_linkchg() callback updates the ifi_link_state field and calls rt_ifmsg() to notify listeners on the routing socket in addition to the kqueue KNOTE. o If vlans are configured on a physical interface notify and update all vlan pseudo devices as well with the vlan_link_state() callback. No objections by: sam, wpaul, ru, bms Brucification by: bde --- sys/net/if.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/net/if.h') diff --git a/sys/net/if.h b/sys/net/if.h index 625dfe0..2266fee 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -104,6 +104,7 @@ struct if_data { u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ u_char ifi_addrlen; /* media address length */ u_char ifi_hdrlen; /* media header length */ + u_char ifi_link_state; /* current link state */ u_char ifi_recvquota; /* polling quota for receive intrs */ u_char ifi_xmitquota; /* polling quota for xmit intrs */ u_long ifi_mtu; /* maximum transmission unit */ @@ -155,6 +156,13 @@ struct if_data { IFF_POLLING) /* + * Values for if_link_state. + */ +#define LINK_STATE_UNKNOWN 0 /* link invalid/unknown */ +#define LINK_STATE_DOWN 1 /* link is down */ +#define LINK_STATE_UP 2 /* link is up */ + +/* * Some convenience macros used for setting ifi_baudrate. * XXX 1000 vs. 1024? --thorpej@netbsd.org */ -- cgit v1.1