3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-29 13:59:24 +01:00

manager: Disable touching interfaces for some drivers

Blacklist some drivers known to crash when interfaces are deleted or
created so that we don't even attempt that before falling back to using
the default interface.
This commit is contained in:
Andrew Zaborowski 2019-05-08 03:15:27 +02:00 committed by Denis Kenzior
parent ac2eeab570
commit 36c08b9508

View File

@ -62,6 +62,23 @@ struct wiphy_setup_state {
static struct l_queue *pending_wiphys; static struct l_queue *pending_wiphys;
/* With these drivers don't even try creating our interfaces */
const char *default_if_driver_list[] = {
/*
* The out-of-tree rtl88x2bu crashes the kernel hard. Seemingly
* many other drivers are built from the same source code so
* blacklist all of them. Unfortunately there are in-tree drivers
* that also match these names and may be fine. Use
* use_default_interface to override.
*/
"rtl81*",
"rtl87*",
"rtl88*",
"rtw_*",
NULL,
};
static void wiphy_setup_state_free(void *data) static void wiphy_setup_state_free(void *data)
{ {
struct wiphy_setup_state *state = data; struct wiphy_setup_state *state = data;
@ -383,6 +400,7 @@ static struct wiphy_setup_state *manager_rx_cmd_new_wiphy(
struct l_genl_attr attr; struct l_genl_attr attr;
uint32_t id; uint32_t id;
const char *name; const char *name;
const char *driver, **driver_bad;
bool use_default; bool use_default;
const struct l_settings *settings = iwd_get_config(); const struct l_settings *settings = iwd_get_config();
@ -421,6 +439,12 @@ static struct wiphy_setup_state *manager_rx_cmd_new_wiphy(
state->wiphy = wiphy; state->wiphy = wiphy;
l_queue_push_tail(pending_wiphys, state); l_queue_push_tail(pending_wiphys, state);
driver = wiphy_get_driver(wiphy);
for (driver_bad = default_if_driver_list; *driver_bad; driver_bad++)
if (fnmatch(*driver_bad, driver, 0) == 0)
state->use_default = true;
/* /*
* If whitelist/blacklist were given only try to use existing * If whitelist/blacklist were given only try to use existing
* interfaces same as when the driver does not support NEW_INTERFACE * interfaces same as when the driver does not support NEW_INTERFACE