mac80211/ath9k: some more performance improvements
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 562-mac80211_remove_code_duplication.patch
1 --- a/net/mac80211/debugfs_netdev.c
2 +++ b/net/mac80211/debugfs_netdev.c
3 @@ -445,26 +445,23 @@ IEEE80211_IF_FILE(dot11MeshHWMPRannInter
4 IEEE80211_IF_FILE(dot11MeshForwarding, u.mesh.mshcfg.dot11MeshForwarding, DEC);
5 #endif
6
7 -
8 -#define DEBUGFS_ADD(name) \
9 - debugfs_create_file(#name, 0400, sdata->debugfs.dir, \
10 - sdata, &name##_ops);
11 -
12 #define DEBUGFS_ADD_MODE(name, mode) \
13 debugfs_create_file(#name, mode, sdata->debugfs.dir, \
14 sdata, &name##_ops);
15
16 -static void add_sta_files(struct ieee80211_sub_if_data *sdata)
17 +#define DEBUGFS_ADD(name) DEBUGFS_ADD_MODE(name, 0400)
18 +
19 +static void add_common_files(struct ieee80211_sub_if_data *sdata)
20 {
21 DEBUGFS_ADD(drop_unencrypted);
22 - DEBUGFS_ADD(flags);
23 - DEBUGFS_ADD(state);
24 - DEBUGFS_ADD(channel_type);
25 DEBUGFS_ADD(rc_rateidx_mask_2ghz);
26 DEBUGFS_ADD(rc_rateidx_mask_5ghz);
27 DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz);
28 DEBUGFS_ADD(rc_rateidx_mcs_mask_5ghz);
29 +}
30
31 +static void add_sta_files(struct ieee80211_sub_if_data *sdata)
32 +{
33 DEBUGFS_ADD(bssid);
34 DEBUGFS_ADD(aid);
35 DEBUGFS_ADD(last_beacon);
36 @@ -475,15 +472,6 @@ static void add_sta_files(struct ieee802
37
38 static void add_ap_files(struct ieee80211_sub_if_data *sdata)
39 {
40 - DEBUGFS_ADD(drop_unencrypted);
41 - DEBUGFS_ADD(flags);
42 - DEBUGFS_ADD(state);
43 - DEBUGFS_ADD(channel_type);
44 - DEBUGFS_ADD(rc_rateidx_mask_2ghz);
45 - DEBUGFS_ADD(rc_rateidx_mask_5ghz);
46 - DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz);
47 - DEBUGFS_ADD(rc_rateidx_mcs_mask_5ghz);
48 -
49 DEBUGFS_ADD(num_sta_authorized);
50 DEBUGFS_ADD(num_sta_ps);
51 DEBUGFS_ADD(dtim_count);
52 @@ -493,48 +481,14 @@ static void add_ap_files(struct ieee8021
53
54 static void add_ibss_files(struct ieee80211_sub_if_data *sdata)
55 {
56 - DEBUGFS_ADD(channel_type);
57 - DEBUGFS_ADD(rc_rateidx_mask_2ghz);
58 - DEBUGFS_ADD(rc_rateidx_mask_5ghz);
59 - DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz);
60 - DEBUGFS_ADD(rc_rateidx_mcs_mask_5ghz);
61 -
62 DEBUGFS_ADD_MODE(tsf, 0600);
63 }
64
65 static void add_wds_files(struct ieee80211_sub_if_data *sdata)
66 {
67 - DEBUGFS_ADD(drop_unencrypted);
68 - DEBUGFS_ADD(flags);
69 - DEBUGFS_ADD(state);
70 - DEBUGFS_ADD(channel_type);
71 - DEBUGFS_ADD(rc_rateidx_mask_2ghz);
72 - DEBUGFS_ADD(rc_rateidx_mask_5ghz);
73 - DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz);
74 - DEBUGFS_ADD(rc_rateidx_mcs_mask_5ghz);
75 -
76 DEBUGFS_ADD(peer);
77 }
78
79 -static void add_vlan_files(struct ieee80211_sub_if_data *sdata)
80 -{
81 - DEBUGFS_ADD(drop_unencrypted);
82 - DEBUGFS_ADD(flags);
83 - DEBUGFS_ADD(state);
84 - DEBUGFS_ADD(channel_type);
85 - DEBUGFS_ADD(rc_rateidx_mask_2ghz);
86 - DEBUGFS_ADD(rc_rateidx_mask_5ghz);
87 - DEBUGFS_ADD(rc_rateidx_mcs_mask_2ghz);
88 - DEBUGFS_ADD(rc_rateidx_mcs_mask_5ghz);
89 -}
90 -
91 -static void add_monitor_files(struct ieee80211_sub_if_data *sdata)
92 -{
93 - DEBUGFS_ADD(flags);
94 - DEBUGFS_ADD(state);
95 - DEBUGFS_ADD(channel_type);
96 -}
97 -
98 #ifdef CONFIG_MAC80211_MESH
99
100 static void add_mesh_stats(struct ieee80211_sub_if_data *sdata)
101 @@ -590,6 +544,13 @@ static void add_files(struct ieee80211_s
102 if (!sdata->debugfs.dir)
103 return;
104
105 + DEBUGFS_ADD(flags);
106 + DEBUGFS_ADD(state);
107 + DEBUGFS_ADD(channel_type);
108 +
109 + if (sdata->vif.type != NL80211_IFTYPE_MONITOR)
110 + add_common_files(sdata);
111 +
112 switch (sdata->vif.type) {
113 case NL80211_IFTYPE_MESH_POINT:
114 #ifdef CONFIG_MAC80211_MESH
115 @@ -609,12 +570,6 @@ static void add_files(struct ieee80211_s
116 case NL80211_IFTYPE_WDS:
117 add_wds_files(sdata);
118 break;
119 - case NL80211_IFTYPE_MONITOR:
120 - add_monitor_files(sdata);
121 - break;
122 - case NL80211_IFTYPE_AP_VLAN:
123 - add_vlan_files(sdata);
124 - break;
125 default:
126 break;
127 }