svn commit: r252717 - head/sys/dev/iwn

Adrian Chadd adrian at FreeBSD.org
Thu Jul 4 19:45:34 UTC 2013


Author: adrian
Date: Thu Jul  4 19:45:34 2013
New Revision: 252717
URL: http://svnweb.freebsd.org/changeset/base/252717

Log:
  Enable the station-side power management flag.
  
  It's not enabled by default in net80211 so this is a no-op unless
  if you enable it (ifconfig wlan0 powersave).
  
  Tested:
  
  * iwn0: <Intel WiFi Link 5100> mem 0xf4300000-0xf4301fff irq 17 at device 0.0 on pci3
  
  TODO:
  
  * .. test on all the other NICs
  * See if I have to disable it during scan and such
  * Make it configurable live, rather than only after it's done its initial
    receive calibration.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c	Thu Jul  4 19:44:30 2013	(r252716)
+++ head/sys/dev/iwn/if_iwn.c	Thu Jul  4 19:45:34 2013	(r252717)
@@ -585,6 +585,7 @@ iwn_attach(device_t dev)
 		| IEEE80211_C_IBSS		/* ibss/adhoc mode */
 #endif
 		| IEEE80211_C_WME		/* WME */
+		| IEEE80211_C_PMGT		/* Station-side power mgmt */
 		;
 
 	/* Read MAC address, channels, etc from EEPROM. */
@@ -4585,6 +4586,8 @@ iwn_collect_noise(struct iwn_softc *sc,
 {
 	struct iwn_ops *ops = &sc->ops;
 	struct iwn_calib_state *calib = &sc->calib;
+	struct ifnet *ifp = sc->sc_ifp;
+	struct ieee80211com *ic = ifp->if_l2com;
 	uint32_t val;
 	int i;
 
@@ -4623,12 +4626,9 @@ iwn_collect_noise(struct iwn_softc *sc,
 	(void)iwn_cmd(sc, IWN_CMD_RXON, &sc->rxon, sc->rxonsz, 1);
 #endif
 
-#if 0
-	/* XXX: not yet */
 	/* Enable power-saving mode if requested by user. */
-	if (sc->sc_ic.ic_flags & IEEE80211_F_PMGTON)
+	if (ic->ic_flags & IEEE80211_F_PMGTON)
 		(void)iwn_set_pslevel(sc, 0, 3, 1);
-#endif
 }
 
 static int


More information about the svn-src-all mailing list