summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/wlan/if_rum.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2009-03-29 21:17:08 +0000
committersam <sam@FreeBSD.org>2009-03-29 21:17:08 +0000
commitf7c50ce1e4a47dd26c6dc6d42d8a07343e9d020b (patch)
tree3adee507d18d3410de7636b1c9fdf73932df5b00 /sys/dev/usb/wlan/if_rum.c
parent616f4bd2e5f839f51b2cfd6f131a31b7d81e837c (diff)
downloadFreeBSD-src-f7c50ce1e4a47dd26c6dc6d42d8a07343e9d020b.zip
FreeBSD-src-f7c50ce1e4a47dd26c6dc6d42d8a07343e9d020b.tar.gz
o add ic_rt to track the rate table for the current channel; this enables
calculation of packet transmit times to do things like check txop limits o remove equivalent driver code and convert to use net80211 state
Diffstat (limited to 'sys/dev/usb/wlan/if_rum.c')
-rw-r--r--sys/dev/usb/wlan/if_rum.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c
index bfe38a1..fbdb792 100644
--- a/sys/dev/usb/wlan/if_rum.c
+++ b/sys/dev/usb/wlan/if_rum.c
@@ -527,8 +527,6 @@ rum_attach_post(struct usb2_proc_msg *pm)
ic->ic_vap_create = rum_vap_create;
ic->ic_vap_delete = rum_vap_delete;
- sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan);
-
bpfattach(ifp, DLT_IEEE802_11_RADIO,
sizeof (struct ieee80211_frame) + sizeof(sc->sc_txtap));
@@ -1067,7 +1065,7 @@ rum_setup_tx_desc(struct rum_softc *sc, struct rum_tx_desc *desc,
desc->plcp_service = 4;
len += IEEE80211_CRC_LEN;
- if (ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM) {
+ if (ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM) {
desc->flags |= htole32(RT2573_TX_OFDM);
plcp_length = len & 0xfff;
@@ -1106,16 +1104,16 @@ rum_sendprot(struct rum_softc *sc,
wh = mtod(m, const struct ieee80211_frame *);
pktlen = m->m_pkthdr.len + IEEE80211_CRC_LEN;
- protrate = ieee80211_ctl_rate(sc->sc_rates, rate);
- ackrate = ieee80211_ack_rate(sc->sc_rates, rate);
+ protrate = ieee80211_ctl_rate(ic->ic_rt, rate);
+ ackrate = ieee80211_ack_rate(ic->ic_rt, rate);
isshort = (ic->ic_flags & IEEE80211_F_SHPREAMBLE) != 0;
- dur = ieee80211_compute_duration(sc->sc_rates, pktlen, rate, isshort);
- + ieee80211_ack_duration(sc->sc_rates, rate, isshort);
+ dur = ieee80211_compute_duration(ic->ic_rt, pktlen, rate, isshort);
+ + ieee80211_ack_duration(ic->ic_rt, rate, isshort);
flags = RT2573_TX_MORE_FRAG;
if (prot == IEEE80211_PROT_RTSCTS) {
/* NB: CTS is the same size as an ACK */
- dur += ieee80211_ack_duration(sc->sc_rates, rate, isshort);
+ dur += ieee80211_ack_duration(ic->ic_rt, rate, isshort);
flags |= RT2573_TX_NEED_ACK;
mprot = ieee80211_alloc_rts(ic, wh->i_addr1, wh->i_addr2, dur);
} else {
@@ -1174,7 +1172,7 @@ rum_tx_mgt(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
if (!IEEE80211_IS_MULTICAST(wh->i_addr1)) {
flags |= RT2573_TX_NEED_ACK;
- dur = ieee80211_ack_duration(sc->sc_rates, tp->mgmtrate,
+ dur = ieee80211_ack_duration(ic->ic_rt, tp->mgmtrate,
ic->ic_flags & IEEE80211_F_SHPREAMBLE);
*(uint16_t *)wh->i_dur = htole16(dur);
@@ -1294,7 +1292,7 @@ rum_tx_data(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
if (m0->m_pkthdr.len + IEEE80211_CRC_LEN > vap->iv_rtsthreshold)
prot = IEEE80211_PROT_RTSCTS;
else if ((ic->ic_flags & IEEE80211_F_USEPROT) &&
- ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_OFDM)
+ ieee80211_rate2phytype(ic->ic_rt, rate) == IEEE80211_T_OFDM)
prot = ic->ic_protmode;
if (prot != IEEE80211_PROT_NONE) {
error = rum_sendprot(sc, m0, ni, prot, rate);
@@ -1318,7 +1316,7 @@ rum_tx_data(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
flags |= RT2573_TX_NEED_ACK;
flags |= RT2573_TX_MORE_FRAG;
- dur = ieee80211_ack_duration(sc->sc_rates, rate,
+ dur = ieee80211_ack_duration(ic->ic_rt, rate,
ic->ic_flags & IEEE80211_F_SHPREAMBLE);
*(uint16_t *)wh->i_dur = htole16(dur);
}
@@ -2367,7 +2365,6 @@ rum_set_channel(struct ieee80211com *ic)
RUM_LOCK(sc);
/* do it in a process context */
sc->sc_scan_action = RUM_SET_CHANNEL;
- sc->sc_rates = ieee80211_get_ratetable(ic->ic_curchan);
rum_queue_command(sc, rum_scantask,
&sc->sc_scantask[0].hdr, &sc->sc_scantask[1].hdr);
RUM_UNLOCK(sc);
OpenPOWER on IntegriCloud