Actually register an if_stop, prevents jumping to NULL on suspend.

enable rt2860 power management support.
- remove it from operations struct (previously ifdef'd out)
- get rid of non-existent references to power management code
on rt2661 and rt_2560
- we use pmf_device_register to register resume/suspend, so get
rid of ral_pci_activate which would've been useful if we had done
things through CFATTACH_DECL.

move splnet on rt2860_resume (it was previously on ral_pci_activate)
in case that's needed.

Index: ic/rt2860.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/rt2860.c,v
retrieving revision 1.27
diff -u -r1.27 rt2860.c
--- ic/rt2860.c	20 Jul 2017 18:17:25 -0000	1.27
+++ ic/rt2860.c	20 Jul 2017 20:39:34 -0000
@@ -74,6 +74,8 @@
 #define MAXQS	6 /* Tx (4 EDCAs + HCCA + Mgt) and Rx rings */
 
 static void	rt2860_attachhook(device_t);
+static bool	rt2860_suspend(device_t self, const pmf_qual_t *qual);
+static bool	rt2860_wakeup(device_t self, const pmf_qual_t *qual);
 static int	rt2860_alloc_tx_ring(struct rt2860_softc *,
 		    struct rt2860_tx_ring *);
 static void	rt2860_reset_tx_ring(struct rt2860_softc *,
@@ -394,6 +396,7 @@
 	ifp->if_init = rt2860_init;
 	ifp->if_ioctl = rt2860_ioctl;
 	ifp->if_start = rt2860_start;
+	ifp->if_stop = rt2860_stop;
 	ifp->if_watchdog = rt2860_watchdog;
 	IFQ_SET_READY(&ifp->if_snd);
 	memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
@@ -434,7 +437,7 @@
 
 	ieee80211_announce(ic);
 
-	if (pmf_device_register(sc->sc_dev, NULL, NULL))
+	if (pmf_device_register(sc->sc_dev, rt2860_wakeup, rt2860_suspend))
 		pmf_class_network_register(sc->sc_dev, ifp);
 	else
 		aprint_error_dev(sc->sc_dev,
@@ -471,24 +474,31 @@
 	return 0;
 }
 
-void
-rt2860_suspend(void *xsc)
+static bool
+rt2860_suspend(device_t self, const pmf_qual_t *qual)
 {
-	struct rt2860_softc *sc = xsc;
+	struct rt2860_softc *sc = device_private(self);
 	struct ifnet *ifp = &sc->sc_if;
 
 	if (ifp->if_flags & IFF_RUNNING)
 		rt2860_stop(ifp, 1);
+
+	return true;
 }
 
-void
-rt2860_wakeup(void *xsc)
+static bool
+rt2860_wakeup(device_t self, const pmf_qual_t *qual)
 {
-	struct rt2860_softc *sc = xsc;
+	struct rt2860_softc *sc = device_private(self);
 	struct ifnet *ifp = &sc->sc_if;
+	int s;
 
+	s = splnet();
 	if (ifp->if_flags & IFF_UP)
 		rt2860_init(ifp);
+	splx(s);
+
+	return true;
 }
 
 static int
Index: ic/rt2860var.h
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/rt2860var.h,v
retrieving revision 1.4
diff -u -r1.4 rt2860var.h
--- ic/rt2860var.h	2 Feb 2017 10:05:35 -0000	1.4
+++ ic/rt2860var.h	20 Jul 2017 20:39:34 -0000
@@ -212,6 +212,4 @@
 
 int	rt2860_attach(void *, int);
 int	rt2860_detach(void *);
-void	rt2860_suspend(void *);
-void	rt2860_wakeup(void *);
 int	rt2860_intr(void *);
Index: pci/if_ral_pci.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_ral_pci.c,v
retrieving revision 1.23
diff -u -r1.23 if_ral_pci.c
--- pci/if_ral_pci.c	6 Jul 2016 14:28:51 -0000	1.23
+++ pci/if_ral_pci.c	20 Jul 2017 20:39:35 -0000
@@ -56,42 +56,26 @@
 #include <dev/pci/pcivar.h>
 #include <dev/pci/pcidevs.h>
 
-#define RAL_POWER_MANAGEMENT 0	/* Disabled for now */
+#define RAL_MORE_POWER_MANAGEMENT 0
 
 static struct ral_opns {
 	int	(*attach)(void *, int);
 	int	(*detach)(void *);
-#if RAL_POWER_MANAGEMENT
-	void	(*suspend)(void *);
-	void	(*wakeup)(void *);
-#endif
 	int	(*intr)(void *);
 
 }  ral_rt2560_opns = {
 	rt2560_attach,
 	rt2560_detach,
-#if RAL_POWER_MANAGEMENT
-	rt2560_suspend,
-	rt2560_wakeup,
-#endif
 	rt2560_intr
 
 }, ral_rt2661_opns = {
 	rt2661_attach,
 	rt2661_detach,
-#if RAL_POWER_MANAGEMENT
-	rt2661_suspend,
-	rt2661_wakeup,
-#endif
 	rt2661_intr
 
 }, ral_rt2860_opns = {
 	rt2860_attach,
 	rt2860_detach,
-#if RAL_POWER_MANAGEMENT
-	rt2860_suspend,
-	rt2860_wakeup,
-#endif
 	rt2860_intr
 };
 
@@ -116,15 +100,9 @@
 int	ral_pci_match(device_t, cfdata_t, void *);
 void	ral_pci_attach(device_t, device_t, void *);
 int	ral_pci_detach(device_t, int);
-#if RAL_POWER_MANAGEMENT
-int	ral_pci_activate(struct device *, devact_t);
-void	ral_pci_wakeup(struct ral_pci_softc *);
-#else
-#define ral_pci_activate NULL
-#endif
 
 CFATTACH_DECL_NEW(ral_pci, sizeof (struct ral_pci_softc),
-	ral_pci_match, ral_pci_attach, ral_pci_detach, ral_pci_activate);
+	ral_pci_match, ral_pci_attach, ral_pci_detach, NULL);
 
 static const struct ral_pci_matchid {
 	pci_vendor_id_t         ral_vendor;
@@ -276,33 +254,3 @@
 
 	return 0;
 }
-
-#if RAL_POWER_MANAGEMENT
-int
-ral_pci_activate(struct device *self, devact_t act)
-{
-	struct ral_pci_softc *psc = (struct ral_pci_softc *)self;
-	struct rt2560_softc *sc = &psc->sc_sc;
-
-	switch (act) {
-	case DVACT_SUSPEND:
-		(*psc->sc_opns->suspend)(sc);
-		break;
-	case DVACT_WAKEUP:
-		ral_pci_wakeup(psc);
-		break;
-	}
-	return 0;
-}
-
-void
-ral_pci_wakeup(struct ral_pci_softc *psc)
-{
-	struct rt2560_softc *sc = &psc->sc_sc;
-	int s;
-
-	s = splnet();
-	(*psc->sc_opns->wakeup)(sc);
-	splx(s);
-}
-#endif
