From owner-freebsd-current@FreeBSD.ORG Fri Sep 14 22:39:22 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B533A16A417 for ; Fri, 14 Sep 2007 22:39:22 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from heff.fud.org.nz (203-109-251-39.static.bliink.ihug.co.nz [203.109.251.39]) by mx1.freebsd.org (Postfix) with ESMTP id 4B41B13C458 for ; Fri, 14 Sep 2007 22:39:22 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: by heff.fud.org.nz (Postfix, from userid 1001) id 9E7A41CC26; Sat, 15 Sep 2007 10:39:20 +1200 (NZST) Date: Sat, 15 Sep 2007 10:39:20 +1200 From: Andrew Thompson To: JoaoBR Message-ID: <20070914223920.GB78224@heff.fud.org.nz> References: <200708251905.18834.joao@matik.com.br> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: <200708251905.18834.joao@matik.com.br> User-Agent: Mutt/1.5.13 (2006-08-11) Cc: freebsd-current@freebsd.org Subject: Re: if_wi channel set problem X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Sep 2007 22:39:22 -0000 --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Aug 25, 2007 at 07:05:18PM -0300, JoaoBR wrote: > > Hi > > I sent this some time ago but nothing changed. > > Whatever channel I try to set on a wi card it stays at channel 3, I use hostap > > Even hardcoding the default channel in if_wi.c does not help, it is not > possible setting the channel to anything else as channel 3 which it is > already when the driver comes up > > somebody has a help for me? Can you please test this patch. Andrew --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="wi_hostapchan.diff" Index: if_wi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/wi/if_wi.c,v retrieving revision 1.213 diff -u -p -r1.213 if_wi.c --- if_wi.c 5 Sep 2007 21:31:32 -0000 1.213 +++ if_wi.c 14 Sep 2007 22:36:16 -0000 @@ -608,7 +608,7 @@ wi_power(struct wi_softc *sc, int why) break; case PWR_RESUME: if (ifp->if_flags & IFF_UP) { - wi_init(ifp); + wi_init(sc); (void)wi_intr(sc); } break; @@ -3536,8 +3536,17 @@ wi_set_channel(struct ieee80211com *ic) struct wi_softc *sc = ifp->if_softc; WI_LOCK(sc); - if (!(sc->sc_flags & WI_FLAGS_SCANNING)) { + if (sc->sc_enabled && !(sc->sc_flags & WI_FLAGS_SCANNING)) { sc->wi_channel = ic->ic_curchan; + wi_write_val(sc, WI_RID_OWN_CHNL, + ieee80211_chan2ieee(ic, ic->ic_curchan)); + + if (ic->ic_opmode == IEEE80211_M_HOSTAP && + sc->sc_firmware_type == WI_INTERSIL) { + /* XXX: some cards need to be re-enabled */ + wi_cmd(sc, WI_CMD_DISABLE | WI_PORT0, 0, 0, 0); + wi_cmd(sc, WI_CMD_ENABLE | WI_PORT0, 0, 0, 0); + } } WI_UNLOCK(sc); } --G4iJoqBmSsgzjUCe--