|
@@ -70,6 +70,36 @@ static u8 wl1271_rx_rate_to_idx[] = {
|
|
0 /* WL1271_RATE_1 */
|
|
0 /* WL1271_RATE_1 */
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+/* The values of this table must match the wl1271_rates[] array */
|
|
|
|
+static u8 wl1271_5_ghz_rx_rate_to_idx[] = {
|
|
|
|
+ /* MCS rates are used only with 11n */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS7 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS6 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS5 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS4 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS3 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS2 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS1 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS0 */
|
|
|
|
+
|
|
|
|
+ 7, /* WL1271_RATE_54 */
|
|
|
|
+ 6, /* WL1271_RATE_48 */
|
|
|
|
+ 5, /* WL1271_RATE_36 */
|
|
|
|
+ 4, /* WL1271_RATE_24 */
|
|
|
|
+
|
|
|
|
+ /* TI-specific rate */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_22 */
|
|
|
|
+
|
|
|
|
+ 3, /* WL1271_RATE_18 */
|
|
|
|
+ 2, /* WL1271_RATE_12 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_11 */
|
|
|
|
+ 1, /* WL1271_RATE_9 */
|
|
|
|
+ 0, /* WL1271_RATE_6 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_5_5 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_2 */
|
|
|
|
+ WL1271_RX_RATE_UNSUPPORTED /* WL1271_RATE_1 */
|
|
|
|
+};
|
|
|
|
+
|
|
static void wl1271_rx_status(struct wl1271 *wl,
|
|
static void wl1271_rx_status(struct wl1271 *wl,
|
|
struct wl1271_rx_descriptor *desc,
|
|
struct wl1271_rx_descriptor *desc,
|
|
struct ieee80211_rx_status *status,
|
|
struct ieee80211_rx_status *status,
|
|
@@ -77,15 +107,21 @@ static void wl1271_rx_status(struct wl1271 *wl,
|
|
{
|
|
{
|
|
memset(status, 0, sizeof(struct ieee80211_rx_status));
|
|
memset(status, 0, sizeof(struct ieee80211_rx_status));
|
|
|
|
|
|
- if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == WL1271_RX_DESC_BAND_BG)
|
|
|
|
|
|
+ if ((desc->flags & WL1271_RX_DESC_BAND_MASK) ==
|
|
|
|
+ WL1271_RX_DESC_BAND_BG) {
|
|
status->band = IEEE80211_BAND_2GHZ;
|
|
status->band = IEEE80211_BAND_2GHZ;
|
|
- else if ((desc->flags & WL1271_RX_DESC_BAND_MASK) ==
|
|
|
|
- WL1271_RX_DESC_BAND_A)
|
|
|
|
|
|
+ status->rate_idx = wl1271_rx_rate_to_idx[desc->rate];
|
|
|
|
+ } else if ((desc->flags & WL1271_RX_DESC_BAND_MASK) ==
|
|
|
|
+ WL1271_RX_DESC_BAND_A) {
|
|
status->band = IEEE80211_BAND_5GHZ;
|
|
status->band = IEEE80211_BAND_5GHZ;
|
|
- else
|
|
|
|
|
|
+ status->rate_idx = wl1271_5_ghz_rx_rate_to_idx[desc->rate];
|
|
|
|
+ } else
|
|
wl1271_warning("unsupported band 0x%x",
|
|
wl1271_warning("unsupported band 0x%x",
|
|
desc->flags & WL1271_RX_DESC_BAND_MASK);
|
|
desc->flags & WL1271_RX_DESC_BAND_MASK);
|
|
|
|
|
|
|
|
+ if (unlikely(status->rate_idx == WL1271_RX_RATE_UNSUPPORTED))
|
|
|
|
+ wl1271_warning("unsupported rate");
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* FIXME: Add mactime handling. For IBSS (ad-hoc) we need to get the
|
|
* FIXME: Add mactime handling. For IBSS (ad-hoc) we need to get the
|
|
* timestamp from the beacon (acx_tsf_info). In BSS mode (infra) we
|
|
* timestamp from the beacon (acx_tsf_info). In BSS mode (infra) we
|
|
@@ -108,15 +144,14 @@ static void wl1271_rx_status(struct wl1271 *wl,
|
|
|
|
|
|
if (likely(!(desc->flags & WL1271_RX_DESC_DECRYPT_FAIL)))
|
|
if (likely(!(desc->flags & WL1271_RX_DESC_DECRYPT_FAIL)))
|
|
status->flag |= RX_FLAG_DECRYPTED;
|
|
status->flag |= RX_FLAG_DECRYPTED;
|
|
-
|
|
|
|
|
|
+ /* FIXME: Flag should be also set when using 5 GHz band.
|
|
|
|
+ * At the moment chip reports MIC failed on all packets,
|
|
|
|
+ * so flag is silently discarded.
|
|
|
|
+ */
|
|
if (unlikely(desc->flags & WL1271_RX_DESC_MIC_FAIL))
|
|
if (unlikely(desc->flags & WL1271_RX_DESC_MIC_FAIL))
|
|
- status->flag |= RX_FLAG_MMIC_ERROR;
|
|
|
|
|
|
+ if (status->band != IEEE80211_BAND_5GHZ)
|
|
|
|
+ status->flag |= RX_FLAG_MMIC_ERROR;
|
|
}
|
|
}
|
|
-
|
|
|
|
- status->rate_idx = wl1271_rx_rate_to_idx[desc->rate];
|
|
|
|
-
|
|
|
|
- if (status->rate_idx == WL1271_RX_RATE_UNSUPPORTED)
|
|
|
|
- wl1271_warning("unsupported rate");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length)
|
|
static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length)
|