led.c (664b0bae0b87f69bc9deb098f5e0158b9cf18e04) led.c (2282e125a406e09331c5a785e3df29035c99a607)
1/*
2 * Copyright 2006, Johannes Berg <johannes@sipsolutions.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8

--- 38 unchanged lines hidden (view full) ---

47void ieee80211_free_led_names(struct ieee80211_local *local)
48{
49 kfree(local->rx_led.name);
50 kfree(local->tx_led.name);
51 kfree(local->assoc_led.name);
52 kfree(local->radio_led.name);
53}
54
1/*
2 * Copyright 2006, Johannes Berg <johannes@sipsolutions.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8

--- 38 unchanged lines hidden (view full) ---

47void ieee80211_free_led_names(struct ieee80211_local *local)
48{
49 kfree(local->rx_led.name);
50 kfree(local->tx_led.name);
51 kfree(local->assoc_led.name);
52 kfree(local->radio_led.name);
53}
54
55static void ieee80211_tx_led_activate(struct led_classdev *led_cdev)
55static int ieee80211_tx_led_activate(struct led_classdev *led_cdev)
56{
57 struct ieee80211_local *local = container_of(led_cdev->trigger,
58 struct ieee80211_local,
59 tx_led);
60
61 atomic_inc(&local->tx_led_active);
56{
57 struct ieee80211_local *local = container_of(led_cdev->trigger,
58 struct ieee80211_local,
59 tx_led);
60
61 atomic_inc(&local->tx_led_active);
62
63 return 0;
62}
63
64static void ieee80211_tx_led_deactivate(struct led_classdev *led_cdev)
65{
66 struct ieee80211_local *local = container_of(led_cdev->trigger,
67 struct ieee80211_local,
68 tx_led);
69
70 atomic_dec(&local->tx_led_active);
71}
72
64}
65
66static void ieee80211_tx_led_deactivate(struct led_classdev *led_cdev)
67{
68 struct ieee80211_local *local = container_of(led_cdev->trigger,
69 struct ieee80211_local,
70 tx_led);
71
72 atomic_dec(&local->tx_led_active);
73}
74
73static void ieee80211_rx_led_activate(struct led_classdev *led_cdev)
75static int ieee80211_rx_led_activate(struct led_classdev *led_cdev)
74{
75 struct ieee80211_local *local = container_of(led_cdev->trigger,
76 struct ieee80211_local,
77 rx_led);
78
79 atomic_inc(&local->rx_led_active);
76{
77 struct ieee80211_local *local = container_of(led_cdev->trigger,
78 struct ieee80211_local,
79 rx_led);
80
81 atomic_inc(&local->rx_led_active);
82
83 return 0;
80}
81
82static void ieee80211_rx_led_deactivate(struct led_classdev *led_cdev)
83{
84 struct ieee80211_local *local = container_of(led_cdev->trigger,
85 struct ieee80211_local,
86 rx_led);
87
88 atomic_dec(&local->rx_led_active);
89}
90
84}
85
86static void ieee80211_rx_led_deactivate(struct led_classdev *led_cdev)
87{
88 struct ieee80211_local *local = container_of(led_cdev->trigger,
89 struct ieee80211_local,
90 rx_led);
91
92 atomic_dec(&local->rx_led_active);
93}
94
91static void ieee80211_assoc_led_activate(struct led_classdev *led_cdev)
95static int ieee80211_assoc_led_activate(struct led_classdev *led_cdev)
92{
93 struct ieee80211_local *local = container_of(led_cdev->trigger,
94 struct ieee80211_local,
95 assoc_led);
96
97 atomic_inc(&local->assoc_led_active);
96{
97 struct ieee80211_local *local = container_of(led_cdev->trigger,
98 struct ieee80211_local,
99 assoc_led);
100
101 atomic_inc(&local->assoc_led_active);
102
103 return 0;
98}
99
100static void ieee80211_assoc_led_deactivate(struct led_classdev *led_cdev)
101{
102 struct ieee80211_local *local = container_of(led_cdev->trigger,
103 struct ieee80211_local,
104 assoc_led);
105
106 atomic_dec(&local->assoc_led_active);
107}
108
104}
105
106static void ieee80211_assoc_led_deactivate(struct led_classdev *led_cdev)
107{
108 struct ieee80211_local *local = container_of(led_cdev->trigger,
109 struct ieee80211_local,
110 assoc_led);
111
112 atomic_dec(&local->assoc_led_active);
113}
114
109static void ieee80211_radio_led_activate(struct led_classdev *led_cdev)
115static int ieee80211_radio_led_activate(struct led_classdev *led_cdev)
110{
111 struct ieee80211_local *local = container_of(led_cdev->trigger,
112 struct ieee80211_local,
113 radio_led);
114
115 atomic_inc(&local->radio_led_active);
116{
117 struct ieee80211_local *local = container_of(led_cdev->trigger,
118 struct ieee80211_local,
119 radio_led);
120
121 atomic_inc(&local->radio_led_active);
122
123 return 0;
116}
117
118static void ieee80211_radio_led_deactivate(struct led_classdev *led_cdev)
119{
120 struct ieee80211_local *local = container_of(led_cdev->trigger,
121 struct ieee80211_local,
122 radio_led);
123
124 atomic_dec(&local->radio_led_active);
125}
126
124}
125
126static void ieee80211_radio_led_deactivate(struct led_classdev *led_cdev)
127{
128 struct ieee80211_local *local = container_of(led_cdev->trigger,
129 struct ieee80211_local,
130 radio_led);
131
132 atomic_dec(&local->radio_led_active);
133}
134
127static void ieee80211_tpt_led_activate(struct led_classdev *led_cdev)
135static int ieee80211_tpt_led_activate(struct led_classdev *led_cdev)
128{
129 struct ieee80211_local *local = container_of(led_cdev->trigger,
130 struct ieee80211_local,
131 tpt_led);
132
133 atomic_inc(&local->tpt_led_active);
136{
137 struct ieee80211_local *local = container_of(led_cdev->trigger,
138 struct ieee80211_local,
139 tpt_led);
140
141 atomic_inc(&local->tpt_led_active);
142
143 return 0;
134}
135
136static void ieee80211_tpt_led_deactivate(struct led_classdev *led_cdev)
137{
138 struct ieee80211_local *local = container_of(led_cdev->trigger,
139 struct ieee80211_local,
140 tpt_led);
141

--- 236 unchanged lines hidden ---
144}
145
146static void ieee80211_tpt_led_deactivate(struct led_classdev *led_cdev)
147{
148 struct ieee80211_local *local = container_of(led_cdev->trigger,
149 struct ieee80211_local,
150 tpt_led);
151

--- 236 unchanged lines hidden ---