diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common-debug.c | 9 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common-init.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/common-spectral.c | 22 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 40 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug_sta.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/dfs_debug.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_debug.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/htc_drv_init.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/tx99.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/xmit.c | 4 |
12 files changed, 73 insertions, 61 deletions
diff --git a/drivers/net/wireless/ath/ath9k/common-debug.c b/drivers/net/wireless/ath/ath9k/common-debug.c index 84afcf78151f..239429f10378 100644 --- a/drivers/net/wireless/ath/ath9k/common-debug.c +++ b/drivers/net/wireless/ath/ath9k/common-debug.c @@ -47,7 +47,7 @@ static const struct file_operations fops_modal_eeprom = { void ath9k_cmn_debug_modal_eeprom(struct dentry *debugfs_phy, struct ath_hw *ah) { - debugfs_create_file("modal_eeprom", S_IRUSR, debugfs_phy, ah, + debugfs_create_file("modal_eeprom", 0400, debugfs_phy, ah, &fops_modal_eeprom); } EXPORT_SYMBOL(ath9k_cmn_debug_modal_eeprom); @@ -82,7 +82,7 @@ static const struct file_operations fops_base_eeprom = { void ath9k_cmn_debug_base_eeprom(struct dentry *debugfs_phy, struct ath_hw *ah) { - debugfs_create_file("base_eeprom", S_IRUSR, debugfs_phy, ah, + debugfs_create_file("base_eeprom", 0400, debugfs_phy, ah, &fops_base_eeprom); } EXPORT_SYMBOL(ath9k_cmn_debug_base_eeprom); @@ -178,8 +178,7 @@ static const struct file_operations fops_recv = { void ath9k_cmn_debug_recv(struct dentry *debugfs_phy, struct ath_rx_stats *rxstats) { - debugfs_create_file("recv", S_IRUSR, debugfs_phy, rxstats, - &fops_recv); + debugfs_create_file("recv", 0400, debugfs_phy, rxstats, &fops_recv); } EXPORT_SYMBOL(ath9k_cmn_debug_recv); @@ -255,7 +254,7 @@ static const struct file_operations fops_phy_err = { void ath9k_cmn_debug_phy_err(struct dentry *debugfs_phy, struct ath_rx_stats *rxstats) { - debugfs_create_file("phy_err", S_IRUSR, debugfs_phy, rxstats, + debugfs_create_file("phy_err", 0400, debugfs_phy, rxstats, &fops_phy_err); } EXPORT_SYMBOL(ath9k_cmn_debug_phy_err); diff --git a/drivers/net/wireless/ath/ath9k/common-init.c b/drivers/net/wireless/ath/ath9k/common-init.c index 8b4f7fdabf58..82de0fadbc95 100644 --- a/drivers/net/wireless/ath/ath9k/common-init.c +++ b/drivers/net/wireless/ath/ath9k/common-init.c @@ -88,7 +88,7 @@ static const struct ieee80211_channel ath9k_5ghz_chantable[] = { CHAN5G(5825, 37), /* Channel 165 */ }; -/* Atheros hardware rate code addition for short premble */ +/* Atheros hardware rate code addition for short preamble */ #define SHPCHECK(__hw_rate, __flags) \ ((__flags & IEEE80211_RATE_SHORT_PREAMBLE) ? (__hw_rate | 0x04 ) : 0) diff --git a/drivers/net/wireless/ath/ath9k/common-spectral.c b/drivers/net/wireless/ath/ath9k/common-spectral.c index 5e77fe1f5b0d..440e16e641e4 100644 --- a/drivers/net/wireless/ath/ath9k/common-spectral.c +++ b/drivers/net/wireless/ath/ath9k/common-spectral.c @@ -479,14 +479,16 @@ ath_cmn_is_fft_buf_full(struct ath_spec_scan_priv *spec_priv) { int i = 0; int ret = 0; + struct rchan_buf *buf; struct rchan *rc = spec_priv->rfs_chan_spec_scan; - for_each_online_cpu(i) - ret += relay_buf_full(*per_cpu_ptr(rc->buf, i)); - - i = num_online_cpus(); + for_each_possible_cpu(i) { + if ((buf = *per_cpu_ptr(rc->buf, i))) { + ret += relay_buf_full(buf); + } + } - if (ret == i) + if (ret) return 1; else return 0; @@ -1096,23 +1098,23 @@ void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, return; debugfs_create_file("spectral_scan_ctl", - S_IRUSR | S_IWUSR, + 0600, debugfs_phy, spec_priv, &fops_spec_scan_ctl); debugfs_create_file("spectral_short_repeat", - S_IRUSR | S_IWUSR, + 0600, debugfs_phy, spec_priv, &fops_spectral_short_repeat); debugfs_create_file("spectral_count", - S_IRUSR | S_IWUSR, + 0600, debugfs_phy, spec_priv, &fops_spectral_count); debugfs_create_file("spectral_period", - S_IRUSR | S_IWUSR, + 0600, debugfs_phy, spec_priv, &fops_spectral_period); debugfs_create_file("spectral_fft_period", - S_IRUSR | S_IWUSR, + 0600, debugfs_phy, spec_priv, &fops_spectral_fft_period); } diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 9e8aed5c478c..f685843a2ff3 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -1385,7 +1385,7 @@ int ath9k_init_debug(struct ath_hw *ah) return -ENOMEM; #ifdef CONFIG_ATH_DEBUG - debugfs_create_file("debug", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, + debugfs_create_file("debug", 0600, sc->debug.debugfs_phy, sc, &fops_debug); #endif @@ -1409,22 +1409,22 @@ int ath9k_init_debug(struct ath_hw *ah) ath9k_cmn_debug_recv(sc->debug.debugfs_phy, &sc->debug.stats.rxstats); ath9k_cmn_debug_phy_err(sc->debug.debugfs_phy, &sc->debug.stats.rxstats); - debugfs_create_u8("rx_chainmask", S_IRUSR, sc->debug.debugfs_phy, + debugfs_create_u8("rx_chainmask", 0400, sc->debug.debugfs_phy, &ah->rxchainmask); - debugfs_create_u8("tx_chainmask", S_IRUSR, sc->debug.debugfs_phy, + debugfs_create_u8("tx_chainmask", 0400, sc->debug.debugfs_phy, &ah->txchainmask); - debugfs_create_file("ani", S_IRUSR | S_IWUSR, + debugfs_create_file("ani", 0600, sc->debug.debugfs_phy, sc, &fops_ani); - debugfs_create_bool("paprd", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, + debugfs_create_bool("paprd", 0600, sc->debug.debugfs_phy, &sc->sc_ah->config.enable_paprd); - debugfs_create_file("regidx", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, + debugfs_create_file("regidx", 0600, sc->debug.debugfs_phy, sc, &fops_regidx); - debugfs_create_file("regval", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, + debugfs_create_file("regval", 0600, sc->debug.debugfs_phy, sc, &fops_regval); - debugfs_create_bool("ignore_extcca", S_IRUSR | S_IWUSR, + debugfs_create_bool("ignore_extcca", 0600, sc->debug.debugfs_phy, &ah->config.cwm_ignore_extcca); - debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc, + debugfs_create_file("regdump", 0400, sc->debug.debugfs_phy, sc, &fops_regdump); debugfs_create_devm_seqfile(sc->dev, "dump_nfcal", sc->debug.debugfs_phy, @@ -1433,35 +1433,33 @@ int ath9k_init_debug(struct ath_hw *ah) ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah); ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah); - debugfs_create_u32("gpio_mask", S_IRUSR | S_IWUSR, + debugfs_create_u32("gpio_mask", 0600, sc->debug.debugfs_phy, &sc->sc_ah->gpio_mask); - debugfs_create_u32("gpio_val", S_IRUSR | S_IWUSR, + debugfs_create_u32("gpio_val", 0600, sc->debug.debugfs_phy, &sc->sc_ah->gpio_val); - debugfs_create_file("antenna_diversity", S_IRUSR, + debugfs_create_file("antenna_diversity", 0400, sc->debug.debugfs_phy, sc, &fops_antenna_diversity); #ifdef CONFIG_ATH9K_BTCOEX_SUPPORT - debugfs_create_file("bt_ant_diversity", S_IRUSR | S_IWUSR, + debugfs_create_file("bt_ant_diversity", 0600, sc->debug.debugfs_phy, sc, &fops_bt_ant_diversity); - debugfs_create_file("btcoex", S_IRUSR, sc->debug.debugfs_phy, sc, + debugfs_create_file("btcoex", 0400, sc->debug.debugfs_phy, sc, &fops_btcoex); #endif #ifdef CONFIG_ATH9K_WOW - debugfs_create_file("wow", S_IRUSR | S_IWUSR, - sc->debug.debugfs_phy, sc, &fops_wow); + debugfs_create_file("wow", 0600, sc->debug.debugfs_phy, sc, &fops_wow); #endif #ifdef CONFIG_ATH9K_DYNACK - debugfs_create_file("ack_to", S_IRUSR, sc->debug.debugfs_phy, + debugfs_create_file("ack_to", 0400, sc->debug.debugfs_phy, sc, &fops_ackto); #endif - debugfs_create_file("tpc", S_IRUSR | S_IWUSR, - sc->debug.debugfs_phy, sc, &fops_tpc); + debugfs_create_file("tpc", 0600, sc->debug.debugfs_phy, sc, &fops_tpc); - debugfs_create_u16("airtime_flags", S_IRUSR | S_IWUSR, + debugfs_create_u16("airtime_flags", 0600, sc->debug.debugfs_phy, &sc->airtime_flags); - debugfs_create_file("nf_override", S_IRUSR | S_IWUSR, + debugfs_create_file("nf_override", 0600, sc->debug.debugfs_phy, sc, &fops_nf_override); return 0; diff --git a/drivers/net/wireless/ath/ath9k/debug_sta.c b/drivers/net/wireless/ath/ath9k/debug_sta.c index efc692ee67d4..a6f45f1bb5bb 100644 --- a/drivers/net/wireless/ath/ath9k/debug_sta.c +++ b/drivers/net/wireless/ath/ath9k/debug_sta.c @@ -302,7 +302,7 @@ void ath9k_sta_add_debugfs(struct ieee80211_hw *hw, { struct ath_node *an = (struct ath_node *)sta->drv_priv; - debugfs_create_file("node_aggr", S_IRUGO, dir, an, &fops_node_aggr); - debugfs_create_file("node_recv", S_IRUGO, dir, an, &fops_node_recv); - debugfs_create_file("airtime", S_IRUGO, dir, an, &fops_airtime); + debugfs_create_file("node_aggr", 0444, dir, an, &fops_node_aggr); + debugfs_create_file("node_recv", 0444, dir, an, &fops_node_recv); + debugfs_create_file("airtime", 0444, dir, an, &fops_airtime); } diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c index 8824610c21fb..3251c9abe270 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_debug.c +++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c @@ -144,8 +144,8 @@ static const struct file_operations fops_dfs_stats = { void ath9k_dfs_init_debug(struct ath_softc *sc) { - debugfs_create_file("dfs_stats", S_IRUSR, + debugfs_create_file("dfs_stats", 0400, sc->debug.debugfs_phy, sc, &fops_dfs_stats); - debugfs_create_file("dfs_simulate_radar", S_IWUSR, + debugfs_create_file("dfs_simulate_radar", 0200, sc->debug.debugfs_phy, sc, &fops_simulate_radar); } diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c index dc79afd7e151..b3ed65e5c4da 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c @@ -496,25 +496,25 @@ int ath9k_htc_init_debug(struct ath_hw *ah) ath9k_cmn_spectral_init_debug(&priv->spec_priv, priv->debug.debugfs_phy); - debugfs_create_file("tgt_int_stats", S_IRUSR, priv->debug.debugfs_phy, + debugfs_create_file("tgt_int_stats", 0400, priv->debug.debugfs_phy, priv, &fops_tgt_int_stats); - debugfs_create_file("tgt_tx_stats", S_IRUSR, priv->debug.debugfs_phy, + debugfs_create_file("tgt_tx_stats", 0400, priv->debug.debugfs_phy, priv, &fops_tgt_tx_stats); - debugfs_create_file("tgt_rx_stats", S_IRUSR, priv->debug.debugfs_phy, + debugfs_create_file("tgt_rx_stats", 0400, priv->debug.debugfs_phy, priv, &fops_tgt_rx_stats); - debugfs_create_file("xmit", S_IRUSR, priv->debug.debugfs_phy, + debugfs_create_file("xmit", 0400, priv->debug.debugfs_phy, priv, &fops_xmit); - debugfs_create_file("skb_rx", S_IRUSR, priv->debug.debugfs_phy, + debugfs_create_file("skb_rx", 0400, priv->debug.debugfs_phy, priv, &fops_skb_rx); ath9k_cmn_debug_recv(priv->debug.debugfs_phy, &priv->debug.rx_stats); ath9k_cmn_debug_phy_err(priv->debug.debugfs_phy, &priv->debug.rx_stats); - debugfs_create_file("slot", S_IRUSR, priv->debug.debugfs_phy, + debugfs_create_file("slot", 0400, priv->debug.debugfs_phy, priv, &fops_slot); - debugfs_create_file("queue", S_IRUSR, priv->debug.debugfs_phy, + debugfs_create_file("queue", 0400, priv->debug.debugfs_phy, priv, &fops_queue); - debugfs_create_file("debug", S_IRUSR | S_IWUSR, priv->debug.debugfs_phy, + debugfs_create_file("debug", 0600, priv->debug.debugfs_phy, priv, &fops_debug); ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah); diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index f246e9ed4a81..214c68269a69 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -591,7 +591,7 @@ static void ath9k_init_misc(struct ath9k_htc_priv *priv) { struct ath_common *common = ath9k_hw_common(priv->ah); - memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); + eth_broadcast_addr(common->bssidmask); common->last_rssi = ATH_RSSI_DUMMY_MARKER; priv->ah->opmode = NL80211_IFTYPE_STATION; diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index cd0f023ccf77..6b37036b2d36 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -184,7 +184,8 @@ u16 ath9k_hw_computetxtime(struct ath_hw *ah, break; case WLAN_RC_PHY_OFDM: if (ah->curchan && IS_CHAN_QUARTER_RATE(ah->curchan)) { - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_QUARTER) / 1000; + bitsPerSymbol = + ((kbps >> 2) * OFDM_SYMBOL_TIME_QUARTER) / 1000; numBits = OFDM_PLCP_BITS + (frameLen << 3); numSymbols = DIV_ROUND_UP(numBits, bitsPerSymbol); txTime = OFDM_SIFS_TIME_QUARTER @@ -192,7 +193,8 @@ u16 ath9k_hw_computetxtime(struct ath_hw *ah, + (numSymbols * OFDM_SYMBOL_TIME_QUARTER); } else if (ah->curchan && IS_CHAN_HALF_RATE(ah->curchan)) { - bitsPerSymbol = (kbps * OFDM_SYMBOL_TIME_HALF) / 1000; + bitsPerSymbol = + ((kbps >> 1) * OFDM_SYMBOL_TIME_HALF) / 1000; numBits = OFDM_PLCP_BITS + (frameLen << 3); numSymbols = DIV_ROUND_UP(numBits, bitsPerSymbol); txTime = OFDM_SIFS_TIME_HALF + @@ -1036,7 +1038,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah) int acktimeout, ctstimeout, ack_offset = 0; int slottime; int sifstime; - int rx_lat = 0, tx_lat = 0, eifs = 0; + int rx_lat = 0, tx_lat = 0, eifs = 0, ack_shift = 0; u32 reg; ath_dbg(ath9k_hw_common(ah), RESET, "ah->misc_mode 0x%x\n", @@ -1068,6 +1070,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah) sifstime = 32; ack_offset = 16; + ack_shift = 3; slottime = 13; } else if (IS_CHAN_QUARTER_RATE(chan)) { eifs = 340; @@ -1078,6 +1081,7 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah) sifstime = 64; ack_offset = 32; + ack_shift = 1; slottime = 21; } else { if (AR_SREV_9287(ah) && AR_SREV_9287_13_OR_LATER(ah)) { @@ -1134,6 +1138,10 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah) SM(tx_lat, AR_USEC_TX_LAT), AR_USEC_TX_LAT | AR_USEC_RX_LAT | AR_USEC_USEC); + if (IS_CHAN_HALF_RATE(chan) || IS_CHAN_QUARTER_RATE(chan)) + REG_RMW(ah, AR_TXSIFS, + sifstime | SM(ack_shift, AR_TXSIFS_ACK_SHIFT), + (AR_TXSIFS_TIME | AR_TXSIFS_ACK_SHIFT)); } EXPORT_SYMBOL(ath9k_hw_init_global_settings); diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index e479fae5aab9..c070a9e51ebf 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -257,6 +257,11 @@ static void ath9k_reg_notifier(struct wiphy *wiphy, ath_reg_notifier_apply(wiphy, request, reg); + /* synchronize DFS detector if regulatory domain changed */ + if (sc->dfs_detector != NULL) + sc->dfs_detector->set_dfs_domain(sc->dfs_detector, + request->dfs_region); + /* Set tx power */ if (!ah->curchan) return; @@ -267,10 +272,6 @@ static void ath9k_reg_notifier(struct wiphy *wiphy, ath9k_cmn_update_txpow(ah, sc->cur_chan->cur_txpower, sc->cur_chan->txpower, &sc->cur_chan->cur_txpower); - /* synchronize DFS detector if regulatory domain changed */ - if (sc->dfs_detector != NULL) - sc->dfs_detector->set_dfs_domain(sc->dfs_detector, - request->dfs_region); ath9k_ps_restore(sc); } @@ -427,7 +428,7 @@ static void ath9k_init_misc(struct ath_softc *sc) timer_setup(&common->ani.timer, ath_ani_calibrate, 0); common->last_rssi = ATH_RSSI_DUMMY_MARKER; - memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); + eth_broadcast_addr(common->bssidmask); sc->beacon.slottime = 9; for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) diff --git a/drivers/net/wireless/ath/ath9k/tx99.c b/drivers/net/wireless/ath/ath9k/tx99.c index fe3a8263b224..ce50d8f5835e 100644 --- a/drivers/net/wireless/ath/ath9k/tx99.c +++ b/drivers/net/wireless/ath/ath9k/tx99.c @@ -278,10 +278,10 @@ void ath9k_tx99_init_debug(struct ath_softc *sc) if (!AR_SREV_9280_20_OR_LATER(sc->sc_ah)) return; - debugfs_create_file("tx99", S_IRUSR | S_IWUSR, + debugfs_create_file("tx99", 0600, sc->debug.debugfs_phy, sc, &fops_tx99); - debugfs_create_file("tx99_power", S_IRUSR | S_IWUSR, + debugfs_create_file("tx99_power", 0600, sc->debug.debugfs_phy, sc, &fops_tx99_power); } diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 396bf05c6bf6..d8b041f48ca8 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -2892,6 +2892,8 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an) struct ath_txq *txq; int tidno; + rcu_read_lock(); + for (tidno = 0; tidno < IEEE80211_NUM_TIDS; tidno++) { tid = ath_node_to_tid(an, tidno); txq = tid->txq; @@ -2909,6 +2911,8 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an) if (!an->sta) break; /* just one multicast ath_atx_tid */ } + + rcu_read_unlock(); } #ifdef CONFIG_ATH9K_TX99 |