| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2003-2005 Devicescape Software, Inc. |
|---|
| 3 | 4 | * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz> |
|---|
| 4 | 5 | * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> |
|---|
| 5 | 6 | * 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. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #include <linux/kobject.h> |
|---|
| .. | .. |
|---|
| 342 | 339 | key->debugfs.dir = debugfs_create_dir(buf, |
|---|
| 343 | 340 | key->local->debugfs.keys); |
|---|
| 344 | 341 | |
|---|
| 345 | | - if (!key->debugfs.dir) |
|---|
| 346 | | - return; |
|---|
| 347 | | - |
|---|
| 348 | 342 | sta = key->sta; |
|---|
| 349 | 343 | if (sta) { |
|---|
| 350 | 344 | sprintf(buf, "../../netdev:%s/stations/%pM", |
|---|
| .. | .. |
|---|
| 439 | 433 | sdata->debugfs.default_mgmt_key = NULL; |
|---|
| 440 | 434 | } |
|---|
| 441 | 435 | |
|---|
| 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 | + |
|---|
| 442 | 467 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, |
|---|
| 443 | 468 | struct sta_info *sta) |
|---|
| 444 | 469 | { |
|---|