mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-29 23:54:14 +00:00
parent
b7cdb5840a
commit
5516dbcb1f
@ -14,7 +14,6 @@
|
||||
/* Genode includes */
|
||||
#include <base/allocator.h>
|
||||
#include <base/entrypoint.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/signal.h>
|
||||
#include <util/misc_math.h>
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
/* Genode includes */
|
||||
#include <base/allocator.h>
|
||||
#include <base/entrypoint.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/signal.h>
|
||||
#include <irq_session/client.h>
|
||||
#include <util/misc_math.h>
|
||||
|
@ -330,10 +330,10 @@ struct Wifi::Frontend
|
||||
|
||||
Msg_buffer _msg;
|
||||
|
||||
Genode::Lock _notify_lock { Genode::Lock::UNLOCKED };
|
||||
Genode::Blockade _notify_blockade { };
|
||||
|
||||
void _notify_lock_lock() { _notify_lock.lock(); }
|
||||
void _notify_lock_unlock() { _notify_lock.unlock(); }
|
||||
void _notify_lock_lock() { _notify_blockade.block(); }
|
||||
void _notify_lock_unlock() { _notify_blockade.wakeup(); }
|
||||
|
||||
bool _rfkilled { false };
|
||||
|
||||
@ -1568,6 +1568,9 @@ struct Wifi::Frontend
|
||||
_config_rom.sigh(_config_sigh);
|
||||
_scan_timer.sigh(_scan_timer_sigh);
|
||||
|
||||
/* set/initialize as unblocked */
|
||||
_notify_blockade.wakeup();
|
||||
|
||||
try {
|
||||
_ap_reporter.construct(env, "accesspoints", "accesspoints");
|
||||
_ap_reporter->generate([&] (Genode::Xml_generator &xml) { });
|
||||
|
@ -93,7 +93,8 @@ void *wifi_get_buffer(void)
|
||||
|
||||
|
||||
/* exported by wifi.lib.so */
|
||||
extern void wifi_init(Genode::Env&, Genode::Lock&, bool, Genode::Signal_context_capability);
|
||||
extern void wifi_init(Genode::Env&, Genode::Blockade&, bool,
|
||||
Genode::Signal_context_capability);
|
||||
|
||||
|
||||
struct Main
|
||||
@ -103,21 +104,21 @@ struct Main
|
||||
Genode::Constructible<Wpa_thread> _wpa;
|
||||
Genode::Constructible<Wifi::Frontend> _frontend;
|
||||
|
||||
Genode::Lock _wpa_startup_lock { Genode::Lock::LOCKED };
|
||||
Genode::Blockade _wpa_startup_blockade { };
|
||||
|
||||
Main(Genode::Env &env) : env(env)
|
||||
{
|
||||
_frontend.construct(env);
|
||||
_wifi_frontend = &*_frontend;
|
||||
|
||||
_wpa.construct(env, _wpa_startup_lock);
|
||||
_wpa.construct(env, _wpa_startup_blockade);
|
||||
|
||||
/*
|
||||
* Forcefully disable 11n but for convenience the attribute is used the
|
||||
* other way araound.
|
||||
*/
|
||||
bool const disable_11n = !_frontend->use_11n();
|
||||
wifi_init(env, _wpa_startup_lock, disable_11n,
|
||||
wifi_init(env, _wpa_startup_blockade, disable_11n,
|
||||
_frontend->rfkill_sigh());
|
||||
}
|
||||
};
|
||||
|
@ -13,8 +13,8 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/blockade.h>
|
||||
#include <base/env.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/sleep.h>
|
||||
|
||||
/* libc includes */
|
||||
@ -40,14 +40,14 @@ void * Wpa_thread::_entry_trampoline(void *arg)
|
||||
void Wpa_thread::_entry()
|
||||
{
|
||||
/* wait until the wifi driver is up and running */
|
||||
_lock.lock();
|
||||
_blockade.block();
|
||||
_exit = wpa_main();
|
||||
Genode::sleep_forever();
|
||||
}
|
||||
|
||||
|
||||
Wpa_thread::Wpa_thread(Genode::Env &env, Genode::Lock &lock)
|
||||
: _lock(lock), _exit(-1)
|
||||
Wpa_thread::Wpa_thread(Genode::Env &env, Genode::Blockade &blockade)
|
||||
: _blockade(blockade), _exit(-1)
|
||||
{
|
||||
pthread_t tid = 0;
|
||||
if (pthread_create(&tid, 0, _entry_trampoline, this) != 0) {
|
||||
|
@ -17,15 +17,15 @@
|
||||
|
||||
namespace Genode {
|
||||
struct Env;
|
||||
struct Lock;
|
||||
struct Blockade;
|
||||
}
|
||||
|
||||
class Wpa_thread
|
||||
{
|
||||
private:
|
||||
|
||||
Genode::Lock &_lock;
|
||||
int _exit;
|
||||
Genode::Blockade &_blockade;
|
||||
int _exit;
|
||||
|
||||
static void * _entry_trampoline(void *arg);
|
||||
|
||||
@ -33,7 +33,7 @@ class Wpa_thread
|
||||
|
||||
public:
|
||||
|
||||
Wpa_thread(Genode::Env &env, Genode::Lock &lock);
|
||||
Wpa_thread(Genode::Env &, Genode::Blockade &);
|
||||
};
|
||||
|
||||
#endif /* _WIFI__WPA_H_ */
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/env.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/blockade.h>
|
||||
|
||||
/* local includes */
|
||||
#include <firmware_list.h>
|
||||
@ -113,7 +113,7 @@ struct net init_net;
|
||||
LIST_HEAD(net_namespace_list);
|
||||
|
||||
|
||||
static Genode::Lock *_wpa_lock;
|
||||
static Genode::Blockade *_wpa_blockade;
|
||||
|
||||
|
||||
static void run_linux(void *args)
|
||||
@ -146,7 +146,7 @@ static void run_linux(void *args)
|
||||
Genode::sleep_forever();
|
||||
}
|
||||
|
||||
_wpa_lock->unlock();
|
||||
_wpa_blockade->wakeup();
|
||||
|
||||
_lx_init_done = true;
|
||||
|
||||
@ -180,7 +180,7 @@ static void run_linux(void *args)
|
||||
unsigned long jiffies;
|
||||
|
||||
|
||||
void wifi_init(Genode::Env &env, Genode::Lock &lock, bool disable_11n,
|
||||
void wifi_init(Genode::Env &env, Genode::Blockade &blockade, bool disable_11n,
|
||||
Genode::Signal_context_capability rfkill)
|
||||
{
|
||||
Lx_kit::construct_env(env);
|
||||
@ -194,7 +194,7 @@ void wifi_init(Genode::Env &env, Genode::Lock &lock, bool disable_11n,
|
||||
LX_MUTEX_INIT(rfkill_global_mutex);
|
||||
LX_MUTEX_INIT(rtnl_mutex);
|
||||
|
||||
_wpa_lock = &lock;
|
||||
_wpa_blockade = &blockade;
|
||||
|
||||
INIT_LIST_HEAD(&init_net.dev_base_head);
|
||||
/* add init_net namespace to namespace list */
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/env.h>
|
||||
#include <base/lock.h>
|
||||
#include <base/log.h>
|
||||
#include <base/sleep.h>
|
||||
#include <base/thread.h>
|
||||
@ -39,7 +38,6 @@ class Lx_kit::Scheduler : public Lx::Scheduler
|
||||
bool verbose = false;
|
||||
|
||||
Lx_kit::List<Lx::Task> _present_list;
|
||||
Genode::Lock _present_list_mutex;
|
||||
|
||||
Lx::Task *_current = nullptr; /* currently scheduled task */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user