Commit
14ad75d3b4c3 ("iw: support multiple regdom print") added
support for dumping multiple regulatory domain, with the intent
that if a specific phy is given, only its regulatory information
would be fetched. However, the phy specific handling was ignored.
Fix it.
Change-Id: I647ef420741e528a4d6568a7d4518c9a561bd199
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
char *dump_args[] = { "reg", "dump" };
int err;
+ /*
+ * If PHY was specifically given, get the PHY specific regulatory
+ * information. Otherwise, dump the entire regulatory information.
+ */
+ if (id == II_PHY_IDX || id == II_PHY_NAME) {
+ register_handler(print_reg_handler, NULL);
+ return 0;
+ }
+
err = handle_cmd(state, II_NONE, 2, dump_args);
+
/*
* dump might fail since it's not supported on older kernels,
* in that case the handler is still registered already