svn commit: r334158 - head/sys/dev/usb/net

Hans Petter Selasky hselasky at FreeBSD.org
Thu May 24 15:24:43 UTC 2018


Author: hselasky
Date: Thu May 24 15:24:42 2018
New Revision: 334158
URL: https://svnweb.freebsd.org/changeset/base/334158

Log:
  Add function to wait for USB ethernet attach to complete.
  
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/usb/net/usb_ethernet.c
  head/sys/dev/usb/net/usb_ethernet.h

Modified: head/sys/dev/usb/net/usb_ethernet.c
==============================================================================
--- head/sys/dev/usb/net/usb_ethernet.c	Thu May 24 15:07:53 2018	(r334157)
+++ head/sys/dev/usb/net/usb_ethernet.c	Thu May 24 15:24:42 2018	(r334158)
@@ -190,6 +190,17 @@ error:
 	return (error);
 }
 
+void
+uether_ifattach_wait(struct usb_ether *ue)
+{
+
+	UE_LOCK(ue);
+	usb_proc_mwait(&ue->ue_tq,
+	    &ue->ue_sync_task[0].hdr,
+	    &ue->ue_sync_task[1].hdr);
+	UE_UNLOCK(ue);
+}
+
 static void
 ue_attach_post_task(struct usb_proc_msg *_task)
 {

Modified: head/sys/dev/usb/net/usb_ethernet.h
==============================================================================
--- head/sys/dev/usb/net/usb_ethernet.h	Thu May 24 15:07:53 2018	(r334157)
+++ head/sys/dev/usb/net/usb_ethernet.h	Thu May 24 15:24:42 2018	(r334158)
@@ -113,6 +113,7 @@ struct ifnet	*uether_getifp(struct usb_ether *);
 struct mii_data *uether_getmii(struct usb_ether *);
 void		*uether_getsc(struct usb_ether *);
 int		uether_ifattach(struct usb_ether *);
+void		uether_ifattach_wait(struct usb_ether *);
 void		uether_ifdetach(struct usb_ether *);
 int		uether_ifmedia_upd(struct ifnet *);
 void		uether_init(void *);


More information about the svn-src-all mailing list