diff options
author | thompsa <thompsa@FreeBSD.org> | 2007-09-16 20:02:29 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2007-09-16 20:02:29 +0000 |
commit | ad840660932b3ea60a4a7a995abe548ca1df57d0 (patch) | |
tree | 7accef0b3f6c60acbf5b605ec593d084d7a7ab08 /sys/dev/wi/if_wi.c | |
parent | cf6bc93f9bf5ec043116c9c88f0dfa846078772c (diff) | |
download | FreeBSD-src-ad840660932b3ea60a4a7a995abe548ca1df57d0.zip FreeBSD-src-ad840660932b3ea60a4a7a995abe548ca1df57d0.tar.gz |
Make wi_set_channel() actually change the channel in hardware so that hostap
mode works properly, previously the hostap channel could not be changed off #3.
Fix an ifp/sc misuse while I am here.
Reported by: many
Approved by: re (bmah)
Diffstat (limited to 'sys/dev/wi/if_wi.c')
-rw-r--r-- | sys/dev/wi/if_wi.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index aa71627..9ff16a4 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -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,21 @@ 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)) { + DPRINTF(("wi_set_channel: %d (%dMHz)\n", + ieee80211_chan2ieee(ic, ic->ic_curchan), + ic->ic_curchan->ic_freq)); + 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); } |