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>
This commit is contained in:
Jouni Malinen 2011-12-23 18:13:01 +02:00 committed by Jouni Malinen
parent 82554b100c
commit 536062f274

View file

@ -2269,6 +2269,7 @@ struct wiphy_info_data {
unsigned int device_ap_sme:1; unsigned int device_ap_sme:1;
unsigned int poll_command_supported:1; unsigned int poll_command_supported:1;
unsigned int data_tx_status: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: case NL80211_IFTYPE_P2P_CLIENT:
p2p_client_supported = 1; p2p_client_supported = 1;
break; 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; 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 * If we aren't going to use monitor interfaces, but the
* driver doesn't support data TX status, we won't get TX * driver doesn't support data TX status, we won't get TX