diff options
author | andre <andre@FreeBSD.org> | 2004-05-03 13:48:35 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2004-05-03 13:48:35 +0000 |
commit | 25ae331e1251bd9562a10f53fdb2f054f7b21dfe (patch) | |
tree | 26d69d96320d4278394e06ff25df74de9314a2fc /sys/net/if.h | |
parent | f8ee348f1d1b903d0b117c893b5f73aed4e5bce8 (diff) | |
download | FreeBSD-src-25ae331e1251bd9562a10f53fdb2f054f7b21dfe.zip FreeBSD-src-25ae331e1251bd9562a10f53fdb2f054f7b21dfe.tar.gz |
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
Diffstat (limited to 'sys/net/if.h')
-rw-r--r-- | sys/net/if.h | 8 |
1 files changed, 8 insertions, 0 deletions
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 */ |