aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-debugfs.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2009-09-11 13:38:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-07 16:39:33 -0400
commite307ddce394ee7bcec41fb74330ac89eafaea1d9 (patch)
tree1302dda59ece68b9476aac8532aa6d064c433346 /drivers/net/wireless/iwlwifi/iwl-debugfs.c
parentfad95bf59bf14f72e7d45d3887044e88b8584637 (diff)
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: Wey-Yi Guy <wey-yi.w.guy@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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index a198bcf61022..037b75ca77f1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -383,6 +383,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
383 int pos = 0, ofs = 0, buf_size = 0; 383 int pos = 0, ofs = 0, buf_size = 0;
384 const u8 *ptr; 384 const u8 *ptr;
385 char *buf; 385 char *buf;
386 u16 eeprom_ver;
386 size_t eeprom_len = priv->cfg->eeprom_size; 387 size_t eeprom_len = priv->cfg->eeprom_size;
387 buf_size = 4 * eeprom_len + 256; 388 buf_size = 4 * eeprom_len + 256;
388 389
@@ -403,9 +404,11 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
403 IWL_ERR(priv, "Can not allocate Buffer\n"); 404 IWL_ERR(priv, "Can not allocate Buffer\n");
404 return -ENOMEM; 405 return -ENOMEM;
405 } 406 }
406 pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n", 407 eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
408 pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s, "
409 "version: 0x%x\n",
407 (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) 410 (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
408 ? "OTP" : "EEPROM"); 411 ? "OTP" : "EEPROM", eeprom_ver);
409 for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) { 412 for (ofs = 0 ; ofs < eeprom_len ; ofs += 16) {
410 pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs); 413 pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x ", ofs);
411 hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos, 414 hex_dump_to_buffer(ptr + ofs, 16 , 16, 2, buf + pos,