From owner-svn-src-head@FreeBSD.ORG Sat Dec 7 06:45:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8D89747; Sat, 7 Dec 2013 06:45:09 +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 B8964182F; Sat, 7 Dec 2013 06:45:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB76j9tF029263; Sat, 7 Dec 2013 06:45:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB76j9kr029262; Sat, 7 Dec 2013 06:45:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201312070645.rB76j9kr029262@svn.freebsd.org> From: Adrian Chadd Date: Sat, 7 Dec 2013 06:45:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259059 - 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-head@freebsd.org X-Mailman-Version: 2.1.17 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: Sat, 07 Dec 2013 06:45:09 -0000 Author: adrian Date: Sat Dec 7 06:45:09 2013 New Revision: 259059 URL: http://svnweb.freebsd.org/changeset/base/259059 Log: Add some PLCP thresholds from Linux iwlwifi driver in preparation for working on some RF tuning issues. The linux iwlwifi driver has these thresholds which they use to see if there are PLCP errors over a certain interval. If they hit this, they trigger a single-channel (different from active channels!) scan to retune the RF front-end. Modified: head/sys/dev/iwn/if_iwn_chip_cfg.h Modified: head/sys/dev/iwn/if_iwn_chip_cfg.h ============================================================================== --- head/sys/dev/iwn/if_iwn_chip_cfg.h Sat Dec 7 06:27:54 2013 (r259058) +++ head/sys/dev/iwn/if_iwn_chip_cfg.h Sat Dec 7 06:45:09 2013 (r259059) @@ -50,6 +50,14 @@ #define IWN_FLG_NEED_PHY_CALIB_TEMP_OFFSETv2 (1<<7) /* + * Each chip has a different threshold for PLCP errors that should trigger a + * retune. + */ +#define IWN_PLCP_ERR_DEFAULT_THRESHOLD 50 +#define IWN_PLCP_ERR_LONG_THRESHOLD 100 +#define IWN_PLCP_ERR_EXT_LONG_THRESHOLD 200 + +/* * Define some parameters for managing different NIC. * Refer to linux specific file like iwl-xxxx.c to determine correct value * for NIC. @@ -102,6 +110,7 @@ struct iwn_base_params { const bool no_multi_vaps; uint8_t additional_gp_drv_bit; enum bt_mode_enum bt_mode; + uint32_t plcp_err_threshold; }; static const struct iwn_base_params iwn5000_base_params = { @@ -123,6 +132,7 @@ static const struct iwn_base_params iwn5 .no_multi_vaps = true, /* no_multi_vaps */ .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, /* additional_gp_drv_bit */ .bt_mode = IWN_BT_NONE, /* bt_mode */ + .plcp_err_threshold = IWN_PLCP_ERR_LONG_THRESHOLD, }; /* @@ -148,6 +158,7 @@ static const struct iwn_base_params iwn4 .no_multi_vaps = true, /* no_multi_vaps - XXX should work on fixing! */ .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, /* additional_gp_drv_bit */ .bt_mode = IWN_BT_SIMPLE, /* bt_mode */ + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; @@ -171,6 +182,7 @@ static const struct iwn_base_params iwn2 .no_multi_vaps = false, .additional_gp_drv_bit = IWN_GP_DRIVER_REG_BIT_RADIO_IQ_INVERT, .bt_mode = IWN_BT_NONE, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; static const struct iwn_base_params iwn2030_base_params = { @@ -193,6 +205,7 @@ static const struct iwn_base_params iwn2 .no_multi_vaps = false, .additional_gp_drv_bit = IWN_GP_DRIVER_REG_BIT_RADIO_IQ_INVERT, .bt_mode = IWN_BT_ADVANCED, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; static const struct iwn_base_params iwn1000_base_params = { @@ -214,6 +227,7 @@ static const struct iwn_base_params iwn1 .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, .bt_mode = IWN_BT_NONE, + .plcp_err_threshold = IWN_PLCP_ERR_EXT_LONG_THRESHOLD, }; static const struct iwn_base_params iwn_6000_base_params = { .pll_cfg_val = 0, @@ -234,6 +248,7 @@ static const struct iwn_base_params iwn_ .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, .bt_mode = IWN_BT_SIMPLE, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; static const struct iwn_base_params iwn_6000i_base_params = { .pll_cfg_val = 0, @@ -254,6 +269,7 @@ static const struct iwn_base_params iwn_ .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, .bt_mode = IWN_BT_SIMPLE, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; static const struct iwn_base_params iwn_6000g2_base_params = { .pll_cfg_val = 0, @@ -275,6 +291,7 @@ static const struct iwn_base_params iwn_ .no_multi_vaps = true, .additional_gp_drv_bit = 0, .bt_mode = IWN_BT_SIMPLE, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; static const struct iwn_base_params iwn_6050_base_params = { @@ -296,6 +313,7 @@ static const struct iwn_base_params iwn_ .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, .bt_mode = IWN_BT_SIMPLE, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; static const struct iwn_base_params iwn_6150_base_params = { .pll_cfg_val = 0, @@ -315,6 +333,7 @@ static const struct iwn_base_params iwn_ .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_6050_1X2, .bt_mode = IWN_BT_SIMPLE, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; /* IWL_DEVICE_6035 & IWL_DEVICE_6030 */ @@ -338,6 +357,7 @@ static const struct iwn_base_params iwn_ .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, .bt_mode = IWN_BT_ADVANCED, + .plcp_err_threshold = IWN_PLCP_ERR_DEFAULT_THRESHOLD, }; static const struct iwn_base_params iwn_5x50_base_params = { .pll_cfg_val = IWN_ANA_PLL_INIT, @@ -358,6 +378,7 @@ static const struct iwn_base_params iwn_ .no_multi_vaps = true, .additional_gp_drv_bit = IWN_GP_DRIVER_NONE, .bt_mode = IWN_BT_SIMPLE, + .plcp_err_threshold = IWN_PLCP_ERR_LONG_THRESHOLD, }; #endif /* __IF_IWN_CHIP_CFG_H__ */