From owner-freebsd-wireless@FreeBSD.ORG Sun Mar 18 19:22:55 2012 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93629106566B; Sun, 18 Mar 2012 19:22:55 +0000 (UTC) (envelope-from iwasaki@jp.FreeBSD.org) Received: from locore.org (ns01.locore.org [218.45.21.227]) by mx1.freebsd.org (Postfix) with ESMTP id 447108FC0C; Sun, 18 Mar 2012 19:22:54 +0000 (UTC) Received: from localhost (celeron.v4.locore.org [192.168.0.10]) by locore.org (8.14.5/8.14.5/iwasaki) with ESMTP/inet id q2IJMqXr083056; Mon, 19 Mar 2012 04:22:52 +0900 (JST) (envelope-from iwasaki@jp.FreeBSD.org) Date: Mon, 19 Mar 2012 04:22:50 +0900 (JST) Message-Id: <20120319.042250.74754884.iwasaki@jp.FreeBSD.org> To: bschmidt@freebsd.org From: Mitsuru IWASAKI In-Reply-To: <201203181825.25124.bschmidt@freebsd.org> References: <201203171232.42515.bschmidt@freebsd.org> <20120319.010352.124006046.iwasaki@jp.FreeBSD.org> <201203181825.25124.bschmidt@freebsd.org> X-Mailer: Mew version 3.3 on Emacs 20.7 / Mule 4.0 (HANANOEN) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Mar_19_04:22:50_2012_364)--" Content-Transfer-Encoding: 7bit Cc: freebsd-wireless@freebsd.org Subject: Re: [patch] iwi(4) suspend/resume broken X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2012 19:22:55 -0000 ----Next_Part(Mon_Mar_19_04:22:50_2012_364)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, From: Bernhard Schmidt > Well, I came up with attached diff. It works fine on iwn and wpi > too basically, wpi has a bit of an issue with the scan after resume, > I see probe resquest/response on air but the device doesn't pick > em up sometimes.. still debugging. > > Anyways, I'm pretty sure that if you are doing the same for ipw/iwi > it will just work fine. The ieee80211_resume_all/suspend_all calls > will ensure that the appropriate stop/init driver functions are called. Great! I did the same thing for iwi(4), tested several times and it works just fine. Please commit the attached patches if you like it. Thanks! ----Next_Part(Mon_Mar_19_04:22:50_2012_364)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="iwi-suspend.diff" Index: if_iwi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/iwi/if_iwi.c,v retrieving revision 1.81 diff -u -r1.81 if_iwi.c --- if_iwi.c 10 Mar 2012 17:08:57 -0000 1.81 +++ if_iwi.c 18 Mar 2012 19:02:42 -0000 @@ -863,8 +863,10 @@ iwi_suspend(device_t dev) { struct iwi_softc *sc = device_get_softc(dev); + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; - iwi_stop(sc); + ieee80211_suspend_all(ic); return 0; } @@ -874,11 +876,11 @@ { struct iwi_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; pci_write_config(dev, 0x41, 0, 1); - if (ifp->if_flags & IFF_UP) - iwi_init(sc); + ieee80211_resume_all(ic); return 0; } ----Next_Part(Mon_Mar_19_04:22:50_2012_364)----