aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2008-12-18 21:37:27 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:59:11 -0500
commitf2c7e52100545e54af064fe0345d141fdcf2d243 (patch)
treee75d927bc367b7ff178fdcef7e27b81133fbd4a2 /drivers/net/wireless/iwlwifi/iwl-3945.c
parent3832ec9dc919a0994d713390eb4fb3c7e7500b94 (diff)
iwl3945: rename iwl3945_priv variables
The patch renames iwl3945 specific variables in iwl3945_priv structure. iwl3945_priv structure differs with iwl_priv structure with these variables. Goal of this patch is to make transition from iwl3945_priv to iwl_priv smoothly. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index b5b23b1ad240..f480c437cd66 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -199,7 +199,7 @@ static int iwl3945_hwrate_to_plcp_idx(u8 plcp)
199 * iwl3945_get_antenna_flags - Get antenna flags for RXON command 199 * iwl3945_get_antenna_flags - Get antenna flags for RXON command
200 * @priv: eeprom and antenna fields are used to determine antenna flags 200 * @priv: eeprom and antenna fields are used to determine antenna flags
201 * 201 *
202 * priv->eeprom is used to determine if antenna AUX/MAIN are reversed 202 * priv->eeprom39 is used to determine if antenna AUX/MAIN are reversed
203 * priv->antenna specifies the antenna diversity mode: 203 * priv->antenna specifies the antenna diversity mode:
204 * 204 *
205 * IWL_ANTENNA_DIVERSITY - NIC selects best antenna by itself 205 * IWL_ANTENNA_DIVERSITY - NIC selects best antenna by itself
@@ -213,12 +213,12 @@ __le32 iwl3945_get_antenna_flags(const struct iwl3945_priv *priv)
213 return 0; 213 return 0;
214 214
215 case IWL_ANTENNA_MAIN: 215 case IWL_ANTENNA_MAIN:
216 if (priv->eeprom.antenna_switch_type) 216 if (priv->eeprom39.antenna_switch_type)
217 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK; 217 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK;
218 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK; 218 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK;
219 219
220 case IWL_ANTENNA_AUX: 220 case IWL_ANTENNA_AUX:
221 if (priv->eeprom.antenna_switch_type) 221 if (priv->eeprom39.antenna_switch_type)
222 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK; 222 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_A_MSK;
223 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK; 223 return RXON_FLG_DIS_DIV_MSK | RXON_FLG_ANT_B_MSK;
224 } 224 }
@@ -305,7 +305,7 @@ int iwl3945_rs_next_rate(struct iwl3945_priv *priv, int rate)
305static void iwl3945_tx_queue_reclaim(struct iwl3945_priv *priv, 305static void iwl3945_tx_queue_reclaim(struct iwl3945_priv *priv,
306 int txq_id, int index) 306 int txq_id, int index)
307{ 307{
308 struct iwl3945_tx_queue *txq = &priv->txq[txq_id]; 308 struct iwl3945_tx_queue *txq = &priv->txq39[txq_id];
309 struct iwl_queue *q = &txq->q; 309 struct iwl_queue *q = &txq->q;
310 struct iwl3945_tx_info *tx_info; 310 struct iwl3945_tx_info *tx_info;
311 311
@@ -336,7 +336,7 @@ static void iwl3945_rx_reply_tx(struct iwl3945_priv *priv,
336 u16 sequence = le16_to_cpu(pkt->hdr.sequence); 336 u16 sequence = le16_to_cpu(pkt->hdr.sequence);
337 int txq_id = SEQ_TO_QUEUE(sequence); 337 int txq_id = SEQ_TO_QUEUE(sequence);
338 int index = SEQ_TO_INDEX(sequence); 338 int index = SEQ_TO_INDEX(sequence);
339 struct iwl3945_tx_queue *txq = &priv->txq[txq_id]; 339 struct iwl3945_tx_queue *txq = &priv->txq39[txq_id];
340 struct ieee80211_tx_info *info; 340 struct ieee80211_tx_info *info;
341 struct iwl3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; 341 struct iwl3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
342 u32 status = le32_to_cpu(tx_resp->status); 342 u32 status = le32_to_cpu(tx_resp->status);
@@ -396,7 +396,7 @@ void iwl3945_hw_rx_statistics(struct iwl3945_priv *priv, struct iwl_rx_mem_buffe
396 (int)sizeof(struct iwl3945_notif_statistics), 396 (int)sizeof(struct iwl3945_notif_statistics),
397 le32_to_cpu(pkt->len)); 397 le32_to_cpu(pkt->len));
398 398
399 memcpy(&priv->statistics, pkt->u.raw, sizeof(priv->statistics)); 399 memcpy(&priv->statistics_39, pkt->u.raw, sizeof(priv->statistics_39));
400 400
401 iwl3945_led_background(priv); 401 iwl3945_led_background(priv);
402 402
@@ -808,9 +808,9 @@ u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr)
808 808
809 spin_lock_irqsave(&priv->sta_lock, flags); 809 spin_lock_irqsave(&priv->sta_lock, flags);
810 for (i = start; i < priv->hw_params.max_stations; i++) 810 for (i = start; i < priv->hw_params.max_stations; i++)
811 if ((priv->stations[i].used) && 811 if ((priv->stations_39[i].used) &&
812 (!compare_ether_addr 812 (!compare_ether_addr
813 (priv->stations[i].sta.sta.addr, addr))) { 813 (priv->stations_39[i].sta.sta.addr, addr))) {
814 ret = i; 814 ret = i;
815 goto out; 815 goto out;
816 } 816 }
@@ -905,7 +905,7 @@ u8 iwl3945_sync_sta(struct iwl3945_priv *priv, int sta_id, u16 tx_rate, u8 flags
905 return IWL_INVALID_STATION; 905 return IWL_INVALID_STATION;
906 906
907 spin_lock_irqsave(&priv->sta_lock, flags_spin); 907 spin_lock_irqsave(&priv->sta_lock, flags_spin);
908 station = &priv->stations[sta_id]; 908 station = &priv->stations_39[sta_id];
909 909
910 station->sta.sta.modify_mask = STA_MODIFY_TX_RATE_MSK; 910 station->sta.sta.modify_mask = STA_MODIFY_TX_RATE_MSK;
911 station->sta.rate_n_flags = cpu_to_le16(tx_rate); 911 station->sta.rate_n_flags = cpu_to_le16(tx_rate);
@@ -1062,7 +1062,7 @@ static int iwl3945_txq_ctx_reset(struct iwl3945_priv *priv)
1062 for (txq_id = 0; txq_id < TFD_QUEUE_MAX; txq_id++) { 1062 for (txq_id = 0; txq_id < TFD_QUEUE_MAX; txq_id++) {
1063 slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ? 1063 slots_num = (txq_id == IWL_CMD_QUEUE_NUM) ?
1064 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS; 1064 TFD_CMD_SLOTS : TFD_TX_CMD_SLOTS;
1065 rc = iwl3945_tx_queue_init(priv, &priv->txq[txq_id], slots_num, 1065 rc = iwl3945_tx_queue_init(priv, &priv->txq39[txq_id], slots_num,
1066 txq_id); 1066 txq_id);
1067 if (rc) { 1067 if (rc) {
1068 IWL_ERROR("Tx %d queue init failed\n", txq_id); 1068 IWL_ERROR("Tx %d queue init failed\n", txq_id);
@@ -1135,42 +1135,42 @@ int iwl3945_hw_nic_init(struct iwl3945_priv *priv)
1135 CSR39_HW_IF_CONFIG_REG_BIT_3945_MM); 1135 CSR39_HW_IF_CONFIG_REG_BIT_3945_MM);
1136 } 1136 }
1137 1137
1138 if (EEPROM_SKU_CAP_OP_MODE_MRC == priv->eeprom.sku_cap) { 1138 if (EEPROM_SKU_CAP_OP_MODE_MRC == priv->eeprom39.sku_cap) {
1139 IWL_DEBUG_INFO("SKU OP mode is mrc\n"); 1139 IWL_DEBUG_INFO("SKU OP mode is mrc\n");
1140 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1140 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1141 CSR39_HW_IF_CONFIG_REG_BIT_SKU_MRC); 1141 CSR39_HW_IF_CONFIG_REG_BIT_SKU_MRC);
1142 } else 1142 } else
1143 IWL_DEBUG_INFO("SKU OP mode is basic\n"); 1143 IWL_DEBUG_INFO("SKU OP mode is basic\n");
1144 1144
1145 if ((priv->eeprom.board_revision & 0xF0) == 0xD0) { 1145 if ((priv->eeprom39.board_revision & 0xF0) == 0xD0) {
1146 IWL_DEBUG_INFO("3945ABG revision is 0x%X\n", 1146 IWL_DEBUG_INFO("3945ABG revision is 0x%X\n",
1147 priv->eeprom.board_revision); 1147 priv->eeprom39.board_revision);
1148 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1148 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1149 CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE); 1149 CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
1150 } else { 1150 } else {
1151 IWL_DEBUG_INFO("3945ABG revision is 0x%X\n", 1151 IWL_DEBUG_INFO("3945ABG revision is 0x%X\n",
1152 priv->eeprom.board_revision); 1152 priv->eeprom39.board_revision);
1153 iwl3945_clear_bit(priv, CSR_HW_IF_CONFIG_REG, 1153 iwl3945_clear_bit(priv, CSR_HW_IF_CONFIG_REG,
1154 CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE); 1154 CSR39_HW_IF_CONFIG_REG_BIT_BOARD_TYPE);
1155 } 1155 }
1156 1156
1157 if (priv->eeprom.almgor_m_version <= 1) { 1157 if (priv->eeprom39.almgor_m_version <= 1) {
1158 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1158 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1159 CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A); 1159 CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A);
1160 IWL_DEBUG_INFO("Card M type A version is 0x%X\n", 1160 IWL_DEBUG_INFO("Card M type A version is 0x%X\n",
1161 priv->eeprom.almgor_m_version); 1161 priv->eeprom39.almgor_m_version);
1162 } else { 1162 } else {
1163 IWL_DEBUG_INFO("Card M type B version is 0x%X\n", 1163 IWL_DEBUG_INFO("Card M type B version is 0x%X\n",
1164 priv->eeprom.almgor_m_version); 1164 priv->eeprom39.almgor_m_version);
1165 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1165 iwl3945_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1166 CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B); 1166 CSR39_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B);
1167 } 1167 }
1168 spin_unlock_irqrestore(&priv->lock, flags); 1168 spin_unlock_irqrestore(&priv->lock, flags);
1169 1169
1170 if (priv->eeprom.sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE) 1170 if (priv->eeprom39.sku_cap & EEPROM_SKU_CAP_SW_RF_KILL_ENABLE)
1171 IWL_DEBUG_RF_KILL("SW RF KILL supported in EEPROM.\n"); 1171 IWL_DEBUG_RF_KILL("SW RF KILL supported in EEPROM.\n");
1172 1172
1173 if (priv->eeprom.sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE) 1173 if (priv->eeprom39.sku_cap & EEPROM_SKU_CAP_HW_RF_KILL_ENABLE)
1174 IWL_DEBUG_RF_KILL("HW RF KILL supported in EEPROM.\n"); 1174 IWL_DEBUG_RF_KILL("HW RF KILL supported in EEPROM.\n");
1175 1175
1176 /* Allocate the RX queue, or reset if it is already allocated */ 1176 /* Allocate the RX queue, or reset if it is already allocated */
@@ -1224,7 +1224,7 @@ void iwl3945_hw_txq_ctx_free(struct iwl3945_priv *priv)
1224 1224
1225 /* Tx queues */ 1225 /* Tx queues */
1226 for (txq_id = 0; txq_id < TFD_QUEUE_MAX; txq_id++) 1226 for (txq_id = 0; txq_id < TFD_QUEUE_MAX; txq_id++)
1227 iwl3945_tx_queue_free(priv, &priv->txq[txq_id]); 1227 iwl3945_tx_queue_free(priv, &priv->txq39[txq_id]);
1228} 1228}
1229 1229
1230void iwl3945_hw_txq_ctx_stop(struct iwl3945_priv *priv) 1230void iwl3945_hw_txq_ctx_stop(struct iwl3945_priv *priv)
@@ -1382,7 +1382,7 @@ static int iwl3945_hw_reg_txpower_get_temperature(struct iwl3945_priv *priv)
1382 /* if really really hot(?), 1382 /* if really really hot(?),
1383 * substitute the 3rd band/group's temp measured at factory */ 1383 * substitute the 3rd band/group's temp measured at factory */
1384 if (priv->last_temperature > 100) 1384 if (priv->last_temperature > 100)
1385 temperature = priv->eeprom.groups[2].temperature; 1385 temperature = priv->eeprom39.groups[2].temperature;
1386 else /* else use most recent "sane" value from driver */ 1386 else /* else use most recent "sane" value from driver */
1387 temperature = priv->last_temperature; 1387 temperature = priv->last_temperature;
1388 } 1388 }
@@ -1677,17 +1677,17 @@ int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv)
1677 int rate_idx, i; 1677 int rate_idx, i;
1678 const struct iwl_channel_info *ch_info = NULL; 1678 const struct iwl_channel_info *ch_info = NULL;
1679 struct iwl3945_txpowertable_cmd txpower = { 1679 struct iwl3945_txpowertable_cmd txpower = {
1680 .channel = priv->active_rxon.channel, 1680 .channel = priv->active39_rxon.channel,
1681 }; 1681 };
1682 1682
1683 txpower.band = (priv->band == IEEE80211_BAND_5GHZ) ? 0 : 1; 1683 txpower.band = (priv->band == IEEE80211_BAND_5GHZ) ? 0 : 1;
1684 ch_info = iwl3945_get_channel_info(priv, 1684 ch_info = iwl3945_get_channel_info(priv,
1685 priv->band, 1685 priv->band,
1686 le16_to_cpu(priv->active_rxon.channel)); 1686 le16_to_cpu(priv->active39_rxon.channel));
1687 if (!ch_info) { 1687 if (!ch_info) {
1688 IWL_ERROR 1688 IWL_ERROR
1689 ("Failed to get channel info for channel %d [%d]\n", 1689 ("Failed to get channel info for channel %d [%d]\n",
1690 le16_to_cpu(priv->active_rxon.channel), priv->band); 1690 le16_to_cpu(priv->active39_rxon.channel), priv->band);
1691 return -EINVAL; 1691 return -EINVAL;
1692 } 1692 }
1693 1693
@@ -1757,7 +1757,7 @@ static int iwl3945_hw_reg_set_new_power(struct iwl3945_priv *priv,
1757 int power; 1757 int power;
1758 1758
1759 /* Get this chnlgrp's rate-to-max/clip-powers table */ 1759 /* Get this chnlgrp's rate-to-max/clip-powers table */
1760 clip_pwrs = priv->clip_groups[ch_info->group_index].clip_powers; 1760 clip_pwrs = priv->clip39_groups[ch_info->group_index].clip_powers;
1761 1761
1762 /* Get this channel's rate-to-current-power settings table */ 1762 /* Get this channel's rate-to-current-power settings table */
1763 power_info = ch_info->power_info; 1763 power_info = ch_info->power_info;
@@ -1856,7 +1856,7 @@ static int iwl3945_hw_reg_comp_txpower_temp(struct iwl3945_priv *priv)
1856 a_band = is_channel_a_band(ch_info); 1856 a_band = is_channel_a_band(ch_info);
1857 1857
1858 /* Get this chnlgrp's factory calibration temperature */ 1858 /* Get this chnlgrp's factory calibration temperature */
1859 ref_temp = (s16)priv->eeprom.groups[ch_info->group_index]. 1859 ref_temp = (s16)priv->eeprom39.groups[ch_info->group_index].
1860 temperature; 1860 temperature;
1861 1861
1862 /* get power index adjustment based on current and factory 1862 /* get power index adjustment based on current and factory
@@ -1882,7 +1882,7 @@ static int iwl3945_hw_reg_comp_txpower_temp(struct iwl3945_priv *priv)
1882 } 1882 }
1883 1883
1884 /* Get this chnlgrp's rate-to-max/clip-powers table */ 1884 /* Get this chnlgrp's rate-to-max/clip-powers table */
1885 clip_pwrs = priv->clip_groups[ch_info->group_index].clip_powers; 1885 clip_pwrs = priv->clip39_groups[ch_info->group_index].clip_powers;
1886 1886
1887 /* set scan tx power, 1Mbit for CCK, 6Mbit for OFDM */ 1887 /* set scan tx power, 1Mbit for CCK, 6Mbit for OFDM */
1888 for (scan_tbl_index = 0; 1888 for (scan_tbl_index = 0;
@@ -2001,7 +2001,7 @@ static void iwl3945_bg_reg_txpower_periodic(struct work_struct *work)
2001static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl3945_priv *priv, 2001static u16 iwl3945_hw_reg_get_ch_grp_index(struct iwl3945_priv *priv,
2002 const struct iwl_channel_info *ch_info) 2002 const struct iwl_channel_info *ch_info)
2003{ 2003{
2004 struct iwl3945_eeprom_txpower_group *ch_grp = &priv->eeprom.groups[0]; 2004 struct iwl3945_eeprom_txpower_group *ch_grp = &priv->eeprom39.groups[0];
2005 u8 group; 2005 u8 group;
2006 u16 group_index = 0; /* based on factory calib frequencies */ 2006 u16 group_index = 0; /* based on factory calib frequencies */
2007 u8 grp_channel; 2007 u8 grp_channel;
@@ -2045,7 +2045,7 @@ static int iwl3945_hw_reg_get_matched_power_index(struct iwl3945_priv *priv,
2045 s32 res; 2045 s32 res;
2046 s32 denominator; 2046 s32 denominator;
2047 2047
2048 chnl_grp = &priv->eeprom.groups[setting_index]; 2048 chnl_grp = &priv->eeprom39.groups[setting_index];
2049 samples = chnl_grp->samples; 2049 samples = chnl_grp->samples;
2050 for (i = 0; i < 5; i++) { 2050 for (i = 0; i < 5; i++) {
2051 if (power == samples[i].power) { 2051 if (power == samples[i].power) {
@@ -2091,7 +2091,7 @@ static void iwl3945_hw_reg_init_channel_groups(struct iwl3945_priv *priv)
2091 for (i = 0; i < IWL_NUM_TX_CALIB_GROUPS; i++) { 2091 for (i = 0; i < IWL_NUM_TX_CALIB_GROUPS; i++) {
2092 s8 *clip_pwrs; /* table of power levels for each rate */ 2092 s8 *clip_pwrs; /* table of power levels for each rate */
2093 s8 satur_pwr; /* saturation power for each chnl group */ 2093 s8 satur_pwr; /* saturation power for each chnl group */
2094 group = &priv->eeprom.groups[i]; 2094 group = &priv->eeprom39.groups[i];
2095 2095
2096 /* sanity check on factory saturation power value */ 2096 /* sanity check on factory saturation power value */
2097 if (group->saturation_power < 40) { 2097 if (group->saturation_power < 40) {
@@ -2110,7 +2110,7 @@ static void iwl3945_hw_reg_init_channel_groups(struct iwl3945_priv *priv)
2110 * power peaks, without too much distortion (clipping). 2110 * power peaks, without too much distortion (clipping).
2111 */ 2111 */
2112 /* we'll fill in this array with h/w max power levels */ 2112 /* we'll fill in this array with h/w max power levels */
2113 clip_pwrs = (s8 *) priv->clip_groups[i].clip_powers; 2113 clip_pwrs = (s8 *) priv->clip39_groups[i].clip_powers;
2114 2114
2115 /* divide factory saturation power by 2 to find -3dB level */ 2115 /* divide factory saturation power by 2 to find -3dB level */
2116 satur_pwr = (s8) (group->saturation_power >> 1); 2116 satur_pwr = (s8) (group->saturation_power >> 1);
@@ -2193,12 +2193,12 @@ int iwl3945_txpower_set_from_eeprom(struct iwl3945_priv *priv)
2193 iwl3945_hw_reg_get_ch_grp_index(priv, ch_info); 2193 iwl3945_hw_reg_get_ch_grp_index(priv, ch_info);
2194 2194
2195 /* Get this chnlgrp's rate->max/clip-powers table */ 2195 /* Get this chnlgrp's rate->max/clip-powers table */
2196 clip_pwrs = priv->clip_groups[ch_info->group_index].clip_powers; 2196 clip_pwrs = priv->clip39_groups[ch_info->group_index].clip_powers;
2197 2197
2198 /* calculate power index *adjustment* value according to 2198 /* calculate power index *adjustment* value according to
2199 * diff between current temperature and factory temperature */ 2199 * diff between current temperature and factory temperature */
2200 delta_index = iwl3945_hw_reg_adjust_power_by_temp(temperature, 2200 delta_index = iwl3945_hw_reg_adjust_power_by_temp(temperature,
2201 priv->eeprom.groups[ch_info->group_index]. 2201 priv->eeprom39.groups[ch_info->group_index].
2202 temperature); 2202 temperature);
2203 2203
2204 IWL_DEBUG_POWER("Delta index for channel %d: %d [%d]\n", 2204 IWL_DEBUG_POWER("Delta index for channel %d: %d [%d]\n",