Loading drivers/net/wireless/mediatek/mt76/mac80211.c +6 −2 Original line number Diff line number Diff line Loading @@ -548,7 +548,7 @@ mt76_check_ccmp_pn(struct sk_buff *skb) } static void mt76_check_ps(struct mt76_dev *dev, struct sk_buff *skb) mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb) { struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; Loading @@ -567,6 +567,9 @@ mt76_check_ps(struct mt76_dev *dev, struct sk_buff *skb) sta = container_of((void *) wcid, struct ieee80211_sta, drv_priv); ewma_signal_add(&wcid->rssi, status->signal); wcid->inactive_count = 0; if (!test_bit(MT_WCID_FLAG_CHECK_PS, &wcid->flags)) return; Loading Loading @@ -626,7 +629,7 @@ void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q, __skb_queue_head_init(&frames); while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) { mt76_check_ps(dev, skb); mt76_check_sta(dev, skb); mt76_rx_aggr_reorder(skb, &frames); } Loading Loading @@ -660,6 +663,7 @@ mt76_sta_add(struct mt76_dev *dev, struct ieee80211_vif *vif, mt76_txq_init(dev, sta->txq[i]); } ewma_signal_init(&wcid->rssi); rcu_assign_pointer(dev->wcid[wcid->idx], wcid); out: Loading drivers/net/wireless/mediatek/mt76/mt76.h +8 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <linux/skbuff.h> #include <linux/leds.h> #include <linux/usb.h> #include <linux/average.h> #include <net/mac80211.h> #include "util.h" Loading Loading @@ -174,6 +175,8 @@ enum mt76_wcid_flags { #define MT76_N_WCIDS 128 DECLARE_EWMA(signal, 10, 8); struct mt76_wcid { struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS]; Loading @@ -181,6 +184,9 @@ struct mt76_wcid { unsigned long flags; struct ewma_signal rssi; int inactive_count; u8 idx; u8 hw_key_idx; Loading Loading @@ -680,6 +686,8 @@ int mt76_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *mt76_rx_convert(struct sk_buff *skb); int mt76_get_min_avg_rssi(struct mt76_dev *dev); int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int *dbm); Loading drivers/net/wireless/mediatek/mt76/mt76x0/phy.c +3 −1 Original line number Diff line number Diff line Loading @@ -1077,7 +1077,9 @@ mt76x0_phy_update_channel_gain(struct mt76x02_dev *dev) u8 gain_delta; int low_gain; dev->cal.avg_rssi_all = mt76x02_phy_get_min_avg_rssi(dev); dev->cal.avg_rssi_all = mt76_get_min_avg_rssi(&dev->mt76); if (!dev->cal.avg_rssi_all) dev->cal.avg_rssi_all = -75; low_gain = (dev->cal.avg_rssi_all > mt76x02_get_rssi_gain_thresh(dev)) + (dev->cal.avg_rssi_all > mt76x02_get_low_rssi_gain_thresh(dev)); Loading drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +0 −5 Original line number Diff line number Diff line Loading @@ -656,11 +656,6 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb, status->tid = FIELD_GET(MT_RXWI_TID, tid_sn); status->seqno = FIELD_GET(MT_RXWI_SN, tid_sn); if (sta) { ewma_signal_add(&sta->rssi, status->signal); sta->inactive_count = 0; } return mt76x02_mac_process_rate(status, rate); } Loading drivers/net/wireless/mediatek/mt76/mt76x02_mac.h +0 −6 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ #ifndef __MT76X02_MAC_H #define __MT76X02_MAC_H #include <linux/average.h> struct mt76x02_dev; struct mt76x02_tx_status { Loading @@ -41,8 +39,6 @@ struct mt76x02_vif { u8 idx; }; DECLARE_EWMA(signal, 10, 8); struct mt76x02_sta { struct mt76_wcid wcid; /* must be first */ Loading @@ -50,8 +46,6 @@ struct mt76x02_sta { struct mt76x02_tx_status status; int n_frames; struct ewma_signal rssi; int inactive_count; }; #define MT_RXINFO_BA BIT(0) Loading Loading
drivers/net/wireless/mediatek/mt76/mac80211.c +6 −2 Original line number Diff line number Diff line Loading @@ -548,7 +548,7 @@ mt76_check_ccmp_pn(struct sk_buff *skb) } static void mt76_check_ps(struct mt76_dev *dev, struct sk_buff *skb) mt76_check_sta(struct mt76_dev *dev, struct sk_buff *skb) { struct mt76_rx_status *status = (struct mt76_rx_status *) skb->cb; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; Loading @@ -567,6 +567,9 @@ mt76_check_ps(struct mt76_dev *dev, struct sk_buff *skb) sta = container_of((void *) wcid, struct ieee80211_sta, drv_priv); ewma_signal_add(&wcid->rssi, status->signal); wcid->inactive_count = 0; if (!test_bit(MT_WCID_FLAG_CHECK_PS, &wcid->flags)) return; Loading Loading @@ -626,7 +629,7 @@ void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q, __skb_queue_head_init(&frames); while ((skb = __skb_dequeue(&dev->rx_skb[q])) != NULL) { mt76_check_ps(dev, skb); mt76_check_sta(dev, skb); mt76_rx_aggr_reorder(skb, &frames); } Loading Loading @@ -660,6 +663,7 @@ mt76_sta_add(struct mt76_dev *dev, struct ieee80211_vif *vif, mt76_txq_init(dev, sta->txq[i]); } ewma_signal_init(&wcid->rssi); rcu_assign_pointer(dev->wcid[wcid->idx], wcid); out: Loading
drivers/net/wireless/mediatek/mt76/mt76.h +8 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <linux/skbuff.h> #include <linux/leds.h> #include <linux/usb.h> #include <linux/average.h> #include <net/mac80211.h> #include "util.h" Loading Loading @@ -174,6 +175,8 @@ enum mt76_wcid_flags { #define MT76_N_WCIDS 128 DECLARE_EWMA(signal, 10, 8); struct mt76_wcid { struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS]; Loading @@ -181,6 +184,9 @@ struct mt76_wcid { unsigned long flags; struct ewma_signal rssi; int inactive_count; u8 idx; u8 hw_key_idx; Loading Loading @@ -680,6 +686,8 @@ int mt76_sta_state(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *mt76_rx_convert(struct sk_buff *skb); int mt76_get_min_avg_rssi(struct mt76_dev *dev); int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int *dbm); Loading
drivers/net/wireless/mediatek/mt76/mt76x0/phy.c +3 −1 Original line number Diff line number Diff line Loading @@ -1077,7 +1077,9 @@ mt76x0_phy_update_channel_gain(struct mt76x02_dev *dev) u8 gain_delta; int low_gain; dev->cal.avg_rssi_all = mt76x02_phy_get_min_avg_rssi(dev); dev->cal.avg_rssi_all = mt76_get_min_avg_rssi(&dev->mt76); if (!dev->cal.avg_rssi_all) dev->cal.avg_rssi_all = -75; low_gain = (dev->cal.avg_rssi_all > mt76x02_get_rssi_gain_thresh(dev)) + (dev->cal.avg_rssi_all > mt76x02_get_low_rssi_gain_thresh(dev)); Loading
drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +0 −5 Original line number Diff line number Diff line Loading @@ -656,11 +656,6 @@ int mt76x02_mac_process_rx(struct mt76x02_dev *dev, struct sk_buff *skb, status->tid = FIELD_GET(MT_RXWI_TID, tid_sn); status->seqno = FIELD_GET(MT_RXWI_SN, tid_sn); if (sta) { ewma_signal_add(&sta->rssi, status->signal); sta->inactive_count = 0; } return mt76x02_mac_process_rate(status, rate); } Loading
drivers/net/wireless/mediatek/mt76/mt76x02_mac.h +0 −6 Original line number Diff line number Diff line Loading @@ -18,8 +18,6 @@ #ifndef __MT76X02_MAC_H #define __MT76X02_MAC_H #include <linux/average.h> struct mt76x02_dev; struct mt76x02_tx_status { Loading @@ -41,8 +39,6 @@ struct mt76x02_vif { u8 idx; }; DECLARE_EWMA(signal, 10, 8); struct mt76x02_sta { struct mt76_wcid wcid; /* must be first */ Loading @@ -50,8 +46,6 @@ struct mt76x02_sta { struct mt76x02_tx_status status; int n_frames; struct ewma_signal rssi; int inactive_count; }; #define MT_RXINFO_BA BIT(0) Loading