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

Commit af0ed69b authored by Johannes Berg's avatar Johannes Berg
Browse files

mac80211: stop modifying HT SMPS capability



Instead of modifying the HT SMPS capability field
for stations, track the SMPS mode explicitly in a
new field in the station struct and use it in the
drivers that care about it. This simplifies the
code using it.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 9fb04b50
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -1183,8 +1183,7 @@ il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta,
	if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
	if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
		return -1;
		return -1;


	if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2) ==
	if (sta->smps_mode == IEEE80211_SMPS_STATIC)
	    WLAN_HT_CAP_SM_PS_STATIC)
		return -1;
		return -1;


	/* Need both Tx chains/antennas to support MIMO */
	/* Need both Tx chains/antennas to support MIMO */
+7 −9
Original line number Original line Diff line number Diff line
@@ -1830,32 +1830,30 @@ il_set_ht_add_station(struct il_priv *il, u8 idx, struct ieee80211_sta *sta)
{
{
	struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap;
	struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap;
	__le32 sta_flags;
	__le32 sta_flags;
	u8 mimo_ps_mode;


	if (!sta || !sta_ht_inf->ht_supported)
	if (!sta || !sta_ht_inf->ht_supported)
		goto done;
		goto done;


	mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2;
	D_ASSOC("spatial multiplexing power save mode: %s\n",
	D_ASSOC("spatial multiplexing power save mode: %s\n",
		(mimo_ps_mode == WLAN_HT_CAP_SM_PS_STATIC) ? "static" :
		(sta->smps_mode == IEEE80211_SMPS_STATIC) ? "static" :
		(mimo_ps_mode == WLAN_HT_CAP_SM_PS_DYNAMIC) ? "dynamic" :
		(sta->smps_mode == IEEE80211_SMPS_DYNAMIC) ? "dynamic" :
		"disabled");
		"disabled");


	sta_flags = il->stations[idx].sta.station_flags;
	sta_flags = il->stations[idx].sta.station_flags;


	sta_flags &= ~(STA_FLG_RTS_MIMO_PROT_MSK | STA_FLG_MIMO_DIS_MSK);
	sta_flags &= ~(STA_FLG_RTS_MIMO_PROT_MSK | STA_FLG_MIMO_DIS_MSK);


	switch (mimo_ps_mode) {
	switch (sta->smps_mode) {
	case WLAN_HT_CAP_SM_PS_STATIC:
	case IEEE80211_SMPS_STATIC:
		sta_flags |= STA_FLG_MIMO_DIS_MSK;
		sta_flags |= STA_FLG_MIMO_DIS_MSK;
		break;
		break;
	case WLAN_HT_CAP_SM_PS_DYNAMIC:
	case IEEE80211_SMPS_DYNAMIC:
		sta_flags |= STA_FLG_RTS_MIMO_PROT_MSK;
		sta_flags |= STA_FLG_RTS_MIMO_PROT_MSK;
		break;
		break;
	case WLAN_HT_CAP_SM_PS_DISABLED:
	case IEEE80211_SMPS_OFF:
		break;
		break;
	default:
	default:
		IL_WARN("Invalid MIMO PS mode %d\n", mimo_ps_mode);
		IL_WARN("Invalid MIMO PS mode %d\n", sta->smps_mode);
		break;
		break;
	}
	}


+2 −4
Original line number Original line Diff line number Diff line
@@ -1289,8 +1289,7 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv,
	if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
	if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
		return -1;
		return -1;


	if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2)
	if (sta->smps_mode == IEEE80211_SMPS_STATIC)
						== WLAN_HT_CAP_SM_PS_STATIC)
		return -1;
		return -1;


	/* Need both Tx chains/antennas to support MIMO */
	/* Need both Tx chains/antennas to support MIMO */
@@ -1345,8 +1344,7 @@ static int rs_switch_to_mimo3(struct iwl_priv *priv,
	if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
	if (!conf_is_ht(conf) || !sta->ht_cap.ht_supported)
		return -1;
		return -1;


	if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2)
	if (sta->smps_mode == IEEE80211_SMPS_STATIC)
						== WLAN_HT_CAP_SM_PS_STATIC)
		return -1;
		return -1;


	/* Need both Tx chains/antennas to support MIMO */
	/* Need both Tx chains/antennas to support MIMO */
+7 −10
Original line number Original line Diff line number Diff line
@@ -196,7 +196,6 @@ static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
				  __le32 *flags, __le32 *mask)
				  __le32 *flags, __le32 *mask)
{
{
	struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap;
	struct ieee80211_sta_ht_cap *sta_ht_inf = &sta->ht_cap;
	u8 mimo_ps_mode;


	*mask = STA_FLG_RTS_MIMO_PROT_MSK |
	*mask = STA_FLG_RTS_MIMO_PROT_MSK |
		STA_FLG_MIMO_DIS_MSK |
		STA_FLG_MIMO_DIS_MSK |
@@ -208,26 +207,24 @@ static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
	if (!sta || !sta_ht_inf->ht_supported)
	if (!sta || !sta_ht_inf->ht_supported)
		return;
		return;


	mimo_ps_mode = (sta_ht_inf->cap & IEEE80211_HT_CAP_SM_PS) >> 2;

	IWL_DEBUG_INFO(priv, "STA %pM SM PS mode: %s\n",
	IWL_DEBUG_INFO(priv, "STA %pM SM PS mode: %s\n",
			sta->addr,
			sta->addr,
			(mimo_ps_mode == WLAN_HT_CAP_SM_PS_STATIC) ?
			(sta->smps_mode == IEEE80211_SMPS_STATIC) ?
			"static" :
			"static" :
			(mimo_ps_mode == WLAN_HT_CAP_SM_PS_DYNAMIC) ?
			(sta->smps_mode == IEEE80211_SMPS_DYNAMIC) ?
			"dynamic" : "disabled");
			"dynamic" : "disabled");


	switch (mimo_ps_mode) {
	switch (sta->smps_mode) {
	case WLAN_HT_CAP_SM_PS_STATIC:
	case IEEE80211_SMPS_STATIC:
		*flags |= STA_FLG_MIMO_DIS_MSK;
		*flags |= STA_FLG_MIMO_DIS_MSK;
		break;
		break;
	case WLAN_HT_CAP_SM_PS_DYNAMIC:
	case IEEE80211_SMPS_DYNAMIC:
		*flags |= STA_FLG_RTS_MIMO_PROT_MSK;
		*flags |= STA_FLG_RTS_MIMO_PROT_MSK;
		break;
		break;
	case WLAN_HT_CAP_SM_PS_DISABLED:
	case IEEE80211_SMPS_OFF:
		break;
		break;
	default:
	default:
		IWL_WARN(priv, "Invalid MIMO PS mode %d\n", mimo_ps_mode);
		IWL_WARN(priv, "Invalid MIMO PS mode %d\n", sta->smps_mode);
		break;
		break;
	}
	}


+2 −4
Original line number Original line Diff line number Diff line
@@ -1229,8 +1229,7 @@ static int rs_switch_to_mimo2(struct iwl_mvm *mvm,
	if (!sta->ht_cap.ht_supported)
	if (!sta->ht_cap.ht_supported)
		return -1;
		return -1;


	if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2)
	if (sta->smps_mode == IEEE80211_SMPS_STATIC)
						== WLAN_HT_CAP_SM_PS_STATIC)
		return -1;
		return -1;


	/* Need both Tx chains/antennas to support MIMO */
	/* Need both Tx chains/antennas to support MIMO */
@@ -1282,8 +1281,7 @@ static int rs_switch_to_mimo3(struct iwl_mvm *mvm,
	if (!sta->ht_cap.ht_supported)
	if (!sta->ht_cap.ht_supported)
		return -1;
		return -1;


	if (((sta->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >> 2)
	if (sta->smps_mode == IEEE80211_SMPS_STATIC)
						== WLAN_HT_CAP_SM_PS_STATIC)
		return -1;
		return -1;


	/* Need both Tx chains/antennas to support MIMO */
	/* Need both Tx chains/antennas to support MIMO */
Loading