From owner-svn-src-head@freebsd.org Fri Jul 8 22:39:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A4BB840F5; Fri, 8 Jul 2016 22:39:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AD3418E2; Fri, 8 Jul 2016 22:39:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u68MdbJY001157; Fri, 8 Jul 2016 22:39:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u68MdbJD001156; Fri, 8 Jul 2016 22:39:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201607082239.u68MdbJD001156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 8 Jul 2016 22:39:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302467 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jul 2016 22:39:38 -0000 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;