Linux wireless drivers development
 help / color / mirror / Atom feed
From: Bruno Randolf <br1@einfach.org>
To: johannes@sipsolutions.net, linville@tuxdriver.com
Cc: dhalperi@cs.washington.edu, linux-wireless@vger.kernel.org
Subject: [PATCH 2/3] nl80211: Export available antennas
Date: Thu, 16 Dec 2010 11:30:28 +0900	[thread overview]
Message-ID: <20101216023028.24356.25352.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20101216023022.24356.22416.stgit@localhost6.localdomain6>

Export the information which antennas are available for configuration as TX or
RX antennas via nl80211.

Signed-off-by: Bruno Randolf <br1@einfach.org>

---

v3:	rebased and updated for separate RX and TX availablility
v2:	rebased
---
 include/linux/nl80211.h |    9 +++++++++
 net/wireless/nl80211.c  |    5 +++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 1cee56b..a6e1ec5 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -844,6 +844,12 @@ enum nl80211_commands {
  *	the hardware should not be configured to receive on this antenna.
  *	For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX.
  *
+ * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available
+ *	for configuration as TX antennas via the above parameters.
+ *
+ * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available
+ *	for configuration as RX antennas via the above parameters.
+ *
  * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
  *
  * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be
@@ -1040,6 +1046,9 @@ enum nl80211_attrs {
 
 	NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
 
+	NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
+	NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
+
 	/* add attributes here, update the policy in nl80211.c */
 
 	__NL80211_ATTR_AFTER_LAST,
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 087397b..ad3ca7d 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -605,6 +605,11 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags,
 	if (dev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL)
 		NLA_PUT_FLAG(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE);
 
+	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
+		    dev->wiphy.available_antennas_tx);
+	NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
+		    dev->wiphy.available_antennas_rx);
+
 	if ((dev->wiphy.available_antennas_tx ||
 	     dev->wiphy.available_antennas_rx) && dev->ops->get_antenna) {
 		u32 tx_ant = 0, rx_ant = 0;


  reply	other threads:[~2010-12-16  2:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-16  2:30 [PATCH 1/3] cfg80211: Separate available antennas for RX and TX Bruno Randolf
2010-12-16  2:30 ` Bruno Randolf [this message]
2010-12-16  2:30 ` [PATCH 3/3] ath5k: Set available antenna information for cfg80211 Bruno Randolf
  -- strict thread matches above, loose matches on Subject: below --
2010-12-06  3:45 [PATCH 1/3] cfg80211: Add antenna availability information Bruno Randolf
2010-12-06  3:45 ` [PATCH 2/3] nl80211: Export available antennas Bruno Randolf
2010-12-06  8:17   ` Johannes Berg
2010-12-06  8:30     ` Bruno Randolf
2010-12-06  8:33       ` Johannes Berg
2010-12-07  2:17         ` Bruno Randolf
2010-12-07  9:35           ` Johannes Berg
2010-12-08  3:45             ` Bruno Randolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101216023028.24356.25352.stgit@localhost6.localdomain6 \
    --to=br1@einfach.org \
    --cc=dhalperi@cs.washington.edu \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox