2010-05-02 22:03:49 +00:00
|
|
|
--- a/src/drivers/driver_nl80211.c
|
|
|
|
+++ b/src/drivers/driver_nl80211.c
|
2011-11-04 01:05:26 +00:00
|
|
|
@@ -2289,6 +2289,7 @@ static void * wpa_driver_nl80211_init(vo
|
2010-05-02 22:03:49 +00:00
|
|
|
drv->monitor_ifidx = -1;
|
|
|
|
drv->monitor_sock = -1;
|
2011-11-04 01:05:26 +00:00
|
|
|
drv->ap_scan_as_station = NL80211_IFTYPE_UNSPECIFIED;
|
2010-05-02 22:03:49 +00:00
|
|
|
+ drv->nlmode = NL80211_IFTYPE_STATION;
|
|
|
|
|
2010-11-09 01:36:36 +00:00
|
|
|
if (wpa_driver_nl80211_init_nl(drv)) {
|
2010-05-02 22:03:49 +00:00
|
|
|
os_free(drv);
|
2011-11-04 01:05:26 +00:00
|
|
|
@@ -2446,37 +2447,37 @@ wpa_driver_nl80211_finish_drv_init(struc
|
2010-05-02 22:03:49 +00:00
|
|
|
drv->ifindex = if_nametoindex(bss->ifname);
|
|
|
|
drv->first_bss.ifindex = drv->ifindex;
|
|
|
|
|
|
|
|
-#ifndef HOSTAPD
|
2011-11-04 01:05:26 +00:00
|
|
|
- /*
|
|
|
|
- * Make sure the interface starts up in station mode unless this is a
|
|
|
|
- * dynamically added interface (e.g., P2P) that was already configured
|
|
|
|
- * with proper iftype.
|
|
|
|
- */
|
|
|
|
- if ((drv->global == NULL ||
|
|
|
|
- drv->ifindex != drv->global->if_add_ifindex) &&
|
|
|
|
- wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
|
|
|
|
- wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
|
2010-05-02 22:03:49 +00:00
|
|
|
- "use managed mode");
|
2011-11-04 01:05:26 +00:00
|
|
|
- return -1;
|
2010-05-02 22:03:49 +00:00
|
|
|
- }
|
2011-11-04 01:05:26 +00:00
|
|
|
-
|
|
|
|
- if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
|
2010-07-08 18:35:15 +00:00
|
|
|
- if (rfkill_is_blocked(drv->rfkill)) {
|
|
|
|
- wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
|
|
|
|
- "interface '%s' due to rfkill",
|
|
|
|
- bss->ifname);
|
|
|
|
- drv->if_disabled = 1;
|
|
|
|
- send_rfkill_event = 1;
|
|
|
|
- } else {
|
|
|
|
- wpa_printf(MSG_ERROR, "nl80211: Could not set "
|
|
|
|
- "interface '%s' UP", bss->ifname);
|
2011-11-04 01:05:26 +00:00
|
|
|
+ if (drv->nlmode == NL80211_IFTYPE_STATION) {
|
|
|
|
+ /*
|
|
|
|
+ * Make sure the interface starts up in station mode unless this is a
|
|
|
|
+ * dynamically added interface (e.g., P2P) that was already configured
|
|
|
|
+ * with proper iftype.
|
|
|
|
+ */
|
|
|
|
+ if ((drv->global == NULL ||
|
|
|
|
+ drv->ifindex != drv->global->if_add_ifindex) &&
|
|
|
|
+ wpa_driver_nl80211_set_mode(bss, NL80211_IFTYPE_STATION) < 0) {
|
|
|
|
+ wpa_printf(MSG_ERROR, "nl80211: Could not configure driver to "
|
|
|
|
+ "use managed mode");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
- }
|
|
|
|
|
|
|
|
- netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
|
|
|
|
- 1, IF_OPER_DORMANT);
|
|
|
|
-#endif /* HOSTAPD */
|
|
|
|
+ if (linux_set_iface_flags(drv->global->ioctl_sock, bss->ifname, 1)) {
|
2010-07-08 18:35:15 +00:00
|
|
|
+ if (rfkill_is_blocked(drv->rfkill)) {
|
|
|
|
+ wpa_printf(MSG_DEBUG, "nl80211: Could not yet enable "
|
|
|
|
+ "interface '%s' due to rfkill",
|
|
|
|
+ bss->ifname);
|
|
|
|
+ drv->if_disabled = 1;
|
|
|
|
+ send_rfkill_event = 1;
|
|
|
|
+ } else {
|
|
|
|
+ wpa_printf(MSG_ERROR, "nl80211: Could not set "
|
|
|
|
+ "interface '%s' UP", bss->ifname);
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
2011-11-04 01:05:26 +00:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ netlink_send_oper_ifla(drv->global->netlink, drv->ifindex,
|
|
|
|
+ 1, IF_OPER_DORMANT);
|
2010-05-02 22:03:49 +00:00
|
|
|
+ }
|
|
|
|
|
2011-04-02 19:44:47 +00:00
|
|
|
if (wpa_driver_nl80211_capa(drv))
|
2011-01-24 18:54:20 +00:00
|
|
|
return -1;
|