hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/net/mac80211/debugfs_netdev.c
....@@ -1,10 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2006 Jiri Benc <jbenc@suse.cz>
34 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License version 2 as
7
- * published by the Free Software Foundation.
5
+ * Copyright (C) 2020 Intel Corporation
86 */
97
108 #include <linux/kernel.h>
....@@ -238,7 +236,7 @@
238236
239237 /* STA attributes */
240238 IEEE80211_IF_FILE(bssid, u.mgd.bssid, MAC);
241
-IEEE80211_IF_FILE(aid, u.mgd.aid, DEC);
239
+IEEE80211_IF_FILE(aid, vif.bss_conf.aid, DEC);
242240 IEEE80211_IF_FILE(beacon_timeout, u.mgd.beacon_timeout, JIFFIES_TO_MS);
243241
244242 static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata,
....@@ -257,15 +255,11 @@
257255 smps_mode == IEEE80211_SMPS_AUTOMATIC))
258256 return -EINVAL;
259257
260
- if (sdata->vif.type != NL80211_IFTYPE_STATION &&
261
- sdata->vif.type != NL80211_IFTYPE_AP)
258
+ if (sdata->vif.type != NL80211_IFTYPE_STATION)
262259 return -EOPNOTSUPP;
263260
264261 sdata_lock(sdata);
265
- if (sdata->vif.type == NL80211_IFTYPE_STATION)
266
- err = __ieee80211_request_smps_mgd(sdata, smps_mode);
267
- else
268
- err = __ieee80211_request_smps_ap(sdata, smps_mode);
262
+ err = __ieee80211_request_smps_mgd(sdata, smps_mode);
269263 sdata_unlock(sdata);
270264
271265 return err;
....@@ -284,10 +278,6 @@
284278 if (sdata->vif.type == NL80211_IFTYPE_STATION)
285279 return snprintf(buf, buflen, "request: %s\nused: %s\n",
286280 smps_modes[sdata->u.mgd.req_smps],
287
- smps_modes[sdata->smps_mode]);
288
- if (sdata->vif.type == NL80211_IFTYPE_AP)
289
- return snprintf(buf, buflen, "request: %s\nused: %s\n",
290
- smps_modes[sdata->u.ap.req_smps],
291281 smps_modes[sdata->smps_mode]);
292282 return -EINVAL;
293283 }
....@@ -646,6 +636,11 @@
646636 IEEE80211_IF_FILE(power_mode, u.mesh.mshcfg.power_mode, DEC);
647637 IEEE80211_IF_FILE(dot11MeshAwakeWindowDuration,
648638 u.mesh.mshcfg.dot11MeshAwakeWindowDuration, DEC);
639
+IEEE80211_IF_FILE(dot11MeshConnectedToMeshGate,
640
+ u.mesh.mshcfg.dot11MeshConnectedToMeshGate, DEC);
641
+IEEE80211_IF_FILE(dot11MeshNolearn, u.mesh.mshcfg.dot11MeshNolearn, DEC);
642
+IEEE80211_IF_FILE(dot11MeshConnectedToAuthServer,
643
+ u.mesh.mshcfg.dot11MeshConnectedToAuthServer, DEC);
649644 #endif
650645
651646 #define DEBUGFS_ADD_MODE(name, mode) \
....@@ -769,6 +764,9 @@
769764 MESHPARAMS_ADD(dot11MeshHWMPconfirmationInterval);
770765 MESHPARAMS_ADD(power_mode);
771766 MESHPARAMS_ADD(dot11MeshAwakeWindowDuration);
767
+ MESHPARAMS_ADD(dot11MeshConnectedToMeshGate);
768
+ MESHPARAMS_ADD(dot11MeshNolearn);
769
+ MESHPARAMS_ADD(dot11MeshConnectedToAuthServer);
772770 #undef MESHPARAMS_ADD
773771 }
774772 #endif
....@@ -822,9 +820,8 @@
822820 sprintf(buf, "netdev:%s", sdata->name);
823821 sdata->vif.debugfs_dir = debugfs_create_dir(buf,
824822 sdata->local->hw.wiphy->debugfsdir);
825
- if (sdata->vif.debugfs_dir)
826
- sdata->debugfs.subdir_stations = debugfs_create_dir("stations",
827
- sdata->vif.debugfs_dir);
823
+ sdata->debugfs.subdir_stations = debugfs_create_dir("stations",
824
+ sdata->vif.debugfs_dir);
828825 add_files(sdata);
829826 }
830827
....@@ -849,8 +846,5 @@
849846 return;
850847
851848 sprintf(buf, "netdev:%s", sdata->name);
852
- if (!debugfs_rename(dir->d_parent, dir, dir->d_parent, buf))
853
- sdata_err(sdata,
854
- "debugfs: failed to rename debugfs dir to %s\n",
855
- buf);
849
+ debugfs_rename(dir->d_parent, dir, dir->d_parent, buf);
856850 }