Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/iwm/if_iwm.c
Show First 20 Lines • Show All 3,297 Lines • ▼ Show 20 Lines | IWM_DPRINTF(sc, IWM_DEBUG_RECV, | ||||
le16toh(phy_info->channel), | le16toh(phy_info->channel), | ||||
le16toh(phy_info->phy_flags)); | le16toh(phy_info->phy_flags)); | ||||
/* | /* | ||||
* Populate an RX state struct with the provided information. | * Populate an RX state struct with the provided information. | ||||
*/ | */ | ||||
bzero(&rxs, sizeof(rxs)); | bzero(&rxs, sizeof(rxs)); | ||||
rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; | 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.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; | ||||
rxs.c_ieee = le16toh(phy_info->channel); | rxs.c_ieee = le16toh(phy_info->channel); | ||||
if (le16toh(phy_info->phy_flags & IWM_RX_RES_PHY_FLAGS_BAND_24)) { | 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_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_2GHZ); | ||||
rxs.c_band = IEEE80211_CHAN_2GHZ; | |||||
} else { | } else { | ||||
rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ); | rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ); | ||||
rxs.c_band = IEEE80211_CHAN_5GHZ; | |||||
} | } | ||||
/* rssi is in 1/2db units */ | /* rssi is in 1/2db units */ | ||||
rxs.c_rssi = rssi * 2; | rxs.c_rssi = rssi * 2; | ||||
rxs.c_nf = sc->sc_noise; | rxs.c_nf = sc->sc_noise; | ||||
if (ieee80211_add_rx_params(m, &rxs) == 0) | if (ieee80211_add_rx_params(m, &rxs) == 0) | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | iwm_rx_mpdu_mq(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, | ||||
IWM_DPRINTF(sc, IWM_DEBUG_RECV, | IWM_DPRINTF(sc, IWM_DEBUG_RECV, | ||||
"%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise); | "%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise); | ||||
/* | /* | ||||
* Populate an RX state struct with the provided information. | * Populate an RX state struct with the provided information. | ||||
*/ | */ | ||||
bzero(&rxs, sizeof(rxs)); | bzero(&rxs, sizeof(rxs)); | ||||
rxs.r_flags |= IEEE80211_R_IEEE | IEEE80211_R_FREQ; | 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.r_flags |= IEEE80211_R_NF | IEEE80211_R_RSSI; | ||||
rxs.c_ieee = channel; | rxs.c_ieee = channel; | ||||
rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, | rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, | ||||
channel <= 14 ? IEEE80211_CHAN_2GHZ : IEEE80211_CHAN_5GHZ); | 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 */ | /* rssi is in 1/2db units */ | ||||
rxs.c_rssi = rssi * 2; | rxs.c_rssi = rssi * 2; | ||||
rxs.c_nf = sc->sc_noise; | rxs.c_nf = sc->sc_noise; | ||||
if (ieee80211_add_rx_params(m, &rxs) == 0) | if (ieee80211_add_rx_params(m, &rxs) == 0) | ||||
return false; | return false; | ||||
if (ieee80211_radiotap_active_vap(vap)) { | if (ieee80211_radiotap_active_vap(vap)) { | ||||
▲ Show 20 Lines • Show All 3,256 Lines • Show Last 20 Lines |