diff --git a/repos/dde_linux/README b/repos/dde_linux/README index 83379c7582..6326f2aa96 100644 --- a/repos/dde_linux/README +++ b/repos/dde_linux/README @@ -268,6 +268,10 @@ based component in 'src/app/qt_wifi_connect'. Currently only WPA/WPA2 protection using a pre-shared key is supported. +On certain cards, e.g. Intel Wireless 6200 ABG, it may be necessary to disable +the 11n mode. This can be achieved by setting the 'use_11n' attribute in +the config node to 'no'. + lx_kit ###### diff --git a/repos/dde_linux/src/drivers/wifi/main.cc b/repos/dde_linux/src/drivers/wifi/main.cc index 64daf526f9..279780d83c 100644 --- a/repos/dde_linux/src/drivers/wifi/main.cc +++ b/repos/dde_linux/src/drivers/wifi/main.cc @@ -25,7 +25,7 @@ typedef long long ssize_t; -extern void wifi_init(Genode::Env&, Genode::Lock&); +extern void wifi_init(Genode::Env&, Genode::Lock&, bool); extern "C" void wpa_conf_reload(void); extern "C" ssize_t wpa_write_conf(char const *, Genode::size_t); @@ -232,6 +232,12 @@ struct Main { bool const verbose = config_rom.xml().attribute_value("verbose", false); + /* + * Forcefully disable 11n but for convenience the attribute is used the + * other way araound. + */ + bool const disable_11n = !config_rom.xml().attribute_value("use_11n", true); + wpa = new (&heap) Wpa_thread(env, wpa_startup_lock(), verbose); wpa->start(); @@ -242,7 +248,7 @@ struct Main Genode::warning("could not create Wlan_configration handler"); } - wifi_init(env, wpa_startup_lock()); + wifi_init(env, wpa_startup_lock(), disable_11n); } }; diff --git a/repos/dde_linux/src/lib/wifi/init.cc b/repos/dde_linux/src/lib/wifi/init.cc index 60a1ff27e0..7991de5fe7 100644 --- a/repos/dde_linux/src/lib/wifi/init.cc +++ b/repos/dde_linux/src/lib/wifi/init.cc @@ -43,6 +43,8 @@ extern "C" void module_arc4_init(void); extern "C" void module_chainiv_module_init(void); extern "C" void module_krng_mod_init(void); +extern "C" unsigned int *module_param_11n_disable; + struct workqueue_struct *system_power_efficient_wq; struct workqueue_struct *system_wq; @@ -130,7 +132,7 @@ static void run_linux(void *) unsigned long jiffies; -void wifi_init(Genode::Env &env, Genode::Lock &lock) +void wifi_init(Genode::Env &env, Genode::Lock &lock, bool disable_11n) { Lx_kit::construct_env(env); @@ -150,6 +152,12 @@ void wifi_init(Genode::Env &env, Genode::Lock &lock) Lx::socket_init(env.ep(), Lx_kit::env().heap()); Lx::nic_init(env, Lx_kit::env().heap()); + /* set IWL_DISABLE_HT_ALL if disable 11n is requested */ + if (disable_11n) { + Genode::log("Disable 11n mode"); + *module_param_11n_disable = 1; + } + /* Linux task (handles the initialization only currently) */ static Lx::Task linux(run_linux, nullptr, "linux", Lx::Task::PRIORITY_0, Lx::scheduler());