freebsd11_network: Only start_wlan if FBSD_WLAN_FEATURE is required.

Fixes #8634.
This commit is contained in:
Augustin Cavalier
2018-07-10 18:40:21 -04:00
parent 77cf476567
commit 1a35344427
+5 -3
View File
@@ -453,7 +453,7 @@ device_attach(device_t device)
if (result == 0)
atomic_or(&device->flags, DEVICE_ATTACHED);
if (result == 0)
if (result == 0 && HAIKU_DRIVER_REQUIRES(FBSD_WLAN_FEATURE))
result = start_wlan(device);
return result;
@@ -467,8 +467,10 @@ device_detach(device_t device)
return B_ERROR;
if ((atomic_and(&device->flags, ~DEVICE_ATTACHED) & DEVICE_ATTACHED) != 0
&& device->methods.detach != NULL) {
int result = stop_wlan(device);
&& device->methods.detach != NULL) {
int result = 0;
if (HAIKU_DRIVER_REQUIRES(FBSD_WLAN_FEATURE))
result = stop_wlan(device);
if (result != 0) {
atomic_or(&device->flags, DEVICE_ATTACHED);
return result;