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

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

wlcore: support peer MIMO rates



Parse the peer ht_cap element containing MCS8-MCS15 rates and pass it
to the FW. Rates unsupported by the HW will be sanitized by mac80211
before reaching us.

Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent f13af348
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -1371,7 +1371,9 @@ int wl12xx_cmd_add_peer(struct wl1271 *wl, struct wl12xx_vif *wlvif,


	sta_rates = sta->supp_rates[wlvif->band];
	sta_rates = sta->supp_rates[wlvif->band];
	if (sta->ht_cap.ht_supported)
	if (sta->ht_cap.ht_supported)
		sta_rates |= sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET;
		sta_rates |=
			(sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET) |
			(sta->ht_cap.mcs.rx_mask[1] << HW_MIMO_RATES_OFFSET);


	cmd->supported_rates =
	cmd->supported_rates =
		cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates,
		cpu_to_le32(wl1271_tx_enabled_rates_get(wl, sta_rates,
+2 −1
Original line number Original line Diff line number Diff line
@@ -3696,7 +3696,8 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
		sta_rate_set = sta->supp_rates[wl->hw->conf.channel->band];
		sta_rate_set = sta->supp_rates[wl->hw->conf.channel->band];
		if (sta->ht_cap.ht_supported)
		if (sta->ht_cap.ht_supported)
			sta_rate_set |=
			sta_rate_set |=
			    (sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET);
			  (sta->ht_cap.mcs.rx_mask[0] << HW_HT_RATES_OFFSET) |
			  (sta->ht_cap.mcs.rx_mask[1] << HW_MIMO_RATES_OFFSET);
		sta_ht_cap = sta->ht_cap;
		sta_ht_cap = sta->ht_cap;
		sta_exists = true;
		sta_exists = true;


+2 −2
Original line number Original line Diff line number Diff line
@@ -428,10 +428,10 @@ u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set,
		rate_set >>= 1;
		rate_set >>= 1;
	}
	}


	/* MCS rates indication are on bits 16 - 23 */
	/* MCS rates indication are on bits 16 - 31 */
	rate_set >>= HW_HT_RATES_OFFSET - band->n_bitrates;
	rate_set >>= HW_HT_RATES_OFFSET - band->n_bitrates;


	for (bit = 0; bit < 8; bit++) {
	for (bit = 0; bit < 16; bit++) {
		if (rate_set & 0x1)
		if (rate_set & 0x1)
			enabled_rates |= (CONF_HW_BIT_RATE_MCS_0 << bit);
			enabled_rates |= (CONF_HW_BIT_RATE_MCS_0 << bit);
		rate_set >>= 1;
		rate_set >>= 1;
+1 −0
Original line number Original line Diff line number Diff line
@@ -502,6 +502,7 @@ void wl1271_rx_filter_flatten_fields(struct wl12xx_rx_filter *filter,
/* Macros to handle wl1271.sta_rate_set */
/* Macros to handle wl1271.sta_rate_set */
#define HW_BG_RATES_MASK	0xffff
#define HW_BG_RATES_MASK	0xffff
#define HW_HT_RATES_OFFSET	16
#define HW_HT_RATES_OFFSET	16
#define HW_MIMO_RATES_OFFSET	24


#define WL12XX_HW_BLOCK_SIZE	256
#define WL12XX_HW_BLOCK_SIZE	256