aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-04-09 20:46:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 15:06:09 -0400
commit11483b5c2296cb318140f8b4ff9148faab0209d0 (patch)
treeac24fbd7e8693f21c4f503b216fcc84bdf83a3ed /drivers/net/wireless/iwlwifi/iwl-agn-lib.c
parent48dffd397ec13e7fb4a52b77e8b07ed8ea12a938 (diff)
iwlwifi: move eeprom into priv
The whole code around eeprom is distributed across whole bunch of different files, most of which belong to the to-be-DVM code. As a result, it is currently very hard to split out the EEPROM code to be generic. However, it is also quite unlikely that the current EEPROM code will be needed by the MVM code as that has different mechanisms to query the EEPROM (it does so through the uCode.) So, at least temporarily, move everything into priv. If it becomes necessary to use the code from MVM, we will have to split it out, but then it's also easier since we'll know what pieces we need. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-lib.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c62
1 files changed, 0 insertions, 62 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index da67f908bab2..b5ee99e236b1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -94,68 +94,6 @@ void iwlagn_temperature(struct iwl_priv *priv)
94 iwl_tt_handler(priv); 94 iwl_tt_handler(priv);
95} 95}
96 96
97u16 iwl_eeprom_calib_version(struct iwl_shared *shrd)
98{
99 struct iwl_eeprom_calib_hdr *hdr;
100
101 hdr = (struct iwl_eeprom_calib_hdr *)iwl_eeprom_query_addr(shrd,
102 EEPROM_CALIB_ALL);
103 return hdr->version;
104
105}
106
107/*
108 * EEPROM
109 */
110static u32 eeprom_indirect_address(const struct iwl_shared *shrd, u32 address)
111{
112 u16 offset = 0;
113
114 if ((address & INDIRECT_ADDRESS) == 0)
115 return address;
116
117 switch (address & INDIRECT_TYPE_MSK) {
118 case INDIRECT_HOST:
119 offset = iwl_eeprom_query16(shrd, EEPROM_LINK_HOST);
120 break;
121 case INDIRECT_GENERAL:
122 offset = iwl_eeprom_query16(shrd, EEPROM_LINK_GENERAL);
123 break;
124 case INDIRECT_REGULATORY:
125 offset = iwl_eeprom_query16(shrd, EEPROM_LINK_REGULATORY);
126 break;
127 case INDIRECT_TXP_LIMIT:
128 offset = iwl_eeprom_query16(shrd, EEPROM_LINK_TXP_LIMIT);
129 break;
130 case INDIRECT_TXP_LIMIT_SIZE:
131 offset = iwl_eeprom_query16(shrd, EEPROM_LINK_TXP_LIMIT_SIZE);
132 break;
133 case INDIRECT_CALIBRATION:
134 offset = iwl_eeprom_query16(shrd, EEPROM_LINK_CALIBRATION);
135 break;
136 case INDIRECT_PROCESS_ADJST:
137 offset = iwl_eeprom_query16(shrd, EEPROM_LINK_PROCESS_ADJST);
138 break;
139 case INDIRECT_OTHERS:
140 offset = iwl_eeprom_query16(shrd, EEPROM_LINK_OTHERS);
141 break;
142 default:
143 IWL_ERR(shrd->trans, "illegal indirect type: 0x%X\n",
144 address & INDIRECT_TYPE_MSK);
145 break;
146 }
147
148 /* translate the offset from words to byte */
149 return (address & ADDRESS_MSK) + (offset << 1);
150}
151
152const u8 *iwl_eeprom_query_addr(const struct iwl_shared *shrd, size_t offset)
153{
154 u32 address = eeprom_indirect_address(shrd, offset);
155 BUG_ON(address >= shrd->cfg->base_params->eeprom_size);
156 return &shrd->eeprom[address];
157}
158
159struct iwl_mod_params iwlagn_mod_params = { 97struct iwl_mod_params iwlagn_mod_params = {
160 .amsdu_size_8K = 1, 98 .amsdu_size_8K = 1,
161 .restart_fw = 1, 99 .restart_fw = 1,