[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-omap / wl1271 / 0002-wl1271-11n-Support-Add-Definitions.patch
1 From 99d1c6c23faa446ec0ebdf056d8aa8f4d983d518 Mon Sep 17 00:00:00 2001
2 From: Shahar Levi <shahar_levi@ti.com>
3 Date: Wed, 13 Oct 2010 16:09:39 +0200
4 Subject: [PATCH 02/15] wl1271: 11n Support, Add Definitions
6 Two acx commands: ht_capabilities & ht_information, 11n sta capabilities
7 macro.
9 Signed-off-by: Shahar Levi <shahar_levi@ti.com>
10 Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com>
11 Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com>
12 ---
13 drivers/net/wireless/wl12xx/wl1271.h | 11 ++++-
14 drivers/net/wireless/wl12xx/wl1271_acx.h | 81 +++++++++++++++++++++++++++++
15 drivers/net/wireless/wl12xx/wl1271_main.c | 15 +++++
16 3 files changed, 106 insertions(+), 1 deletions(-)
18 diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
19 index 8a4cd76..45a2583 100644
20 --- a/drivers/net/wireless/wl12xx/wl1271.h
21 +++ b/drivers/net/wireless/wl12xx/wl1271.h
22 @@ -432,7 +432,12 @@ struct wl1271 {
23 /* Our association ID */
24 u16 aid;
26 - /* currently configured rate set */
27 + /*
28 + * currently configured rate set:
29 + * bits 0-15 - 802.11abg rates
30 + * bits 16-23 - 802.11n MCS index mask
31 + * support only 1 stream, thus only 8 bits for the MCS rates (0-7).
32 + */
33 u32 sta_rate_set;
34 u32 basic_rate_set;
35 u32 basic_rate;
36 @@ -509,4 +514,8 @@ int wl1271_plt_stop(struct wl1271 *wl);
37 #define WL1271_PRE_POWER_ON_SLEEP 20 /* in miliseconds */
38 #define WL1271_POWER_ON_SLEEP 200 /* in miliseconds */
40 +/* Macros to handle wl1271.sta_rate_set */
41 +#define HW_BG_RATES_MASK 0xffff
42 +#define HW_HT_RATES_OFFSET 16
43 +
44 #endif
45 diff --git a/drivers/net/wireless/wl12xx/wl1271_acx.h b/drivers/net/wireless/wl12xx/wl1271_acx.h
46 index ebb341d..f090a04 100644
47 --- a/drivers/net/wireless/wl12xx/wl1271_acx.h
48 +++ b/drivers/net/wireless/wl12xx/wl1271_acx.h
49 @@ -964,6 +964,87 @@ struct wl1271_acx_rssi_snr_avg_weights {
50 u8 snr_data;
51 };
53 +/*
54 + * ACX_PEER_HT_CAP
55 + * Configure HT capabilities - declare the capabilities of the peer
56 + * we are connected to.
57 + */
58 +struct wl1271_acx_ht_capabilities {
59 + struct acx_header header;
60 +
61 + /*
62 + * bit 0 - Allow HT Operation
63 + * bit 1 - Allow Greenfield format in TX
64 + * bit 2 - Allow Short GI in TX
65 + * bit 3 - Allow L-SIG TXOP Protection in TX
66 + * bit 4 - Allow HT Control fields in TX.
67 + * Note, driver will still leave space for HT control in packets
68 + * regardless of the value of this field. FW will be responsible
69 + * to drop the HT field from any frame when this Bit set to 0.
70 + * bit 5 - Allow RD initiation in TXOP. FW is allowed to initate RD.
71 + * Exact policy setting for this feature is TBD.
72 + * Note, this bit can only be set to 1 if bit 3 is set to 1.
73 + */
74 + __le32 ht_capabilites;
75 +
76 + /*
77 + * Indicates to which peer these capabilities apply.
78 + * For infrastructure use ff:ff:ff:ff:ff:ff that indicates relevance
79 + * for all peers.
80 + * Only valid for IBSS/DLS operation.
81 + */
82 + u8 mac_address[ETH_ALEN];
83 +
84 + /*
85 + * This the maximum A-MPDU length supported by the AP. The FW may not
86 + * exceed this length when sending A-MPDUs
87 + */
88 + u8 ampdu_max_length;
89 +
90 + /* This is the minimal spacing required when sending A-MPDUs to the AP*/
91 + u8 ampdu_min_spacing;
92 +} __packed;
93 +
94 +/* HT Capabilites Fw Bit Mask Mapping */
95 +#define WL1271_ACX_FW_CAP_HT_OPERATION BIT(0)
96 +#define WL1271_ACX_FW_CAP_GREENFIELD_FRAME_FORMAT BIT(1)
97 +#define WL1271_ACX_FW_CAP_SHORT_GI_FOR_20MHZ_PACKETS BIT(2)
98 +#define WL1271_ACX_FW_CAP_LSIG_TXOP_PROTECTION BIT(3)
99 +#define WL1271_ACX_FW_CAP_HT_CONTROL_FIELDS BIT(4)
100 +#define WL1271_ACX_FW_CAP_RD_INITIATION BIT(5)
101 +
102 +
103 +/*
104 + * ACX_HT_BSS_OPERATION
105 + * Configure HT capabilities - AP rules for behavior in the BSS.
106 + */
107 +struct wl1271_acx_ht_information {
108 + struct acx_header header;
109 +
110 + /* Values: 0 - RIFS not allowed, 1 - RIFS allowed */
111 + u8 rifs_mode;
112 +
113 + /* Values: 0 - 3 like in spec */
114 + u8 ht_protection;
115 +
116 + /* Values: 0 - GF protection not required, 1 - GF protection required */
117 + u8 gf_protection;
118 +
119 + /*Values: 0 - TX Burst limit not required, 1 - TX Burst Limit required*/
120 + u8 ht_tx_burst_limit;
121 +
122 + /*
123 + * Values: 0 - Dual CTS protection not required,
124 + * 1 - Dual CTS Protection required
125 + * Note: When this value is set to 1 FW will protect all TXOP with RTS
126 + * frame and will not use CTS-to-self regardless of the value of the
127 + * ACX_CTS_PROTECTION information element
128 + */
129 + u8 dual_cts_protection;
130 +
131 + u8 padding[3];
132 +} __packed;
133 +
134 struct wl1271_acx_fw_tsf_information {
135 struct acx_header header;
137 diff --git a/drivers/net/wireless/wl12xx/wl1271_main.c b/drivers/net/wireless/wl12xx/wl1271_main.c
138 index 591de0e..785b73c 100644
139 --- a/drivers/net/wireless/wl12xx/wl1271_main.c
140 +++ b/drivers/net/wireless/wl12xx/wl1271_main.c
141 @@ -2134,6 +2134,21 @@ static const u8 wl1271_rate_to_idx_2ghz[] = {
142 0 /* CONF_HW_RXTX_RATE_1 */
143 };
145 +/* 11n STA capabilities */
146 +#define HW_RX_HIGHEST_RATE 72
147 +
148 +#define WL1271_HT_CAP { \
149 + .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20, \
150 + .ht_supported = true, \
151 + .ampdu_factor = IEEE80211_HT_MAX_AMPDU_8K, \
152 + .ampdu_density = IEEE80211_HT_MPDU_DENSITY_8, \
153 + .mcs = { \
154 + .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
155 + .rx_highest = cpu_to_le16(HW_RX_HIGHEST_RATE), \
156 + .tx_params = IEEE80211_HT_MCS_TX_DEFINED, \
157 + }, \
158 +}
159 +
160 /* can't be const, mac80211 writes to this */
161 static struct ieee80211_supported_band wl1271_band_2ghz = {
162 .channels = wl1271_channels,
163 --
164 1.6.6.1