summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/dvm/testmode.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-05-21 11:55:54 +0200
committerJohannes Berg <johannes.berg@intel.com>2012-06-06 13:24:19 +0200
commit26a7ca9a71a3f7e1826de96b1a1e907123e11b07 (patch)
tree7ab52c58fdd876bacf112c1bfceeac865f196704 /drivers/net/wireless/iwlwifi/dvm/testmode.c
parent08838cdeca65e754af5c755a05f6cdb1c632eda8 (diff)
iwlwifi: refactor EEPROM reading/parsing
The EEPROM reading/parsing code is all mixed in the driver today, and the EEPROM is parsed only when we access data from it. This is problematic because the NVM needs to be parsed and that is independent of reading it. Also, the NVM format for new devices will be different and probably require a new parser. Therefore refactor the reading and parsing and create two independent components. Reading the EEPROM requires direct hardware accesses and therefore access to the transport, but parsing is independent and can be done on an NVM blob. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/dvm/testmode.c')
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/testmode.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/testmode.c b/drivers/net/wireless/iwlwifi/dvm/testmode.c
index 59cfe9a8eea5..a7b59590bb53 100644
--- a/drivers/net/wireless/iwlwifi/dvm/testmode.c
+++ b/drivers/net/wireless/iwlwifi/dvm/testmode.c
@@ -534,9 +534,9 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
break;
case IWL_TM_CMD_APP2DEV_GET_EEPROM:
- if (priv->eeprom) {
+ if (priv->eeprom_blob) {
skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy,
- priv->cfg->base_params->eeprom_size + 20);
+ priv->eeprom_blob_size + 20);
if (!skb) {
IWL_ERR(priv, "Memory allocation fail\n");
return -ENOMEM;
@@ -544,15 +544,15 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
if (nla_put_u32(skb, IWL_TM_ATTR_COMMAND,
IWL_TM_CMD_DEV2APP_EEPROM_RSP) ||
nla_put(skb, IWL_TM_ATTR_EEPROM,
- priv->cfg->base_params->eeprom_size,
- priv->eeprom))
+ priv->eeprom_blob_size,
+ priv->eeprom_blob))
goto nla_put_failure;
status = cfg80211_testmode_reply(skb);
if (status < 0)
IWL_ERR(priv, "Error sending msg : %d\n",
status);
} else
- return -EFAULT;
+ return -ENODATA;
break;
case IWL_TM_CMD_APP2DEV_FIXRATE_REQ: