svn commit: r302467 - head/sys/contrib/dev/ath/ath_hal/ar9300
Adrian Chadd
adrian at FreeBSD.org
Fri Jul 8 22:39:38 UTC 2016
Author: adrian
Date: Fri Jul 8 22:39:37 2016
New Revision: 302467
URL: https://svnweb.freebsd.org/changeset/base/302467
Log:
[ath_hal] add locationing / tx-beamforming RX status descriptor decoding.
* LOC_INFO is mostly just "did this packet come with a locationing
timestamp instead of TSF";
* Decode not-sounding, uploaded-data, data-valid, data type and
number of extension spatial streams.
Modified:
head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c
Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c
==============================================================================
--- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c Fri Jul 8 22:37:52 2016 (r302466)
+++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_recv_ds.c Fri Jul 8 22:39:37 2016 (r302467)
@@ -94,8 +94,15 @@ ar9300_proc_rx_desc_fast(struct ath_hal
rxs->rs_moreaggr = (rxsp->status11 & AR_rx_more_aggr) ? 1 : 0;
rxs->rs_antenna = (MS(rxsp->status4, AR_rx_antenna) & 0x7);
rxs->rs_flags = (rxsp->status11 & AR_apsd_trig) ? HAL_RX_IS_APSD : 0;
- rxs->rs_flags |= (rxsp->status4 & AR_gi) ? HAL_RX_GI : 0;
- rxs->rs_flags |= (rxsp->status4 & AR_2040) ? HAL_RX_2040 : 0;
+ rxs->rs_flags |= (rxsp->status4 & AR_gi) ? HAL_RX_GI : 0;
+ rxs->rs_flags |= (rxsp->status4 & AR_2040) ? HAL_RX_2040 : 0;
+
+ /* TX beamforming; CSI for locationing */
+ rxs->rs_flags |= (rxsp->status2 & AR_hw_upload_data) ? HAL_RX_HW_UPLOAD_DATA : 0;
+ rxs->rs_flags |= (rxsp->status4 & AR_rx_not_sounding) ? 0 : HAL_RX_HW_SOUNDING;
+ rxs->rs_ness = MS(rxsp->status4, AR_rx_ness);
+ rxs->rs_flags |= (rxsp->status4 & AR_hw_upload_data_valid) ? HAL_RX_UPLOAD_VALID : 0;
+ rxs->rs_hw_upload_data_type = MS(rxsp->status11, AR_hw_upload_data_type);
/* Copy EVM information */
rxs->rs_evm0 = rxsp->status6;
@@ -133,9 +140,9 @@ ar9300_proc_rx_desc_fast(struct ath_hal
if (rxsp->status11 & AR_crc_err) {
rxs->rs_status |= HAL_RXERR_CRC;
- /*
- * ignore CRC flag for phy reports
- */
+ /*
+ * ignore CRC flag for phy reports
+ */
if (rxsp->status11 & AR_phyerr) {
u_int phyerr = MS(rxsp->status11, AR_phy_err_code);
rxs->rs_status |= HAL_RXERR_PHY;
@@ -164,6 +171,23 @@ ar9300_proc_rx_desc_fast(struct ath_hal
} else if (rxsp->status11 & AR_michael_err) {
rxs->rs_status |= HAL_RXERR_MIC;
}
+ } else {
+ if (rxsp->status11 & AR_position_bit) {
+#if 1
+ rxs->rs_flags |= HAL_RX_LOC_INFO;
+#else
+ /*
+ * If the locationing counter is enabled, Osprey always
+ * seems to put AR_position_bit in each frame.
+ * So, only do this if we also have a valid upload
+ * and it's type "1" (which I'm guessing is CSI.)
+ */
+ if ((rxs->rs_flags & HAL_RX_UPLOAD_VALID) &&
+ (rxs->rs_hw_upload_data_type == 1)) {
+ rxs->rs_flags |= HAL_RX_LOC_INFO;
+ }
+#endif
+ }
}
#if 0
rxs->rs_channel = AH_PRIVATE(ah)->ah_curchan->channel;
More information about the svn-src-head
mailing list