2016-08-25 17:48:53 +02:00
|
|
|
/*
|
2016-09-12 12:55:12 +02:00
|
|
|
* \brief Uplink interface in form of a NIC session component
|
|
|
|
* \author Martin Stein
|
|
|
|
* \date 2016-08-23
|
2016-08-25 17:48:53 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2016-09-12 12:55:12 +02:00
|
|
|
* Copyright (C) 2016 Genode Labs GmbH
|
2016-08-25 17:48:53 +02:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Genode includes */
|
|
|
|
#include <base/env.h>
|
|
|
|
#include <net/ethernet.h>
|
|
|
|
|
|
|
|
/* local includes */
|
|
|
|
#include <uplink.h>
|
2016-09-12 12:55:12 +02:00
|
|
|
#include <configuration.h>
|
2016-08-25 17:48:53 +02:00
|
|
|
|
|
|
|
using namespace Net;
|
|
|
|
using namespace Genode;
|
|
|
|
|
|
|
|
|
2016-09-12 12:55:12 +02:00
|
|
|
Net::Uplink::Uplink(Entrypoint &ep,
|
|
|
|
Genode::Timer &timer,
|
|
|
|
Genode::Allocator &alloc,
|
|
|
|
Configuration &config)
|
2016-08-25 17:48:53 +02:00
|
|
|
:
|
2016-09-12 12:55:12 +02:00
|
|
|
Nic::Packet_allocator(&alloc),
|
2016-08-25 17:48:53 +02:00
|
|
|
Nic::Connection(this, BUF_SIZE, BUF_SIZE),
|
2016-09-12 12:55:12 +02:00
|
|
|
Interface(ep, timer, mac_address(), alloc, Mac_address(),
|
|
|
|
config.domains().find_by_name(Cstring("uplink")))
|
2016-08-25 17:48:53 +02:00
|
|
|
{
|
|
|
|
rx_channel()->sigh_ready_to_ack(_sink_ack);
|
|
|
|
rx_channel()->sigh_packet_avail(_sink_submit);
|
|
|
|
tx_channel()->sigh_ack_avail(_source_ack);
|
|
|
|
tx_channel()->sigh_ready_to_submit(_source_submit);
|
|
|
|
}
|