Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a589a6f authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho
Browse files

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: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent fa7930af
Loading
Loading
Loading
Loading
+14 −0
Original line number Original line Diff line number Diff line
@@ -1291,6 +1291,19 @@ static struct wlcore_ops wl12xx_ops = {
	.get_mac		= wl12xx_get_mac,
	.get_mac		= wl12xx_get_mac,
};
};


static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
	.cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 |
	       (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT),
	.ht_supported = true,
	.ampdu_factor = IEEE80211_HT_MAX_AMPDU_8K,
	.ampdu_density = IEEE80211_HT_MPDU_DENSITY_8,
	.mcs = {
		.rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
		.rx_highest = cpu_to_le16(72),
		.tx_params = IEEE80211_HT_MCS_TX_DEFINED,
		},
};

static int __devinit wl12xx_probe(struct platform_device *pdev)
static int __devinit wl12xx_probe(struct platform_device *pdev)
{
{
	struct wl1271 *wl;
	struct wl1271 *wl;
@@ -1313,6 +1326,7 @@ static int __devinit wl12xx_probe(struct platform_device *pdev)
	wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
	wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
	wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
	wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
	wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0;
	wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0;
	memcpy(&wl->ht_cap, &wl12xx_ht_cap, sizeof(wl12xx_ht_cap));
	wl12xx_conf_init(wl);
	wl12xx_conf_init(wl);


	return wlcore_probe(wl, pdev);
	return wlcore_probe(wl, pdev);
+4 −18
Original line number Original line Diff line number Diff line
@@ -4256,29 +4256,12 @@ static struct ieee80211_channel wl1271_channels[] = {
	{ .hw_value = 14, .center_freq = 2484, .max_power = 25 },
	{ .hw_value = 14, .center_freq = 2484, .max_power = 25 },
};
};


/* 11n STA capabilities */
#define HW_RX_HIGHEST_RATE	72

#define WL12XX_HT_CAP { \
	.cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 | \
	       (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT), \
	.ht_supported = true, \
	.ampdu_factor = IEEE80211_HT_MAX_AMPDU_8K, \
	.ampdu_density = IEEE80211_HT_MPDU_DENSITY_8, \
	.mcs = { \
		.rx_mask = { 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, \
		.rx_highest = cpu_to_le16(HW_RX_HIGHEST_RATE), \
		.tx_params = IEEE80211_HT_MCS_TX_DEFINED, \
		}, \
}

/* can't be const, mac80211 writes to this */
/* can't be const, mac80211 writes to this */
static struct ieee80211_supported_band wl1271_band_2ghz = {
static struct ieee80211_supported_band wl1271_band_2ghz = {
	.channels = wl1271_channels,
	.channels = wl1271_channels,
	.n_channels = ARRAY_SIZE(wl1271_channels),
	.n_channels = ARRAY_SIZE(wl1271_channels),
	.bitrates = wl1271_rates,
	.bitrates = wl1271_rates,
	.n_bitrates = ARRAY_SIZE(wl1271_rates),
	.n_bitrates = ARRAY_SIZE(wl1271_rates),
	.ht_cap	= WL12XX_HT_CAP,
};
};


/* 5 GHz data rates for WL1273 */
/* 5 GHz data rates for WL1273 */
@@ -4352,7 +4335,6 @@ static struct ieee80211_supported_band wl1271_band_5ghz = {
	.n_channels = ARRAY_SIZE(wl1271_channels_5ghz),
	.n_channels = ARRAY_SIZE(wl1271_channels_5ghz),
	.bitrates = wl1271_rates_5ghz,
	.bitrates = wl1271_rates_5ghz,
	.n_bitrates = ARRAY_SIZE(wl1271_rates_5ghz),
	.n_bitrates = ARRAY_SIZE(wl1271_rates_5ghz),
	.ht_cap	= WL12XX_HT_CAP,
};
};


static const struct ieee80211_ops wl1271_ops = {
static const struct ieee80211_ops wl1271_ops = {
@@ -4729,8 +4711,12 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
	 */
	 */
	memcpy(&wl->bands[IEEE80211_BAND_2GHZ], &wl1271_band_2ghz,
	memcpy(&wl->bands[IEEE80211_BAND_2GHZ], &wl1271_band_2ghz,
	       sizeof(wl1271_band_2ghz));
	       sizeof(wl1271_band_2ghz));
	memcpy(&wl->bands[IEEE80211_BAND_2GHZ].ht_cap, &wl->ht_cap,
	       sizeof(wl->ht_cap));
	memcpy(&wl->bands[IEEE80211_BAND_5GHZ], &wl1271_band_5ghz,
	memcpy(&wl->bands[IEEE80211_BAND_5GHZ], &wl1271_band_5ghz,
	       sizeof(wl1271_band_5ghz));
	       sizeof(wl1271_band_5ghz));
	memcpy(&wl->bands[IEEE80211_BAND_5GHZ].ht_cap, &wl->ht_cap,
	       sizeof(wl->ht_cap));


	wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
	wl->hw->wiphy->bands[IEEE80211_BAND_2GHZ] =
		&wl->bands[IEEE80211_BAND_2GHZ];
		&wl->bands[IEEE80211_BAND_2GHZ];
+3 −0
Original line number Original line Diff line number Diff line
@@ -342,6 +342,9 @@ struct wl1271 {


	/* this HW rate and below are considered HT rates for this chip */
	/* this HW rate and below are considered HT rates for this chip */
	u8 hw_min_ht_rate;
	u8 hw_min_ht_rate;

	/* HW HT (11n) capabilities */
	struct ieee80211_sta_ht_cap ht_cap;
};
};


int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);