[package] iw: Extend antenna setting 'all' to apply for either rx or tx antenna
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25134 3c298f89-4303-0410-b956-a3cf2f4a3e73master
parent
4e2d90b5b8
commit
984e573e16
|
@ -37,7 +37,7 @@ diff --git a/phy.c b/phy.c
|
||||||
index 7c6c7c8..e3bd4e8 100644
|
index 7c6c7c8..e3bd4e8 100644
|
||||||
--- a/phy.c
|
--- a/phy.c
|
||||||
+++ b/phy.c
|
+++ b/phy.c
|
||||||
@@ -307,3 +307,42 @@ COMMAND(set, txpower, "<auto|fixed|limit> [<tx power in mBm>]",
|
@@ -307,3 +307,51 @@ COMMAND(set, txpower, "<auto|fixed|limit> [<tx power in mBm>]",
|
||||||
COMMAND(set, txpower, "<auto|fixed|limit> [<tx power in mBm>]",
|
COMMAND(set, txpower, "<auto|fixed|limit> [<tx power in mBm>]",
|
||||||
NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_txpower,
|
NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_txpower,
|
||||||
"Specify transmit power level and setting type.");
|
"Specify transmit power level and setting type.");
|
||||||
|
@ -50,21 +50,30 @@ index 7c6c7c8..e3bd4e8 100644
|
||||||
+ char *end;
|
+ char *end;
|
||||||
+ uint32_t tx_ant = 0, rx_ant = 0;
|
+ uint32_t tx_ant = 0, rx_ant = 0;
|
||||||
+
|
+
|
||||||
+ if (argc == 1 && strcmp(argv[0], "all") == 0) {
|
+ if (argc == 1) {
|
||||||
+ tx_ant = 0xffffffff;
|
+ if (strcmp(argv[0], "all") == 0)
|
||||||
+ rx_ant = 0xffffffff;
|
+ tx_ant = rx_ant = 0xffffffff;
|
||||||
+ } else if (argc == 1) {
|
+ else {
|
||||||
+ tx_ant = rx_ant = strtoul(argv[0], &end, 0);
|
+ tx_ant = rx_ant = strtoul(argv[0], &end, 0);
|
||||||
+ if (*end)
|
+ if (*end)
|
||||||
+ return 1;
|
+ return 1;
|
||||||
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ else if (argc == 2) {
|
+ else if (argc == 2) {
|
||||||
+ tx_ant = strtoul(argv[0], &end, 0);
|
+ if (strcmp(argv[0], "all") == 0)
|
||||||
+ if (*end)
|
+ tx_ant = 0xffffffff;
|
||||||
+ return 1;
|
+ else {
|
||||||
+ rx_ant = strtoul(argv[1], &end, 0);
|
+ tx_ant = strtoul(argv[0], &end, 0);
|
||||||
+ if (*end)
|
+ if (*end)
|
||||||
+ return 1;
|
+ return 1;
|
||||||
|
+ }
|
||||||
|
+ if (strcmp(argv[1], "all") == 0)
|
||||||
|
+ rx_ant = 0xffffffff;
|
||||||
|
+ else {
|
||||||
|
+ rx_ant = strtoul(argv[1], &end, 0);
|
||||||
|
+ if (*end)
|
||||||
|
+ return 1;
|
||||||
|
+ }
|
||||||
+ } else
|
+ } else
|
||||||
+ return 1;
|
+ return 1;
|
||||||
+
|
+
|
||||||
|
|
Loading…
Reference in New Issue