Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Move pmf(9) calls to MI re_attach() and re_detach() ...



details:   https://anonhg.NetBSD.org/src/rev/48bce6b1a660
branches:  trunk
changeset: 747102:48bce6b1a660
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Sep 02 15:11:13 2009 +0000

description:
Move pmf(9) calls to MI re_attach() and re_detach() from each backend.

diffstat:

 sys/dev/cardbus/if_re_cardbus.c |  11 ++---------
 sys/dev/ic/rtl8169.c            |  12 ++++++++++--
 sys/dev/pci/if_re_pci.c         |   9 ++-------
 3 files changed, 14 insertions(+), 18 deletions(-)

diffs (107 lines):

diff -r 593553577615 -r 48bce6b1a660 sys/dev/cardbus/if_re_cardbus.c
--- a/sys/dev/cardbus/if_re_cardbus.c   Wed Sep 02 14:58:38 2009 +0000
+++ b/sys/dev/cardbus/if_re_cardbus.c   Wed Sep 02 15:11:13 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_re_cardbus.c,v 1.19 2009/08/29 14:18:34 tsutsui Exp $       */
+/*     $NetBSD: if_re_cardbus.c,v 1.20 2009/09/02 15:11:13 tsutsui Exp $       */
 
 /*
  * Copyright (c) 2004 Jonathan Stone
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_re_cardbus.c,v 1.19 2009/08/29 14:18:34 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_re_cardbus.c,v 1.20 2009/09/02 15:11:13 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -207,11 +207,6 @@
        sc->sc_dmat = ca->ca_dmat;
        re_attach(sc);
 
-       if (!pmf_device_register(self, NULL, NULL))
-               aprint_error_dev(self, "couldn't establish power handler\n");
-       else
-               pmf_class_network_register(self, &sc->ethercom.ec_if);
-
        /*
         * Power down the socket.
         */
@@ -236,8 +231,6 @@
        if (rv)
                return rv;
 
-       pmf_device_deregister(self);
-
        /*
         * Unhook the interrupt handler.
         */
diff -r 593553577615 -r 48bce6b1a660 sys/dev/ic/rtl8169.c
--- a/sys/dev/ic/rtl8169.c      Wed Sep 02 14:58:38 2009 +0000
+++ b/sys/dev/ic/rtl8169.c      Wed Sep 02 15:11:13 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rtl8169.c,v 1.124 2009/08/31 13:05:30 tsutsui Exp $    */
+/*     $NetBSD: rtl8169.c,v 1.125 2009/09/02 15:11:13 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.124 2009/08/31 13:05:30 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.125 2009/09/02 15:11:13 tsutsui Exp $");
 /* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
 
 /*
@@ -833,6 +833,12 @@
        if_attach(ifp);
        ether_ifattach(ifp, eaddr);
 
+       if (pmf_device_register(sc->sc_dev, NULL, NULL))
+               pmf_class_network_register(sc->sc_dev, ifp);
+       else
+               aprint_error_dev(sc->sc_dev,
+                   "couldn't establish power handler\n");
+
        return;
 
  fail_8:
@@ -956,6 +962,8 @@
        bus_dmamem_free(sc->sc_dmat,
            &sc->re_ldata.re_tx_listseg, sc->re_ldata.re_tx_listnseg);
 
+       pmf_device_deregister(sc->sc_dev);
+
        return 0;
 }
 
diff -r 593553577615 -r 48bce6b1a660 sys/dev/pci/if_re_pci.c
--- a/sys/dev/pci/if_re_pci.c   Wed Sep 02 14:58:38 2009 +0000
+++ b/sys/dev/pci/if_re_pci.c   Wed Sep 02 15:11:13 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_re_pci.c,v 1.37 2009/08/29 14:18:34 tsutsui Exp $   */
+/*     $NetBSD: if_re_pci.c,v 1.38 2009/09/02 15:11:13 tsutsui Exp $   */
 
 /*
  * Copyright (c) 1997, 1998-2003
@@ -46,7 +46,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_re_pci.c,v 1.37 2009/08/29 14:18:34 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_re_pci.c,v 1.38 2009/09/02 15:11:13 tsutsui Exp $");
 
 #include <sys/types.h>
 
@@ -286,9 +286,4 @@
                                bus_space_unmap(memt, memh, memsize);
                }
        }
-
-       if (!pmf_device_register(self, NULL, NULL))
-               aprint_error_dev(self, "couldn't establish power handler\n");
-       else
-               pmf_class_network_register(self, &sc->ethercom.ec_if);
 }



Home | Main Index | Thread Index | Old Index