Commit d2e2d769 authored by Pontus Fuchs's avatar Pontus Fuchs Committed by Luciano Coelho

wl12xx: Set IEEE80211_TX_RC_MCS on MCS rates on TX complete.

IEEE80211_TX_RC_MCS was not set correctly leading to incorrect link
speed calculation.
Signed-off-by: default avatarPontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: default avatarIdo Reis <idor@ti.com>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent d18da7fc
...@@ -91,6 +91,10 @@ enum { ...@@ -91,6 +91,10 @@ enum {
CONF_HW_RXTX_RATE_UNSUPPORTED = 0xff CONF_HW_RXTX_RATE_UNSUPPORTED = 0xff
}; };
/* Rates between and including these are MCS rates */
#define CONF_HW_RXTX_RATE_MCS_MIN CONF_HW_RXTX_RATE_MCS7
#define CONF_HW_RXTX_RATE_MCS_MAX CONF_HW_RXTX_RATE_MCS0
enum { enum {
CONF_SG_DISABLE = 0, CONF_SG_DISABLE = 0,
CONF_SG_PROTECTIVE, CONF_SG_PROTECTIVE,
......
...@@ -764,6 +764,14 @@ void wl1271_tx_work(struct work_struct *work) ...@@ -764,6 +764,14 @@ void wl1271_tx_work(struct work_struct *work)
mutex_unlock(&wl->mutex); mutex_unlock(&wl->mutex);
} }
static u8 wl1271_tx_get_rate_flags(u8 rate_class_index)
{
if (rate_class_index >= CONF_HW_RXTX_RATE_MCS_MIN &&
rate_class_index <= CONF_HW_RXTX_RATE_MCS_MAX)
return IEEE80211_TX_RC_MCS;
return 0;
}
static void wl1271_tx_complete_packet(struct wl1271 *wl, static void wl1271_tx_complete_packet(struct wl1271 *wl,
struct wl1271_tx_hw_res_descr *result) struct wl1271_tx_hw_res_descr *result)
{ {
...@@ -773,6 +781,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, ...@@ -773,6 +781,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
struct sk_buff *skb; struct sk_buff *skb;
int id = result->id; int id = result->id;
int rate = -1; int rate = -1;
u8 rate_flags = 0;
u8 retries = 0; u8 retries = 0;
/* check for id legality */ /* check for id legality */
...@@ -799,6 +808,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, ...@@ -799,6 +808,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
info->flags |= IEEE80211_TX_STAT_ACK; info->flags |= IEEE80211_TX_STAT_ACK;
rate = wl1271_rate_to_idx(result->rate_class_index, rate = wl1271_rate_to_idx(result->rate_class_index,
wlvif->band); wlvif->band);
rate_flags = wl1271_tx_get_rate_flags(result->rate_class_index);
retries = result->ack_failures; retries = result->ack_failures;
} else if (result->status == TX_RETRY_EXCEEDED) { } else if (result->status == TX_RETRY_EXCEEDED) {
wl->stats.excessive_retries++; wl->stats.excessive_retries++;
...@@ -807,7 +817,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl, ...@@ -807,7 +817,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
info->status.rates[0].idx = rate; info->status.rates[0].idx = rate;
info->status.rates[0].count = retries; info->status.rates[0].count = retries;
info->status.rates[0].flags = 0; info->status.rates[0].flags = rate_flags;
info->status.ack_signal = -1; info->status.ack_signal = -1;
wl->stats.retry_count += result->ack_failures; wl->stats.retry_count += result->ack_failures;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment