aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c35
1 files changed, 16 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 8d4d91d35fd2..50d927bb2170 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -247,7 +247,7 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
247 * the information provided in the skb from the hardware */ 247 * the information provided in the skb from the hardware */
248 s8 signal = stats->ssi; 248 s8 signal = stats->ssi;
249 s8 noise = 0; 249 s8 noise = 0;
250 int rate = stats->rate; 250 int rate = stats->rate_idx;
251 u64 tsf = stats->mactime; 251 u64 tsf = stats->mactime;
252 __le16 phy_flags_hw = rx_hdr->phy_flags; 252 __le16 phy_flags_hw = rx_hdr->phy_flags;
253 253
@@ -315,7 +315,6 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,
315 IEEE80211_CHAN_2GHZ), 315 IEEE80211_CHAN_2GHZ),
316 &iwl3945_rt->rt_chbitmask); 316 &iwl3945_rt->rt_chbitmask);
317 317
318 rate = iwl3945_rate_index_from_plcp(rate);
319 if (rate == -1) 318 if (rate == -1)
320 iwl3945_rt->rt_rate = 0; 319 iwl3945_rt->rt_rate = 0;
321 else 320 else
@@ -387,11 +386,10 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
387 struct ieee80211_rx_status stats = { 386 struct ieee80211_rx_status stats = {
388 .mactime = le64_to_cpu(rx_end->timestamp), 387 .mactime = le64_to_cpu(rx_end->timestamp),
389 .freq = ieee80211chan2mhz(le16_to_cpu(rx_hdr->channel)), 388 .freq = ieee80211chan2mhz(le16_to_cpu(rx_hdr->channel)),
390 .channel = le16_to_cpu(rx_hdr->channel), 389 .band = (rx_hdr->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ?
391 .phymode = (rx_hdr->phy_flags & RX_RES_PHY_FLAGS_BAND_24_MSK) ? 390 IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ,
392 MODE_IEEE80211G : MODE_IEEE80211A,
393 .antenna = 0, 391 .antenna = 0,
394 .rate = rx_hdr->rate, 392 .rate_idx = iwl3945_rate_index_from_plcp(rx_hdr->rate),
395 .flag = 0, 393 .flag = 0,
396 }; 394 };
397 u8 network_packet; 395 u8 network_packet;
@@ -450,8 +448,6 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
450 stats.ssi, stats.noise, stats.signal, 448 stats.ssi, stats.noise, stats.signal,
451 rx_stats_sig_avg, rx_stats_noise_diff); 449 rx_stats_sig_avg, rx_stats_noise_diff);
452 450
453 stats.freq = ieee80211chan2mhz(stats.channel);
454
455 /* can be covered by iwl3945_report_frame() in most cases */ 451 /* can be covered by iwl3945_report_frame() in most cases */
456/* IWL_DEBUG_RX("RX status: 0x%08X\n", rx_end->status); */ 452/* IWL_DEBUG_RX("RX status: 0x%08X\n", rx_end->status); */
457 453
@@ -464,8 +460,9 @@ static void iwl3945_rx_reply_rx(struct iwl3945_priv *priv,
464 IWL_DEBUG_STATS 460 IWL_DEBUG_STATS
465 ("[%c] %d RSSI: %d Signal: %u, Noise: %u, Rate: %u\n", 461 ("[%c] %d RSSI: %d Signal: %u, Noise: %u, Rate: %u\n",
466 network_packet ? '*' : ' ', 462 network_packet ? '*' : ' ',
467 stats.channel, stats.ssi, stats.ssi, 463 le16_to_cpu(rx_hdr->channel),
468 stats.ssi, stats.rate); 464 stats.ssi, stats.ssi,
465 stats.ssi, stats.rate_idx);
469 466
470 if (iwl3945_debug_level & (IWL_DL_RX)) 467 if (iwl3945_debug_level & (IWL_DL_RX))
471 /* Set "1" to report good data frames in groups of 100 */ 468 /* Set "1" to report good data frames in groups of 100 */
@@ -689,7 +686,7 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
689 struct ieee80211_hdr *hdr, int sta_id, int tx_id) 686 struct ieee80211_hdr *hdr, int sta_id, int tx_id)
690{ 687{
691 unsigned long flags; 688 unsigned long flags;
692 u16 rate_index = min(ctrl->tx_rate & 0xffff, IWL_RATE_COUNT - 1); 689 u16 rate_index = min(ctrl->tx_rate->hw_value & 0xffff, IWL_RATE_COUNT - 1);
693 u16 rate_mask; 690 u16 rate_mask;
694 int rate; 691 int rate;
695 u8 rts_retry_limit; 692 u8 rts_retry_limit;
@@ -1552,14 +1549,14 @@ int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv)
1552 .channel = priv->active_rxon.channel, 1549 .channel = priv->active_rxon.channel,
1553 }; 1550 };
1554 1551
1555 txpower.band = (priv->phymode == MODE_IEEE80211A) ? 0 : 1; 1552 txpower.band = (priv->band == IEEE80211_BAND_5GHZ) ? 0 : 1;
1556 ch_info = iwl3945_get_channel_info(priv, 1553 ch_info = iwl3945_get_channel_info(priv,
1557 priv->phymode, 1554 priv->band,
1558 le16_to_cpu(priv->active_rxon.channel)); 1555 le16_to_cpu(priv->active_rxon.channel));
1559 if (!ch_info) { 1556 if (!ch_info) {
1560 IWL_ERROR 1557 IWL_ERROR
1561 ("Failed to get channel info for channel %d [%d]\n", 1558 ("Failed to get channel info for channel %d [%d]\n",
1562 le16_to_cpu(priv->active_rxon.channel), priv->phymode); 1559 le16_to_cpu(priv->active_rxon.channel), priv->band);
1563 return -EINVAL; 1560 return -EINVAL;
1564 } 1561 }
1565 1562
@@ -2241,8 +2238,8 @@ int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv)
2241 table[index].next_rate_index = iwl3945_rates[prev_index].table_rs_index; 2238 table[index].next_rate_index = iwl3945_rates[prev_index].table_rs_index;
2242 } 2239 }
2243 2240
2244 switch (priv->phymode) { 2241 switch (priv->band) {
2245 case MODE_IEEE80211A: 2242 case IEEE80211_BAND_5GHZ:
2246 IWL_DEBUG_RATE("Select A mode rate scale\n"); 2243 IWL_DEBUG_RATE("Select A mode rate scale\n");
2247 /* If one of the following CCK rates is used, 2244 /* If one of the following CCK rates is used,
2248 * have it fall back to the 6M OFDM rate */ 2245 * have it fall back to the 6M OFDM rate */
@@ -2257,8 +2254,8 @@ int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv)
2257 iwl3945_rates[IWL_FIRST_OFDM_RATE].table_rs_index; 2254 iwl3945_rates[IWL_FIRST_OFDM_RATE].table_rs_index;
2258 break; 2255 break;
2259 2256
2260 case MODE_IEEE80211B: 2257 case IEEE80211_BAND_2GHZ:
2261 IWL_DEBUG_RATE("Select B mode rate scale\n"); 2258 IWL_DEBUG_RATE("Select B/G mode rate scale\n");
2262 /* If an OFDM rate is used, have it fall back to the 2259 /* If an OFDM rate is used, have it fall back to the
2263 * 1M CCK rates */ 2260 * 1M CCK rates */
2264 for (i = IWL_RATE_6M_INDEX_TABLE; i <= IWL_RATE_54M_INDEX_TABLE; i++) 2261 for (i = IWL_RATE_6M_INDEX_TABLE; i <= IWL_RATE_54M_INDEX_TABLE; i++)
@@ -2269,7 +2266,7 @@ int iwl3945_init_hw_rate_table(struct iwl3945_priv *priv)
2269 break; 2266 break;
2270 2267
2271 default: 2268 default:
2272 IWL_DEBUG_RATE("Select G mode rate scale\n"); 2269 WARN_ON(1);
2273 break; 2270 break;
2274 } 2271 }
2275 2272