diff options
author | Bruno Randolf <br1@einfach.org> | 2010-12-15 21:30:28 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-20 14:49:47 -0500 |
commit | 39fd5de4472b7b222c6cec78d72b069133f694e4 (patch) | |
tree | 81dd5a546598a1b09d3a48ca0f001b375ad91acb | |
parent | 7f531e03abf0162df3966c4fa5fa6fdd9302cb6b (diff) |
nl80211: Export available antennas
Export the information which antennas are available for configuration as TX or
RX antennas via nl80211.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/linux/nl80211.h | 9 | ||||
-rw-r--r-- | 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 69eaccac78c4..2b89b712565b 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -858,6 +858,12 @@ enum nl80211_commands { | |||
858 | * the hardware should not be configured to receive on this antenna. | 858 | * the hardware should not be configured to receive on this antenna. |
859 | * For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX. | 859 | * For a more detailed descripton see @NL80211_ATTR_WIPHY_ANTENNA_TX. |
860 | * | 860 | * |
861 | * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available | ||
862 | * for configuration as TX antennas via the above parameters. | ||
863 | * | ||
864 | * @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available | ||
865 | * for configuration as RX antennas via the above parameters. | ||
866 | * | ||
861 | * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS | 867 | * @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS |
862 | * | 868 | * |
863 | * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be | 869 | * @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be |
@@ -1059,6 +1065,9 @@ enum nl80211_attrs { | |||
1059 | 1065 | ||
1060 | NL80211_ATTR_MESH_SETUP, | 1066 | NL80211_ATTR_MESH_SETUP, |
1061 | 1067 | ||
1068 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, | ||
1069 | NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, | ||
1070 | |||
1062 | /* add attributes here, update the policy in nl80211.c */ | 1071 | /* add attributes here, update the policy in nl80211.c */ |
1063 | 1072 | ||
1064 | __NL80211_ATTR_AFTER_LAST, | 1073 | __NL80211_ATTR_AFTER_LAST, |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 8d2f5f8d8080..9b62710891a2 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, | |||
605 | if (dev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) | 605 | if (dev->wiphy.flags & WIPHY_FLAG_CONTROL_PORT_PROTOCOL) |
606 | NLA_PUT_FLAG(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE); | 606 | NLA_PUT_FLAG(msg, NL80211_ATTR_CONTROL_PORT_ETHERTYPE); |
607 | 607 | ||
608 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX, | ||
609 | dev->wiphy.available_antennas_tx); | ||
610 | NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX, | ||
611 | dev->wiphy.available_antennas_rx); | ||
612 | |||
608 | if ((dev->wiphy.available_antennas_tx || | 613 | if ((dev->wiphy.available_antennas_tx || |
609 | dev->wiphy.available_antennas_rx) && dev->ops->get_antenna) { | 614 | dev->wiphy.available_antennas_rx) && dev->ops->get_antenna) { |
610 | u32 tx_ant = 0, rx_ant = 0; | 615 | u32 tx_ant = 0, rx_ant = 0; |