aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_rx.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_rx.c83
1 files changed, 2 insertions, 81 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
index 6f1b732ae43b..57f4bfd959c8 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
@@ -43,66 +43,6 @@ static u32 wl1271_rx_get_buf_size(struct wl1271_fw_status *status,
43 RX_BUF_SIZE_MASK) >> RX_BUF_SIZE_SHIFT_DIV; 43 RX_BUF_SIZE_MASK) >> RX_BUF_SIZE_SHIFT_DIV;
44} 44}
45 45
46/* The values of this table must match the wl1271_rates[] array */
47static u8 wl1271_rx_rate_to_idx[] = {
48 /* MCS rates are used only with 11n */
49 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS7 */
50 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS6 */
51 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS5 */
52 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS4 */
53 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS3 */
54 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS2 */
55 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS1 */
56 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS0 */
57
58 11, /* WL1271_RATE_54 */
59 10, /* WL1271_RATE_48 */
60 9, /* WL1271_RATE_36 */
61 8, /* WL1271_RATE_24 */
62
63 /* TI-specific rate */
64 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_22 */
65
66 7, /* WL1271_RATE_18 */
67 6, /* WL1271_RATE_12 */
68 3, /* WL1271_RATE_11 */
69 5, /* WL1271_RATE_9 */
70 4, /* WL1271_RATE_6 */
71 2, /* WL1271_RATE_5_5 */
72 1, /* WL1271_RATE_2 */
73 0 /* WL1271_RATE_1 */
74};
75
76/* The values of this table must match the wl1271_rates[] array */
77static u8 wl1271_5_ghz_rx_rate_to_idx[] = {
78 /* MCS rates are used only with 11n */
79 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS7 */
80 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS6 */
81 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS5 */
82 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS4 */
83 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS3 */
84 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS2 */
85 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS1 */
86 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS0 */
87
88 7, /* WL1271_RATE_54 */
89 6, /* WL1271_RATE_48 */
90 5, /* WL1271_RATE_36 */
91 4, /* WL1271_RATE_24 */
92
93 /* TI-specific rate */
94 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_22 */
95
96 3, /* WL1271_RATE_18 */
97 2, /* WL1271_RATE_12 */
98 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_11 */
99 1, /* WL1271_RATE_9 */
100 0, /* WL1271_RATE_6 */
101 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_5_5 */
102 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_2 */
103 WL1271_RX_RATE_UNSUPPORTED /* WL1271_RATE_1 */
104};
105
106static void wl1271_rx_status(struct wl1271 *wl, 46static void wl1271_rx_status(struct wl1271 *wl,
107 struct wl1271_rx_descriptor *desc, 47 struct wl1271_rx_descriptor *desc,
108 struct ieee80211_rx_status *status, 48 struct ieee80211_rx_status *status,
@@ -110,20 +50,8 @@ static void wl1271_rx_status(struct wl1271 *wl,
110{ 50{
111 memset(status, 0, sizeof(struct ieee80211_rx_status)); 51 memset(status, 0, sizeof(struct ieee80211_rx_status));
112 52
113 if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == 53 status->band = wl->band;
114 WL1271_RX_DESC_BAND_BG) { 54 status->rate_idx = wl1271_rate_to_idx(wl, desc->rate);
115 status->band = IEEE80211_BAND_2GHZ;
116 status->rate_idx = wl1271_rx_rate_to_idx[desc->rate];
117 } else if ((desc->flags & WL1271_RX_DESC_BAND_MASK) ==
118 WL1271_RX_DESC_BAND_A) {
119 status->band = IEEE80211_BAND_5GHZ;
120 status->rate_idx = wl1271_5_ghz_rx_rate_to_idx[desc->rate];
121 } else
122 wl1271_warning("unsupported band 0x%x",
123 desc->flags & WL1271_RX_DESC_BAND_MASK);
124
125 if (unlikely(status->rate_idx == WL1271_RX_RATE_UNSUPPORTED))
126 wl1271_warning("unsupported rate");
127 55
128 /* 56 /*
129 * FIXME: Add mactime handling. For IBSS (ad-hoc) we need to get the 57 * FIXME: Add mactime handling. For IBSS (ad-hoc) we need to get the
@@ -133,13 +61,6 @@ static void wl1271_rx_status(struct wl1271 *wl,
133 */ 61 */
134 status->signal = desc->rssi; 62 status->signal = desc->rssi;
135 63
136 /*
137 * FIXME: In wl1251, the SNR should be divided by two. In wl1271 we
138 * need to divide by two for now, but TI has been discussing about
139 * changing it. This needs to be rechecked.
140 */
141 status->noise = desc->rssi - (desc->snr >> 1);
142
143 status->freq = ieee80211_channel_to_frequency(desc->channel); 64 status->freq = ieee80211_channel_to_frequency(desc->channel);
144 65
145 if (desc->flags & WL1271_RX_DESC_ENCRYPT_MASK) { 66 if (desc->flags & WL1271_RX_DESC_ENCRYPT_MASK) {