From owner-svn-src-head@FreeBSD.ORG Thu Jul 4 19:45:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A000B899; Thu, 4 Jul 2013 19:45:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 921221BCD; Thu, 4 Jul 2013 19:45:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64JjYx3020106; Thu, 4 Jul 2013 19:45:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64JjY4w020105; Thu, 4 Jul 2013 19:45:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201307041945.r64JjY4w020105@svn.freebsd.org> From: Adrian Chadd Date: Thu, 4 Jul 2013 19:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252717 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Jul 2013 19:45:34 -0000 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: 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