diff options
author | thompsa <thompsa@FreeBSD.org> | 2007-06-30 21:12:41 +0000 |
---|---|---|
committer | thompsa <thompsa@FreeBSD.org> | 2007-06-30 21:12:41 +0000 |
commit | 59be299a4e0e2fe099e874859863a1c5971b06cb (patch) | |
tree | 4f805b99b9cab8a58b8dee72115f6e11fec203e0 /sys/dev | |
parent | 14083ff1fda32d3b03d654beea71491828526a61 (diff) | |
download | FreeBSD-src-59be299a4e0e2fe099e874859863a1c5971b06cb.zip FreeBSD-src-59be299a4e0e2fe099e874859863a1c5971b06cb.tar.gz |
Fix the channel reporting when the card is associated. The channel array used
to be index by IEEE channel number but that is no longer the case and it needs
to be searched for.
Submitted by: avatar
Reviewed by: sam
Approved by: re (kensmith)
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/wi/if_wi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c index aeb8a4e..16f2d9f 100644 --- a/sys/dev/wi/if_wi.c +++ b/sys/dev/wi/if_wi.c @@ -2959,8 +2959,12 @@ wi_newstate(struct ieee80211com *ic, enum ieee80211_state nstate, int arg) IEEE80211_ADDR_COPY(ni->ni_macaddr, ni->ni_bssid); buflen = sizeof(val); wi_read_rid(sc, WI_RID_CURRENT_CHAN, &val, &buflen); + ni->ni_chan = ieee80211_find_channel(ic, + ieee80211_ieee2mhz(val, IEEE80211_CHAN_B), + IEEE80211_CHAN_B); + if (ni->ni_chan == NULL) + ni->ni_chan = &ic->ic_channels[0]; /* XXX validate channel */ - ni->ni_chan = &ic->ic_channels[le16toh(val)]; ic->ic_curchan = ic->ic_bsschan = ni->ni_chan; #if NBPFILTER > 0 sc->sc_tx_th.wt_chan_freq = sc->sc_rx_th.wr_chan_freq = |