Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/dev Pull up following revision(s) (requested by msait...
details: https://anonhg.NetBSD.org/src/rev/c56fe2cf4472
branches: netbsd-8
changeset: 852318:c56fe2cf4472
user: martin <martin%NetBSD.org@localhost>
date: Fri Mar 29 19:48:35 2019 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #1224):
sys/dev/mii/tlphy.c: revision 1.65
sys/dev/usb/if_url.c: revision 1.62
sys/dev/usb/if_aue.c: revision 1.148
mii_phy_add_media() automatically install power handler, but if_media_add()
doesn't. When mii_phy_add_media() isn't used, call pmf_device_register().
-
Use pmf(9).
-
Use pmf(9).
diffstat:
sys/dev/mii/tlphy.c | 21 ++++++++++++++-------
sys/dev/usb/if_aue.c | 9 +++++++--
sys/dev/usb/if_url.c | 9 +++++++--
3 files changed, 28 insertions(+), 11 deletions(-)
diffs (117 lines):
diff -r 3881a1ef405a -r c56fe2cf4472 sys/dev/mii/tlphy.c
--- a/sys/dev/mii/tlphy.c Fri Mar 29 19:43:28 2019 +0000
+++ b/sys/dev/mii/tlphy.c Fri Mar 29 19:48:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tlphy.c,v 1.62 2014/06/16 16:48:16 msaitoh Exp $ */
+/* $NetBSD: tlphy.c,v 1.62.20.1 2019/03/29 19:48:35 martin Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.62 2014/06/16 16:48:16 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.62.20.1 2019/03/29 19:48:35 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -183,12 +183,19 @@
if (sc->mii_capabilities & BMSR_MEDIAMASK) {
aprint_normal("%s", sep);
mii_phy_add_media(sc);
- } else if ((tsc->sc_tlphycap &
+ } else {
+ if ((tsc->sc_tlphycap &
(TLPHY_MEDIA_10_2 | TLPHY_MEDIA_10_5)) == 0)
- aprint_error("no media present");
- else if (!pmf_device_register(self, NULL, mii_phy_resume)) {
- aprint_normal("\n");
- aprint_error_dev(self, "couldn't establish power handler");
+ aprint_error("no media present");
+ /*
+ * mii_phy_add_media() automatically install power handler,
+ * but if_media_add() doesn't. Do it now.
+ */
+ if (!pmf_device_register(self, NULL, mii_phy_resume)) {
+ aprint_normal("\n");
+ aprint_error_dev(self,
+ "couldn't establish power handler");
+ }
}
aprint_normal("\n");
#undef ADD
diff -r 3881a1ef405a -r c56fe2cf4472 sys/dev/usb/if_aue.c
--- a/sys/dev/usb/if_aue.c Fri Mar 29 19:43:28 2019 +0000
+++ b/sys/dev/usb/if_aue.c Fri Mar 29 19:48:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_aue.c,v 1.141.8.2 2018/08/08 10:28:35 martin Exp $ */
+/* $NetBSD: if_aue.c,v 1.141.8.3 2019/03/29 19:48:36 martin Exp $ */
/*
* Copyright (c) 1997, 1998, 1999, 2000
@@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.141.8.2 2018/08/08 10:28:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.141.8.3 2019/03/29 19:48:36 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -869,6 +869,9 @@
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->aue_udev, sc->aue_dev);
+ if (!pmf_device_register(self, NULL, NULL))
+ aprint_error_dev(self, "couldn't establish power handler\n");
+
return;
}
@@ -886,6 +889,8 @@
return 0;
}
+ pmf_device_deregister(self);
+
/*
* XXX Halting callout guarantees no more tick tasks. What
* guarantees no more stop tasks? What guarantees no more
diff -r 3881a1ef405a -r c56fe2cf4472 sys/dev/usb/if_url.c
--- a/sys/dev/usb/if_url.c Fri Mar 29 19:43:28 2019 +0000
+++ b/sys/dev/usb/if_url.c Fri Mar 29 19:48:35 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_url.c,v 1.56.8.2 2018/08/08 10:28:35 martin Exp $ */
+/* $NetBSD: if_url.c,v 1.56.8.3 2019/03/29 19:48:35 martin Exp $ */
/*
* Copyright (c) 2001, 2002
@@ -44,7 +44,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.56.8.2 2018/08/08 10:28:35 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_url.c,v 1.56.8.3 2019/03/29 19:48:35 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -325,6 +325,9 @@
usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, dev, sc->sc_dev);
+ if (!pmf_device_register(self, NULL, NULL))
+ aprint_error_dev(self, "couldn't establish power handler\n");
+
return;
bad:
@@ -346,6 +349,8 @@
if (!sc->sc_attached)
return 0;
+ pmf_device_deregister(self);
+
/*
* XXX Halting callout guarantees no more tick tasks. What
* guarantees no more stop tasks? What guarantees no more
Home |
Main Index |
Thread Index |
Old Index