X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/fedce2a94df014ad03a010842fba9cae4dca5933..3b329ec7b5c182f2b66e86a855b633c4b97ee5f1:/package/iw/patches/401-antenna.patch?ds=sidebyside diff --git a/package/iw/patches/401-antenna.patch b/package/iw/patches/401-antenna.patch index 660f79f67..62f37c2e2 100644 --- a/package/iw/patches/401-antenna.patch +++ b/package/iw/patches/401-antenna.patch @@ -15,11 +15,9 @@ v8: Simplfied option parser as requested. phy.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 0 deletions(-) -diff --git a/info.c b/info.c -index ce85514..75cadf0 100644 --- a/info.c +++ b/info.c -@@ -168,6 +168,13 @@ static int print_phy_handler(struct nl_msg *msg, void *arg) +@@ -168,6 +168,13 @@ static int print_phy_handler(struct nl_m printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage); } @@ -33,11 +31,9 @@ index ce85514..75cadf0 100644 if (tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES]) { printf("\tSupported interface modes:\n"); nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SUPPORTED_IFTYPES], rem_mode) -diff --git a/phy.c b/phy.c -index 7c6c7c8..e3bd4e8 100644 --- a/phy.c +++ b/phy.c -@@ -307,3 +307,42 @@ COMMAND(set, txpower, " []", +@@ -307,3 +307,51 @@ COMMAND(set, txpower, " []", NL80211_CMD_SET_WIPHY, 0, CIB_NETDEV, handle_txpower, "Specify transmit power level and setting type."); @@ -50,21 +46,30 @@ index 7c6c7c8..e3bd4e8 100644 + char *end; + uint32_t tx_ant = 0, rx_ant = 0; + -+ if (argc == 1 && strcmp(argv[0], "all") == 0) { -+ tx_ant = 0xffffffff; -+ rx_ant = 0xffffffff; -+ } else if (argc == 1) { -+ tx_ant = rx_ant = strtoul(argv[0], &end, 0); -+ if (*end) -+ return 1; ++ if (argc == 1) { ++ if (strcmp(argv[0], "all") == 0) ++ tx_ant = rx_ant = 0xffffffff; ++ else { ++ tx_ant = rx_ant = strtoul(argv[0], &end, 0); ++ if (*end) ++ return 1; ++ } + } + else if (argc == 2) { -+ tx_ant = strtoul(argv[0], &end, 0); -+ if (*end) -+ return 1; -+ rx_ant = strtoul(argv[1], &end, 0); -+ if (*end) -+ return 1; ++ if (strcmp(argv[0], "all") == 0) ++ tx_ant = 0xffffffff; ++ else { ++ tx_ant = strtoul(argv[0], &end, 0); ++ if (*end) ++ return 1; ++ } ++ if (strcmp(argv[1], "all") == 0) ++ rx_ant = 0xffffffff; ++ else { ++ rx_ant = strtoul(argv[1], &end, 0); ++ if (*end) ++ return 1; ++ } + } else + return 1; +