Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148345047
D11617.id31116.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11617.id31116.diff
View Options
Index: head/sys/net/ethernet.h
===================================================================
--- head/sys/net/ethernet.h
+++ head/sys/net/ethernet.h
@@ -406,6 +406,12 @@
void *, u_int);
struct mbuf *ether_vlanencap(struct mbuf *, uint16_t);
+#ifdef _SYS_EVENTHANDLER_H_
+/* new ethernet interface attached event */
+typedef void (*ether_ifattach_event_handler_t)(void *, struct ifnet *);
+EVENTHANDLER_DECLARE(ether_ifattach_event, ether_ifattach_event_handler_t);
+#endif
+
#else /* _KERNEL */
#include <sys/cdefs.h>
Index: head/sys/net/if_ethersubr.c
===================================================================
--- head/sys/net/if_ethersubr.c
+++ head/sys/net/if_ethersubr.c
@@ -38,6 +38,8 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/eventhandler.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
@@ -931,6 +933,11 @@
if_printf(ifp, "Ethernet address: %6D\n", lla, ":");
uuid_ether_add(LLADDR(sdl));
+
+ /* Add necessary bits are setup; announce it now. */
+ EVENTHANDLER_INVOKE(ether_ifattach_event, ifp);
+ if (IS_DEFAULT_VNET(curvnet))
+ devctl_notify("ETHERNET", ifp->if_xname, "IFATTACH", NULL);
}
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 6:50 AM (20 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29888823
Default Alt Text
D11617.id31116.diff (1 KB)
Attached To
Mode
D11617: ethernet: Add ethernet interface attached event and devctl notification.
Attached
Detach File
Event Timeline
Log In to Comment