diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-debugfs.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-debugfs.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c index 7d9ffc1575de..088a2c13f59b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c | |||
@@ -1487,7 +1487,7 @@ static ssize_t iwl_dbgfs_force_reset_write(struct file *file, | |||
1487 | switch (reset) { | 1487 | switch (reset) { |
1488 | case IWL_RF_RESET: | 1488 | case IWL_RF_RESET: |
1489 | case IWL_FW_RESET: | 1489 | case IWL_FW_RESET: |
1490 | ret = iwl_force_reset(priv, reset); | 1490 | ret = iwl_force_reset(priv, reset, true); |
1491 | break; | 1491 | break; |
1492 | default: | 1492 | default: |
1493 | return -EINVAL; | 1493 | return -EINVAL; |
@@ -1495,6 +1495,30 @@ static ssize_t iwl_dbgfs_force_reset_write(struct file *file, | |||
1495 | return ret ? ret : count; | 1495 | return ret ? ret : count; |
1496 | } | 1496 | } |
1497 | 1497 | ||
1498 | static ssize_t iwl_dbgfs_txfifo_flush_write(struct file *file, | ||
1499 | const char __user *user_buf, | ||
1500 | size_t count, loff_t *ppos) { | ||
1501 | |||
1502 | struct iwl_priv *priv = file->private_data; | ||
1503 | char buf[8]; | ||
1504 | int buf_size; | ||
1505 | int flush; | ||
1506 | |||
1507 | memset(buf, 0, sizeof(buf)); | ||
1508 | buf_size = min(count, sizeof(buf) - 1); | ||
1509 | if (copy_from_user(buf, user_buf, buf_size)) | ||
1510 | return -EFAULT; | ||
1511 | if (sscanf(buf, "%d", &flush) != 1) | ||
1512 | return -EINVAL; | ||
1513 | |||
1514 | if (iwl_is_rfkill(priv)) | ||
1515 | return -EFAULT; | ||
1516 | |||
1517 | priv->cfg->ops->lib->dev_txfifo_flush(priv, IWL_DROP_ALL); | ||
1518 | |||
1519 | return count; | ||
1520 | } | ||
1521 | |||
1498 | DEBUGFS_READ_FILE_OPS(rx_statistics); | 1522 | DEBUGFS_READ_FILE_OPS(rx_statistics); |
1499 | DEBUGFS_READ_FILE_OPS(tx_statistics); | 1523 | DEBUGFS_READ_FILE_OPS(tx_statistics); |
1500 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); | 1524 | DEBUGFS_READ_WRITE_FILE_OPS(traffic_log); |
@@ -1516,6 +1540,7 @@ DEBUGFS_READ_WRITE_FILE_OPS(plcp_delta); | |||
1516 | DEBUGFS_READ_WRITE_FILE_OPS(force_reset); | 1540 | DEBUGFS_READ_WRITE_FILE_OPS(force_reset); |
1517 | DEBUGFS_READ_FILE_OPS(rxon_flags); | 1541 | DEBUGFS_READ_FILE_OPS(rxon_flags); |
1518 | DEBUGFS_READ_FILE_OPS(rxon_filter_flags); | 1542 | DEBUGFS_READ_FILE_OPS(rxon_filter_flags); |
1543 | DEBUGFS_WRITE_FILE_OPS(txfifo_flush); | ||
1519 | 1544 | ||
1520 | /* | 1545 | /* |
1521 | * Create the debugfs files and directories | 1546 | * Create the debugfs files and directories |
@@ -1574,6 +1599,8 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) | |||
1574 | DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); | 1599 | DEBUGFS_ADD_FILE(ucode_rx_stats, dir_debug, S_IRUSR); |
1575 | DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); | 1600 | DEBUGFS_ADD_FILE(ucode_tx_stats, dir_debug, S_IRUSR); |
1576 | DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR); | 1601 | DEBUGFS_ADD_FILE(ucode_general_stats, dir_debug, S_IRUSR); |
1602 | if (priv->cfg->ops->lib->dev_txfifo_flush) | ||
1603 | DEBUGFS_ADD_FILE(txfifo_flush, dir_debug, S_IWUSR); | ||
1577 | 1604 | ||
1578 | if (priv->cfg->sensitivity_calib_by_driver) | 1605 | if (priv->cfg->sensitivity_calib_by_driver) |
1579 | DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); | 1606 | DEBUGFS_ADD_FILE(sensitivity, dir_debug, S_IRUSR); |