aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorTeemu Paasikivi <ext-teemu.3.paasikivi@nokia.com>2009-10-13 05:47:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:11 -0400
commita410264553447ff90bf13e3662684e794e5ff83e (patch)
treebafa31d089221252d2639fb2c90a294ff36842e3 /drivers/net/wireless
parentabb0b3bfb2d2411034b721df21c31964265b851e (diff)
wl1271: Added 5 GHz support to join and rx
Added support to assiociate and use connection on 5 GHz band (802.11a). Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> Reviewed-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.c13
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_cmd.h1
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_rx.c57
3 files changed, 58 insertions, 13 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.c b/drivers/net/wireless/wl12xx/wl1271_cmd.c
index 6d7a40c004f..fe4f1e64512 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.c
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.c
@@ -219,6 +219,7 @@ int wl1271_cmd_join(struct wl1271 *wl)
219 219
220 join->rx_config_options = wl->rx_config; 220 join->rx_config_options = wl->rx_config;
221 join->rx_filter_options = wl->rx_filter; 221 join->rx_filter_options = wl->rx_filter;
222 join->bss_type = wl->bss_type;
222 223
223 /* 224 /*
224 * FIXME: disable temporarily all filters because after commit 225 * FIXME: disable temporarily all filters because after commit
@@ -229,12 +230,20 @@ int wl1271_cmd_join(struct wl1271 *wl)
229 join->rx_config_options = 0; 230 join->rx_config_options = 0;
230 join->rx_filter_options = WL1271_DEFAULT_RX_FILTER; 231 join->rx_filter_options = WL1271_DEFAULT_RX_FILTER;
231 232
232 join->basic_rate_set = CONF_HW_BIT_RATE_1MBPS | CONF_HW_BIT_RATE_2MBPS | 233 if (wl->band == IEEE80211_BAND_2GHZ)
234 join->basic_rate_set =
235 CONF_HW_BIT_RATE_1MBPS | CONF_HW_BIT_RATE_2MBPS |
233 CONF_HW_BIT_RATE_5_5MBPS | CONF_HW_BIT_RATE_11MBPS; 236 CONF_HW_BIT_RATE_5_5MBPS | CONF_HW_BIT_RATE_11MBPS;
237 else {
238 join->bss_type |= WL1271_JOIN_CMD_BSS_TYPE_5GHZ;
239 join->basic_rate_set =
240 CONF_HW_BIT_RATE_6MBPS | CONF_HW_BIT_RATE_12MBPS |
241 CONF_HW_BIT_RATE_24MBPS;
242 }
234 243
235 join->beacon_interval = WL1271_DEFAULT_BEACON_INT; 244 join->beacon_interval = WL1271_DEFAULT_BEACON_INT;
236 join->dtim_interval = WL1271_DEFAULT_DTIM_PERIOD; 245 join->dtim_interval = WL1271_DEFAULT_DTIM_PERIOD;
237 join->bss_type = wl->bss_type; 246
238 join->channel = wl->channel; 247 join->channel = wl->channel;
239 join->ssid_len = wl->ssid_len; 248 join->ssid_len = wl->ssid_len;
240 memcpy(join->ssid, wl->ssid, wl->ssid_len); 249 memcpy(join->ssid, wl->ssid, wl->ssid_len);
diff --git a/drivers/net/wireless/wl12xx/wl1271_cmd.h b/drivers/net/wireless/wl12xx/wl1271_cmd.h
index 33089408e75..15254fa82f6 100644
--- a/drivers/net/wireless/wl12xx/wl1271_cmd.h
+++ b/drivers/net/wireless/wl12xx/wl1271_cmd.h
@@ -198,6 +198,7 @@ enum {
198 198
199#define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */ 199#define WL1271_JOIN_CMD_CTRL_TX_FLUSH 0x80 /* Firmware flushes all Tx */
200#define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1 200#define WL1271_JOIN_CMD_TX_SESSION_OFFSET 1
201#define WL1271_JOIN_CMD_BSS_TYPE_5GHZ 0x10
201 202
202struct wl1271_cmd_join { 203struct wl1271_cmd_join {
203 struct wl1271_cmd_header header; 204 struct wl1271_cmd_header header;
diff --git a/drivers/net/wireless/wl12xx/wl1271_rx.c b/drivers/net/wireless/wl12xx/wl1271_rx.c
index 66b83e92290..1dd84582ef3 100644
--- a/drivers/net/wireless/wl12xx/wl1271_rx.c
+++ b/drivers/net/wireless/wl12xx/wl1271_rx.c
@@ -70,6 +70,36 @@ static u8 wl1271_rx_rate_to_idx[] = {
70 0 /* WL1271_RATE_1 */ 70 0 /* WL1271_RATE_1 */
71}; 71};
72 72
73/* The values of this table must match the wl1271_rates[] array */
74static u8 wl1271_5_ghz_rx_rate_to_idx[] = {
75 /* MCS rates are used only with 11n */
76 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS7 */
77 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS6 */
78 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS5 */
79 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS4 */
80 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS3 */
81 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS2 */
82 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS1 */
83 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_MCS0 */
84
85 7, /* WL1271_RATE_54 */
86 6, /* WL1271_RATE_48 */
87 5, /* WL1271_RATE_36 */
88 4, /* WL1271_RATE_24 */
89
90 /* TI-specific rate */
91 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_22 */
92
93 3, /* WL1271_RATE_18 */
94 2, /* WL1271_RATE_12 */
95 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_11 */
96 1, /* WL1271_RATE_9 */
97 0, /* WL1271_RATE_6 */
98 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_5_5 */
99 WL1271_RX_RATE_UNSUPPORTED, /* WL1271_RATE_2 */
100 WL1271_RX_RATE_UNSUPPORTED /* WL1271_RATE_1 */
101};
102
73static void wl1271_rx_status(struct wl1271 *wl, 103static void wl1271_rx_status(struct wl1271 *wl,
74 struct wl1271_rx_descriptor *desc, 104 struct wl1271_rx_descriptor *desc,
75 struct ieee80211_rx_status *status, 105 struct ieee80211_rx_status *status,
@@ -77,15 +107,21 @@ static void wl1271_rx_status(struct wl1271 *wl,
77{ 107{
78 memset(status, 0, sizeof(struct ieee80211_rx_status)); 108 memset(status, 0, sizeof(struct ieee80211_rx_status));
79 109
80 if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == WL1271_RX_DESC_BAND_BG) 110 if ((desc->flags & WL1271_RX_DESC_BAND_MASK) ==
111 WL1271_RX_DESC_BAND_BG) {
81 status->band = IEEE80211_BAND_2GHZ; 112 status->band = IEEE80211_BAND_2GHZ;
82 else if ((desc->flags & WL1271_RX_DESC_BAND_MASK) == 113 status->rate_idx = wl1271_rx_rate_to_idx[desc->rate];
83 WL1271_RX_DESC_BAND_A) 114 } else if ((desc->flags & WL1271_RX_DESC_BAND_MASK) ==
115 WL1271_RX_DESC_BAND_A) {
84 status->band = IEEE80211_BAND_5GHZ; 116 status->band = IEEE80211_BAND_5GHZ;
85 else 117 status->rate_idx = wl1271_5_ghz_rx_rate_to_idx[desc->rate];
118 } else
86 wl1271_warning("unsupported band 0x%x", 119 wl1271_warning("unsupported band 0x%x",
87 desc->flags & WL1271_RX_DESC_BAND_MASK); 120 desc->flags & WL1271_RX_DESC_BAND_MASK);
88 121
122 if (unlikely(status->rate_idx == WL1271_RX_RATE_UNSUPPORTED))
123 wl1271_warning("unsupported rate");
124
89 /* 125 /*
90 * FIXME: Add mactime handling. For IBSS (ad-hoc) we need to get the 126 * FIXME: Add mactime handling. For IBSS (ad-hoc) we need to get the
91 * timestamp from the beacon (acx_tsf_info). In BSS mode (infra) we 127 * timestamp from the beacon (acx_tsf_info). In BSS mode (infra) we
@@ -108,15 +144,14 @@ static void wl1271_rx_status(struct wl1271 *wl,
108 144
109 if (likely(!(desc->flags & WL1271_RX_DESC_DECRYPT_FAIL))) 145 if (likely(!(desc->flags & WL1271_RX_DESC_DECRYPT_FAIL)))
110 status->flag |= RX_FLAG_DECRYPTED; 146 status->flag |= RX_FLAG_DECRYPTED;
111 147 /* FIXME: Flag should be also set when using 5 GHz band.
148 * At the moment chip reports MIC failed on all packets,
149 * so flag is silently discarded.
150 */
112 if (unlikely(desc->flags & WL1271_RX_DESC_MIC_FAIL)) 151 if (unlikely(desc->flags & WL1271_RX_DESC_MIC_FAIL))
113 status->flag |= RX_FLAG_MMIC_ERROR; 152 if (status->band != IEEE80211_BAND_5GHZ)
153 status->flag |= RX_FLAG_MMIC_ERROR;
114 } 154 }
115
116 status->rate_idx = wl1271_rx_rate_to_idx[desc->rate];
117
118 if (status->rate_idx == WL1271_RX_RATE_UNSUPPORTED)
119 wl1271_warning("unsupported rate");
120} 155}
121 156
122static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length) 157static void wl1271_rx_handle_data(struct wl1271 *wl, u32 length)