Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/usb/wlan/if_urtwn.c
Show First 20 Lines • Show All 748 Lines • ▼ Show 20 Lines | if (ieee80211_radiotap_active(ic)) { | ||||
if (!(rxdw3 & R92C_RXDW3_HT)) { | if (!(rxdw3 & R92C_RXDW3_HT)) { | ||||
tap->wr_rate = ridx2rate[rate]; | tap->wr_rate = ridx2rate[rate]; | ||||
} else if (rate >= 12) { /* MCS0~15. */ | } else if (rate >= 12) { /* MCS0~15. */ | ||||
/* Bit 7 set means HT MCS instead of rate. */ | /* Bit 7 set means HT MCS instead of rate. */ | ||||
tap->wr_rate = 0x80 | (rate - 12); | tap->wr_rate = 0x80 | (rate - 12); | ||||
} | } | ||||
tap->wr_dbm_antsignal = rssi; | tap->wr_dbm_antsignal = rssi; | ||||
tap->wr_dbm_antnoise = URTWN_NOISE_FLOOR; | tap->wr_dbm_antnoise = URTWN_NOISE_FLOOR; | ||||
tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq); | |||||
tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags); | |||||
} | } | ||||
*rssi_p = rssi; | *rssi_p = rssi; | ||||
return (m); | return (m); | ||||
} | } | ||||
static struct mbuf * | static struct mbuf * | ||||
▲ Show 20 Lines • Show All 1,644 Lines • ▼ Show 20 Lines | if (!hasqos) { | ||||
/* Set sequence number. */ | /* Set sequence number. */ | ||||
txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); | txd->txdseq = htole16(M_SEQNO_GET(m) % IEEE80211_SEQ_RANGE); | ||||
} | } | ||||
if (ieee80211_radiotap_active_vap(vap)) { | if (ieee80211_radiotap_active_vap(vap)) { | ||||
struct urtwn_tx_radiotap_header *tap = &sc->sc_txtap; | struct urtwn_tx_radiotap_header *tap = &sc->sc_txtap; | ||||
tap->wt_flags = 0; | tap->wt_flags = 0; | ||||
tap->wt_chan_freq = htole16(ic->ic_curchan->ic_freq); | |||||
tap->wt_chan_flags = htole16(ic->ic_curchan->ic_flags); | |||||
if (k != NULL) | if (k != NULL) | ||||
tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; | tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; | ||||
ieee80211_radiotap_tx(vap, m); | ieee80211_radiotap_tx(vap, m); | ||||
} | } | ||||
data->ni = ni; | data->ni = ni; | ||||
urtwn_tx_start(sc, m, type, data); | urtwn_tx_start(sc, m, type, data); | ||||
▲ Show 20 Lines • Show All 1,291 Lines • ▼ Show 20 Lines | urtwn_scan_end(struct ieee80211com *ic) | ||||
urtwn_set_gain(sc, 0x32); | urtwn_set_gain(sc, 0x32); | ||||
URTWN_UNLOCK(sc); | URTWN_UNLOCK(sc); | ||||
} | } | ||||
static void | static void | ||||
urtwn_set_channel(struct ieee80211com *ic) | urtwn_set_channel(struct ieee80211com *ic) | ||||
{ | { | ||||
struct urtwn_softc *sc = ic->ic_softc; | struct urtwn_softc *sc = ic->ic_softc; | ||||
struct ieee80211_channel *c = ic->ic_curchan; | |||||
struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); | struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); | ||||
URTWN_LOCK(sc); | URTWN_LOCK(sc); | ||||
if (vap->iv_state == IEEE80211_S_SCAN) { | if (vap->iv_state == IEEE80211_S_SCAN) { | ||||
/* Make link LED blink during scan. */ | /* Make link LED blink during scan. */ | ||||
urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); | urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); | ||||
} | } | ||||
urtwn_set_chan(sc, ic->ic_curchan, NULL); | urtwn_set_chan(sc, c, NULL); | ||||
sc->sc_rxtap.wr_chan_freq = htole16(c->ic_freq); | |||||
sc->sc_rxtap.wr_chan_flags = htole16(c->ic_flags); | |||||
sc->sc_txtap.wt_chan_freq = htole16(c->ic_freq); | |||||
sc->sc_txtap.wt_chan_flags = htole16(c->ic_flags); | |||||
URTWN_UNLOCK(sc); | URTWN_UNLOCK(sc); | ||||
} | } | ||||
static int | static int | ||||
urtwn_wme_update(struct ieee80211com *ic) | urtwn_wme_update(struct ieee80211com *ic) | ||||
{ | { | ||||
const struct wmeParams *wmep = | const struct wmeParams *wmep = | ||||
ic->ic_wme.wme_chanParams.cap_wmeParams; | ic->ic_wme.wme_chanParams.cap_wmeParams; | ||||
▲ Show 20 Lines • Show All 603 Lines • Show Last 20 Lines |