Commit e307ddce authored by Wey-Yi Guy's avatar Wey-Yi Guy Committed by John W. Linville

iwlwifi: show NVM version in debugfs

Show version number along with dumping NVM data, the version information
being removed from sysfs, add it back to debugfs to help debugging.
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent fad95bf5
...@@ -383,6 +383,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, ...@@ -383,6 +383,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
int pos = 0, ofs = 0, buf_size = 0; int pos = 0, ofs = 0, buf_size = 0;
const u8 *ptr; const u8 *ptr;
char *buf; char *buf;
u16 eeprom_ver;
size_t eeprom_len = priv->cfg->eeprom_size; size_t eeprom_len = priv->cfg->eeprom_size;
buf_size = 4 * eeprom_len + 256; buf_size = 4 * eeprom_len + 256;
...@@ -403,9 +404,11 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file, ...@@ -403,9 +404,11 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
IWL_ERR(priv, "Can not allocate Buffer\n"); IWL_ERR(priv, "Can not allocate Buffer\n");
return -ENOMEM; return -ENOMEM;
} }
pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n", eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s, "
"version: 0x%x\n",
(priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
? "OTP" : "EEPROM"); ? "OTP" : "EEPROM", eeprom_ver);
for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) {
pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs); pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs);
hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos, hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment