diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-08-23 10:57:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-25 14:34:20 -0400 |
commit | 7bdc473c7a52497af9fe8c73e4745615a2825aaa (patch) | |
tree | c3148d911d8f6be00b10b5ab20c26f5b8a810a2d /drivers/net | |
parent | c6c996b5de82b5de4b4b5a31941aab725961a6dd (diff) |
iwlwifi: add debugfs to control stuck queue timer
In current implementation, stuck queue timer is fixed to 1 second. Add
debugfs file to modify the timer to enhance the flexibility:
Set the monitor_period as following:
0: disable stuck queue force reset function
1 - 60000: monitor period (1 - 60 second)
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 30 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-dev.h | 1 |
3 files changed, 39 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 13d2dcea85d1..34cba38f1d0c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2697,12 +2697,14 @@ void iwl_bg_monitor_recover(unsigned long data) | |||
2697 | return; | 2697 | return; |
2698 | } | 2698 | } |
2699 | } | 2699 | } |
2700 | /* | 2700 | if (priv->cfg->monitor_recover_period) { |
2701 | * Reschedule the timer to occur in | 2701 | /* |
2702 | * priv->cfg->monitor_recover_period | 2702 | * Reschedule the timer to occur in |
2703 | */ | 2703 | * priv->cfg->monitor_recover_period |
2704 | mod_timer(&priv->monitor_recover, | 2704 | */ |
2705 | jiffies + msecs_to_jiffies(priv->cfg->monitor_recover_period)); | 2705 | mod_timer(&priv->monitor_recover, jiffies + msecs_to_jiffies( |
2706 | priv->cfg->monitor_recover_period)); | ||
2707 | } | ||
2706 | } | 2708 | } |
2707 | EXPORT_SYMBOL(iwl_bg_monitor_recover); | 2709 | EXPORT_SYMBOL(iwl_bg_monitor_recover); |
2708 | 2710 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index d3acdae72381..aae9eb552350 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -1527,6 +1527,34 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_read(struct file *file, | |||
1527 | user_buf, count, ppos); | 1527 | user_buf, count, ppos); |
1528 | } | 1528 | } |
1529 | 1529 | ||
1530 | static ssize_t iwl_dbgfs_monitor_period_write(struct file *file, | ||
1531 | const char __user *user_buf, | ||
1532 | size_t count, loff_t *ppos) { | ||
1533 | |||
1534 | struct iwl_priv *priv = file->private_data; | ||
1535 | char buf[8]; | ||
1536 | int buf_size; | ||
1537 | int period; | ||
1538 | |||
1539 | memset(buf, 0, sizeof(buf)); | ||
1540 | buf_size = min(count, sizeof(buf) - 1); | ||
1541 | if (copy_from_user(buf, user_buf, buf_size)) | ||
1542 | return -EFAULT; | ||
1543 | if (sscanf(buf, "%d", &period) != 1) | ||
1544 | return -EINVAL; | ||
1545 | if (period < 0 || period > IWL_MAX_MONITORING_PERIOD) | ||
1546 | priv->cfg->monitor_recover_period = IWL_DEF_MONITORING_PERIOD; | ||
1547 | else | ||
1548 | priv->cfg->monitor_recover_period = period; | ||
1549 | |||
1550 | if (priv->cfg->monitor_recover_period) | ||
1551 | mod_timer(&priv->monitor_recover, jiffies + msecs_to_jiffies( | ||
1552 | priv->cfg->monitor_recover_period)); | ||
1553 | else | ||
1554 | del_timer_sync(&priv->monitor_recover); | ||
1555 | return count; | ||
1556 | } | ||
1557 | |||
1530 | DEBUGFS_READ_FILE_OPS(rx_statistics); | 1558 | DEBUGFS_READ_FILE_OPS(rx_statistics); |
1531 | DEBUGFS_READ_FILE_OPS(tx_statistics); | 1559 | DEBUGFS_READ_FILE_OPS(tx_statistics); |
1532 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); | 1560 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); |
@@ -1550,6 +1578,7 @@ DEBUGFS_READ_FILE_OPS(rxon_flags); | |||
1550 | DEBUGFS_READ_FILE_OPS(rxon_filter_flags); | 1578 | DEBUGFS_READ_FILE_OPS(rxon_filter_flags); |
1551 | DEBUGFS_WRITE_FILE_OPS(txfifo_flush); | 1579 | DEBUGFS_WRITE_FILE_OPS(txfifo_flush); |
1552 | DEBUGFS_READ_FILE_OPS(ucode_bt_stats); | 1580 | DEBUGFS_READ_FILE_OPS(ucode_bt_stats); |
1581 | DEBUGFS_WRITE_FILE_OPS(monitor_period); | ||
1553 | 1582 | ||
1554 | /* | 1583 | /* |
1555 | * Create the debugfs files and directories | 1584 | * Create the debugfs files and directories |
@@ -1621,6 +1650,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1621 | DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR); | 1650 | DEBUGFS_ADD_FILE(ucode_bt_stats, dir_debug, S_IRUSR); |
1622 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); | 1651 | DEBUGFS_ADD_FILE(rxon_flags, dir_debug, S_IWUSR); |
1623 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); | 1652 | DEBUGFS_ADD_FILE(rxon_filter_flags, dir_debug, S_IWUSR); |
1653 | DEBUGFS_ADD_FILE(monitor_period, dir_debug, S_IWUSR); | ||
1624 | if (priv->cfg->sensitivity_calib_by_driver) | 1654 | if (priv->cfg->sensitivity_calib_by_driver) |
1625 | DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, | 1655 | DEBUGFS_ADD_BOOL(disable_sensitivity, dir_rf, |
1626 | &priv->disable_sens_cal); | 1656 | &priv->disable_sens_cal); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h index 7a96d9dd1732..bb92a7f01988 100644 --- a/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/drivers/net/wireless/iwlwifi/iwl-dev.h | |||
@@ -1064,6 +1064,7 @@ struct iwl_event_log { | |||
1064 | #define IWL_DEF_MONITORING_PERIOD (1000) | 1064 | #define IWL_DEF_MONITORING_PERIOD (1000) |
1065 | #define IWL_LONG_MONITORING_PERIOD (5000) | 1065 | #define IWL_LONG_MONITORING_PERIOD (5000) |
1066 | #define IWL_ONE_HUNDRED_MSECS (100) | 1066 | #define IWL_ONE_HUNDRED_MSECS (100) |
1067 | #define IWL_MAX_MONITORING_PERIOD (60000) | ||
1067 | 1068 | ||
1068 | /* BT Antenna Coupling Threshold (dB) */ | 1069 | /* BT Antenna Coupling Threshold (dB) */ |
1069 | #define IWL_BT_ANTENNA_COUPLING_THRESHOLD (35) | 1070 | #define IWL_BT_ANTENNA_COUPLING_THRESHOLD (35) |