From: Johannes Berg Date: Fri, 3 May 2013 09:30:23 +0000 (+0200) Subject: iwlwifi: mvm: don't assume data section is at 0x800000 X-Git-Tag: next-20130607~64^2~32^2~29 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ce7f9ab381ea1cc4514f462d18a15785de050323;p=karo-tx-linux.git iwlwifi: mvm: don't assume data section is at 0x800000 In theory, the firmware format allows changing the data section offset. This may not be used today, but there's no reason for the driver to assume the data section is always at 0x800000 as it can know better. Reviewed-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- diff --git a/drivers/net/wireless/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/iwlwifi/mvm/debugfs.c index 2053dccefcd6..a12c98be8616 100644 --- a/drivers/net/wireless/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/iwlwifi/mvm/debugfs.c @@ -147,10 +147,11 @@ static ssize_t iwl_dbgfs_sram_read(struct file *file, char __user *user_buf, /* default is to dump the entire data segment */ if (!mvm->dbgfs_sram_offset && !mvm->dbgfs_sram_len) { - mvm->dbgfs_sram_offset = 0x800000; if (!mvm->ucode_loaded) return -EINVAL; img = &mvm->fw->img[mvm->cur_ucode]; + mvm->dbgfs_sram_offset = + img->sec[IWL_UCODE_SECTION_DATA].offset; mvm->dbgfs_sram_len = img->sec[IWL_UCODE_SECTION_DATA].len; } len = mvm->dbgfs_sram_len;