From owner-svn-src-head@freebsd.org Tue Apr 26 04:45:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CCE2B1D004; Tue, 26 Apr 2016 04:45:23 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 234C21792; Tue, 26 Apr 2016 04:45:23 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp002.me.com by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O6800D004OJGC00@mr11p00im-asmtp002.me.com>; Tue, 26 Apr 2016 04:45:17 +0000 (GMT) Received: from [192.168.1.4] (c-50-174-208-73.hsd1.ca.comcast.net [50.174.208.73]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O6800CVP57F9S20@mr11p00im-asmtp002.me.com>; Tue, 26 Apr 2016 04:45:16 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-26_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1604260079 User-Agent: Microsoft-MacOutlook/f.15.1.160411 Date: Mon, 25 Apr 2016 21:45:15 -0700 Subject: Re: svn commit: r298612 - head/sys/dev/iwm From: Ravi Pokala Sender: "Pokala, Ravi" To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r298612 - head/sys/dev/iwm References: <201604260440.u3Q4exZD045896@repo.freebsd.org> In-reply-to: <201604260440.u3Q4exZD045896@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1461645917; bh=0raATdlLCrrQe8Ra1iHA79BRJ664czyKCedKWyjnr8o=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=ByRnbLv2YqgGJWdD9XG06vQqa2GtfzZyJnbVyQJY7OMVDM2JnQws9pMRKsMCiHEMi Q9ah3wHsiBUOy/sBqnCcBRu9Qw2fljsW3YrTOMULcLGbWuD18O7vFIezg+X6rrOOTP 1wd12L92ZGOg5CzbmZMIjzU5qm/mNo5V397n9SSJWNn3Nl8aYwQF8hMTUAjChYtaw+ pYuuTgq2/AjXjSlYxEtRSOiHbRGZZhouGAdJliZ3PMvII6AxYW9sCDdffRwq4JEE3f kd1HqW4xNPIrt+CtrT+Q/t0eEimtO0Q2yTnwHxxut0vWneM8BVsj91ZWH9cUhuGQ1w 8tmgGhnMGt5og== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 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: Tue, 26 Apr 2016 04:45:23 -0000 > do_stop = !! (sc->sc_ic.ic_nrunning > 0); Why the double-negation? Isn't do_stop = (sc->sc_ic.ic_nrunning > 0); equivalent? -Ravi (rpokala@) -----Original Message----- From: on behalf of Adrian Chadd Date: 2016-04-25, Monday at 21:40 To: , , Subject: svn commit: r298612 - head/sys/dev/iwm >Author: adrian >Date: Tue Apr 26 04:40:59 2016 >New Revision: 298612 >URL: https://svnweb.freebsd.org/changeset/base/298612 > >Log: > [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all > > This allows wifi to associate correctly after a suspend/resume cycle. > > Yes, I'm using this now day to day. > > Tested: > > * Intel 7260AC, STA mode > >Modified: > head/sys/dev/iwm/if_iwm.c > head/sys/dev/iwm/if_iwmvar.h > >Modified: head/sys/dev/iwm/if_iwm.c >============================================================================== >--- head/sys/dev/iwm/if_iwm.c Tue Apr 26 03:24:28 2016 (r298611) >+++ head/sys/dev/iwm/if_iwm.c Tue Apr 26 04:40:59 2016 (r298612) >@@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1) > static int > iwm_resume(device_t dev) > { >+ struct iwm_softc *sc = device_get_softc(dev); >+ int do_reinit = 0; > uint16_t reg; > > /* Clear device-specific "PCI retry timeout" register (41h). */ >@@ -4941,17 +4943,33 @@ iwm_resume(device_t dev) > pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); > iwm_init_task(device_get_softc(dev)); > >+ IWM_LOCK(sc); >+ if (sc->sc_flags & IWM_FLAG_DORESUME) { >+ sc->sc_flags &= ~IWM_FLAG_DORESUME; >+ do_reinit = 1; >+ } >+ IWM_UNLOCK(sc); >+ >+ if (do_reinit) >+ ieee80211_resume_all(&sc->sc_ic); >+ > return 0; > } > > static int > iwm_suspend(device_t dev) > { >+ int do_stop = 0; > struct iwm_softc *sc = device_get_softc(dev); > >- if (sc->sc_ic.ic_nrunning > 0) { >+ do_stop = !! (sc->sc_ic.ic_nrunning > 0); >+ >+ ieee80211_suspend_all(&sc->sc_ic); >+ >+ if (do_stop) { > IWM_LOCK(sc); > iwm_stop(sc); >+ sc->sc_flags |= IWM_FLAG_DORESUME; > IWM_UNLOCK(sc); > } > > >Modified: head/sys/dev/iwm/if_iwmvar.h >============================================================================== >--- head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 03:24:28 2016 (r298611) >+++ head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 04:40:59 2016 (r298612) >@@ -405,6 +405,7 @@ struct iwm_softc { > #define IWM_FLAG_STOPPED (1 << 2) > #define IWM_FLAG_RFKILL (1 << 3) > #define IWM_FLAG_BUSY (1 << 4) >+#define IWM_FLAG_DORESUME (1 << 5) > > struct intr_config_hook sc_preinit_hook; > struct callout sc_watchdog_to; >