Blame view

net/mac80211/led.h 2.1 KB
f0706e828   Jiri Benc   [MAC80211]: Add m...
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
e1e540685   Johannes Berg   mac80211: add thr...
15
16
17
18
19
20
21
22
23
  void ieee80211_led_rx(struct ieee80211_local *local);
  void ieee80211_led_tx(struct ieee80211_local *local, int q);
  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);
67408c8c7   Johannes Berg   mac80211: selecti...
24
25
  void ieee80211_mod_tpt_led_trig(struct ieee80211_local *local,
  				unsigned int types_on, unsigned int types_off);
f0706e828   Jiri Benc   [MAC80211]: Add m...
26
27
28
29
30
31
32
  #else
  static inline void ieee80211_led_rx(struct ieee80211_local *local)
  {
  }
  static inline void ieee80211_led_tx(struct ieee80211_local *local, int q)
  {
  }
47f0c5022   Michael Buesch   [MAC80211]: Add a...
33
34
35
36
  static inline void ieee80211_led_assoc(struct ieee80211_local *local,
  				       bool associated)
  {
  }
cdcb006fb   Ivo van Doorn   mac80211: Add rad...
37
38
39
40
  static inline void ieee80211_led_radio(struct ieee80211_local *local,
  				       bool enabled)
  {
  }
fe67c913f   Johannes Berg   mac80211: make LE...
41
42
43
  static inline void ieee80211_led_names(struct ieee80211_local *local)
  {
  }
f0706e828   Jiri Benc   [MAC80211]: Add m...
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)
  {
  }
67408c8c7   Johannes Berg   mac80211: selecti...
50
51
52
  static inline void ieee80211_mod_tpt_led_trig(struct ieee80211_local *local,
  					      unsigned int types_on,
  					      unsigned int types_off)
e1e540685   Johannes Berg   mac80211: add thr...
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;
f0706e828   Jiri Benc   [MAC80211]: Add m...
63
  #endif
e1e540685   Johannes Berg   mac80211: add thr...
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
  }