From owner-svn-src-all@FreeBSD.ORG Sat Mar 1 02:57:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB159C6C; Sat, 1 Mar 2014 02:57:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A6AE61618; Sat, 1 Mar 2014 02:57:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s212vMmS025873; Sat, 1 Mar 2014 02:57:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s212vMEY025872; Sat, 1 Mar 2014 02:57:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201403010257.s212vMEY025872@svn.freebsd.org> From: Adrian Chadd Date: Sat, 1 Mar 2014 02:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r262642 - head/sys/dev/iwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Mar 2014 02:57:22 -0000 Author: adrian Date: Sat Mar 1 02:57:22 2014 New Revision: 262642 URL: http://svnweb.freebsd.org/changeset/base/262642 Log: Add the bluetooth information structs to the firmware RX statistics message. It turns out that there's a variant format of the RX statisitcs notification from the intel firmware. It's even more whacked - the non-BT variant has bluetooth fields; apparently some later NICs return even _more_ bluetooth related fields. I'll commit the statistics structure changes here - it's a no-op for the driver. I'll later teach the driver code to populate a statistics structure from the received message after reformatting things correctly. I don't _think_ it's going to fix anything related to sensitivity programming as the CCK/OFDM (non-11n) fields are in the same place for both formats. But the HT structure and the general statistics aren't in the same place. I'll go find some NIC(s) that spit out the other format and when I find one, I'll go and update the driver to handle things correctly. Tested: * Intel 5100 (which returns the legacy, non-BT format) Obtained from: Linux iwlwifi Modified: head/sys/dev/iwn/if_iwnreg.h Modified: head/sys/dev/iwn/if_iwnreg.h ============================================================================== --- head/sys/dev/iwn/if_iwnreg.h Sat Mar 1 00:42:13 2014 (r262641) +++ head/sys/dev/iwn/if_iwnreg.h Sat Mar 1 02:57:22 2014 (r262642) @@ -1509,7 +1509,7 @@ struct iwn_rx_ht_phy_stats { uint32_t good_ampdu_crc32; uint32_t ampdu; uint32_t fragment; - uint32_t reserved; + uint32_t unsupport_mcs; } __packed; struct iwn_rx_stats { @@ -1519,6 +1519,20 @@ struct iwn_rx_stats { struct iwn_rx_ht_phy_stats ht; } __packed; +struct iwn_rx_general_stats_bt { + struct iwn_rx_general_stats common; + /* additional stats for bt */ + uint32_t num_bt_kills; + uint32_t reserved[2]; +} __packed; + +struct iwn_rx_stats_bt { + struct iwn_rx_phy_stats ofdm; + struct iwn_rx_phy_stats cck; + struct iwn_rx_general_stats_bt general_bt; + struct iwn_rx_ht_phy_stats ht; +} __packed; + struct iwn_tx_stats { uint32_t preamble; uint32_t rx_detected; @@ -1544,15 +1558,21 @@ struct iwn_tx_stats { uint32_t underrun; uint32_t bt_ht_kill; uint32_t rx_ba_resp; - uint32_t reserved[2]; + /* + * 6000 series only - LSB=ant A, ant B, ant C, MSB=reserved + * TX power on chain in 1/2 dBm. + */ + uint32_t tx_power; + uint32_t reserved[1]; } __packed; struct iwn_general_stats { - uint32_t temp; - uint32_t temp_m; + uint32_t temp; /* radio temperature */ + uint32_t temp_m; /* radio voltage */ uint32_t burst_check; uint32_t burst; - uint32_t reserved1[4]; + uint32_t wait_for_silence_timeout_cnt; + uint32_t reserved1[3]; uint32_t sleep; uint32_t slot_out; uint32_t slot_idle; @@ -1563,7 +1583,11 @@ struct iwn_general_stats { uint32_t probe; uint32_t reserved2[2]; uint32_t rx_enabled; - uint32_t reserved3[3]; + /* + * This is the number of times we have to re-tune + * in order to get out of bad PHY status. + */ + uint32_t num_of_sos_states; } __packed; struct iwn_stats { @@ -1571,8 +1595,30 @@ struct iwn_stats { struct iwn_rx_stats rx; struct iwn_tx_stats tx; struct iwn_general_stats general; + uint32_t reserved1[2]; } __packed; +struct iwn_bt_activity_stats { + /* Tx statistics */ + uint32_t hi_priority_tx_req_cnt; + uint32_t hi_priority_tx_denied_cnt; + uint32_t lo_priority_tx_req_cnt; + uint32_t lo_priority_tx_denied_cnt; + /* Rx statistics */ + uint32_t hi_priority_rx_req_cnt; + uint32_t hi_priority_rx_denied_cnt; + uint32_t lo_priority_rx_req_cnt; + uint32_t lo_priority_rx_denied_cnt; +} __packed; + +struct iwn_stats_bt { + uint32_t flags; + struct iwn_rx_stats_bt rx_bt; + struct iwn_tx_stats tx; + struct iwn_general_stats general; + struct iwn_bt_activity_stats activity; + uint32_t reserved1[2]; +}; /* Firmware error dump. */ struct iwn_fw_dump {