From owner-p4-projects@FreeBSD.ORG Mon Mar 10 22:15:05 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AD9A11065670; Mon, 10 Mar 2008 22:15:04 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21ABD106566B for ; Mon, 10 Mar 2008 22:15:04 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E6A708FC1C for ; Mon, 10 Mar 2008 22:15:03 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m2AMF3W4054436 for ; Mon, 10 Mar 2008 22:15:03 GMT (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m2AMF32L054434 for perforce@freebsd.org; Mon, 10 Mar 2008 22:15:03 GMT (envelope-from sam@freebsd.org) Date: Mon, 10 Mar 2008 22:15:03 GMT Message-Id: <200803102215.m2AMF32L054434@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Cc: Subject: PERFORCE change 137362 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Mar 2008 22:15:09 -0000 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? */