Skip to contentSkip to conversation

iw antenna command

PATCH New Bruno Randolf 1 participant 4 messages May 12, 2010 Kbuild

lore
Share & tools
lore
#0 lore raw

cover iw antenna command

here the iw part. the option parsing is more flexible now and i added a possibility to use

iw phy0 anenna set X

to set both RX and TX antennas

+ one small fix for the channel command name

bruno

---

Bruno Randolf (3):
iw: add channel command name
iw: sync nl80211.h with wireless-testing
iw: Add antenna set/get

 Makefile  |    2 +
 antenna.c |   88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 nl80211.h |   12 ++++++++
 util.c    |    3 ++
 4 files changed, 104 insertions(+), 1 deletions(-)
 create mode 100644 antenna.c
Signature · 1 line
Signature
#1 lore raw

PATCH 1/3 iw: add channel command name

---
 util.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
util.c +1 -0
index 42c992d..0c6d978 100644
@@ -165,6 +165,7 @@ static const char *commands[NL80211_CMD_MAX + 1] = {
 	[NL80211_CMD_SET_TX_BITRATE_MASK] = "set_tx_bitrate_mask",
 	[NL80211_CMD_REGISTER_ACTION] = "register_action",
 	[NL80211_CMD_ACTION] = "action",
+	[NL80211_CMD_SET_CHANNEL] = "set_channel",
 };
 
 static char cmdbuf[100];
#2 lore raw

PATCH 2/3 iw: sync nl80211.h with wireless-testing

In reply to Bruno Randolf

adding antenna settings

---
 nl80211.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
nl80211.h +12 -0
index b7c77f9..46a2c76 100644
@@ -341,6 +341,9 @@
  *	of any other interfaces, and other interfaces will again take
  *	precedence when they are used.
  *
+ * @NL80211_CMD_SET_ANTENNA: Set a bitmap of antennas to use.
+ * @NL80211_CMD_GET_ANTENNA: Get antenna configuration from driver.
+ *
  * @NL80211_CMD_MAX: highest used command number
  * @__NL80211_CMD_AFTER_LAST: internal use
  */
@@ -441,6 +444,9 @@ enum nl80211_commands {
 
 	NL80211_CMD_SET_CHANNEL,
 
+	NL80211_CMD_SET_ANTENNA,
+	NL80211_CMD_GET_ANTENNA,
+
 	/* add new commands above here */
 
 	/* used to define NL80211_CMD_MAX below */
@@ -725,6 +731,9 @@ enum nl80211_commands {
  * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
  *	connected to this BSS.
  *
+ * @NL80211_ATTR_ANTENNA_TX: Bitmap of antennas to use for transmitting.
+ * @NL80211_ATTR_ANTENNA_RX: Bitmap of antennas to use for receiving.
+ *
  * @NL80211_ATTR_MAX: highest attribute number currently defined
  * @__NL80211_ATTR_AFTER_LAST: internal use
  */
@@ -882,6 +891,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_AP_ISOLATE,
 
+	NL80211_ATTR_ANTENNA_TX,
+	NL80211_ATTR_ANTENNA_RX,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
#3 lore raw

PATCH 3/3 iw: Add antenna set/get

In reply to Bruno Randolf

Add commands to set and get the antenna configuration. The antenna configuration is defined as a bitmap of 8 antennas. When multiple antennas are selected the driver may use diversity. Also the driver may reject antenna configurations it cannot support.

---
 Makefile  |    2 +
 antenna.c |   88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 util.c    |    2 +
 3 files changed, 91 insertions(+), 1 deletions(-)
 create mode 100644 antenna.c
Makefile +1 -1
index d303f45..e526cda 100644
@@ -17,7 +17,7 @@ CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
 OBJS = iw.o genl.o event.o info.o phy.o \
 	interface.o ibss.o station.o survey.o util.o \
 	mesh.o mpath.o scan.o reg.o version.o \
-	reason.o status.o connect.o link.o offch.o ps.o cqm.o
+	reason.o status.o connect.o link.o offch.o ps.o cqm.o antenna.o
 OBJS += sections.o
 ALL = iw
 
antenna.c new file +88 -0

88 lines not on this page · raw message

util.c +2 -0
index 0c6d978..7d971ac 100644
@@ -166,6 +166,8 @@ static const char *commands[NL80211_CMD_MAX + 1] = {
 	[NL80211_CMD_REGISTER_ACTION] = "register_action",
 	[NL80211_CMD_ACTION] = "action",
 	[NL80211_CMD_SET_CHANNEL] = "set_channel",
+	[NL80211_CMD_SET_ANTENNA] = "antenna_set",
+	[NL80211_CMD_GET_ANTENNA] = "antenna_get",
 };
 
 static char cmdbuf[100];