aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-03-26 06:53:12 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:39:11 -0400
commit31627dc59b4a87c4198b4245a7de1b8ccf4424fa (patch)
treea7ded2c4c2b539cf672fa1d75b5feda07a36a597
parentf876bb9aafc71d8ea395eec99666faaffec5df49 (diff)
wl1271: Add TX rate reporting
Add reporting of the used TX rate to mac80211 in the tx_status. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Kalle Valo <kalle.valo@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_main.c1
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_tx.c27
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_tx.h1
3 files changed, 17 insertions, 12 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
index 49779e588e30..864503048257 100644
--- a/drivers/net/wireless/wl12xx/wl1271_main.c
+++ b/drivers/net/wireless/wl12xx/wl1271_main.c
@@ -2127,6 +2127,7 @@ int wl1271_init_ieee80211(struct wl1271 *wl)
2127 wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl1271_band_5ghz; 2127 wl->hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &wl1271_band_5ghz;
2128 2128
2129 wl->hw->queues = 4; 2129 wl->hw->queues = 4;
2130 wl->hw->max_rates = 1;
2130 2131
2131 SET_IEEE80211_DEV(wl->hw, wl1271_wl_to_dev(wl)); 2132 SET_IEEE80211_DEV(wl->hw, wl1271_wl_to_dev(wl));
2132 2133
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.c b/drivers/net/wireless/wl12xx/wl1271_tx.c
index 6d109df9a0a0..5712489f5ddb 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.c
@@ -304,6 +304,8 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
304 struct ieee80211_tx_info *info; 304 struct ieee80211_tx_info *info;
305 struct sk_buff *skb; 305 struct sk_buff *skb;
306 int id = result->id; 306 int id = result->id;
307 int rate = -1;
308 u8 retries = 0;
307 309
308 /* check for id legality */ 310 /* check for id legality */
309 if (unlikely(id >= ACX_TX_DESCRIPTORS || wl->tx_frames[id] == NULL)) { 311 if (unlikely(id >= ACX_TX_DESCRIPTORS || wl->tx_frames[id] == NULL)) {
@@ -314,19 +316,22 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
314 skb = wl->tx_frames[id]; 316 skb = wl->tx_frames[id];
315 info = IEEE80211_SKB_CB(skb); 317 info = IEEE80211_SKB_CB(skb);
316 318
317 /* update packet status */ 319 /* update the TX status info */
318 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { 320 if (result->status == TX_SUCCESS) {
319 if (result->status == TX_SUCCESS) 321 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
320 info->flags |= IEEE80211_TX_STAT_ACK; 322 info->flags |= IEEE80211_TX_STAT_ACK;
321 if (result->status & TX_RETRY_EXCEEDED) { 323 rate = wl1271_rate_to_idx(wl, result->rate_class_index);
322 /* FIXME */ 324 retries = result->ack_failures;
323 /* info->status.excessive_retries = 1; */ 325 } else if (result->status == TX_RETRY_EXCEEDED) {
324 wl->stats.excessive_retries++; 326 wl->stats.excessive_retries++;
325 } 327 retries = result->ack_failures;
326 } 328 }
327 329
328 /* FIXME */ 330 info->status.rates[0].idx = rate;
329 /* info->status.retry_count = result->ack_failures; */ 331 info->status.rates[0].count = retries;
332 info->status.rates[0].flags = 0;
333 info->status.ack_signal = -1;
334
330 wl->stats.retry_count += result->ack_failures; 335 wl->stats.retry_count += result->ack_failures;
331 336
332 /* update security sequence number */ 337 /* update security sequence number */
@@ -350,8 +355,6 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
350 result->id, skb, result->ack_failures, 355 result->id, skb, result->ack_failures,
351 result->rate_class_index, result->status); 356 result->rate_class_index, result->status);
352 357
353 /* FIXME: do we need to tell the stack about the used rate? */
354
355 /* return the packet to the stack */ 358 /* return the packet to the stack */
356 ieee80211_tx_status(wl->hw, skb); 359 ieee80211_tx_status(wl->hw, skb);
357 wl->tx_frames[result->id] = NULL; 360 wl->tx_frames[result->id] = NULL;
diff --git a/drivers/net/wireless/wl12xx/wl1271_tx.h b/drivers/net/wireless/wl12xx/wl1271_tx.h
index 5e6c27a57415..b03c95d9673f 100644
--- a/drivers/net/wireless/wl12xx/wl1271_tx.h
+++ b/drivers/net/wireless/wl12xx/wl1271_tx.h
@@ -159,5 +159,6 @@ static inline int wl1271_tx_ac_to_tid(int ac)
159void wl1271_tx_work(struct work_struct *work); 159void wl1271_tx_work(struct work_struct *work);
160void wl1271_tx_complete(struct wl1271 *wl); 160void wl1271_tx_complete(struct wl1271 *wl);
161void wl1271_tx_flush(struct wl1271 *wl); 161void wl1271_tx_flush(struct wl1271 *wl);
162u8 wl1271_rate_to_idx(struct wl1271 *wl, int rate);
162 163
163#endif 164#endif