From 6c4a15254a5c3eb5df51d294e1d9c36f435bba09 Mon Sep 17 00:00:00 2001 From: nbd Date: Sat, 18 Dec 2010 02:21:24 +0000 Subject: [PATCH] ath9k: merge chainmask fix from r24657 git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@24659 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../patches/550-ath9k_chainmask_read_fix.patch | 28 ++++++++ .../patches/551-ath9k_legacy_chainmask_fix.patch | 75 ++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 package/mac80211/patches/550-ath9k_chainmask_read_fix.patch create mode 100644 package/mac80211/patches/551-ath9k_legacy_chainmask_fix.patch diff --git a/package/mac80211/patches/550-ath9k_chainmask_read_fix.patch b/package/mac80211/patches/550-ath9k_chainmask_read_fix.patch new file mode 100644 index 000000000..a0eebf597 --- /dev/null +++ b/package/mac80211/patches/550-ath9k_chainmask_read_fix.patch @@ -0,0 +1,28 @@ +--- a/drivers/net/wireless/ath/ath9k/debug.c ++++ b/drivers/net/wireless/ath/ath9k/debug.c +@@ -81,11 +81,10 @@ static ssize_t read_file_tx_chainmask(st + size_t count, loff_t *ppos) + { + struct ath_softc *sc = file->private_data; +- struct ath_common *common = ath9k_hw_common(sc->sc_ah); + char buf[32]; + unsigned int len; + +- len = sprintf(buf, "0x%08x\n", common->tx_chainmask); ++ len = sprintf(buf, "0x%08x\n", sc->sc_ah->caps.tx_chainmask); + return simple_read_from_buffer(user_buf, count, ppos, buf, len); + } + +@@ -124,11 +123,10 @@ static ssize_t read_file_rx_chainmask(st + size_t count, loff_t *ppos) + { + struct ath_softc *sc = file->private_data; +- struct ath_common *common = ath9k_hw_common(sc->sc_ah); + char buf[32]; + unsigned int len; + +- len = sprintf(buf, "0x%08x\n", common->rx_chainmask); ++ len = sprintf(buf, "0x%08x\n", sc->sc_ah->caps.rx_chainmask); + return simple_read_from_buffer(user_buf, count, ppos, buf, len); + } + diff --git a/package/mac80211/patches/551-ath9k_legacy_chainmask_fix.patch b/package/mac80211/patches/551-ath9k_legacy_chainmask_fix.patch new file mode 100644 index 000000000..a62cf63d9 --- /dev/null +++ b/package/mac80211/patches/551-ath9k_legacy_chainmask_fix.patch @@ -0,0 +1,75 @@ +--- a/drivers/net/wireless/ath/ath9k/ath9k.h ++++ b/drivers/net/wireless/ath/ath9k/ath9k.h +@@ -662,7 +662,6 @@ void ath9k_deinit_device(struct ath_soft + void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw); + void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw, + struct ath9k_channel *ichan); +-void ath_update_chainmask(struct ath_softc *sc, int is_ht); + int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, + struct ath9k_channel *hchan); + +--- a/drivers/net/wireless/ath/ath9k/main.c ++++ b/drivers/net/wireless/ath/ath9k/main.c +@@ -522,32 +522,6 @@ set_timer: + } + } + +-/* +- * Update tx/rx chainmask. For legacy association, +- * hard code chainmask to 1x1, for 11n association, use +- * the chainmask configuration, for bt coexistence, use +- * the chainmask configuration even in legacy mode. +- */ +-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_OFFCHANNEL) || is_ht || +- (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE)) { +- common->tx_chainmask = ah->caps.tx_chainmask; +- common->rx_chainmask = ah->caps.rx_chainmask; +- } else { +- common->tx_chainmask = 1; +- common->rx_chainmask = 1; +- } +- +- ath_dbg(common, ATH_DBG_CONFIG, +- "tx chmask: %d, rx chmask: %d\n", +- common->tx_chainmask, +- common->rx_chainmask); +-} +- + static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta) + { + struct ath_node *an; +@@ -1609,8 +1583,6 @@ static int ath9k_config(struct ieee80211 + /* XXX: remove me eventualy */ + ath9k_update_ichannel(sc, hw, &sc->sc_ah->channels[pos]); + +- ath_update_chainmask(sc, conf_is_ht(conf)); +- + /* update survey stats for the old channel before switching */ + spin_lock_irqsave(&common->cc_lock, flags); + ath_update_survey_stats(sc); +@@ -1842,10 +1814,6 @@ static void ath9k_bss_info_changed(struc + /* Set aggregation protection mode parameters */ + sc->config.ath_aggr_prot = 0; + +- /* Only legacy IBSS for now */ +- if (vif->type == NL80211_IFTYPE_ADHOC) +- ath_update_chainmask(sc, 0); +- + ath_dbg(common, ATH_DBG_CONFIG, "BSSID: %pM aid: 0x%x\n", + common->curbssid, common->curaid); + +--- a/drivers/net/wireless/ath/ath9k/virtual.c ++++ b/drivers/net/wireless/ath/ath9k/virtual.c +@@ -288,7 +288,6 @@ void ath9k_wiphy_chan_work(struct work_s + /* sync hw configuration for hw code */ + common->hw = aphy->hw; + +- ath_update_chainmask(sc, sc->chan_is_ht); + if (ath_set_channel(sc, aphy->hw, + &sc->sc_ah->channels[sc->chan_idx]) < 0) { + printk(KERN_DEBUG "ath9k: Failed to set channel for new " -- 2.11.0