Date: Mon, 10 Mar 2008 22:15:03 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 137362 for review Message-ID: <200803102215.m2AMF32L054434@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=137362 Change 137362 by sam@sam_ebb on 2008/03/10 22:14:10 Report the current tx rate in .5 Mb/s units so user code doesn't need to know about channel width and short/long GI for ht operation; this is still not entirely accurate as these parameters can vary per-packet so we could maintain a running rate based on recent packets but since this is really for reporting a subjective value to user space this will do for now. Note there is no abi change as there was a hole in the sta info structure this new field fits in and we intentionally leave the old data so old code will work. Affected files ... .. //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#41 edit .. //depot/projects/vap/sys/net80211/ieee80211_ioctl.h#16 edit Differences ... ==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.c#41 (text+ko) ==== @@ -399,6 +399,22 @@ si->isi_nrates = 15; memcpy(si->isi_rates, ni->ni_rates.rs_rates, si->isi_nrates); si->isi_txrate = ni->ni_txrate; + if (si->isi_txrate & IEEE80211_RATE_MCS) { + const struct ieee80211_mcs_rates *mcs = + &ieee80211_htrates[ni->ni_txrate &~ IEEE80211_RATE_MCS]; + if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { + if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) + si->isi_txmbps = mcs->ht40_rate_800ns; + else + si->isi_txmbps = mcs->ht40_rate_400ns; + } else { + if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) + si->isi_txmbps = mcs->ht20_rate_800ns; + else + si->isi_txmbps = mcs->ht20_rate_400ns; + } + } else + si->isi_txmbps = si->isi_txrate; si->isi_associd = ni->ni_associd; si->isi_txpower = ni->ni_txpower; si->isi_vlan = ni->ni_vlan; ==== //depot/projects/vap/sys/net80211/ieee80211_ioctl.h#16 (text+ko) ==== @@ -363,6 +363,7 @@ uint16_t isi_txseqs[IEEE80211_TID_SIZE];/* tx seq #/TID */ uint16_t isi_rxseqs[IEEE80211_TID_SIZE];/* rx seq#/TID */ uint16_t isi_inact; /* inactivity timer */ + uint16_t isi_txmbps; /* current tx rate in .5 Mb/s */ uint32_t isi_jointime; /* time of assoc/join */ struct ieee80211_mimo_info isi_mimo; /* MIMO info for 11n sta's */ /* XXX frag state? */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200803102215.m2AMF32L054434>