aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debugfs.c
diff options
context:
space:
mode:
authorTrieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com>2010-01-22 17:22:46 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-25 16:36:21 -0500
commit3e4fb5faefb57824f2e42305b3d5907845af978c (patch)
treea9cb64dff2fea16e290ab29eb4260c973d52e88f /drivers/net/wireless/iwlwifi/iwl-debugfs.c
parentd4d59e88cb746165c6fe33eacb6f582d525c6ef1 (diff)
iwlwifi: Tune radio to prevent unexpected behavior
We have seen the throughput dropped due to external noisy environment and the radio is out of tune. There are lot of plcp errors indicating this condition. Eventually the station can get de-authenticated by the Access Point. By resetting and tuning the radio, the plcp errors are reduced or eliminated and the throughput starts to rise. To prevent unexpected behavior such as drop in throughput or deauthentication, - The change provides the driver feature to monitor and tune the radio base on the statistics notification from the uCode. - It also allows the setting of the plcp error rate threshold via the plcp_delta under debugfs interface. Signed-off-by: Trieu 'Andrew' Nguyen <trieux.t.nguyen@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 4944fdb31ba8..3f9c03998491 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -2195,6 +2195,47 @@ static ssize_t iwl_dbgfs_internal_scan_write(struct file *file,
2195 return count; 2195 return count;
2196} 2196}
2197 2197
2198static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file,
2199 char __user *user_buf,
2200 size_t count, loff_t *ppos) {
2201
2202 struct iwl_priv *priv = (struct iwl_priv *)file->private_data;
2203 int pos = 0;
2204 char buf[12];
2205 const size_t bufsz = sizeof(buf);
2206 ssize_t ret;
2207
2208 pos += scnprintf(buf + pos, bufsz - pos, "%u\n",
2209 priv->cfg->plcp_delta_threshold);
2210
2211 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
2212 return ret;
2213}
2214
2215static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file,
2216 const char __user *user_buf,
2217 size_t count, loff_t *ppos) {
2218
2219 struct iwl_priv *priv = file->private_data;
2220 char buf[8];
2221 int buf_size;
2222 int plcp;
2223
2224 memset(buf, 0, sizeof(buf));
2225 buf_size = min(count, sizeof(buf) - 1);
2226 if (copy_from_user(buf, user_buf, buf_size))
2227 return -EFAULT;
2228 if (sscanf(buf, "%d", &plcp) != 1)
2229 return -EINVAL;
2230 if ((plcp <= IWL_MAX_PLCP_ERR_THRESHOLD_MIN) ||
2231 (plcp > IWL_MAX_PLCP_ERR_THRESHOLD_MAX))
2232 priv->cfg->plcp_delta_threshold =
2233 IWL_MAX_PLCP_ERR_THRESHOLD_DEF;
2234 else
2235 priv->cfg->plcp_delta_threshold = plcp;
2236 return count;
2237}
2238
2198DEBUGFS_READ_FILE_OPS(rx_statistics); 2239DEBUGFS_READ_FILE_OPS(rx_statistics);
2199DEBUGFS_READ_FILE_OPS(tx_statistics); 2240DEBUGFS_READ_FILE_OPS(tx_statistics);
2200DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); 2241DEBUGFS_READ_WRITE_FILE_OPS(traffic_log);
@@ -2214,6 +2255,7 @@ DEBUGFS_READ_WRITE_FILE_OPS(ucode_tracing);
2214DEBUGFS_READ_FILE_OPS(fh_reg); 2255DEBUGFS_READ_FILE_OPS(fh_reg);
2215DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon); 2256DEBUGFS_READ_WRITE_FILE_OPS(missed_beacon);
2216DEBUGFS_WRITE_FILE_OPS(internal_scan); 2257DEBUGFS_WRITE_FILE_OPS(internal_scan);
2258DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta);
2217 2259
2218/* 2260/*
2219 * Create the debugfs files and directories 2261 * Create the debugfs files and directories
@@ -2268,6 +2310,7 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
2268 DEBUGFS_ADD_FILE(fh_reg, debug, S_IRUSR); 2310 DEBUGFS_ADD_FILE(fh_reg, debug, S_IRUSR);
2269 DEBUGFS_ADD_FILE(missed_beacon, debug, S_IWUSR); 2311 DEBUGFS_ADD_FILE(missed_beacon, debug, S_IWUSR);
2270 DEBUGFS_ADD_FILE(internal_scan, debug, S_IWUSR); 2312 DEBUGFS_ADD_FILE(internal_scan, debug, S_IWUSR);
2313 DEBUGFS_ADD_FILE(plcp_delta, debug, S_IWUSR | S_IRUSR);
2271 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { 2314 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
2272 DEBUGFS_ADD_FILE(ucode_rx_stats, debug, S_IRUSR); 2315 DEBUGFS_ADD_FILE(ucode_rx_stats, debug, S_IRUSR);
2273 DEBUGFS_ADD_FILE(ucode_tx_stats, debug, S_IRUSR); 2316 DEBUGFS_ADD_FILE(ucode_tx_stats, debug, S_IRUSR);
@@ -2330,6 +2373,7 @@ void iwl_dbgfs_unregister(struct iwl_priv *priv)
2330 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_fh_reg); 2373 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_fh_reg);
2331 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_missed_beacon); 2374 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_missed_beacon);
2332 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_internal_scan); 2375 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_internal_scan);
2376 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.file_plcp_delta);
2333 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) { 2377 if ((priv->hw_rev & CSR_HW_REV_TYPE_MSK) != CSR_HW_REV_TYPE_3945) {
2334 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files. 2378 DEBUGFS_REMOVE(priv->dbgfs->dbgfs_debug_files.
2335 file_ucode_rx_stats); 2379 file_ucode_rx_stats);