pc/wifi: remove redundant Genode:: prefix

This commit is contained in:
Christian Helmuth 2023-02-07 16:34:32 +01:00
parent de9ea43616
commit 21a9527686
3 changed files with 36 additions and 30 deletions

View File

@ -20,6 +20,9 @@
#include <firmware_list.h>
using namespace Genode;
Firmware_list fw_list[] = {
{ "regulatory.db", 4144, nullptr },
{ "regulatory.db.p7s", 1182, nullptr },
@ -72,7 +75,7 @@ extern "C" int lx_emul_request_firmware_nowait(const char *name, void **dest,
/* only try to load known firmware images */
Firmware_list *fwl = 0;
for (size_t i = 0; i < fw_list_len; i++) {
if (Genode::strcmp(name, fw_list[i].requested_name) == 0) {
if (strcmp(name, fw_list[i].requested_name) == 0) {
fwl = &fw_list[i];
break;
}
@ -80,18 +83,18 @@ extern "C" int lx_emul_request_firmware_nowait(const char *name, void **dest,
if (!fwl ) {
if (warn)
Genode::error("firmware '", name, "' is not in the firmware white list");
error("firmware '", name, "' is not in the firmware white list");
return -1;
}
char const *fw_name = fwl->available_name
? fwl->available_name : fwl->requested_name;
Genode::Rom_connection rom(Lx_kit::env().env, fw_name);
Genode::Dataspace_capability ds_cap = rom.dataspace();
Rom_connection rom(Lx_kit::env().env, fw_name);
Dataspace_capability ds_cap = rom.dataspace();
if (!ds_cap.valid()) {
Genode::error("could not get firmware ROM dataspace");
error("could not get firmware ROM dataspace");
return -1;
}
@ -101,7 +104,7 @@ extern "C" int lx_emul_request_firmware_nowait(const char *name, void **dest,
return -1;
void const *image = Lx_kit::env().env.rm().attach(ds_cap);
Genode::memcpy(data, image, fwl->size);
memcpy(data, image, fwl->size);
Lx_kit::env().env.rm().detach(image);
*dest = data;

View File

@ -27,6 +27,10 @@
#include "lx_socket_call.h"
#include "libc_errno.h"
using namespace Genode;
/*
* The values were taken from 'uapi/asm-generic/socket.h',
* 'uapi/linux/netlink.h' and 'linux/socket.h' and must be
@ -97,7 +101,7 @@ static int convert_errno_from_linux(int linux_errno)
case ENOENT: return -(int)Libc::Errno::BSD_ENOENT;
case ENOEXEC: return -(int)Libc::Errno::BSD_ENOEXEC;
case ENOLINK:
Genode::error("ENOLINK (", (int) ENOLINK, ") -> ", (int)Libc::Errno::BSD_ENOLINK);
error("ENOLINK (", (int) ENOLINK, ") -> ", (int)Libc::Errno::BSD_ENOLINK);
return -(int)Libc::Errno::BSD_ENOLINK;
case ENOMEM: return -(int)Libc::Errno::BSD_ENOMEM;
case ENOMSG: return -(int)Libc::Errno::BSD_ENOMSG;
@ -122,7 +126,7 @@ static int convert_errno_from_linux(int linux_errno)
case ETIMEDOUT: return -(int)Libc::Errno::BSD_ETIMEDOUT;
case EXDEV: return -(int)Libc::Errno::BSD_EXDEV;
default:
Genode::error(__func__, ": unhandled errno ", linux_errno);
error(__func__, ": unhandled errno ", linux_errno);
return linux_errno;
}
}
@ -142,7 +146,7 @@ struct Wifi::Socket
explicit Socket(void *s) : socket(s) { }
void print(Genode::Output &out) const
void print(Output &out) const
{
Genode::print(out, "this: ", this, " socket: ", socket, " non_block: ", non_block);
}
@ -216,7 +220,7 @@ struct Call
};
static Call _call;
static Genode::Semaphore _block;
static Semaphore _block;
namespace Lx {
@ -235,10 +239,10 @@ class Lx::Socket
Socket(const Socket&) = delete;
Socket& operator=(const Socket&) = delete;
Genode::Signal_transmitter _sender { };
Genode::Signal_handler<Lx::Socket> _dispatcher;
Signal_transmitter _sender { };
Signal_handler<Lx::Socket> _dispatcher;
Genode::Signal_handler<Lx::Socket> _dispatcher_blockade;
Signal_handler<Lx::Socket> _dispatcher_blockade;
struct socket *_sock_poll_table[Wifi::MAX_POLL_SOCKETS] { };
@ -246,7 +250,7 @@ class Lx::Socket
{
struct socket *sock = static_cast<struct socket*>(_call.handle->socket);
if (!sock)
Genode::error("BUG: sock is zero");
error("BUG: sock is zero");
return sock;
}
@ -327,11 +331,11 @@ class Lx::Socket
if (!addr)
return;
Genode::size_t const copy = 6 > _call.get_mac_address.addr_len
size_t const copy = 6 > _call.get_mac_address.addr_len
? _call.get_mac_address.addr_len
: 6;
Genode::memcpy(_call.get_mac_address.addr, addr, copy);
memcpy(_call.get_mac_address.addr, addr, copy);
}
void _do_poll_all()
@ -421,7 +425,7 @@ class Lx::Socket
public:
Socket(Genode::Entrypoint &ep)
Socket(Entrypoint &ep)
:
_dispatcher(ep, *this, &Lx::Socket::_handle),
_dispatcher_blockade(ep, *this, &Lx::Socket::_handle_blockade)
@ -472,7 +476,7 @@ static Lx::Socket *_socket;
/* implemented in wlan.cc */
extern Genode::Blockade *wpa_blockade;
extern Blockade *wpa_blockade;
/* implemented in wlan.cc */
void _wifi_report_mac_address(Net::Mac_address const &mac_address);
@ -547,7 +551,7 @@ int Socket_call::close(Socket *s)
_socket->submit_and_block();
if (_call.err)
Genode::warning("closing socket failed: ", _call.err);
warning("closing socket failed: ", _call.err);
destroy(Lx_kit::env().heap, s);
return _call.err;

View File

@ -36,7 +36,7 @@ using namespace Genode;
extern "C" int lx_emul_rfkill_get_any(void);
extern "C" void lx_emul_rfkill_switch_all(int blocked);
static Genode::Signal_context_capability _rfkill_sigh_cap;
static Signal_context_capability _rfkill_sigh_cap;
bool _wifi_get_rfkill(void)
@ -68,7 +68,7 @@ void _wifi_set_rfkill(bool blocked)
lx_emul_task_unblock(uplink_task_struct_ptr);
Lx_kit::env().scheduler.schedule();
Genode::Signal_transmitter(_rfkill_sigh_cap).submit();
Signal_transmitter(_rfkill_sigh_cap).submit();
}
@ -180,11 +180,10 @@ struct Wlan
};
Genode::Blockade *wpa_blockade;
Blockade *wpa_blockade;
void wifi_init(Genode::Env &env,
Genode::Blockade &blockade)
void wifi_init(Env &env, Blockade &blockade)
{
wpa_blockade = &blockade;
@ -192,7 +191,7 @@ void wifi_init(Genode::Env &env,
}
void wifi_set_rfkill_sigh(Genode::Signal_context_capability cap)
void wifi_set_rfkill_sigh(Signal_context_capability cap)
{
_rfkill_sigh_cap = cap;
}