]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Fix use_monitor driver capability for non-mac80211 drivers
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 23 Dec 2011 16:13:01 +0000 (18:13 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 23 Dec 2011 16:13:01 +0000 (18:13 +0200)
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>

src/drivers/driver_nl80211.c

index 6d518bdb7ecb47db0c75c296cb18fd698fb13730..2d7d11d6e929cf9e657f298aa4c4517e13401638 100644 (file)
@@ -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