Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cfg80211/mac80211: use debugfs_remove_recursive

We can save a lot of code and pointers in the structs
by using debugfs_remove_recursive().

First, change cfg80211 to use debugfs_remove_recursive()
so that drivers do not need to clean up any files they
added to the per-wiphy debugfs (if and only if they are
ok to be accessed until after wiphy_unregister!).

Then also make mac80211 use debugfs_remove_recursive()
where necessary -- it need not remove per-wiphy files
as cfg80211 now removes those, but netdev etc. files
still need to be handled but can now be removed without
needing struct dentry pointers to all of them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Johannes Berg and committed by
John W. Linville
7bcfaf2f 2c0d6100

+51 -462
+4 -69
net/mac80211/debugfs.c
··· 1 + 1 2 /* 2 3 * mac80211 debugfs for wireless PHYs 3 4 * ··· 39 38 }; 40 39 41 40 #define DEBUGFS_ADD(name) \ 42 - local->debugfs.name = debugfs_create_file(#name, 0400, phyd, \ 43 - local, &name## _ops); 41 + debugfs_create_file(#name, 0400, phyd, local, &name## _ops); 44 42 45 43 #define DEBUGFS_ADD_MODE(name, mode) \ 46 - local->debugfs.name = debugfs_create_file(#name, mode, phyd, \ 47 - local, &name## _ops); 48 - 49 - #define DEBUGFS_DEL(name) \ 50 - debugfs_remove(local->debugfs.name); \ 51 - local->debugfs.name = NULL; 44 + debugfs_create_file(#name, mode, phyd, local, &name## _ops); 52 45 53 46 54 47 DEBUGFS_READONLY_FILE(frequency, 20, "%d", ··· 228 233 }; 229 234 230 235 #define DEBUGFS_STATS_ADD(name) \ 231 - local->debugfs.stats.name = debugfs_create_file(#name, 0400, statsd,\ 232 - local, &stats_ ##name## _ops); 233 - 234 - #define DEBUGFS_STATS_DEL(name) \ 235 - debugfs_remove(local->debugfs.stats.name); \ 236 - local->debugfs.stats.name = NULL; 236 + debugfs_create_file(#name, 0400, statsd, local, &stats_ ##name## _ops); 237 237 238 238 DEBUGFS_STATS_FILE(transmitted_fragment_count, 20, "%u", 239 239 local->dot11TransmittedFragmentCount); ··· 316 326 DEBUGFS_ADD(noack); 317 327 318 328 statsd = debugfs_create_dir("statistics", phyd); 319 - local->debugfs.statistics = statsd; 320 329 321 330 /* if the dir failed, don't put all the other things into the root! */ 322 331 if (!statsd) ··· 355 366 DEBUGFS_STATS_ADD(dot11RTSFailureCount); 356 367 DEBUGFS_STATS_ADD(dot11FCSErrorCount); 357 368 DEBUGFS_STATS_ADD(dot11RTSSuccessCount); 358 - } 359 - 360 - void debugfs_hw_del(struct ieee80211_local *local) 361 - { 362 - DEBUGFS_DEL(frequency); 363 - DEBUGFS_DEL(total_ps_buffered); 364 - DEBUGFS_DEL(wep_iv); 365 - DEBUGFS_DEL(tsf); 366 - DEBUGFS_DEL(queues); 367 - DEBUGFS_DEL(reset); 368 - DEBUGFS_DEL(noack); 369 - 370 - DEBUGFS_STATS_DEL(transmitted_fragment_count); 371 - DEBUGFS_STATS_DEL(multicast_transmitted_frame_count); 372 - DEBUGFS_STATS_DEL(failed_count); 373 - DEBUGFS_STATS_DEL(retry_count); 374 - DEBUGFS_STATS_DEL(multiple_retry_count); 375 - DEBUGFS_STATS_DEL(frame_duplicate_count); 376 - DEBUGFS_STATS_DEL(received_fragment_count); 377 - DEBUGFS_STATS_DEL(multicast_received_frame_count); 378 - DEBUGFS_STATS_DEL(transmitted_frame_count); 379 - DEBUGFS_STATS_DEL(num_scans); 380 - #ifdef CONFIG_MAC80211_DEBUG_COUNTERS 381 - DEBUGFS_STATS_DEL(tx_handlers_drop); 382 - DEBUGFS_STATS_DEL(tx_handlers_queued); 383 - DEBUGFS_STATS_DEL(tx_handlers_drop_unencrypted); 384 - DEBUGFS_STATS_DEL(tx_handlers_drop_fragment); 385 - DEBUGFS_STATS_DEL(tx_handlers_drop_wep); 386 - DEBUGFS_STATS_DEL(tx_handlers_drop_not_assoc); 387 - DEBUGFS_STATS_DEL(tx_handlers_drop_unauth_port); 388 - DEBUGFS_STATS_DEL(rx_handlers_drop); 389 - DEBUGFS_STATS_DEL(rx_handlers_queued); 390 - DEBUGFS_STATS_DEL(rx_handlers_drop_nullfunc); 391 - DEBUGFS_STATS_DEL(rx_handlers_drop_defrag); 392 - DEBUGFS_STATS_DEL(rx_handlers_drop_short); 393 - DEBUGFS_STATS_DEL(rx_handlers_drop_passive_scan); 394 - DEBUGFS_STATS_DEL(tx_expand_skb_head); 395 - DEBUGFS_STATS_DEL(tx_expand_skb_head_cloned); 396 - DEBUGFS_STATS_DEL(rx_expand_skb_head); 397 - DEBUGFS_STATS_DEL(rx_expand_skb_head2); 398 - DEBUGFS_STATS_DEL(rx_handlers_fragments); 399 - DEBUGFS_STATS_DEL(tx_status_drop); 400 - #endif 401 - DEBUGFS_STATS_DEL(dot11ACKFailureCount); 402 - DEBUGFS_STATS_DEL(dot11RTSFailureCount); 403 - DEBUGFS_STATS_DEL(dot11FCSErrorCount); 404 - DEBUGFS_STATS_DEL(dot11RTSSuccessCount); 405 - 406 - debugfs_remove(local->debugfs.statistics); 407 - local->debugfs.statistics = NULL; 408 - debugfs_remove(local->debugfs.stations); 409 - local->debugfs.stations = NULL; 410 - debugfs_remove(local->debugfs.keys); 411 - local->debugfs.keys = NULL; 412 369 }
-2
net/mac80211/debugfs.h
··· 3 3 4 4 #ifdef CONFIG_MAC80211_DEBUGFS 5 5 extern void debugfs_hw_add(struct ieee80211_local *local); 6 - extern void debugfs_hw_del(struct ieee80211_local *local); 7 6 extern int mac80211_open_file_generic(struct inode *inode, struct file *file); 8 7 #else 9 8 static inline void debugfs_hw_add(struct ieee80211_local *local) 10 9 { 11 10 return; 12 11 } 13 - static inline void debugfs_hw_del(struct ieee80211_local *local) {} 14 12 #endif 15 13 16 14 #endif /* __MAC80211_DEBUGFS_H */
+13 -31
net/mac80211/debugfs_key.c
··· 225 225 KEY_OPS(key); 226 226 227 227 #define DEBUGFS_ADD(name) \ 228 - key->debugfs.name = debugfs_create_file(#name, 0400,\ 229 - key->debugfs.dir, key, &key_##name##_ops); 228 + debugfs_create_file(#name, 0400, key->debugfs.dir, \ 229 + key, &key_##name##_ops); 230 230 231 231 void ieee80211_debugfs_key_add(struct ieee80211_key *key) 232 232 { ··· 271 271 DEBUGFS_ADD(ifindex); 272 272 }; 273 273 274 - #define DEBUGFS_DEL(name) \ 275 - debugfs_remove(key->debugfs.name); key->debugfs.name = NULL; 276 - 277 274 void ieee80211_debugfs_key_remove(struct ieee80211_key *key) 278 275 { 279 276 if (!key) 280 277 return; 281 278 282 - DEBUGFS_DEL(keylen); 283 - DEBUGFS_DEL(flags); 284 - DEBUGFS_DEL(keyidx); 285 - DEBUGFS_DEL(hw_key_idx); 286 - DEBUGFS_DEL(tx_rx_count); 287 - DEBUGFS_DEL(algorithm); 288 - DEBUGFS_DEL(tx_spec); 289 - DEBUGFS_DEL(rx_spec); 290 - DEBUGFS_DEL(replays); 291 - DEBUGFS_DEL(icverrors); 292 - DEBUGFS_DEL(key); 293 - DEBUGFS_DEL(ifindex); 294 - 295 - debugfs_remove(key->debugfs.stalink); 296 - key->debugfs.stalink = NULL; 297 - debugfs_remove(key->debugfs.dir); 279 + debugfs_remove_recursive(key->debugfs.dir); 298 280 key->debugfs.dir = NULL; 299 281 } 300 282 void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata) ··· 284 302 char buf[50]; 285 303 struct ieee80211_key *key; 286 304 287 - if (!sdata->debugfsdir) 305 + if (!sdata->debugfs.dir) 288 306 return; 289 307 290 308 /* this is running under the key lock */ ··· 292 310 key = sdata->default_key; 293 311 if (key) { 294 312 sprintf(buf, "../keys/%d", key->debugfs.cnt); 295 - sdata->common_debugfs.default_key = 313 + sdata->debugfs.default_key = 296 314 debugfs_create_symlink("default_key", 297 - sdata->debugfsdir, buf); 315 + sdata->debugfs.dir, buf); 298 316 } else 299 317 ieee80211_debugfs_key_remove_default(sdata); 300 318 } ··· 304 322 if (!sdata) 305 323 return; 306 324 307 - debugfs_remove(sdata->common_debugfs.default_key); 308 - sdata->common_debugfs.default_key = NULL; 325 + debugfs_remove(sdata->debugfs.default_key); 326 + sdata->debugfs.default_key = NULL; 309 327 } 310 328 311 329 void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata) ··· 313 331 char buf[50]; 314 332 struct ieee80211_key *key; 315 333 316 - if (!sdata->debugfsdir) 334 + if (!sdata->debugfs.dir) 317 335 return; 318 336 319 337 /* this is running under the key lock */ ··· 321 339 key = sdata->default_mgmt_key; 322 340 if (key) { 323 341 sprintf(buf, "../keys/%d", key->debugfs.cnt); 324 - sdata->common_debugfs.default_mgmt_key = 342 + sdata->debugfs.default_mgmt_key = 325 343 debugfs_create_symlink("default_mgmt_key", 326 - sdata->debugfsdir, buf); 344 + sdata->debugfs.dir, buf); 327 345 } else 328 346 ieee80211_debugfs_key_remove_mgmt_default(sdata); 329 347 } ··· 333 351 if (!sdata) 334 352 return; 335 353 336 - debugfs_remove(sdata->common_debugfs.default_mgmt_key); 337 - sdata->common_debugfs.default_mgmt_key = NULL; 354 + debugfs_remove(sdata->debugfs.default_mgmt_key); 355 + sdata->debugfs.default_mgmt_key = NULL; 338 356 } 339 357 340 358 void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key,
+26 -148
net/mac80211/debugfs_netdev.c
··· 152 152 #endif 153 153 154 154 155 - #define DEBUGFS_ADD(name, type)\ 156 - sdata->debugfs.type.name = debugfs_create_file(#name, 0400,\ 157 - sdata->debugfsdir, sdata, &name##_ops); 155 + #define DEBUGFS_ADD(name, type) \ 156 + debugfs_create_file(#name, 0400, sdata->debugfs.dir, \ 157 + sdata, &name##_ops); 158 158 159 159 static void add_sta_files(struct ieee80211_sub_if_data *sdata) 160 160 { ··· 199 199 } 200 200 201 201 #ifdef CONFIG_MAC80211_MESH 202 - #define MESHSTATS_ADD(name)\ 203 - sdata->mesh_stats.name = debugfs_create_file(#name, 0400,\ 204 - sdata->mesh_stats_dir, sdata, &name##_ops); 205 202 206 203 static void add_mesh_stats(struct ieee80211_sub_if_data *sdata) 207 204 { 208 - sdata->mesh_stats_dir = debugfs_create_dir("mesh_stats", 209 - sdata->debugfsdir); 205 + struct dentry *dir = debugfs_create_dir("mesh_stats", 206 + sdata->debugfs.dir); 207 + 208 + #define MESHSTATS_ADD(name)\ 209 + debugfs_create_file(#name, 0400, dir, sdata, &name##_ops); 210 + 210 211 MESHSTATS_ADD(fwded_mcast); 211 212 MESHSTATS_ADD(fwded_unicast); 212 213 MESHSTATS_ADD(fwded_frames); 213 214 MESHSTATS_ADD(dropped_frames_ttl); 214 215 MESHSTATS_ADD(dropped_frames_no_route); 215 216 MESHSTATS_ADD(estab_plinks); 217 + #undef MESHSTATS_ADD 216 218 } 217 - 218 - #define MESHPARAMS_ADD(name)\ 219 - sdata->mesh_config.name = debugfs_create_file(#name, 0600,\ 220 - sdata->mesh_config_dir, sdata, &name##_ops); 221 219 222 220 static void add_mesh_config(struct ieee80211_sub_if_data *sdata) 223 221 { 224 - sdata->mesh_config_dir = debugfs_create_dir("mesh_config", 225 - sdata->debugfsdir); 222 + struct dentry *dir = debugfs_create_dir("mesh_config", 223 + sdata->debugfs.dir); 224 + 225 + #define MESHPARAMS_ADD(name) \ 226 + debugfs_create_file(#name, 0600, dir, sdata, &name##_ops); 227 + 226 228 MESHPARAMS_ADD(dot11MeshMaxRetries); 227 229 MESHPARAMS_ADD(dot11MeshRetryTimeout); 228 230 MESHPARAMS_ADD(dot11MeshConfirmTimeout); ··· 238 236 MESHPARAMS_ADD(dot11MeshHWMPmaxPREQretries); 239 237 MESHPARAMS_ADD(path_refresh_time); 240 238 MESHPARAMS_ADD(min_discovery_timeout); 239 + 240 + #undef MESHPARAMS_ADD 241 241 } 242 242 #endif 243 243 244 244 static void add_files(struct ieee80211_sub_if_data *sdata) 245 245 { 246 - if (!sdata->debugfsdir) 246 + if (!sdata->debugfs.dir) 247 247 return; 248 248 249 249 switch (sdata->vif.type) { ··· 278 274 } 279 275 } 280 276 281 - #define DEBUGFS_DEL(name, type) \ 282 - do { \ 283 - debugfs_remove(sdata->debugfs.type.name); \ 284 - sdata->debugfs.type.name = NULL; \ 285 - } while (0) 286 - 287 - static void del_sta_files(struct ieee80211_sub_if_data *sdata) 288 - { 289 - DEBUGFS_DEL(drop_unencrypted, sta); 290 - DEBUGFS_DEL(force_unicast_rateidx, sta); 291 - DEBUGFS_DEL(max_ratectrl_rateidx, sta); 292 - 293 - DEBUGFS_DEL(bssid, sta); 294 - DEBUGFS_DEL(aid, sta); 295 - DEBUGFS_DEL(capab, sta); 296 - } 297 - 298 - static void del_ap_files(struct ieee80211_sub_if_data *sdata) 299 - { 300 - DEBUGFS_DEL(drop_unencrypted, ap); 301 - DEBUGFS_DEL(force_unicast_rateidx, ap); 302 - DEBUGFS_DEL(max_ratectrl_rateidx, ap); 303 - 304 - DEBUGFS_DEL(num_sta_ps, ap); 305 - DEBUGFS_DEL(dtim_count, ap); 306 - DEBUGFS_DEL(num_buffered_multicast, ap); 307 - } 308 - 309 - static void del_wds_files(struct ieee80211_sub_if_data *sdata) 310 - { 311 - DEBUGFS_DEL(drop_unencrypted, wds); 312 - DEBUGFS_DEL(force_unicast_rateidx, wds); 313 - DEBUGFS_DEL(max_ratectrl_rateidx, wds); 314 - 315 - DEBUGFS_DEL(peer, wds); 316 - } 317 - 318 - static void del_vlan_files(struct ieee80211_sub_if_data *sdata) 319 - { 320 - DEBUGFS_DEL(drop_unencrypted, vlan); 321 - DEBUGFS_DEL(force_unicast_rateidx, vlan); 322 - DEBUGFS_DEL(max_ratectrl_rateidx, vlan); 323 - } 324 - 325 - static void del_monitor_files(struct ieee80211_sub_if_data *sdata) 326 - { 327 - } 328 - 329 - #ifdef CONFIG_MAC80211_MESH 330 - #define MESHSTATS_DEL(name) \ 331 - do { \ 332 - debugfs_remove(sdata->mesh_stats.name); \ 333 - sdata->mesh_stats.name = NULL; \ 334 - } while (0) 335 - 336 - static void del_mesh_stats(struct ieee80211_sub_if_data *sdata) 337 - { 338 - MESHSTATS_DEL(fwded_mcast); 339 - MESHSTATS_DEL(fwded_unicast); 340 - MESHSTATS_DEL(fwded_frames); 341 - MESHSTATS_DEL(dropped_frames_ttl); 342 - MESHSTATS_DEL(dropped_frames_no_route); 343 - MESHSTATS_DEL(estab_plinks); 344 - debugfs_remove(sdata->mesh_stats_dir); 345 - sdata->mesh_stats_dir = NULL; 346 - } 347 - 348 - #define MESHPARAMS_DEL(name) \ 349 - do { \ 350 - debugfs_remove(sdata->mesh_config.name); \ 351 - sdata->mesh_config.name = NULL; \ 352 - } while (0) 353 - 354 - static void del_mesh_config(struct ieee80211_sub_if_data *sdata) 355 - { 356 - MESHPARAMS_DEL(dot11MeshMaxRetries); 357 - MESHPARAMS_DEL(dot11MeshRetryTimeout); 358 - MESHPARAMS_DEL(dot11MeshConfirmTimeout); 359 - MESHPARAMS_DEL(dot11MeshHoldingTimeout); 360 - MESHPARAMS_DEL(dot11MeshTTL); 361 - MESHPARAMS_DEL(auto_open_plinks); 362 - MESHPARAMS_DEL(dot11MeshMaxPeerLinks); 363 - MESHPARAMS_DEL(dot11MeshHWMPactivePathTimeout); 364 - MESHPARAMS_DEL(dot11MeshHWMPpreqMinInterval); 365 - MESHPARAMS_DEL(dot11MeshHWMPnetDiameterTraversalTime); 366 - MESHPARAMS_DEL(dot11MeshHWMPmaxPREQretries); 367 - MESHPARAMS_DEL(path_refresh_time); 368 - MESHPARAMS_DEL(min_discovery_timeout); 369 - debugfs_remove(sdata->mesh_config_dir); 370 - sdata->mesh_config_dir = NULL; 371 - } 372 - #endif 373 - 374 - static void del_files(struct ieee80211_sub_if_data *sdata) 375 - { 376 - if (!sdata->debugfsdir) 377 - return; 378 - 379 - switch (sdata->vif.type) { 380 - case NL80211_IFTYPE_MESH_POINT: 381 - #ifdef CONFIG_MAC80211_MESH 382 - del_mesh_stats(sdata); 383 - del_mesh_config(sdata); 384 - #endif 385 - break; 386 - case NL80211_IFTYPE_STATION: 387 - del_sta_files(sdata); 388 - break; 389 - case NL80211_IFTYPE_ADHOC: 390 - /* XXX */ 391 - break; 392 - case NL80211_IFTYPE_AP: 393 - del_ap_files(sdata); 394 - break; 395 - case NL80211_IFTYPE_WDS: 396 - del_wds_files(sdata); 397 - break; 398 - case NL80211_IFTYPE_MONITOR: 399 - del_monitor_files(sdata); 400 - break; 401 - case NL80211_IFTYPE_AP_VLAN: 402 - del_vlan_files(sdata); 403 - break; 404 - default: 405 - break; 406 - } 407 - } 408 - 409 277 static int notif_registered; 410 278 411 279 void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata) ··· 288 412 return; 289 413 290 414 sprintf(buf, "netdev:%s", sdata->dev->name); 291 - sdata->debugfsdir = debugfs_create_dir(buf, 415 + sdata->debugfs.dir = debugfs_create_dir(buf, 292 416 sdata->local->hw.wiphy->debugfsdir); 293 417 add_files(sdata); 294 418 } 295 419 296 420 void ieee80211_debugfs_remove_netdev(struct ieee80211_sub_if_data *sdata) 297 421 { 298 - del_files(sdata); 299 - debugfs_remove(sdata->debugfsdir); 300 - sdata->debugfsdir = NULL; 422 + if (!sdata->debugfs.dir) 423 + return; 424 + 425 + debugfs_remove_recursive(sdata->debugfs.dir); 426 + sdata->debugfs.dir = NULL; 301 427 } 302 428 303 429 static int netdev_notify(struct notifier_block *nb, ··· 322 444 323 445 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 324 446 325 - dir = sdata->debugfsdir; 447 + dir = sdata->debugfs.dir; 326 448 327 449 if (!dir) 328 450 return 0;
+2 -29
net/mac80211/debugfs_sta.c
··· 158 158 STA_OPS(agg_status); 159 159 160 160 #define DEBUGFS_ADD(name) \ 161 - sta->debugfs.name = debugfs_create_file(#name, 0400, \ 161 + debugfs_create_file(#name, 0400, \ 162 162 sta->debugfs.dir, sta, &sta_ ##name## _ops); 163 - 164 - #define DEBUGFS_DEL(name) \ 165 - debugfs_remove(sta->debugfs.name);\ 166 - sta->debugfs.name = NULL; 167 163 168 164 169 165 void ieee80211_sta_debugfs_add(struct sta_info *sta) ··· 212 216 213 217 void ieee80211_sta_debugfs_remove(struct sta_info *sta) 214 218 { 215 - DEBUGFS_DEL(flags); 216 - DEBUGFS_DEL(num_ps_buf_frames); 217 - DEBUGFS_DEL(inactive_ms); 218 - DEBUGFS_DEL(last_seq_ctrl); 219 - DEBUGFS_DEL(agg_status); 220 - DEBUGFS_DEL(aid); 221 - DEBUGFS_DEL(dev); 222 - DEBUGFS_DEL(rx_packets); 223 - DEBUGFS_DEL(tx_packets); 224 - DEBUGFS_DEL(rx_bytes); 225 - DEBUGFS_DEL(tx_bytes); 226 - DEBUGFS_DEL(rx_duplicates); 227 - DEBUGFS_DEL(rx_fragments); 228 - DEBUGFS_DEL(rx_dropped); 229 - DEBUGFS_DEL(tx_fragments); 230 - DEBUGFS_DEL(tx_filtered); 231 - DEBUGFS_DEL(tx_retry_failed); 232 - DEBUGFS_DEL(tx_retry_count); 233 - DEBUGFS_DEL(last_signal); 234 - DEBUGFS_DEL(last_qual); 235 - DEBUGFS_DEL(last_noise); 236 - DEBUGFS_DEL(wep_weak_iv_count); 237 - 238 - debugfs_remove(sta->debugfs.dir); 219 + debugfs_remove_recursive(sta->debugfs.dir); 239 220 sta->debugfs.dir = NULL; 240 221 }
+2 -112
net/mac80211/ieee80211_i.h
··· 471 471 } u; 472 472 473 473 #ifdef CONFIG_MAC80211_DEBUGFS 474 - struct dentry *debugfsdir; 475 - union { 476 - struct { 477 - struct dentry *drop_unencrypted; 478 - struct dentry *bssid; 479 - struct dentry *aid; 480 - struct dentry *capab; 481 - struct dentry *force_unicast_rateidx; 482 - struct dentry *max_ratectrl_rateidx; 483 - } sta; 484 - struct { 485 - struct dentry *drop_unencrypted; 486 - struct dentry *num_sta_ps; 487 - struct dentry *dtim_count; 488 - struct dentry *force_unicast_rateidx; 489 - struct dentry *max_ratectrl_rateidx; 490 - struct dentry *num_buffered_multicast; 491 - } ap; 492 - struct { 493 - struct dentry *drop_unencrypted; 494 - struct dentry *peer; 495 - struct dentry *force_unicast_rateidx; 496 - struct dentry *max_ratectrl_rateidx; 497 - } wds; 498 - struct { 499 - struct dentry *drop_unencrypted; 500 - struct dentry *force_unicast_rateidx; 501 - struct dentry *max_ratectrl_rateidx; 502 - } vlan; 503 - struct { 504 - struct dentry *mode; 505 - } monitor; 506 - } debugfs; 507 474 struct { 475 + struct dentry *dir; 508 476 struct dentry *default_key; 509 477 struct dentry *default_mgmt_key; 510 - } common_debugfs; 511 - 512 - #ifdef CONFIG_MAC80211_MESH 513 - struct dentry *mesh_stats_dir; 514 - struct { 515 - struct dentry *fwded_mcast; 516 - struct dentry *fwded_unicast; 517 - struct dentry *fwded_frames; 518 - struct dentry *dropped_frames_ttl; 519 - struct dentry *dropped_frames_no_route; 520 - struct dentry *estab_plinks; 521 - struct timer_list mesh_path_timer; 522 - } mesh_stats; 523 - 524 - struct dentry *mesh_config_dir; 525 - struct { 526 - struct dentry *dot11MeshRetryTimeout; 527 - struct dentry *dot11MeshConfirmTimeout; 528 - struct dentry *dot11MeshHoldingTimeout; 529 - struct dentry *dot11MeshMaxRetries; 530 - struct dentry *dot11MeshTTL; 531 - struct dentry *auto_open_plinks; 532 - struct dentry *dot11MeshMaxPeerLinks; 533 - struct dentry *dot11MeshHWMPactivePathTimeout; 534 - struct dentry *dot11MeshHWMPpreqMinInterval; 535 - struct dentry *dot11MeshHWMPnetDiameterTraversalTime; 536 - struct dentry *dot11MeshHWMPmaxPREQretries; 537 - struct dentry *path_refresh_time; 538 - struct dentry *min_discovery_timeout; 539 - } mesh_config; 540 - #endif 541 - 478 + } debugfs; 542 479 #endif 543 480 /* must be last, dynamically sized area in this! */ 544 481 struct ieee80211_vif vif; ··· 755 818 #ifdef CONFIG_MAC80211_DEBUGFS 756 819 struct local_debugfsdentries { 757 820 struct dentry *rcdir; 758 - struct dentry *rcname; 759 - struct dentry *frequency; 760 - struct dentry *total_ps_buffered; 761 - struct dentry *wep_iv; 762 - struct dentry *tsf; 763 - struct dentry *queues; 764 - struct dentry *reset; 765 - struct dentry *noack; 766 - struct dentry *statistics; 767 - struct local_debugfsdentries_statsdentries { 768 - struct dentry *transmitted_fragment_count; 769 - struct dentry *multicast_transmitted_frame_count; 770 - struct dentry *failed_count; 771 - struct dentry *retry_count; 772 - struct dentry *multiple_retry_count; 773 - struct dentry *frame_duplicate_count; 774 - struct dentry *received_fragment_count; 775 - struct dentry *multicast_received_frame_count; 776 - struct dentry *transmitted_frame_count; 777 - struct dentry *wep_undecryptable_count; 778 - struct dentry *num_scans; 779 - #ifdef CONFIG_MAC80211_DEBUG_COUNTERS 780 - struct dentry *tx_handlers_drop; 781 - struct dentry *tx_handlers_queued; 782 - struct dentry *tx_handlers_drop_unencrypted; 783 - struct dentry *tx_handlers_drop_fragment; 784 - struct dentry *tx_handlers_drop_wep; 785 - struct dentry *tx_handlers_drop_not_assoc; 786 - struct dentry *tx_handlers_drop_unauth_port; 787 - struct dentry *rx_handlers_drop; 788 - struct dentry *rx_handlers_queued; 789 - struct dentry *rx_handlers_drop_nullfunc; 790 - struct dentry *rx_handlers_drop_defrag; 791 - struct dentry *rx_handlers_drop_short; 792 - struct dentry *rx_handlers_drop_passive_scan; 793 - struct dentry *tx_expand_skb_head; 794 - struct dentry *tx_expand_skb_head_cloned; 795 - struct dentry *rx_expand_skb_head; 796 - struct dentry *rx_expand_skb_head2; 797 - struct dentry *rx_handlers_fragments; 798 - struct dentry *tx_status_drop; 799 - #endif 800 - struct dentry *dot11ACKFailureCount; 801 - struct dentry *dot11RTSFailureCount; 802 - struct dentry *dot11FCSErrorCount; 803 - struct dentry *dot11RTSSuccessCount; 804 - } stats; 805 821 struct dentry *stations; 806 822 struct dentry *keys; 807 823 } debugfs;
-12
net/mac80211/key.h
··· 118 118 struct { 119 119 struct dentry *stalink; 120 120 struct dentry *dir; 121 - struct dentry *keylen; 122 - struct dentry *flags; 123 - struct dentry *keyidx; 124 - struct dentry *hw_key_idx; 125 - struct dentry *tx_rx_count; 126 - struct dentry *algorithm; 127 - struct dentry *tx_spec; 128 - struct dentry *rx_spec; 129 - struct dentry *replays; 130 - struct dentry *icverrors; 131 - struct dentry *key; 132 - struct dentry *ifindex; 133 121 int cnt; 134 122 } debugfs; 135 123 #endif
-2
net/mac80211/main.c
··· 923 923 fail_wep: 924 924 sta_info_stop(local); 925 925 fail_sta_info: 926 - debugfs_hw_del(local); 927 926 destroy_workqueue(local->workqueue); 928 927 fail_workqueue: 929 928 wiphy_unregister(local->hw.wiphy); ··· 958 959 ieee80211_clear_tx_pending(local); 959 960 sta_info_stop(local); 960 961 rate_control_deinitialize(local); 961 - debugfs_hw_del(local); 962 962 963 963 if (skb_queue_len(&local->skb_queue) 964 964 || skb_queue_len(&local->skb_queue_unreliable))
+2 -5
net/mac80211/rate.c
··· 163 163 #ifdef CONFIG_MAC80211_DEBUGFS 164 164 debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir); 165 165 local->debugfs.rcdir = debugfsdir; 166 - local->debugfs.rcname = debugfs_create_file("name", 0400, debugfsdir, 167 - ref, &rcname_ops); 166 + debugfs_create_file("name", 0400, debugfsdir, ref, &rcname_ops); 168 167 #endif 169 168 170 169 ref->priv = ref->ops->alloc(&local->hw, debugfsdir); ··· 187 188 ctrl_ref->ops->free(ctrl_ref->priv); 188 189 189 190 #ifdef CONFIG_MAC80211_DEBUGFS 190 - debugfs_remove(ctrl_ref->local->debugfs.rcname); 191 - ctrl_ref->local->debugfs.rcname = NULL; 192 - debugfs_remove(ctrl_ref->local->debugfs.rcdir); 191 + debugfs_remove_recursive(ctrl_ref->local->debugfs.rcdir); 193 192 ctrl_ref->local->debugfs.rcdir = NULL; 194 193 #endif 195 194
-22
net/mac80211/sta_info.h
··· 301 301 #ifdef CONFIG_MAC80211_DEBUGFS 302 302 struct sta_info_debugfsdentries { 303 303 struct dentry *dir; 304 - struct dentry *flags; 305 - struct dentry *num_ps_buf_frames; 306 - struct dentry *inactive_ms; 307 - struct dentry *last_seq_ctrl; 308 - struct dentry *agg_status; 309 - struct dentry *aid; 310 - struct dentry *dev; 311 - struct dentry *rx_packets; 312 - struct dentry *tx_packets; 313 - struct dentry *rx_bytes; 314 - struct dentry *tx_bytes; 315 - struct dentry *rx_duplicates; 316 - struct dentry *rx_fragments; 317 - struct dentry *rx_dropped; 318 - struct dentry *tx_fragments; 319 - struct dentry *tx_filtered; 320 - struct dentry *tx_retry_failed; 321 - struct dentry *tx_retry_count; 322 - struct dentry *last_signal; 323 - struct dentry *last_qual; 324 - struct dentry *last_noise; 325 - struct dentry *wep_weak_iv_count; 326 304 bool add_has_run; 327 305 } debugfs; 328 306 #endif
+1 -2
net/wireless/core.c
··· 546 546 * First remove the hardware from everywhere, this makes 547 547 * it impossible to find from userspace. 548 548 */ 549 - cfg80211_debugfs_rdev_del(rdev); 549 + debugfs_remove_recursive(rdev->wiphy.debugfsdir); 550 550 list_del(&rdev->list); 551 551 552 552 /* ··· 569 569 570 570 cfg80211_rdev_list_generation++; 571 571 device_del(&rdev->wiphy.dev); 572 - debugfs_remove(rdev->wiphy.debugfsdir); 573 572 574 573 mutex_unlock(&cfg80211_mutex); 575 574
-11
net/wireless/core.h
··· 72 72 /* current channel */ 73 73 struct ieee80211_channel *channel; 74 74 75 - #ifdef CONFIG_CFG80211_DEBUGFS 76 - /* Debugfs entries */ 77 - struct wiphy_debugfsdentries { 78 - struct dentry *rts_threshold; 79 - struct dentry *fragmentation_threshold; 80 - struct dentry *short_retry_limit; 81 - struct dentry *long_retry_limit; 82 - struct dentry *ht40allow_map; 83 - } debugfs; 84 - #endif 85 - 86 75 /* must be last because of the way we do wiphy_priv(), 87 76 * and it should at least be aligned to NETDEV_ALIGN */ 88 77 struct wiphy wiphy __attribute__((__aligned__(NETDEV_ALIGN)));
+1 -14
net/wireless/debugfs.c
··· 104 104 }; 105 105 106 106 #define DEBUGFS_ADD(name) \ 107 - rdev->debugfs.name = debugfs_create_file(#name, S_IRUGO, phyd, \ 108 - &rdev->wiphy, &name## _ops); 109 - #define DEBUGFS_DEL(name) \ 110 - debugfs_remove(rdev->debugfs.name); \ 111 - rdev->debugfs.name = NULL; 107 + debugfs_create_file(#name, S_IRUGO, phyd, &rdev->wiphy, &name## _ops); 112 108 113 109 void cfg80211_debugfs_rdev_add(struct cfg80211_registered_device *rdev) 114 110 { ··· 115 119 DEBUGFS_ADD(short_retry_limit); 116 120 DEBUGFS_ADD(long_retry_limit); 117 121 DEBUGFS_ADD(ht40allow_map); 118 - } 119 - 120 - void cfg80211_debugfs_rdev_del(struct cfg80211_registered_device *rdev) 121 - { 122 - DEBUGFS_DEL(rts_threshold); 123 - DEBUGFS_DEL(fragmentation_threshold); 124 - DEBUGFS_DEL(short_retry_limit); 125 - DEBUGFS_DEL(long_retry_limit); 126 - DEBUGFS_DEL(ht40allow_map); 127 122 }
-3
net/wireless/debugfs.h
··· 3 3 4 4 #ifdef CONFIG_CFG80211_DEBUGFS 5 5 void cfg80211_debugfs_rdev_add(struct cfg80211_registered_device *rdev); 6 - void cfg80211_debugfs_rdev_del(struct cfg80211_registered_device *rdev); 7 6 #else 8 7 static inline 9 8 void cfg80211_debugfs_rdev_add(struct cfg80211_registered_device *rdev) {} 10 - static inline 11 - void cfg80211_debugfs_rdev_del(struct cfg80211_registered_device *rdev) {} 12 9 #endif 13 10 14 11 #endif /* __CFG80211_DEBUGFS_H */