aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-12-13 06:20:44 -0500
committerLuciano Coelho <coelho@ti.com>2012-04-12 01:44:02 -0400
commit4a589a6f38cbde9500f8b5c350b0a03ca2b3fef0 (patch)
tree8b1dd2b4735372f5b20e3a5da528bf1cc0c9d965 /drivers/net
parentfa7930afa525e7f481f9d6984a301f69c2255ee4 (diff)
wlcore/wl12xx: set HT capabilities per chip-family
Set HT capabilities in the low-level HW driver. These are then used by wlcore when registering with mac80211. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c14
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c22
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h3
3 files changed, 21 insertions, 18 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index f22cd55e396..ec94ad6d2e9 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1291,6 +1291,19 @@ static struct wlcore_ops wl12xx_ops = {
1291 .get_mac = wl12xx_get_mac, 1291 .get_mac = wl12xx_get_mac,
1292}; 1292};
1293 1293
1294static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
1295 .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 |
1296 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT),
1297 .ht_supported = true,
1298 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_8K,
1299 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_8,
1300 .mcs = {
1301 .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
1302 .rx_highest = cpu_to_le16(72),
1303 .tx_params = IEEE80211_HT_MCS_TX_DEFINED,
1304 },
1305};
1306
1294static int __devinit wl12xx_probe(struct platform_device *pdev) 1307static int __devinit wl12xx_probe(struct platform_device *pdev)
1295{ 1308{
1296 struct wl1271 *wl; 1309 struct wl1271 *wl;
@@ -1313,6 +1326,7 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
1313 wl->band_rate_to_idx = wl12xx_band_rate_to_idx; 1326 wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
1314 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX; 1327 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
1315 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0; 1328 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0;
1329 memcpy(&wl->ht_cap, &wl12xx_ht_cap, sizeof(wl12xx_ht_cap));
1316 wl12xx_conf_init(wl); 1330 wl12xx_conf_init(wl);
1317 1331
1318 return wlcore_probe(wl, pdev); 1332 return wlcore_probe(wl, pdev);
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index d351c8f2dc6..ef0d04ed9f1 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -4256,29 +4256,12 @@ static struct ieee80211_channel wl1271_channels[] = {
4256 { .hw_value = 14, .center_freq = 2484, .max_power = 25 }, 4256 { .hw_value = 14, .center_freq = 2484, .max_power = 25 },
4257}; 4257};
4258 4258
4259/* 11n STA capabilities */
4260#define HW_RX_HIGHEST_RATE 72
4261
4262#define WL12XX_HT_CAP { \
4263 .cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | \
4264 (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT), \
4265 .ht_supported = true, \
4266 .ampdu_factor = IEEE80211_HT_MAX_AMPDU_8K, \
4267 .ampdu_density = IEEE80211_HT_MPDU_DENSITY_8, \
4268 .mcs = { \
4269 .rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
4270 .rx_highest = cpu_to_le16(HW_RX_HIGHEST_RATE), \
4271 .tx_params = IEEE80211_HT_MCS_TX_DEFINED, \
4272 }, \
4273}
4274
4275/* can't be const, mac80211 writes to this */ 4259/* can't be const, mac80211 writes to this */
4276static struct ieee80211_supported_band wl1271_band_2ghz = { 4260static struct ieee80211_supported_band wl1271_band_2ghz = {
4277 .channels = wl1271_channels, 4261 .channels = wl1271_channels,
4278 .n_channels = ARRAY_SIZE(wl1271_channels), 4262 .n_channels = ARRAY_SIZE(wl1271_channels),
4279 .bitrates = wl1271_rates, 4263 .bitrates = wl1271_rates,
4280 .n_bitrates = ARRAY_SIZE(wl1271_rates), 4264 .n_bitrates = ARRAY_SIZE(wl1271_rates),
4281 .ht_cap = WL12XX_HT_CAP,
4282}; 4265};
4283 4266
4284/* 5 GHz data rates for WL1273 */ 4267/* 5 GHz data rates for WL1273 */
@@ -4352,7 +4335,6 @@ static struct ieee80211_supported_band wl1271_band_5ghz = {
4352 .n_channels = ARRAY_SIZE(wl1271_channels_5ghz), 4335 .n_channels = ARRAY_SIZE(wl1271_channels_5ghz),
4353 .bitrates = wl1271_rates_5ghz, 4336 .bitrates = wl1271_rates_5ghz,
4354 .n_bitrates = ARRAY_SIZE(wl1271_rates_5ghz), 4337 .n_bitrates = ARRAY_SIZE(wl1271_rates_5ghz),
4355 .ht_cap = WL12XX_HT_CAP,
4356}; 4338};
4357 4339
4358static const struct ieee80211_ops wl1271_ops = { 4340static const struct ieee80211_ops wl1271_ops = {
@@ -4729,8 +4711,12 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
4729 */ 4711 */
4730 memcpy(&wl->bands[IEEE80211_BAND_2GHZ], &wl1271_band_2ghz, 4712 memcpy(&wl->bands[IEEE80211_BAND_2GHZ], &wl1271_band_2ghz,
4731 sizeof(wl1271_band_2ghz)); 4713 sizeof(wl1271_band_2ghz));
4714 memcpy(&wl->bands[IEEE80211_BAND_2GHZ].ht_cap, &wl->ht_cap,
4715 sizeof(wl->ht_cap));
4732 memcpy(&wl->bands[IEEE80211_BAND_5GHZ], &wl1271_band_5ghz, 4716 memcpy(&wl->bands[IEEE80211_BAND_5GHZ], &wl1271_band_5ghz,
4733 sizeof(wl1271_band_5ghz)); 4717 sizeof(wl1271_band_5ghz));
4718 memcpy(&wl->bands[IEEE80211_BAND_5GHZ].ht_cap, &wl->ht_cap,
4719 sizeof(wl->ht_cap));
4734 4720
4735 wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] = 4721 wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
4736 &wl->bands[IEEE80211_BAND_2GHZ]; 4722 &wl->bands[IEEE80211_BAND_2GHZ];
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 0660f750e54..1c2d81fe749 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -342,6 +342,9 @@ struct wl1271 {
342 342
343 /* this HW rate and below are considered HT rates for this chip */ 343 /* this HW rate and below are considered HT rates for this chip */
344 u8 hw_min_ht_rate; 344 u8 hw_min_ht_rate;
345
346 /* HW HT (11n) capabilities */
347 struct ieee80211_sta_ht_cap ht_cap;
345}; 348};
346 349
347int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev); 350int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);