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

Commit 82b2d334 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville
Browse files

ath9k: eliminate common->{rx,tx}_chainmask



we already have ah->{rx,tx}chainmask for the same purpose

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 693828fe
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -140,9 +140,6 @@ struct ath_common {
	u8 curbssid[ETH_ALEN];
	u8 curbssid[ETH_ALEN];
	u8 bssidmask[ETH_ALEN];
	u8 bssidmask[ETH_ALEN];


	u8 tx_chainmask;
	u8 rx_chainmask;

	u32 rx_bufsize;
	u32 rx_bufsize;


	u32 keymax;
	u32 keymax;
+2 −2
Original line number Original line Diff line number Diff line
@@ -113,7 +113,7 @@ static int ar9003_get_training_power_5g(struct ath_hw *ah)
	if (delta > scale)
	if (delta > scale)
		return -1;
		return -1;


	switch (get_streams(common->tx_chainmask)) {
	switch (get_streams(ah->txchainmask)) {
	case 1:
	case 1:
		delta = 6;
		delta = 6;
		break;
		break;
@@ -126,7 +126,7 @@ static int ar9003_get_training_power_5g(struct ath_hw *ah)
	default:
	default:
		delta = 0;
		delta = 0;
		ath_dbg(common, ATH_DBG_CALIBRATE,
		ath_dbg(common, ATH_DBG_CALIBRATE,
		"Invalid tx-chainmask: %u\n", common->tx_chainmask);
		"Invalid tx-chainmask: %u\n", ah->txchainmask);
	}
	}


	power += delta;
	power += delta;
+1 −1
Original line number Original line Diff line number Diff line
@@ -107,7 +107,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
	series[0].Tries = 1;
	series[0].Tries = 1;
	series[0].Rate = rate;
	series[0].Rate = rate;
	series[0].ChSel = ath_txchainmask_reduction(sc,
	series[0].ChSel = ath_txchainmask_reduction(sc,
			common->tx_chainmask, series[0].Rate);
			ah->txchainmask, series[0].Rate);
	series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0;
	series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0;
	ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration,
	ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration,
				     series, 4, 0);
				     series, 4, 0);
+10 −10
Original line number Original line Diff line number Diff line
@@ -95,11 +95,11 @@ static ssize_t read_file_tx_chainmask(struct file *file, char __user *user_buf,
			     size_t count, loff_t *ppos)
			     size_t count, loff_t *ppos)
{
{
	struct ath_softc *sc = file->private_data;
	struct ath_softc *sc = file->private_data;
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_hw *ah = sc->sc_ah;
	char buf[32];
	char buf[32];
	unsigned int len;
	unsigned int len;


	len = sprintf(buf, "0x%08x\n", common->tx_chainmask);
	len = sprintf(buf, "0x%08x\n", ah->txchainmask);
	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
}


@@ -107,7 +107,7 @@ static ssize_t write_file_tx_chainmask(struct file *file, const char __user *use
			     size_t count, loff_t *ppos)
			     size_t count, loff_t *ppos)
{
{
	struct ath_softc *sc = file->private_data;
	struct ath_softc *sc = file->private_data;
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_hw *ah = sc->sc_ah;
	unsigned long mask;
	unsigned long mask;
	char buf[32];
	char buf[32];
	ssize_t len;
	ssize_t len;
@@ -120,8 +120,8 @@ static ssize_t write_file_tx_chainmask(struct file *file, const char __user *use
	if (strict_strtoul(buf, 0, &mask))
	if (strict_strtoul(buf, 0, &mask))
		return -EINVAL;
		return -EINVAL;


	common->tx_chainmask = mask;
	ah->txchainmask = mask;
	sc->sc_ah->caps.tx_chainmask = mask;
	ah->caps.tx_chainmask = mask;
	return count;
	return count;
}
}


@@ -138,11 +138,11 @@ static ssize_t read_file_rx_chainmask(struct file *file, char __user *user_buf,
			     size_t count, loff_t *ppos)
			     size_t count, loff_t *ppos)
{
{
	struct ath_softc *sc = file->private_data;
	struct ath_softc *sc = file->private_data;
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_hw *ah = sc->sc_ah;
	char buf[32];
	char buf[32];
	unsigned int len;
	unsigned int len;


	len = sprintf(buf, "0x%08x\n", common->rx_chainmask);
	len = sprintf(buf, "0x%08x\n", ah->rxchainmask);
	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
	return simple_read_from_buffer(user_buf, count, ppos, buf, len);
}
}


@@ -150,7 +150,7 @@ static ssize_t write_file_rx_chainmask(struct file *file, const char __user *use
			     size_t count, loff_t *ppos)
			     size_t count, loff_t *ppos)
{
{
	struct ath_softc *sc = file->private_data;
	struct ath_softc *sc = file->private_data;
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_hw *ah = sc->sc_ah;
	unsigned long mask;
	unsigned long mask;
	char buf[32];
	char buf[32];
	ssize_t len;
	ssize_t len;
@@ -163,8 +163,8 @@ static ssize_t write_file_rx_chainmask(struct file *file, const char __user *use
	if (strict_strtoul(buf, 0, &mask))
	if (strict_strtoul(buf, 0, &mask))
		return -EINVAL;
		return -EINVAL;


	common->rx_chainmask = mask;
	ah->rxchainmask = mask;
	sc->sc_ah->caps.rx_chainmask = mask;
	ah->caps.rx_chainmask = mask;
	return count;
	return count;
}
}


+2 −5
Original line number Original line Diff line number Diff line
@@ -509,8 +509,8 @@ static void setup_ht_cap(struct ath9k_htc_priv *priv,
	memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
	memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));


	/* ath9k_htc supports only 1 or 2 stream devices */
	/* ath9k_htc supports only 1 or 2 stream devices */
	tx_streams = ath9k_cmn_count_streams(common->tx_chainmask, 2);
	tx_streams = ath9k_cmn_count_streams(priv->ah->txchainmask, 2);
	rx_streams = ath9k_cmn_count_streams(common->rx_chainmask, 2);
	rx_streams = ath9k_cmn_count_streams(priv->ah->rxchainmask, 2);


	ath_dbg(common, ATH_DBG_CONFIG,
	ath_dbg(common, ATH_DBG_CONFIG,
		"TX streams %d, RX streams: %d\n",
		"TX streams %d, RX streams: %d\n",
@@ -601,9 +601,6 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv)
{
{
	struct ath_common *common = ath9k_hw_common(priv->ah);
	struct ath_common *common = ath9k_hw_common(priv->ah);


	common->tx_chainmask = priv->ah->caps.tx_chainmask;
	common->rx_chainmask = priv->ah->caps.rx_chainmask;

	memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);
	memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);


	priv->ah->opmode = NL80211_IFTYPE_STATION;
	priv->ah->opmode = NL80211_IFTYPE_STATION;
Loading