aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c6
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_rx.c10
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_rx.h2
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_tx.c2
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_tx.h2
5 files changed, 15 insertions, 7 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 532ccd01cf6f..63036b53f9e4 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -2367,18 +2367,18 @@ static const struct ieee80211_ops wl1271_ops = {
2367}; 2367};
2368 2368
2369 2369
2370u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate) 2370u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band)
2371{ 2371{
2372 u8 idx; 2372 u8 idx;
2373 2373
2374 BUG_ON(wl->band >= sizeof(wl1271_band_rate_to_idx)/sizeof(u8 *)); 2374 BUG_ON(band >= sizeof(wl1271_band_rate_to_idx)/sizeof(u8 *));
2375 2375
2376 if (unlikely(rate >= CONF_HW_RXTX_RATE_MAX)) { 2376 if (unlikely(rate >= CONF_HW_RXTX_RATE_MAX)) {
2377 wl1271_error("Illegal RX rate from HW: %d", rate); 2377 wl1271_error("Illegal RX rate from HW: %d", rate);
2378 return 0; 2378 return 0;
2379 } 2379 }
2380 2380
2381 idx = wl1271_band_rate_to_idx[wl->band][rate]; 2381 idx = wl1271_band_rate_to_idx[band][rate];
2382 if (unlikely(idx == CONF_HW_RXTX_RATE_UNSUPPORTED)) { 2382 if (unlikely(idx == CONF_HW_RXTX_RATE_UNSUPPORTED)) {
2383 wl1271_error("Unsupported RX rate from HW: %d", rate); 2383 wl1271_error("Unsupported RX rate from HW: %d", rate);
2384 return 0; 2384 return 0;
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
index ac13f7d25219..35448e7c0dd5 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
@@ -48,10 +48,18 @@ static void wl1271_rx_status(struct wl1271 *wl,
48 struct ieee80211_rx_status *status, 48 struct ieee80211_rx_status *status,
49 u8 beacon) 49 u8 beacon)
50{ 50{
51 enum ieee80211_band desc_band;
52
51 memset(status, 0, sizeof(struct ieee80211_rx_status)); 53 memset(status, 0, sizeof(struct ieee80211_rx_status));
52 54
53 status->band = wl->band; 55 status->band = wl->band;
54 status->rate_idx = wl1271_rate_to_idx(wl, desc->rate); 56
57 if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == WL1271_RX_DESC_BAND_BG)
58 desc_band = IEEE80211_BAND_2GHZ;
59 else
60 desc_band = IEEE80211_BAND_5GHZ;
61
62 status->rate_idx = wl1271_rate_to_idx(desc->rate, desc_band);
55 63
56#ifdef CONFIG_WL1271_HT 64#ifdef CONFIG_WL1271_HT
57 /* 11n support */ 65 /* 11n support */
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.h b/drivers/net/wireless/wl12xx/wl1271_rx.h
index 13a232333b13..6d41981ce53f 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.h
@@ -116,6 +116,6 @@ struct wl1271_rx_descriptor {
116} __packed; 116} __packed;
117 117
118void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status); 118void wl1271_rx(struct wl1271 *wl, struct wl1271_fw_status *status);
119u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate); 119u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
120 120
121#endif 121#endif
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c
index 87a5aed00c8c..46fafe08f81a 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.c
@@ -350,7 +350,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
350 if (result->status == TX_SUCCESS) { 350 if (result->status == TX_SUCCESS) {
351 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) 351 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
352 info->flags |= IEEE80211_TX_STAT_ACK; 352 info->flags |= IEEE80211_TX_STAT_ACK;
353 rate = wl1271_rate_to_idx(wl, result->rate_class_index); 353 rate = wl1271_rate_to_idx(result->rate_class_index, wl->band);
354 retries = result->ack_failures; 354 retries = result->ack_failures;
355 } else if (result->status == TX_RETRY_EXCEEDED) { 355 } else if (result->status == TX_RETRY_EXCEEDED) {
356 wl->stats.excessive_retries++; 356 wl->stats.excessive_retries++;
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.h b/drivers/net/wireless/wl12xx/wl1271_tx.h
index f1c906519b7d..9dc6f228c0de 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.h
@@ -144,7 +144,7 @@ void wl1271_tx_work_locked(struct wl1271 *wl);
144void wl1271_tx_complete(struct wl1271 *wl); 144void wl1271_tx_complete(struct wl1271 *wl);
145void wl1271_tx_reset(struct wl1271 *wl); 145void wl1271_tx_reset(struct wl1271 *wl);
146void wl1271_tx_flush(struct wl1271 *wl); 146void wl1271_tx_flush(struct wl1271 *wl);
147u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate); 147u8 wl1271_rate_to_idx(int rate, enum ieee80211_band band);
148u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set); 148u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set);
149 149
150#endif 150#endif