Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Sep 2007 10:39:20 +1200
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        JoaoBR <joao@matik.com.br>
Cc:        freebsd-current@freebsd.org
Subject:   Re: if_wi channel set problem
Message-ID:  <20070914223920.GB78224@heff.fud.org.nz>
In-Reply-To: <200708251905.18834.joao@matik.com.br>
References:  <200708251905.18834.joao@matik.com.br>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070914223920.GB78224>