summaryrefslogtreecommitdiff
path: root/iwinfo_cli.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-06-09 13:57:23 +0200
committerFelix Fietkau <nbd@nbd.name>2021-06-09 13:57:26 +0200
commitaa0e3c4bbe12f02ddb3a0a2e69b3b4f0b30b9b79 (patch)
tree34943e6d8d97203ff7cc824292c56eae28cb53e1 /iwinfo_cli.c
parentc45f0b584b4b86f8250f90ea19afca271c114fa2 (diff)
downloadiwinfo-aa0e3c4bbe12f02ddb3a0a2e69b3b4f0b30b9b79.tar.gz
iwinfo: nl80211: add support for printing the device path for a phy
Will be used to replace the shell code from mac80211.sh Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'iwinfo_cli.c')
-rw-r--r--iwinfo_cli.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/iwinfo_cli.c b/iwinfo_cli.c
index 8691f31..456c67a 100644
--- a/iwinfo_cli.c
+++ b/iwinfo_cli.c
@@ -875,6 +875,16 @@ static void lookup_phy(const struct iwinfo_ops *iw, const char *section)
}
+static void lookup_path(const struct iwinfo_ops *iw, const char *phy)
+{
+ const char *path;
+
+ if (!iw->phy_path || iw->phy_path(phy, &path) || !path)
+ return;
+
+ printf("%s\n", path);
+}
+
int main(int argc, char **argv)
{
int i, rv = 0;
@@ -934,6 +944,10 @@ int main(int argc, char **argv)
}
else
{
+ if (!strcmp(argv[2], "path")) {
+ lookup_path(iw, argv[3]);
+ return 0;
+ }
switch (argv[2][0])
{
case 'p':