hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/net/mac80211/debugfs_key.c
....@@ -1,12 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2003-2005 Devicescape Software, Inc.
34 * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz>
45 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
56 * Copyright (C) 2015 Intel Deutschland GmbH
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
107 */
118
129 #include <linux/kobject.h>
....@@ -342,9 +339,6 @@
342339 key->debugfs.dir = debugfs_create_dir(buf,
343340 key->local->debugfs.keys);
344341
345
- if (!key->debugfs.dir)
346
- return;
347
-
348342 sta = key->sta;
349343 if (sta) {
350344 sprintf(buf, "../../netdev:%s/stations/%pM",
....@@ -439,6 +433,37 @@
439433 sdata->debugfs.default_mgmt_key = NULL;
440434 }
441435
436
+void
437
+ieee80211_debugfs_key_add_beacon_default(struct ieee80211_sub_if_data *sdata)
438
+{
439
+ char buf[50];
440
+ struct ieee80211_key *key;
441
+
442
+ if (!sdata->vif.debugfs_dir)
443
+ return;
444
+
445
+ key = key_mtx_dereference(sdata->local,
446
+ sdata->default_beacon_key);
447
+ if (key) {
448
+ sprintf(buf, "../keys/%d", key->debugfs.cnt);
449
+ sdata->debugfs.default_beacon_key =
450
+ debugfs_create_symlink("default_beacon_key",
451
+ sdata->vif.debugfs_dir, buf);
452
+ } else {
453
+ ieee80211_debugfs_key_remove_beacon_default(sdata);
454
+ }
455
+}
456
+
457
+void
458
+ieee80211_debugfs_key_remove_beacon_default(struct ieee80211_sub_if_data *sdata)
459
+{
460
+ if (!sdata)
461
+ return;
462
+
463
+ debugfs_remove(sdata->debugfs.default_beacon_key);
464
+ sdata->debugfs.default_beacon_key = NULL;
465
+}
466
+
442467 void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key,
443468 struct sta_info *sta)
444469 {