wifi: provide platform specific DTB access

The device-tree binary is normally required on ARM-based platforms
where as on x86 it is omitted. The platform-specific DTB helper
provides a generic interface for accssing the DTB and needs to be
implemented on each platform.

Issue #4813
This commit is contained in:
Josef Söntgen 2023-03-10 16:53:01 +01:00 committed by Christian Helmuth
parent eaaedb6ae8
commit e6ee7d3d4a
4 changed files with 56 additions and 1 deletions

View File

@ -12,6 +12,7 @@ SRC_CC += wlan.cc
SRC_CC += firmware.cc
SRC_CC += socket_call.cc
SRC_CC += lx_emul/random.cc
SRC_CC += dtb_helper.cc
SRC_C += dummies.c
SRC_C += lx_emul.c

View File

@ -0,0 +1,21 @@
/**
* \brief DTB access helper
* \author Josef Soentgen
* \date 2023-04-11
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include "dtb_helper.h"
Dtb_helper::Dtb_helper(Genode::Env &env) : _env { env } { }
void *Dtb_helper::dtb_ptr() { return nullptr; }

View File

@ -0,0 +1,30 @@
/**
* \brief DTB access helper
* \author Josef Soentgen
* \date 2023-04-11
*/
/*
* Copyright (C) 2023 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#ifndef _DTB_HELPER_H_
#define _DTB_HELPER_H_
/* Genode includes */
#include <base/env.h>
struct Dtb_helper
{
Genode::Env &_env;
Dtb_helper(Genode::Env &env);
void *dtb_ptr();
};
#endif /* _DTB_HELPER_H_ */

View File

@ -29,6 +29,7 @@
/* local includes */
#include "lx_user.h"
#include "dtb_helper.h"
using namespace Genode;
@ -155,6 +156,8 @@ struct Wlan
Io_signal_handler<Wlan> _signal_handler { _env.ep(), *this,
&Wlan::_handle_signal };
Dtb_helper _dtb_helper { _env };
void _handle_signal()
{
if (uplink_task_struct_ptr) {
@ -175,7 +178,7 @@ struct Wlan
genode_allocator_ptr(Lx_kit::env().heap),
genode_signal_handler_ptr(_signal_handler));
lx_emul_start_kernel(nullptr);
lx_emul_start_kernel(_dtb_helper.dtb_ptr());
}
};