diff options
Diffstat (limited to 'net/mac80211/driver-ops.h')
-rw-r--r-- | net/mac80211/driver-ops.h | 85 |
1 files changed, 63 insertions, 22 deletions
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index b13446afd48f..4100c361a99d 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <net/mac80211.h> | 4 | #include <net/mac80211.h> |
5 | #include "ieee80211_i.h" | 5 | #include "ieee80211_i.h" |
6 | #include "driver-trace.h" | ||
6 | 7 | ||
7 | static inline int drv_tx(struct ieee80211_local *local, struct sk_buff *skb) | 8 | static inline int drv_tx(struct ieee80211_local *local, struct sk_buff *skb) |
8 | { | 9 | { |
@@ -11,29 +12,37 @@ static inline int drv_tx(struct ieee80211_local *local, struct sk_buff *skb) | |||
11 | 12 | ||
12 | static inline int drv_start(struct ieee80211_local *local) | 13 | static inline int drv_start(struct ieee80211_local *local) |
13 | { | 14 | { |
14 | return local->ops->start(&local->hw); | 15 | int ret = local->ops->start(&local->hw); |
16 | trace_drv_start(local, ret); | ||
17 | return ret; | ||
15 | } | 18 | } |
16 | 19 | ||
17 | static inline void drv_stop(struct ieee80211_local *local) | 20 | static inline void drv_stop(struct ieee80211_local *local) |
18 | { | 21 | { |
19 | local->ops->stop(&local->hw); | 22 | local->ops->stop(&local->hw); |
23 | trace_drv_stop(local); | ||
20 | } | 24 | } |
21 | 25 | ||
22 | static inline int drv_add_interface(struct ieee80211_local *local, | 26 | static inline int drv_add_interface(struct ieee80211_local *local, |
23 | struct ieee80211_if_init_conf *conf) | 27 | struct ieee80211_if_init_conf *conf) |
24 | { | 28 | { |
25 | return local->ops->add_interface(&local->hw, conf); | 29 | int ret = local->ops->add_interface(&local->hw, conf); |
30 | trace_drv_add_interface(local, conf->mac_addr, conf->vif, ret); | ||
31 | return ret; | ||
26 | } | 32 | } |
27 | 33 | ||
28 | static inline void drv_remove_interface(struct ieee80211_local *local, | 34 | static inline void drv_remove_interface(struct ieee80211_local *local, |
29 | struct ieee80211_if_init_conf *conf) | 35 | struct ieee80211_if_init_conf *conf) |
30 | { | 36 | { |
31 | local->ops->remove_interface(&local->hw, conf); | 37 | local->ops->remove_interface(&local->hw, conf); |
38 | trace_drv_remove_interface(local, conf->mac_addr, conf->vif); | ||
32 | } | 39 | } |
33 | 40 | ||
34 | static inline int drv_config(struct ieee80211_local *local, u32 changed) | 41 | static inline int drv_config(struct ieee80211_local *local, u32 changed) |
35 | { | 42 | { |
36 | return local->ops->config(&local->hw, changed); | 43 | int ret = local->ops->config(&local->hw, changed); |
44 | trace_drv_config(local, changed, ret); | ||
45 | return ret; | ||
37 | } | 46 | } |
38 | 47 | ||
39 | static inline void drv_bss_info_changed(struct ieee80211_local *local, | 48 | static inline void drv_bss_info_changed(struct ieee80211_local *local, |
@@ -43,6 +52,7 @@ static inline void drv_bss_info_changed(struct ieee80211_local *local, | |||
43 | { | 52 | { |
44 | if (local->ops->bss_info_changed) | 53 | if (local->ops->bss_info_changed) |
45 | local->ops->bss_info_changed(&local->hw, vif, info, changed); | 54 | local->ops->bss_info_changed(&local->hw, vif, info, changed); |
55 | trace_drv_bss_info_changed(local, vif, info, changed); | ||
46 | } | 56 | } |
47 | 57 | ||
48 | static inline void drv_configure_filter(struct ieee80211_local *local, | 58 | static inline void drv_configure_filter(struct ieee80211_local *local, |
@@ -53,14 +63,18 @@ static inline void drv_configure_filter(struct ieee80211_local *local, | |||
53 | { | 63 | { |
54 | local->ops->configure_filter(&local->hw, changed_flags, total_flags, | 64 | local->ops->configure_filter(&local->hw, changed_flags, total_flags, |
55 | mc_count, mc_list); | 65 | mc_count, mc_list); |
66 | trace_drv_configure_filter(local, changed_flags, total_flags, | ||
67 | mc_count); | ||
56 | } | 68 | } |
57 | 69 | ||
58 | static inline int drv_set_tim(struct ieee80211_local *local, | 70 | static inline int drv_set_tim(struct ieee80211_local *local, |
59 | struct ieee80211_sta *sta, bool set) | 71 | struct ieee80211_sta *sta, bool set) |
60 | { | 72 | { |
73 | int ret = 0; | ||
61 | if (local->ops->set_tim) | 74 | if (local->ops->set_tim) |
62 | return local->ops->set_tim(&local->hw, sta, set); | 75 | ret = local->ops->set_tim(&local->hw, sta, set); |
63 | return 0; | 76 | trace_drv_set_tim(local, sta, set, ret); |
77 | return ret; | ||
64 | } | 78 | } |
65 | 79 | ||
66 | static inline int drv_set_key(struct ieee80211_local *local, | 80 | static inline int drv_set_key(struct ieee80211_local *local, |
@@ -68,7 +82,9 @@ static inline int drv_set_key(struct ieee80211_local *local, | |||
68 | struct ieee80211_sta *sta, | 82 | struct ieee80211_sta *sta, |
69 | struct ieee80211_key_conf *key) | 83 | struct ieee80211_key_conf *key) |
70 | { | 84 | { |
71 | return local->ops->set_key(&local->hw, cmd, vif, sta, key); | 85 | int ret = local->ops->set_key(&local->hw, cmd, vif, sta, key); |
86 | trace_drv_set_key(local, cmd, vif, sta, key, ret); | ||
87 | return ret; | ||
72 | } | 88 | } |
73 | 89 | ||
74 | static inline void drv_update_tkip_key(struct ieee80211_local *local, | 90 | static inline void drv_update_tkip_key(struct ieee80211_local *local, |
@@ -79,32 +95,41 @@ static inline void drv_update_tkip_key(struct ieee80211_local *local, | |||
79 | if (local->ops->update_tkip_key) | 95 | if (local->ops->update_tkip_key) |
80 | local->ops->update_tkip_key(&local->hw, conf, address, | 96 | local->ops->update_tkip_key(&local->hw, conf, address, |
81 | iv32, phase1key); | 97 | iv32, phase1key); |
98 | trace_drv_update_tkip_key(local, conf, address, iv32); | ||
82 | } | 99 | } |
83 | 100 | ||
84 | static inline int drv_hw_scan(struct ieee80211_local *local, | 101 | static inline int drv_hw_scan(struct ieee80211_local *local, |
85 | struct cfg80211_scan_request *req) | 102 | struct cfg80211_scan_request *req) |
86 | { | 103 | { |
87 | return local->ops->hw_scan(&local->hw, req); | 104 | int ret = local->ops->hw_scan(&local->hw, req); |
105 | trace_drv_hw_scan(local, req, ret); | ||
106 | return ret; | ||
88 | } | 107 | } |
89 | 108 | ||
90 | static inline void drv_sw_scan_start(struct ieee80211_local *local) | 109 | static inline void drv_sw_scan_start(struct ieee80211_local *local) |
91 | { | 110 | { |
92 | if (local->ops->sw_scan_start) | 111 | if (local->ops->sw_scan_start) |
93 | local->ops->sw_scan_start(&local->hw); | 112 | local->ops->sw_scan_start(&local->hw); |
113 | trace_drv_sw_scan_start(local); | ||
94 | } | 114 | } |
95 | 115 | ||
96 | static inline void drv_sw_scan_complete(struct ieee80211_local *local) | 116 | static inline void drv_sw_scan_complete(struct ieee80211_local *local) |
97 | { | 117 | { |
98 | if (local->ops->sw_scan_complete) | 118 | if (local->ops->sw_scan_complete) |
99 | local->ops->sw_scan_complete(&local->hw); | 119 | local->ops->sw_scan_complete(&local->hw); |
120 | trace_drv_sw_scan_complete(local); | ||
100 | } | 121 | } |
101 | 122 | ||
102 | static inline int drv_get_stats(struct ieee80211_local *local, | 123 | static inline int drv_get_stats(struct ieee80211_local *local, |
103 | struct ieee80211_low_level_stats *stats) | 124 | struct ieee80211_low_level_stats *stats) |
104 | { | 125 | { |
105 | if (!local->ops->get_stats) | 126 | int ret = -EOPNOTSUPP; |
106 | return -EOPNOTSUPP; | 127 | |
107 | return local->ops->get_stats(&local->hw, stats); | 128 | if (local->ops->get_stats) |
129 | ret = local->ops->get_stats(&local->hw, stats); | ||
130 | trace_drv_get_stats(local, stats, ret); | ||
131 | |||
132 | return ret; | ||
108 | } | 133 | } |
109 | 134 | ||
110 | static inline void drv_get_tkip_seq(struct ieee80211_local *local, | 135 | static inline void drv_get_tkip_seq(struct ieee80211_local *local, |
@@ -112,14 +137,17 @@ static inline void drv_get_tkip_seq(struct ieee80211_local *local, | |||
112 | { | 137 | { |
113 | if (local->ops->get_tkip_seq) | 138 | if (local->ops->get_tkip_seq) |
114 | local->ops->get_tkip_seq(&local->hw, hw_key_idx, iv32, iv16); | 139 | local->ops->get_tkip_seq(&local->hw, hw_key_idx, iv32, iv16); |
140 | trace_drv_get_tkip_seq(local, hw_key_idx, iv32, iv16); | ||
115 | } | 141 | } |
116 | 142 | ||
117 | static inline int drv_set_rts_threshold(struct ieee80211_local *local, | 143 | static inline int drv_set_rts_threshold(struct ieee80211_local *local, |
118 | u32 value) | 144 | u32 value) |
119 | { | 145 | { |
146 | int ret = 0; | ||
120 | if (local->ops->set_rts_threshold) | 147 | if (local->ops->set_rts_threshold) |
121 | return local->ops->set_rts_threshold(&local->hw, value); | 148 | ret = local->ops->set_rts_threshold(&local->hw, value); |
122 | return 0; | 149 | trace_drv_set_rts_threshold(local, value, ret); |
150 | return ret; | ||
123 | } | 151 | } |
124 | 152 | ||
125 | static inline void drv_sta_notify(struct ieee80211_local *local, | 153 | static inline void drv_sta_notify(struct ieee80211_local *local, |
@@ -129,46 +157,57 @@ static inline void drv_sta_notify(struct ieee80211_local *local, | |||
129 | { | 157 | { |
130 | if (local->ops->sta_notify) | 158 | if (local->ops->sta_notify) |
131 | local->ops->sta_notify(&local->hw, vif, cmd, sta); | 159 | local->ops->sta_notify(&local->hw, vif, cmd, sta); |
160 | trace_drv_sta_notify(local, vif, cmd, sta); | ||
132 | } | 161 | } |
133 | 162 | ||
134 | static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue, | 163 | static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue, |
135 | const struct ieee80211_tx_queue_params *params) | 164 | const struct ieee80211_tx_queue_params *params) |
136 | { | 165 | { |
166 | int ret = -EOPNOTSUPP; | ||
137 | if (local->ops->conf_tx) | 167 | if (local->ops->conf_tx) |
138 | return local->ops->conf_tx(&local->hw, queue, params); | 168 | ret = local->ops->conf_tx(&local->hw, queue, params); |
139 | return -EOPNOTSUPP; | 169 | trace_drv_conf_tx(local, queue, params, ret); |
170 | return ret; | ||
140 | } | 171 | } |
141 | 172 | ||
142 | static inline int drv_get_tx_stats(struct ieee80211_local *local, | 173 | static inline int drv_get_tx_stats(struct ieee80211_local *local, |
143 | struct ieee80211_tx_queue_stats *stats) | 174 | struct ieee80211_tx_queue_stats *stats) |
144 | { | 175 | { |
145 | return local->ops->get_tx_stats(&local->hw, stats); | 176 | int ret = local->ops->get_tx_stats(&local->hw, stats); |
177 | trace_drv_get_tx_stats(local, stats, ret); | ||
178 | return ret; | ||
146 | } | 179 | } |
147 | 180 | ||
148 | static inline u64 drv_get_tsf(struct ieee80211_local *local) | 181 | static inline u64 drv_get_tsf(struct ieee80211_local *local) |
149 | { | 182 | { |
183 | u64 ret = -1ULL; | ||
150 | if (local->ops->get_tsf) | 184 | if (local->ops->get_tsf) |
151 | return local->ops->get_tsf(&local->hw); | 185 | ret = local->ops->get_tsf(&local->hw); |
152 | return -1ULL; | 186 | trace_drv_get_tsf(local, ret); |
187 | return ret; | ||
153 | } | 188 | } |
154 | 189 | ||
155 | static inline void drv_set_tsf(struct ieee80211_local *local, u64 tsf) | 190 | static inline void drv_set_tsf(struct ieee80211_local *local, u64 tsf) |
156 | { | 191 | { |
157 | if (local->ops->set_tsf) | 192 | if (local->ops->set_tsf) |
158 | local->ops->set_tsf(&local->hw, tsf); | 193 | local->ops->set_tsf(&local->hw, tsf); |
194 | trace_drv_set_tsf(local, tsf); | ||
159 | } | 195 | } |
160 | 196 | ||
161 | static inline void drv_reset_tsf(struct ieee80211_local *local) | 197 | static inline void drv_reset_tsf(struct ieee80211_local *local) |
162 | { | 198 | { |
163 | if (local->ops->reset_tsf) | 199 | if (local->ops->reset_tsf) |
164 | local->ops->reset_tsf(&local->hw); | 200 | local->ops->reset_tsf(&local->hw); |
201 | trace_drv_reset_tsf(local); | ||
165 | } | 202 | } |
166 | 203 | ||
167 | static inline int drv_tx_last_beacon(struct ieee80211_local *local) | 204 | static inline int drv_tx_last_beacon(struct ieee80211_local *local) |
168 | { | 205 | { |
206 | int ret = 1; | ||
169 | if (local->ops->tx_last_beacon) | 207 | if (local->ops->tx_last_beacon) |
170 | return local->ops->tx_last_beacon(&local->hw); | 208 | ret = local->ops->tx_last_beacon(&local->hw); |
171 | return 1; | 209 | trace_drv_tx_last_beacon(local, ret); |
210 | return ret; | ||
172 | } | 211 | } |
173 | 212 | ||
174 | static inline int drv_ampdu_action(struct ieee80211_local *local, | 213 | static inline int drv_ampdu_action(struct ieee80211_local *local, |
@@ -176,10 +215,12 @@ static inline int drv_ampdu_action(struct ieee80211_local *local, | |||
176 | struct ieee80211_sta *sta, u16 tid, | 215 | struct ieee80211_sta *sta, u16 tid, |
177 | u16 *ssn) | 216 | u16 *ssn) |
178 | { | 217 | { |
218 | int ret = -EOPNOTSUPP; | ||
179 | if (local->ops->ampdu_action) | 219 | if (local->ops->ampdu_action) |
180 | return local->ops->ampdu_action(&local->hw, action, | 220 | ret = local->ops->ampdu_action(&local->hw, action, |
181 | sta, tid, ssn); | 221 | sta, tid, ssn); |
182 | return -EOPNOTSUPP; | 222 | trace_drv_ampdu_action(local, action, sta, tid, ssn, ret); |
223 | return ret; | ||
183 | } | 224 | } |
184 | 225 | ||
185 | 226 | ||