Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Like some other USB devices, register cdce(4) wi...



details:   https://anonhg.NetBSD.org/src/rev/c986bb2879f3
branches:  trunk
changeset: 756936:c986bb2879f3
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Aug 08 01:57:24 2010 +0000

description:
Like some other USB devices, register cdce(4) with pmf(9).
Addresses PR#40949.

diffstat:

 sys/dev/usb/if_cdce.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 453129f2c911 -r c986bb2879f3 sys/dev/usb/if_cdce.c
--- a/sys/dev/usb/if_cdce.c     Sun Aug 08 00:48:46 2010 +0000
+++ b/sys/dev/usb/if_cdce.c     Sun Aug 08 01:57:24 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_cdce.c,v 1.30 2010/05/19 21:10:42 jakllsch Exp $ */
+/*     $NetBSD: if_cdce.c,v 1.31 2010/08/08 01:57:24 jakllsch Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul <wpaul%windriver.com@localhost>
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.30 2010/05/19 21:10:42 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.31 2010/08/08 01:57:24 jakllsch Exp $");
 #ifdef __NetBSD__
 #include "opt_inet.h"
 #endif
@@ -292,6 +292,9 @@
        usbd_add_drv_event(USB_EVENT_DRIVER_ATTACH, sc->cdce_udev,
            sc->cdce_dev);
 
+       if (!pmf_device_register(self, NULL, NULL))
+               aprint_error_dev(self, "couldn't establish power handler\n");
+
        return;
 }
 
@@ -302,6 +305,9 @@
        struct ifnet    *ifp = GET_IFP(sc);
        int              s;
 
+       if (device_pmf_is_registered(self))
+               pmf_device_deregister(self);
+
        s = splusb();
 
        if (!sc->cdce_attached) {



Home | Main Index | Thread Index | Old Index