]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Do not indicate P2P_DEVICE support by default
authorJouni Malinen <j@w1.fi>
Sun, 30 Jun 2013 06:58:50 +0000 (09:58 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 30 Jun 2013 07:50:13 +0000 (10:50 +0300)
Since the P2P_DEVICE support indication was added to kernel before
everything was working properly, there may be kernel versions in use
with the new mechanism breaking P2P functionality (especially with
mac80211_hwsim). For now, disable P2P_DEVICE support by default and
allow it to be enabled with driver_param=p2p_device=1 in the
configuration file. This default behavior may be changed in the future
once the kernel issues has been resolved in stable releases.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/drivers/driver_nl80211.c

index f3a02a25b6f612de37517d4c41f4cee0724ba8c1..90903f5cc05e3253c6cd3ef43c6cd58a5ceddd58 100644 (file)
@@ -253,6 +253,7 @@ struct wpa_driver_nl80211_data {
        unsigned int retry_auth:1;
        unsigned int use_monitor:1;
        unsigned int ignore_next_local_disconnect:1;
+       unsigned int allow_p2p_device:1;
 
        u64 remain_on_chan_cookie;
        u64 send_action_cookie;
@@ -8120,6 +8121,13 @@ static int wpa_driver_nl80211_get_capa(void *priv,
                capa->extended_capa_mask = drv->extended_capa_mask;
                capa->extended_capa_len = drv->extended_capa_len;
        }
+
+       if ((capa->flags & WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE) &&
+           !drv->allow_p2p_device) {
+               wpa_printf(MSG_DEBUG, "nl80211: Do not indicate P2P_DEVICE support (p2p_device=1 driver param not specified)");
+               capa->flags &= ~WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE;
+       }
+
        return 0;
 }
 
@@ -9747,6 +9755,12 @@ static int nl80211_set_param(void *priv, const char *param)
                drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_CONCURRENT;
                drv->capa.flags |= WPA_DRIVER_FLAGS_P2P_MGMT_AND_NON_P2P;
        }
+
+       if (os_strstr(param, "p2p_device=1")) {
+               struct i802_bss *bss = priv;
+               struct wpa_driver_nl80211_data *drv = bss->drv;
+               drv->allow_p2p_device = 1;
+       }
 #endif /* CONFIG_P2P */
 
        return 0;