Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170535
b: refs/heads/master
c: 43c2761
h: refs/heads/master
i:
  170533: 75f2f19
  170531: dd29901
  170527: 482bba3
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Oct 7, 2009
1 parent d76ef3d commit 7b230e9
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c46917bb53a546f60c7d3103407fe953c418dd5b
refs/heads/master: 43c2761364b77cd7fd20eb1f14cfee4cd1462abd
3 changes: 3 additions & 0 deletions trunk/drivers/net/wireless/ath/ath.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ struct ath_common {
u8 curbssid[ETH_ALEN];
u8 bssidmask[ETH_ALEN];

u8 tx_chainmask;
u8 rx_chainmask;

struct ath_regulatory regulatory;
const struct ath_ops *ops;
};
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/wireless/ath/ath9k/ath9k.h
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,6 @@ struct ath_softc {
u16 curtxpow;
u8 nbcnvifs;
u16 nvifs;
u8 tx_chainmask;
u8 rx_chainmask;
u32 keymax;
DECLARE_BITMAP(keymap, ATH_KEYMAX);
u8 splitmic;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
{
struct sk_buff *skb = bf->bf_mpdu;
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);
struct ath_desc *ds;
struct ath9k_11n_rate_series series[4];
const struct ath_rate_table *rt;
Expand Down Expand Up @@ -109,7 +110,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4);
series[0].Tries = 1;
series[0].Rate = rate;
series[0].ChSel = sc->tx_chainmask;
series[0].ChSel = common->tx_chainmask;
series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0;
ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration,
series, 4, 0);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/ath/ath9k/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2334,8 +2334,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
int i, rx_chainmask, r;

ah->extprotspacing = sc->ht_extprotspacing;
ah->txchainmask = sc->tx_chainmask;
ah->rxchainmask = sc->rx_chainmask;
ah->txchainmask = common->tx_chainmask;
ah->rxchainmask = common->rx_chainmask;

if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
return -EIO;
Expand Down
34 changes: 21 additions & 13 deletions trunk/drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,11 @@ static void ath_ani_calibrate(unsigned long data)

/* Perform calibration if necessary */
if (longcal || shortcal) {
sc->ani.caldone = ath9k_hw_calibrate(ah, ah->curchan,
sc->rx_chainmask, longcal);
sc->ani.caldone =
ath9k_hw_calibrate(ah,
ah->curchan,
common->rx_chainmask,
longcal);

if (longcal)
sc->ani.noise_floor = ath9k_hw_getchan_noise(ah,
Expand Down Expand Up @@ -492,19 +495,21 @@ static void ath_start_ani(struct ath_softc *sc)
void ath_update_chainmask(struct ath_softc *sc, int is_ht)
{
struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah);

if ((sc->sc_flags & SC_OP_SCANNING) || is_ht ||
(ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE)) {
sc->tx_chainmask = sc->sc_ah->caps.tx_chainmask;
sc->rx_chainmask = sc->sc_ah->caps.rx_chainmask;
common->tx_chainmask = ah->caps.tx_chainmask;
common->rx_chainmask = ah->caps.rx_chainmask;
} else {
sc->tx_chainmask = 1;
sc->rx_chainmask = 1;
common->tx_chainmask = 1;
common->rx_chainmask = 1;
}

ath_print(ath9k_hw_common(ah), ATH_DBG_CONFIG,
ath_print(common, ATH_DBG_CONFIG,
"tx chmask: %d, rx chmask: %d\n",
sc->tx_chainmask, sc->rx_chainmask);
common->tx_chainmask,
common->rx_chainmask);
}

static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta)
Expand Down Expand Up @@ -949,6 +954,7 @@ static void ath_key_delete(struct ath_softc *sc, struct ieee80211_key_conf *key)
static void setup_ht_cap(struct ath_softc *sc,
struct ieee80211_sta_ht_cap *ht_info)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
u8 tx_streams, rx_streams;

ht_info->ht_supported = true;
Expand All @@ -962,11 +968,13 @@ static void setup_ht_cap(struct ath_softc *sc,

/* set up supported mcs set */
memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
tx_streams = !(sc->tx_chainmask & (sc->tx_chainmask - 1)) ? 1 : 2;
rx_streams = !(sc->rx_chainmask & (sc->rx_chainmask - 1)) ? 1 : 2;
tx_streams = !(common->tx_chainmask & (common->tx_chainmask - 1)) ?
1 : 2;
rx_streams = !(common->rx_chainmask & (common->rx_chainmask - 1)) ?
1 : 2;

if (tx_streams != rx_streams) {
ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_CONFIG,
ath_print(common, ATH_DBG_CONFIG,
"TX streams %d, RX streams: %d\n",
tx_streams, rx_streams);
ht_info->mcs.tx_params |= IEEE80211_HT_MCS_TX_RX_DIFF;
Expand Down Expand Up @@ -1759,8 +1767,8 @@ static int ath_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid)
sc->sc_flags |= SC_OP_RXAGGR;
}

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

ath9k_hw_setcapability(ah, ATH9K_CAP_DIVERSITY, 1, true, NULL);
sc->rx.defant = ath9k_hw_getdefantenna(ah);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath/ath9k/xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,7 @@ static u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, struct ath_buf *bf,

static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)
{
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
const struct ath_rate_table *rt = sc->cur_rate_table;
struct ath9k_11n_rate_series series[4];
struct sk_buff *skb;
Expand Down Expand Up @@ -1511,7 +1512,7 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf)

rix = rates[i].idx;
series[i].Tries = rates[i].count;
series[i].ChSel = sc->tx_chainmask;
series[i].ChSel = common->tx_chainmask;

if (rates[i].flags & IEEE80211_TX_RC_USE_SHORT_PREAMBLE)
series[i].Rate = rt->info[rix].ratecode |
Expand Down

0 comments on commit 7b230e9

Please sign in to comment.