Author: hselasky
Date: Thu Jun  7 07:33:46 2018
New Revision: 334758
URL: https://svnweb.freebsd.org/changeset/base/334758

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

Modified:
  stable/10/sys/dev/usb/net/usb_ethernet.c
  stable/10/sys/dev/usb/net/usb_ethernet.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/net/usb_ethernet.c
==============================================================================
--- stable/10/sys/dev/usb/net/usb_ethernet.c    Thu Jun  7 07:32:51 2018        
(r334757)
+++ stable/10/sys/dev/usb/net/usb_ethernet.c    Thu Jun  7 07:33:46 2018        
(r334758)
@@ -187,6 +187,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: stable/10/sys/dev/usb/net/usb_ethernet.h
==============================================================================
--- stable/10/sys/dev/usb/net/usb_ethernet.h    Thu Jun  7 07:32:51 2018        
(r334757)
+++ stable/10/sys/dev/usb/net/usb_ethernet.h    Thu Jun  7 07:33:46 2018        
(r334758)
@@ -111,6 +111,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 *);
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to