led.h 2.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*
 * Copyright 2006, Johannes Berg <johannes@sipsolutions.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/leds.h>
#include "ieee80211_i.h"

#ifdef CONFIG_MAC80211_LEDS
15
void ieee80211_led_rx(struct ieee80211_local *local);
16
void ieee80211_led_tx(struct ieee80211_local *local);
17 18 19 20 21 22 23
void ieee80211_led_assoc(struct ieee80211_local *local,
			 bool associated);
void ieee80211_led_radio(struct ieee80211_local *local,
			 bool enabled);
void ieee80211_led_names(struct ieee80211_local *local);
void ieee80211_led_init(struct ieee80211_local *local);
void ieee80211_led_exit(struct ieee80211_local *local);
24 25
void ieee80211_mod_tpt_led_trig(struct ieee80211_local *local,
				unsigned int types_on, unsigned int types_off);
26 27 28 29
#else
static inline void ieee80211_led_rx(struct ieee80211_local *local)
{
}
30
static inline void ieee80211_led_tx(struct ieee80211_local *local)
31 32
{
}
33 34 35 36
static inline void ieee80211_led_assoc(struct ieee80211_local *local,
				       bool associated)
{
}
I
Ivo van Doorn 已提交
37 38 39 40
static inline void ieee80211_led_radio(struct ieee80211_local *local,
				       bool enabled)
{
}
41 42 43
static inline void ieee80211_led_names(struct ieee80211_local *local)
{
}
44 45 46 47 48 49
static inline void ieee80211_led_init(struct ieee80211_local *local)
{
}
static inline void ieee80211_led_exit(struct ieee80211_local *local)
{
}
50 51 52
static inline void ieee80211_mod_tpt_led_trig(struct ieee80211_local *local,
					      unsigned int types_on,
					      unsigned int types_off)
53 54 55 56 57 58 59 60 61 62
{
}
#endif

static inline void
ieee80211_tpt_led_trig_tx(struct ieee80211_local *local, __le16 fc, int bytes)
{
#ifdef CONFIG_MAC80211_LEDS
	if (local->tpt_led_trigger && ieee80211_is_data(fc))
		local->tpt_led_trigger->tx_bytes += bytes;
63
#endif
64 65 66 67 68 69 70 71 72 73
}

static inline void
ieee80211_tpt_led_trig_rx(struct ieee80211_local *local, __le16 fc, int bytes)
{
#ifdef CONFIG_MAC80211_LEDS
	if (local->tpt_led_trigger && ieee80211_is_data(fc))
		local->tpt_led_trigger->rx_bytes += bytes;
#endif
}