1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-05 14:36:14 +02:00
openwrt-xburst/package/network/utils/iw/patches/130-antenna_gain.patch
nbd 9c8997d54d packages: sort network related packages into package/network/
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33688 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-10-10 12:32:29 +00:00

35 lines
872 B
Diff

--- a/phy.c
+++ b/phy.c
@@ -359,3 +359,31 @@ COMMAND(set, antenna, "<bitmap> | all |
NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna,
"Set a bitmap of allowed antennas to use for TX and RX.\n"
"The driver may reject antenna configurations it cannot support.");
+
+static int handle_antenna_gain(struct nl80211_state *state,
+ struct nl_cb *cb,
+ struct nl_msg *msg,
+ int argc, char **argv,
+ enum id_input id)
+{
+ char *endptr;
+ int dbm;
+
+ /* get the required args */
+ if (argc != 1)
+ return 1;
+
+ dbm = strtol(argv[0], &endptr, 10);
+ if (*endptr)
+ return 2;
+
+ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_GAIN, dbm);
+
+ return 0;
+
+ nla_put_failure:
+ return -ENOBUFS;
+}
+COMMAND(set, antenna_gain, "<antenna gain in dBm>",
+ NL80211_CMD_SET_WIPHY, 0, CIB_PHY, handle_antenna_gain,
+ "Specify antenna gain.");