@@ -4853,6 +4853,16 @@ ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw, unsigned int flags,
#endif
}
+/**
+ * ieee80211_tpt_led_trig_trx - report traffic to throughput LED
+ *
+ * @hw: the hardware to count bytes for tpt_led
+ * @tx_bytes: bytes to add to tx
+ * @rx_bytes: bytes to add to rx
+ */
+void ieee80211_tpt_led_trig_trx(struct ieee80211_hw *hw,
+ int tx_bytes, int rx_bytes);
+
/**
* ieee80211_unregister_hw - Unregister a hardware device
*
@@ -319,6 +319,13 @@ __ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
}
EXPORT_SYMBOL(__ieee80211_create_tpt_led_trigger);
+void ieee80211_tpt_led_trig_trx(struct ieee80211_hw *hw,
+ int tx_bytes, int rx_bytes)
+{
+ __ieee80211_tpt_led_trig_trx(hw_to_local(hw), tx_bytes, rx_bytes);
+}
+EXPORT_SYMBOL(ieee80211_tpt_led_trig_trx);
+
static void ieee80211_start_tpt_led_trig(struct ieee80211_local *local)
{
struct tpt_led_trigger *tpt_trig = local->tpt_led_trigger;
@@ -28,6 +28,17 @@ static inline void ieee80211_led_tx(struct ieee80211_local *local)
#endif
}
+static inline void __ieee80211_tpt_led_trig_trx(struct ieee80211_local *local,
+ int tx_bytes, int rx_bytes)
+{
+#ifdef CONFIG_MAC80211_LEDS
+ if (atomic_read(&local->tpt_led_active)) {
+ local->tpt_led_trigger->tx_bytes += tx_bytes;
+ local->tpt_led_trigger->rx_bytes += rx_bytes;
+ }
+#endif
+}
+
#ifdef CONFIG_MAC80211_LEDS
void ieee80211_led_assoc(struct ieee80211_local *local,
bool associated);
@@ -66,21 +77,3 @@ static inline void ieee80211_mod_tpt_led_trig(struct ieee80211_local *local,
{
}
#endif
-
-static inline void
-ieee80211_tpt_led_trig_tx(struct ieee80211_local *local, int bytes)
-{
-#ifdef CONFIG_MAC80211_LEDS
- if (atomic_read(&local->tpt_led_active))
- local->tpt_led_trigger->tx_bytes += bytes;
-#endif
-}
-
-static inline void
-ieee80211_tpt_led_trig_rx(struct ieee80211_local *local, int bytes)
-{
-#ifdef CONFIG_MAC80211_LEDS
- if (atomic_read(&local->tpt_led_active))
- local->tpt_led_trigger->rx_bytes += bytes;
-#endif
-}
@@ -5383,7 +5383,7 @@ void ieee80211_rx_list(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
if (skb) {
if ((status->flag & RX_FLAG_8023) ||
ieee80211_is_data_present(hdr->frame_control))
- ieee80211_tpt_led_trig_rx(local, skb->len);
+ ieee80211_tpt_led_trig_trx(&local->hw, 0, skb->len);
if (status->flag & RX_FLAG_8023)
__ieee80211_rx_handle_8023(hw, pubsta, skb, list);
@@ -4334,7 +4334,7 @@ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
len = 0;
out:
if (len)
- ieee80211_tpt_led_trig_tx(local, len);
+ ieee80211_tpt_led_trig_trx(&local->hw, len, 0);
rcu_read_unlock();
}
@@ -4665,7 +4665,7 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
sta->deflink.tx_stats.packets[queue] += skbs;
sta->deflink.tx_stats.bytes[queue] += len;
- ieee80211_tpt_led_trig_tx(local, len);
+ ieee80211_tpt_led_trig_trx(&local->hw, len, 0);
ieee80211_tx_8023(sdata, skb, sta, false);