diff options
author | David Lin <dlin@marvell.com> | 2016-05-20 12:13:27 +0800 |
---|---|---|
committer | David Lin <dlin@marvell.com> | 2016-05-20 12:13:27 +0800 |
commit | c074b732a73cfdfa6f2f5928ba5b55e54fecc85a (patch) | |
tree | c6b2a2d9c9797cda83fad6f7aaf728c296c17a68 | |
parent | 6988b67d9af987a7ba47f82cdaa6c9107e55ec3f (diff) |
Commit mwlwifi driver 10.3.0.17-20160520.
1. If traffic of BA session is not heavy, remove the BA stream.
2. Interrupt cause should be cleaned before processing related interrupt.
Signed-off-by: David Lin <dlin@marvell.com>
-rw-r--r-- | dev.h | 4 | ||||
-rw-r--r-- | isr.c | 18 | ||||
-rw-r--r-- | main.c | 40 | ||||
-rw-r--r-- | tx.c | 2 |
4 files changed, 46 insertions, 18 deletions
@@ -27,7 +27,7 @@ #include <net/mac80211.h> #define MWL_DRV_NAME KBUILD_MODNAME -#define MWL_DRV_VERSION "10.3.0.17-20160324" +#define MWL_DRV_VERSION "10.3.0.17-20160520" /* Map to 0x80000000 (Bus control) on BAR0 */ #define MACREG_REG_H2A_INTERRUPT_EVENTS 0x00000C18 /* (From host to ARM) */ @@ -330,6 +330,8 @@ struct mwl_priv { u32 qe_trigger_num; unsigned long qe_trigger_time; + struct timer_list period_timer; + s8 noise; /* Most recently reported noise in dBm */ struct ieee80211_supported_band band_24; struct ieee80211_channel channels_24[BAND_24_CHANNEL_NUM]; @@ -33,7 +33,7 @@ irqreturn_t mwl_isr(int irq, void *dev_id) #ifdef BG4CT_A0_WORKAROUND unsigned int currIteration = 0; #endif - u32 int_status, clr_status; + u32 int_status; u32 status; #ifdef BG4CT_A0_WORKAROUND @@ -49,11 +49,10 @@ irqreturn_t mwl_isr(int irq, void *dev_id) if (int_status == 0xffffffff) { wiphy_warn(hw->wiphy, "card unplugged?\n"); } else { - clr_status = int_status; + writel(~int_status, + priv->iobase1 + MACREG_REG_A2H_INTERRUPT_CAUSE); if (int_status & MACREG_A2HRIC_BIT_TX_DONE) { - int_status &= ~MACREG_A2HRIC_BIT_TX_DONE; - if (!priv->is_tx_done_schedule) { status = readl(int_status_mask); writel((status & ~MACREG_A2HRIC_BIT_TX_DONE), @@ -64,8 +63,6 @@ irqreturn_t mwl_isr(int irq, void *dev_id) } if (int_status & MACREG_A2HRIC_BIT_RX_RDY) { - int_status &= ~MACREG_A2HRIC_BIT_RX_RDY; - if (!priv->is_rx_schedule) { status = readl(int_status_mask); writel((status & ~MACREG_A2HRIC_BIT_RX_RDY), @@ -76,14 +73,11 @@ irqreturn_t mwl_isr(int irq, void *dev_id) } if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { - int_status &= ~MACREG_A2HRIC_BIT_RADAR_DETECT; wiphy_info(hw->wiphy, "radar detected by firmware\n"); ieee80211_radar_detected(hw); } if (int_status & MACREG_A2HRIC_BIT_QUE_EMPTY) { - int_status &= ~MACREG_A2HRIC_BIT_QUE_EMPTY; - if (!priv->is_qe_schedule) { if (time_after(jiffies, (priv->qe_trigger_time + 1))) { @@ -99,16 +93,12 @@ irqreturn_t mwl_isr(int irq, void *dev_id) } } - if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) { - int_status &= ~MACREG_A2HRIC_BIT_CHAN_SWITCH; + if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) ieee80211_queue_work(hw, &priv->chnl_switch_handle); - } if (int_status & MACREG_A2HRIC_BA_WATCHDOG) ieee80211_queue_work(hw, &priv->watchdog_ba_handle); - writel(~clr_status, - priv->iobase1 + MACREG_REG_A2H_INTERRUPT_CAUSE); } #ifdef BG4CT_A0_WORKAROUND } while (currIteration++ < MAX_ISR_ITERATION); @@ -517,6 +517,39 @@ static void mwl_set_caps(struct mwl_priv *priv) } } +static void timer_routine(unsigned long data) +{ + struct mwl_priv *priv = (struct mwl_priv *)data; + struct mwl_ampdu_stream *stream; + struct mwl_sta *sta_info; + struct mwl_tx_info *tx_stats; + int i; + + spin_lock_bh(&priv->stream_lock); + for (i = 0; i < SYSADPT_TX_AMPDU_QUEUES; i++) { + stream = &priv->ampdu[i]; + + if (stream->state == AMPDU_STREAM_ACTIVE) { + sta_info = mwl_dev_get_sta(stream->sta); + tx_stats = &sta_info->tx_stats[stream->tid]; + + if ((jiffies - tx_stats->start_time > HZ) && + (tx_stats->pkts < SYSADPT_AMPDU_PACKET_THRESHOLD)) { + ieee80211_stop_tx_ba_session(stream->sta, + stream->tid); + } + + if (jiffies - tx_stats->start_time > HZ) { + tx_stats->pkts = 0; + tx_stats->start_time = jiffies; + } + } + } + spin_unlock_bh(&priv->stream_lock); + + mod_timer(&priv->period_timer, jiffies + msecs_to_jiffies(10)); +} + static int mwl_wl_init(struct mwl_priv *priv) { struct ieee80211_hw *hw; @@ -690,6 +723,9 @@ static int mwl_wl_init(struct mwl_priv *priv) } priv->irq = priv->pdev->irq; + setup_timer(&priv->period_timer, timer_routine, (unsigned long)priv); + mod_timer(&priv->period_timer, jiffies + msecs_to_jiffies(10)); + return rc; err_register_irq: @@ -713,9 +749,9 @@ err_thermal_register: static void mwl_wl_deinit(struct mwl_priv *priv) { - struct ieee80211_hw *hw; + struct ieee80211_hw *hw = priv->hw; - hw = priv->hw; + del_timer_sync(&priv->period_timer); if (priv->irq != -1) { free_irq(priv->pdev->irq, hw); @@ -365,7 +365,7 @@ static inline void mwl_tx_count_packet(struct ieee80211_sta *sta, u8 tid) */ if (jiffies - tx_stats->start_time > HZ) { tx_stats->pkts = 0; - tx_stats->start_time = 0; + tx_stats->start_time = jiffies; } else { tx_stats->pkts++; } |