|
@@ -257,6 +257,60 @@ static ssize_t iwl_dbgfs_sram_write(struct iwl_mvm *mvm, char *buf,
|
|
|
return count;
|
|
|
}
|
|
|
|
|
|
+static ssize_t iwl_dbgfs_set_nic_temperature_read(struct file *file,
|
|
|
+ char __user *user_buf,
|
|
|
+ size_t count, loff_t *ppos)
|
|
|
+{
|
|
|
+ struct iwl_mvm *mvm = file->private_data;
|
|
|
+ char buf[16];
|
|
|
+ int pos;
|
|
|
+
|
|
|
+ if (!mvm->temperature_test)
|
|
|
+ pos = scnprintf(buf , sizeof(buf), "disabled\n");
|
|
|
+ else
|
|
|
+ pos = scnprintf(buf , sizeof(buf), "%d\n", mvm->temperature);
|
|
|
+
|
|
|
+ return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
|
|
|
+}
|
|
|
+
|
|
|
+/*
|
|
|
+ * Set NIC Temperature
|
|
|
+ * Cause the driver to ignore the actual NIC temperature reported by the FW
|
|
|
+ * Enable: any value between IWL_MVM_DEBUG_SET_TEMPERATURE_MIN -
|
|
|
+ * IWL_MVM_DEBUG_SET_TEMPERATURE_MAX
|
|
|
+ * Disable: IWL_MVM_DEBUG_SET_TEMPERATURE_DISABLE
|
|
|
+ */
|
|
|
+static ssize_t iwl_dbgfs_set_nic_temperature_write(struct iwl_mvm *mvm,
|
|
|
+ char *buf, size_t count,
|
|
|
+ loff_t *ppos)
|
|
|
+{
|
|
|
+ int temperature;
|
|
|
+
|
|
|
+ if (kstrtoint(buf, 10, &temperature))
|
|
|
+ return -EINVAL;
|
|
|
+ /* not a legal temperature */
|
|
|
+ if ((temperature > IWL_MVM_DEBUG_SET_TEMPERATURE_MAX &&
|
|
|
+ temperature != IWL_MVM_DEBUG_SET_TEMPERATURE_DISABLE) ||
|
|
|
+ temperature < IWL_MVM_DEBUG_SET_TEMPERATURE_MIN)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
+ mutex_lock(&mvm->mutex);
|
|
|
+ if (temperature == IWL_MVM_DEBUG_SET_TEMPERATURE_DISABLE) {
|
|
|
+ mvm->temperature_test = false;
|
|
|
+ } else {
|
|
|
+ mvm->temperature_test = true;
|
|
|
+ mvm->temperature = temperature;
|
|
|
+ }
|
|
|
+ IWL_DEBUG_TEMP(mvm, "%sabling debug set temperature (temp = %d)\n",
|
|
|
+ mvm->temperature_test ? "En" : "Dis" ,
|
|
|
+ mvm->temperature);
|
|
|
+ /* handle the temperature change */
|
|
|
+ iwl_mvm_tt_handler(mvm);
|
|
|
+ mutex_unlock(&mvm->mutex);
|
|
|
+
|
|
|
+ return count;
|
|
|
+}
|
|
|
+
|
|
|
static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf,
|
|
|
size_t count, loff_t *ppos)
|
|
|
{
|
|
@@ -1296,6 +1350,7 @@ MVM_DEBUGFS_READ_WRITE_FILE_OPS(prph_reg, 64);
|
|
|
MVM_DEBUGFS_WRITE_FILE_OPS(tx_flush, 16);
|
|
|
MVM_DEBUGFS_WRITE_FILE_OPS(sta_drain, 8);
|
|
|
MVM_DEBUGFS_READ_WRITE_FILE_OPS(sram, 64);
|
|
|
+MVM_DEBUGFS_READ_WRITE_FILE_OPS(set_nic_temperature, 64);
|
|
|
MVM_DEBUGFS_READ_FILE_OPS(stations);
|
|
|
MVM_DEBUGFS_READ_FILE_OPS(bt_notif);
|
|
|
MVM_DEBUGFS_READ_FILE_OPS(bt_cmd);
|
|
@@ -1336,6 +1391,8 @@ int iwl_mvm_dbgfs_register(struct iwl_mvm *mvm, struct dentry *dbgfs_dir)
|
|
|
MVM_DEBUGFS_ADD_FILE(tx_flush, mvm->debugfs_dir, S_IWUSR);
|
|
|
MVM_DEBUGFS_ADD_FILE(sta_drain, mvm->debugfs_dir, S_IWUSR);
|
|
|
MVM_DEBUGFS_ADD_FILE(sram, mvm->debugfs_dir, S_IWUSR | S_IRUSR);
|
|
|
+ MVM_DEBUGFS_ADD_FILE(set_nic_temperature, mvm->debugfs_dir,
|
|
|
+ S_IWUSR | S_IRUSR);
|
|
|
MVM_DEBUGFS_ADD_FILE(stations, dbgfs_dir, S_IRUSR);
|
|
|
MVM_DEBUGFS_ADD_FILE(fw_error_dump, dbgfs_dir, S_IRUSR);
|
|
|
MVM_DEBUGFS_ADD_FILE(bt_notif, dbgfs_dir, S_IRUSR);
|