Page MenuHomeFreeBSD

D30662.diff
No OneTemporary

D30662.diff

diff --git a/sys/dev/iwm/if_iwm.c b/sys/dev/iwm/if_iwm.c
--- a/sys/dev/iwm/if_iwm.c
+++ b/sys/dev/iwm/if_iwm.c
@@ -3303,12 +3303,15 @@
*/
bzero(&rxs, sizeof(rxs));
rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
+ rxs.r_flags |= IEEE80211_R_BAND;
rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI;
rxs.c_ieee = le16toh(phy_info->channel);
if (le16toh(phy_info->phy_flags & IWM_RX_RES_PHY_FLAGS_BAND_24)) {
rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ);
+ rxs.c_band = IEEE80211_CHAN_2GHZ;
} else {
rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ);
+ rxs.c_band = IEEE80211_CHAN_5GHZ;
}
/* rssi is in 1/2db units */
@@ -3414,10 +3417,12 @@
*/
bzero(&rxs, sizeof(rxs));
rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
+ rxs.r_flags |= IEEE80211_R_BAND;
rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI;
rxs.c_ieee = channel;
rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee,
channel <= 14 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ);
+ rxs.c_band = channel <= 14 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ;
/* rssi is in 1/2db units */
rxs.c_rssi = rssi * 2;
diff --git a/sys/dev/rtwn/rtl8188e/r88e_rx.c b/sys/dev/rtwn/rtl8188e/r88e_rx.c
--- a/sys/dev/rtwn/rtl8188e/r88e_rx.c
+++ b/sys/dev/rtwn/rtl8188e/r88e_rx.c
@@ -240,8 +240,10 @@
if (!sc->sc_ht40) { /* XXX center channel */
rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
+ rxs->r_flags |= IEEE80211_R_BAND;
rxs->c_ieee = physt->chan;
rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee,
IEEE80211_CHAN_2GHZ);
+ rxs->c_band = IEEE80211_CHAN_2GHZ;
}
}
diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c
--- a/sys/dev/rtwn/rtl8812a/r12a_rx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c
@@ -321,8 +321,10 @@
*/
#if 0
rxs->r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
+ rxs->r_flags |= IEEE80211_R_BAND;
rxs->c_ieee = MS(le16toh(physt->phyw1), R12A_PHYW1_CHAN);
rxs->c_freq = ieee80211_ieee2mhz(rxs->c_ieee,
(rxs->c_ieee < 36) ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ);
+ rxs->c_band = (rxs->c_ieee < 36) ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ;
#endif
}
diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c
--- a/sys/dev/usb/wlan/if_rsu.c
+++ b/sys/dev/usb/wlan/if_rsu.c
@@ -2081,9 +2081,11 @@
/* Set channel flags for input path */
bzero(&rxs, sizeof(rxs));
rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ;
+ rxs.r_flags |= IEEE80211_R_BAND;
rxs.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI;
rxs.c_ieee = le32toh(bss->config.dsconfig);
rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ);
+ rxs.c_band = IEEE80211_CHAN_2GHZ;
/* This is a number from 0..100; so let's just divide it down a bit */
rxs.c_rssi = le32toh(bss->rssi) / 2;
rxs.c_nf = -96;
diff --git a/sys/net80211/_ieee80211.h b/sys/net80211/_ieee80211.h
--- a/sys/net80211/_ieee80211.h
+++ b/sys/net80211/_ieee80211.h
@@ -612,6 +612,9 @@
uint8_t c_ieee; /* Channel */
uint8_t c_width; /* channel width, FW flags above */
+ /* 32 bits */
+ uint32_t c_band; /* Band; XXX we do not have a real band. */
+
/* Force alignment to DWORD */
union {
uint8_t evm[IEEE80211_MAX_CHAINS][IEEE80211_MAX_EVM_PILOTS];
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -1818,6 +1818,8 @@
return (NULL);
if ((rxs->r_flags & IEEE80211_R_IEEE) == 0)
return (NULL);
+ if ((rxs->r_flags & IEEE80211_R_BAND) == 0)
+ return (NULL);
/*
* If the rx status contains a valid ieee/freq, then
@@ -1828,11 +1830,20 @@
*/
/* Determine a band */
- /* XXX should be done by the driver? */
- if (rxs->c_freq < 3000) {
+ switch (rxs->c_band) {
+ case IEEE80211_CHAN_2GHZ:
flags = IEEE80211_CHAN_G;
- } else {
+ break;
+ case IEEE80211_CHAN_5GHZ:
flags = IEEE80211_CHAN_A;
+ break;
+ default:
+ if (rxs->c_freq < 3000) {
+ flags = IEEE80211_CHAN_G;
+ } else {
+ flags = IEEE80211_CHAN_A;
+ }
+ break;
}
/* Channel lookup */

File Metadata

Mime Type
text/plain
Expires
Sat, Feb 8, 1:30 AM (10 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16519634
Default Alt Text
D30662.diff (3 KB)

Event Timeline