nic: remove usage of deprecated env()

This commit includes changes to the Nic::Session_component interface.
We now pass the entire env to the component instead of only ram, rm and
the ep because we need the env to open connections from within the
Session_component implemenation. So far only the cadence_gem driver
needs this, though.

Issue #2280.
This commit is contained in:
Josef Söntgen
2017-02-13 20:51:27 +01:00
committed by Christian Helmuth
parent e6e1d8c144
commit 15821e32ec
28 changed files with 112 additions and 127 deletions

View File

@ -133,11 +133,8 @@ class Openvpn_component : public Tuntap_device,
Openvpn_component(Genode::size_t const tx_buf_size,
Genode::size_t const rx_buf_size,
Genode::Allocator &rx_block_md_alloc,
Genode::Ram_session &ram_session,
Genode::Region_map &region_map,
Genode::Entrypoint &ep)
: Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc,
ram_session, region_map, ep)
Genode::Env &env)
: Session_component(tx_buf_size, rx_buf_size, rx_block_md_alloc, env)
{
char buf[] = { 0x02, 0x00, 0x00, 0x00, 0x00, 0x01 };
_mac_addr = Nic::Mac_address((void*)buf);
@ -236,10 +233,9 @@ class Root : public Genode::Root_component<Openvpn_component, Genode::Single_cli
}
Openvpn_component *component = new (Root::md_alloc())
Openvpn_component(tx_buf_size, rx_buf_size,
_heap,
_env.ram(), _env.rm(),
_env.ep());
Openvpn_component(tx_buf_size,
rx_buf_size,
_heap, _env);
/**
* Setting the pointer in this manner is quite hackish but it has
* to be valid before OpenVPN calls open_tun(), which unfortunatly

View File

@ -14,9 +14,7 @@
/* Genode includes */
#include <base/log.h>
#include <base/snprintf.h>
#include <cap_session/connection.h>
#include <nic_session/rpc_object.h>
#include <os/server.h>
#include <root/component.h>
#include <util/string.h>