aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/dvm/scan.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-05-21 05:55:54 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-06 07:24:19 -0400
commit26a7ca9a71a3f7e1826de96b1a1e907123e11b07 (patch)
tree7ab52c58fdd876bacf112c1bfceeac865f196704 /drivers/net/wireless/iwlwifi/dvm/scan.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/scan.c')
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/scan.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/scan.c b/drivers/net/wireless/iwlwifi/dvm/scan.c
index 7ee7f32b0fab..2f271c96ed39 100644
--- a/drivers/net/wireless/iwlwifi/dvm/scan.c
+++ b/drivers/net/wireless/iwlwifi/dvm/scan.c
@@ -30,7 +30,6 @@
30#include <linux/etherdevice.h> 30#include <linux/etherdevice.h>
31#include <net/mac80211.h> 31#include <net/mac80211.h>
32 32
33#include "eeprom.h"
34#include "dev.h" 33#include "dev.h"
35#include "agn.h" 34#include "agn.h"
36 35
@@ -65,7 +64,6 @@ static int iwl_send_scan_abort(struct iwl_priv *priv)
65 * to receive scan abort command or it does not perform 64 * to receive scan abort command or it does not perform
66 * hardware scan currently */ 65 * hardware scan currently */
67 if (!test_bit(STATUS_READY, &priv->status) || 66 if (!test_bit(STATUS_READY, &priv->status) ||
68 !test_bit(STATUS_GEO_CONFIGURED, &priv->status) ||
69 !test_bit(STATUS_SCAN_HW, &priv->status) || 67 !test_bit(STATUS_SCAN_HW, &priv->status) ||
70 test_bit(STATUS_FW_ERROR, &priv->status)) 68 test_bit(STATUS_FW_ERROR, &priv->status))
71 return -EIO; 69 return -EIO;
@@ -648,12 +646,12 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
648 u16 rx_chain = 0; 646 u16 rx_chain = 0;
649 enum ieee80211_band band; 647 enum ieee80211_band band;
650 u8 n_probes = 0; 648 u8 n_probes = 0;
651 u8 rx_ant = priv->hw_params.valid_rx_ant; 649 u8 rx_ant = priv->eeprom_data->valid_rx_ant;
652 u8 rate; 650 u8 rate;
653 bool is_active = false; 651 bool is_active = false;
654 int chan_mod; 652 int chan_mod;
655 u8 active_chains; 653 u8 active_chains;
656 u8 scan_tx_antennas = priv->hw_params.valid_tx_ant; 654 u8 scan_tx_antennas = priv->eeprom_data->valid_tx_ant;
657 int ret; 655 int ret;
658 int scan_cmd_size = sizeof(struct iwl_scan_cmd) + 656 int scan_cmd_size = sizeof(struct iwl_scan_cmd) +
659 MAX_SCAN_CHANNEL * sizeof(struct iwl_scan_channel) + 657 MAX_SCAN_CHANNEL * sizeof(struct iwl_scan_channel) +
@@ -863,7 +861,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
863 861
864 /* MIMO is not used here, but value is required */ 862 /* MIMO is not used here, but value is required */
865 rx_chain |= 863 rx_chain |=
866 priv->hw_params.valid_rx_ant << RXON_RX_CHAIN_VALID_POS; 864 priv->eeprom_data->valid_rx_ant << RXON_RX_CHAIN_VALID_POS;
867 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS; 865 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS;
868 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS; 866 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS;
869 rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS; 867 rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS;
@@ -980,7 +978,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
980 978
981void iwl_init_scan_params(struct iwl_priv *priv) 979void iwl_init_scan_params(struct iwl_priv *priv)
982{ 980{
983 u8 ant_idx = fls(priv->hw_params.valid_tx_ant) - 1; 981 u8 ant_idx = fls(priv->eeprom_data->valid_tx_ant) - 1;
984 if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ]) 982 if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ])
985 priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx; 983 priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx;
986 if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ]) 984 if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ])