mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-23 04:25:21 +00:00
wifi_drv: add verbose attribute in config node
Among others, the driver will now print the MAC address of the wireless device when 'verbose="yes"' is added to <config>. Issue #1439.
This commit is contained in:
parent
c46e3db4d5
commit
88fc1eee61
@ -15,6 +15,7 @@
|
||||
#include <base/env.h>
|
||||
#include <base/sleep.h>
|
||||
#include <os/attached_rom_dataspace.h>
|
||||
#include <os/config.h>
|
||||
#include <os/server.h>
|
||||
#include <util/xml_node.h>
|
||||
|
||||
@ -27,6 +28,7 @@ extern void wifi_init(Server::Entrypoint &, Genode::Lock &);
|
||||
extern "C" void wpa_conf_reload(void);
|
||||
extern "C" ssize_t wpa_write_conf(char const *, Genode::size_t);
|
||||
|
||||
bool config_verbose = false;
|
||||
|
||||
static Genode::Lock &wpa_startup_lock()
|
||||
{
|
||||
@ -222,6 +224,9 @@ struct Main
|
||||
:
|
||||
_ep(ep)
|
||||
{
|
||||
try {
|
||||
config_verbose = Genode::config()->xml_node().attribute("verbose").has_value("yes");
|
||||
} catch (...) { }
|
||||
_wpa = new (Genode::env()->heap()) Wpa_thread(wpa_startup_lock());
|
||||
|
||||
_wpa->start();
|
||||
|
@ -30,6 +30,7 @@
|
||||
# include <net/cfg80211.h>
|
||||
#include <extern_c_end.h>
|
||||
|
||||
extern bool config_verbose;
|
||||
|
||||
enum {
|
||||
HEAD_ROOM = 128, /* XXX guessed value but works */
|
||||
@ -409,6 +410,11 @@ extern "C" int register_netdevice(struct net_device *ndev)
|
||||
/* set mac adress */
|
||||
Genode::memcpy(ndev->perm_addr, ndev->ieee80211_ptr->wiphy->perm_addr, ETH_ALEN);
|
||||
|
||||
if (config_verbose)
|
||||
PINF("mac_address: %02x:%02x:%02x:%02x:%02x:%02x",
|
||||
ndev->perm_addr[0], ndev->perm_addr[1], ndev->perm_addr[2],
|
||||
ndev->perm_addr[3], ndev->perm_addr[4], ndev->perm_addr[5]);
|
||||
|
||||
int err = ndev->netdev_ops->ndo_open(ndev);
|
||||
if (err) {
|
||||
PERR("ndev->netdev_ops->ndo_open(ndev): %d", err);
|
||||
|
Loading…
x
Reference in New Issue
Block a user