aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 6a5d6fa11e46..8d2f5f8d8080 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -605,7 +605,8 @@ 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 if (dev->wiphy.available_antennas && dev->ops->get_antenna) { 608 if ((dev->wiphy.available_antennas_tx ||
609 dev->wiphy.available_antennas_rx) && dev->ops->get_antenna) {
609 u32 tx_ant = 0, rx_ant = 0; 610 u32 tx_ant = 0, rx_ant = 0;
610 int res; 611 int res;
611 res = dev->ops->get_antenna(&dev->wiphy, &tx_ant, &rx_ant); 612 res = dev->ops->get_antenna(&dev->wiphy, &tx_ant, &rx_ant);
@@ -1107,7 +1108,9 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
1107 if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] && 1108 if (info->attrs[NL80211_ATTR_WIPHY_ANTENNA_TX] &&
1108 info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) { 1109 info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]) {
1109 u32 tx_ant, rx_ant; 1110 u32 tx_ant, rx_ant;
1110 if (!rdev->wiphy.available_antennas || !rdev->ops->set_antenna) { 1111 if ((!rdev->wiphy.available_antennas_tx &&
1112 !rdev->wiphy.available_antennas_rx) ||
1113 !rdev->ops->set_antenna) {
1111 result = -EOPNOTSUPP; 1114 result = -EOPNOTSUPP;
1112 goto bad_res; 1115 goto bad_res;
1113 } 1116 }
@@ -1116,15 +1119,15 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
1116 rx_ant = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]); 1119 rx_ant = nla_get_u32(info->attrs[NL80211_ATTR_WIPHY_ANTENNA_RX]);
1117 1120
1118 /* reject antenna configurations which don't match the 1121 /* reject antenna configurations which don't match the
1119 * available antenna mask, except for the "all" mask */ 1122 * available antenna masks, except for the "all" mask */
1120 if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas)) || 1123 if ((~tx_ant && (tx_ant & ~rdev->wiphy.available_antennas_tx)) ||
1121 (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas))) { 1124 (~rx_ant && (rx_ant & ~rdev->wiphy.available_antennas_rx))) {
1122 result = -EINVAL; 1125 result = -EINVAL;
1123 goto bad_res; 1126 goto bad_res;
1124 } 1127 }
1125 1128
1126 tx_ant = tx_ant & rdev->wiphy.available_antennas; 1129 tx_ant = tx_ant & rdev->wiphy.available_antennas_tx;
1127 rx_ant = rx_ant & rdev->wiphy.available_antennas; 1130 rx_ant = rx_ant & rdev->wiphy.available_antennas_rx;
1128 1131
1129 result = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant); 1132 result = rdev->ops->set_antenna(&rdev->wiphy, tx_ant, rx_ant);
1130 if (result) 1133 if (result)