iwlwifi: default max event log size
authorWey-Yi Guy <wey-yi.w.guy@intel.com>
Fri, 26 Mar 2010 19:54:37 +0000 (12:54 -0700)
committerReinette Chatre <reinette.chatre@intel.com>
Fri, 9 Apr 2010 18:27:21 +0000 (11:27 -0700)
Size of event log is determined by uCode which is different per NICs.
Set the maximum event log size per device to better match uCode
configuration.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-3945.c
drivers/net/wireless/iwlwifi/iwl-4965.c
drivers/net/wireless/iwlwifi/iwl-5000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/net/wireless/iwlwifi/iwl3945-base.c

index b941b3e956976a8f4cbe59e253b91c20eb92456f..9a0191a5ea35761e5e412aaeaeb5e6e23d950d8e 100644 (file)
@@ -253,6 +253,7 @@ struct iwl_cfg iwl1000_bgn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 128,
 };
 
 struct iwl_cfg iwl1000_bg_cfg = {
@@ -282,6 +283,7 @@ struct iwl_cfg iwl1000_bg_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 128,
 };
 
 MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));
index f88f75dfd96e6ecd497caa132442e0ed4e8ef68d..7424586a5edbe92c9d04e29da96c07900673f76d 100644 (file)
@@ -2770,6 +2770,7 @@ static struct iwl_cfg iwl3945_bg_cfg = {
        .broken_powersave = true,
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 static struct iwl_cfg iwl3945_abg_cfg = {
@@ -2789,6 +2790,7 @@ static struct iwl_cfg iwl3945_abg_cfg = {
        .broken_powersave = true,
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 DEFINE_PCI_DEVICE_TABLE(iwl3945_hw_card_ids) = {
index 6edae9b83bb7785dec0ad77be07fdcee2b849e43..0164c3f2109d99de686b0530c64c518f1eb4f21a 100644 (file)
@@ -2250,6 +2250,7 @@ struct iwl_cfg iwl4965_agn_cfg = {
        .monitor_recover_period = IWL_MONITORING_PERIOD,
        .temperature_kelvin = true,
        .off_channel_workaround = true,
+       .max_event_log_size = 512,
 };
 
 /* Module firmware */
index ecc302e4c20583801f8fa92902d2eed834c5c043..e967cfcac2249adfb9493e058df2d3abbd97f0c3 100644 (file)
@@ -423,6 +423,7 @@ struct iwl_cfg iwl5300_agn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 struct iwl_cfg iwl5100_bgn_cfg = {
@@ -450,6 +451,7 @@ struct iwl_cfg iwl5100_bgn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 struct iwl_cfg iwl5100_abg_cfg = {
@@ -475,6 +477,7 @@ struct iwl_cfg iwl5100_abg_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 struct iwl_cfg iwl5100_agn_cfg = {
@@ -502,6 +505,7 @@ struct iwl_cfg iwl5100_agn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 struct iwl_cfg iwl5350_agn_cfg = {
@@ -529,6 +533,7 @@ struct iwl_cfg iwl5350_agn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 struct iwl_cfg iwl5150_agn_cfg = {
@@ -556,6 +561,7 @@ struct iwl_cfg iwl5150_agn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 struct iwl_cfg iwl5150_abg_cfg = {
@@ -581,6 +587,7 @@ struct iwl_cfg iwl5150_abg_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 512,
 };
 
 MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
index 7473518e7e0a84d17674031e83a61a8ce3db0ce4..dd03384432f48b5a0b51da0a657257d5f8ba2182 100644 (file)
@@ -394,6 +394,7 @@ struct iwl_cfg iwl6000i_g2_2agn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 1024,
 };
 
 struct iwl_cfg iwl6000i_2agn_cfg = {
@@ -427,6 +428,7 @@ struct iwl_cfg iwl6000i_2agn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 1024,
 };
 
 struct iwl_cfg iwl6000i_2abg_cfg = {
@@ -459,6 +461,7 @@ struct iwl_cfg iwl6000i_2abg_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 1024,
 };
 
 struct iwl_cfg iwl6000i_2bg_cfg = {
@@ -491,6 +494,7 @@ struct iwl_cfg iwl6000i_2bg_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 1024,
 };
 
 struct iwl_cfg iwl6050_2agn_cfg = {
@@ -524,6 +528,7 @@ struct iwl_cfg iwl6050_2agn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .chain_noise_scale = 1500,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 1024,
 };
 
 struct iwl_cfg iwl6050_2abg_cfg = {
@@ -556,6 +561,7 @@ struct iwl_cfg iwl6050_2abg_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .chain_noise_scale = 1500,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 1024,
 };
 
 struct iwl_cfg iwl6000_3agn_cfg = {
@@ -589,6 +595,7 @@ struct iwl_cfg iwl6000_3agn_cfg = {
        .plcp_delta_threshold = IWL_MAX_PLCP_ERR_THRESHOLD_DEF,
        .chain_noise_scale = 1000,
        .monitor_recover_period = IWL_MONITORING_PERIOD,
+       .max_event_log_size = 1024,
 };
 
 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX));
index 4f0cb803f732db76f60fb1ad1c78e26abb60f0f1..978604f8ae92997b79a240dea817efc6b22e29ac 100644 (file)
@@ -1990,9 +1990,6 @@ static int iwl_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
        return pos;
 }
 
-/* For sanity check only.  Actual size is determined by uCode, typ. 512 */
-#define MAX_EVENT_LOG_SIZE (512)
-
 #define DEFAULT_DUMP_EVENT_LOG_ENTRIES (20)
 
 int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
@@ -2025,16 +2022,16 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
        num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
        next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
 
-       if (capacity > MAX_EVENT_LOG_SIZE) {
+       if (capacity > priv->cfg->max_event_log_size) {
                IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n",
-                       capacity, MAX_EVENT_LOG_SIZE);
-               capacity = MAX_EVENT_LOG_SIZE;
+                       capacity, priv->cfg->max_event_log_size);
+               capacity = priv->cfg->max_event_log_size;
        }
 
-       if (next_entry > MAX_EVENT_LOG_SIZE) {
+       if (next_entry > priv->cfg->max_event_log_size) {
                IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n",
-                       next_entry, MAX_EVENT_LOG_SIZE);
-               next_entry = MAX_EVENT_LOG_SIZE;
+                       next_entry, priv->cfg->max_event_log_size);
+               next_entry = priv->cfg->max_event_log_size;
        }
 
        size = num_wraps ? capacity : next_entry;
index 10f95724536f1ce7963be1c5ff702e9e75dabbeb..d89755f5031acef5d46ec5f02e0fbe6537475e91 100644 (file)
@@ -307,6 +307,7 @@ struct iwl_cfg {
        u32 monitor_recover_period;
        bool temperature_kelvin;
        bool off_channel_workaround;
+       u32 max_event_log_size;
 };
 
 /***************************
index c9188b9c565107dc7e349ad2bb2ef1fee05cf2fc..24e969440b319f27892d46ea4567b7680e58f2f3 100644 (file)
@@ -1603,9 +1603,6 @@ static int iwl3945_print_last_event_logs(struct iwl_priv *priv, u32 capacity,
        return pos;
 }
 
-/* For sanity check only.  Actual size is determined by uCode, typ. 512 */
-#define IWL3945_MAX_EVENT_LOG_SIZE (512)
-
 #define DEFAULT_IWL3945_DUMP_EVENT_LOG_ENTRIES (20)
 
 int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
@@ -1632,16 +1629,16 @@ int iwl3945_dump_nic_event_log(struct iwl_priv *priv, bool full_log,
        num_wraps = iwl_read_targ_mem(priv, base + (2 * sizeof(u32)));
        next_entry = iwl_read_targ_mem(priv, base + (3 * sizeof(u32)));
 
-       if (capacity > IWL3945_MAX_EVENT_LOG_SIZE) {
+       if (capacity > priv->cfg->max_event_log_size) {
                IWL_ERR(priv, "Log capacity %d is bogus, limit to %d entries\n",
-                       capacity, IWL3945_MAX_EVENT_LOG_SIZE);
-               capacity = IWL3945_MAX_EVENT_LOG_SIZE;
+                       capacity, priv->cfg->max_event_log_size);
+               capacity = priv->cfg->max_event_log_size;
        }
 
-       if (next_entry > IWL3945_MAX_EVENT_LOG_SIZE) {
+       if (next_entry > priv->cfg->max_event_log_size) {
                IWL_ERR(priv, "Log write index %d is bogus, limit to %d\n",
-                       next_entry, IWL3945_MAX_EVENT_LOG_SIZE);
-               next_entry = IWL3945_MAX_EVENT_LOG_SIZE;
+                       next_entry, priv->cfg->max_event_log_size);
+               next_entry = priv->cfg->max_event_log_size;
        }
 
        size = num_wraps ? capacity : next_entry;