From patchwork Mon Dec 6 03:45:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Randolf X-Patchwork-Id: 376972 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oB63jgnK030960 for ; Mon, 6 Dec 2010 03:45:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752440Ab0LFDpj (ORCPT ); Sun, 5 Dec 2010 22:45:39 -0500 Received: from mail30g.wh2.ocn.ne.jp ([220.111.41.239]:28638 "HELO mail30g.wh2.ocn.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752438Ab0LFDpj (ORCPT ); Sun, 5 Dec 2010 22:45:39 -0500 Received: from vs3007.wh2.ocn.ne.jp (125.206.180.235) by mail30g.wh2.ocn.ne.jp (RS ver 1.0.95vs) with SMTP id 0-0276967136 for ; Mon, 6 Dec 2010 12:45:37 +0900 (JST) Received: (qmail 18938 invoked from network); 6 Dec 2010 03:45:36 -0000 Received: from unknown (HELO localhost6.localdomain6) (220.110.201.18) by with SMTP; 6 Dec 2010 03:45:36 -0000 Subject: [PATCH 2/3] nl80211: Export available antennas To: johannes@sipsolutions.net, linville@tuxdriver.com From: Bruno Randolf Cc: linux-wireless@vger.kernel.org Date: Mon, 06 Dec 2010 12:45:35 +0900 Message-ID: <20101206034535.11462.70791.stgit@localhost6.localdomain6> In-Reply-To: <20101206034529.11462.48097.stgit@localhost6.localdomain6> References: <20101206034529.11462.48097.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 X-SF-Loop: 1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 06 Dec 2010 03:45:43 +0000 (UTC) diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 68fc25f..5f64fd6 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h @@ -833,6 +833,9 @@ 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: Bitmap of antennas which are available for + * configuration 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 @@ -1017,6 +1020,8 @@ enum nl80211_attrs { NL80211_ATTR_OFFCHANNEL_TX_OK, + NL80211_ATTR_WIPHY_ANTENNA_AVAIL, + /* 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 4854df9..1d49d75 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -555,6 +555,8 @@ static int nl80211_send_wiphy(struct sk_buff *msg, u32 pid, u32 seq, int flags, NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_TX, tx_ant); NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_RX, rx_ant); } + NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL, + dev->wiphy.available_antennas); } nl_modes = nla_nest_start(msg, NL80211_ATTR_SUPPORTED_IFTYPES);