aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2011-12-23 16:13:01 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-23 16:13:01 (GMT)
commit536062f274f523f7f84f2895894bb67a03ff9320 (patch)
tree85fdbd07d8a1e1c9d26a10c79b25628e6bc6c475 /src
parent82554b100c22c7e2ba51c81b0e247f03e08b2716 (diff)
downloadhostap-536062f274f523f7f84f2895894bb67a03ff9320.zip
hostap-536062f274f523f7f84f2895894bb67a03ff9320.tar.gz
hostap-536062f274f523f7f84f2895894bb67a03ff9320.tar.bz2
nl80211: Fix use_monitor driver capability for non-mac80211 drivers
Poll command may be enough for mac80211 to figure out whether monitor interface is to be used, but this change did not take into account non-mac80211 drivers that support AP mode without monitor interface. For example, ath6kl needs to get use_monitor disabled. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver_nl80211.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 6d518bd..2d7d11d 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2269,6 +2269,7 @@ struct wiphy_info_data {
unsigned int device_ap_sme:1;
unsigned int poll_command_supported:1;
unsigned int data_tx_status:1;
+ unsigned int monitor_supported:1;
};
@@ -2340,6 +2341,9 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
case NL80211_IFTYPE_P2P_CLIENT:
p2p_client_supported = 1;
break;
+ case NL80211_IFTYPE_MONITOR:
+ info->monitor_supported = 1;
+ break;
}
}
}
@@ -2560,6 +2564,20 @@ static int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv)
*/
drv->use_monitor = !info.poll_command_supported;
+ if (drv->device_ap_sme && drv->use_monitor) {
+ /*
+ * Non-mac80211 drivers may not support monitor interface.
+ * Make sure we do not get stuck with incorrect capability here
+ * by explicitly testing this.
+ */
+ if (!info.monitor_supported) {
+ wpa_printf(MSG_DEBUG, "nl80211: Disable use_monitor "
+ "with device_ap_sme since no monitor mode "
+ "support detected");
+ drv->use_monitor = 0;
+ }
+ }
+
/*
* If we aren't going to use monitor interfaces, but the
* driver doesn't support data TX status, we won't get TX