summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ti/wlcore/tx.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-12-07 22:43:48 (GMT)
committerLuciano Coelho <coelho@ti.com>2012-04-12 05:43:59 (GMT)
commit43a8bc5a53c78b69b99824c9f38c333cea024c8a (patch)
tree136b17f7af87af568576bcbd186867b5787f676b /drivers/net/wireless/ti/wlcore/tx.c
parent6f266e912c0733e77f63e9ad245db3c966b75942 (diff)
downloadlinux-fsl-qoriq-43a8bc5a53c78b69b99824c9f38c333cea024c8a.tar.xz
wlcore/wl12xx: add global elements to convert hw-rates to standard rates
Rates reported by HW can be different between chip families. Make the rate-to-idx translation tables private per family and use them in a common translation function. Add a global element to help determine which rates are HW HT-rates. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/ti/wlcore/tx.c')
-rw-r--r--drivers/net/wireless/ti/wlcore/tx.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index be8fcfd..1fabc48 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -759,11 +759,20 @@ static u8 wl1271_tx_get_rate_flags(u8 rate_class_index)
{
u8 flags = 0;
- if (rate_class_index >= CONF_HW_RXTX_RATE_MCS_MIN &&
- rate_class_index <= CONF_HW_RXTX_RATE_MCS_MAX)
+ /*
+ * TODO: use wl12xx constants when this code is moved to wl12xx, as
+ * only it uses Tx-completion.
+ */
+ if (rate_class_index <= 8)
flags |= IEEE80211_TX_RC_MCS;
- if (rate_class_index == CONF_HW_RXTX_RATE_MCS7_SGI)
+
+ /*
+ * TODO: use wl12xx constants when this code is moved to wl12xx, as
+ * only it uses Tx-completion.
+ */
+ if (rate_class_index == 0)
flags |= IEEE80211_TX_RC_SHORT_GI;
+
return flags;
}
@@ -801,7 +810,7 @@ static void wl1271_tx_complete_packet(struct wl1271 *wl,
if (result->status == TX_SUCCESS) {
if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
info->flags |= IEEE80211_TX_STAT_ACK;
- rate = wl1271_rate_to_idx(result->rate_class_index,
+ rate = wlcore_rate_to_idx(wl, result->rate_class_index,
wlvif->band);
rate_flags = wl1271_tx_get_rate_flags(result->rate_class_index);
retries = result->ack_failures;