Remove NIC server role from drivers

* Remove "mode" attribute utility and XML description
* Remove unused nic/stat.h header

Fix genodelabs/genode#3961
This commit is contained in:
Stefan Kalkowski 2022-04-26 13:03:33 +02:00 committed by Christian Helmuth
parent e3d08893b7
commit 18dcf8af68
7 changed files with 4 additions and 130 deletions

View File

@ -3,7 +3,7 @@
<requires> <uplink/> <usb/> <rm/> </requires> <requires> <uplink/> <usb/> <rm/> </requires>
<provides> <terminal/> </provides> <provides> <terminal/> </provides>
<config mac="02:00:00:00:01:01" mode="uplink_client"/> <config mac="02:00:00:00:01:01"/>
<content> <content>
<rom label="ld.lib.so"/> <rom label="ld.lib.so"/>

View File

@ -17,9 +17,6 @@
/* Genode includes */ /* Genode includes */
#include <base/allocator.h> #include <base/allocator.h>
/* NIC driver includes */
#include <drivers/nic/mode.h>
/* local includes */ /* local includes */
#include <legacy/lx_kit/scheduler.h> #include <legacy/lx_kit/scheduler.h>

View File

@ -65,7 +65,7 @@ append config {
<vfs> <vfs>
<dir name="dev"> <dir name="dev">
<log/> <log/>
<tap name="tap0" mac="02:02:00:00:00:20" mode="uplink_client"/> <tap name="tap0" mac="02:02:00:00:00:20"/>
</dir> </dir>
</vfs> </vfs>
</config> </config>

View File

@ -1,64 +0,0 @@
/*
* \brief Interface to create statistic about received and transmitted
* packets of NIC components
* \author Alexander Boettcher
* \date 2013-03-26
*/
/*
* Copyright (C) 2013-2017 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _INCLUDE__NIC__STAT_H_
#define _INCLUDE__NIC__STAT_H_
#include <base/stdint.h>
#include <net/ethernet.h>
#include <timer_session/connection.h>
namespace Nic { class Measurement; }
class Nic::Measurement
{
private:
Timer::Connection &_timer;
Net::Mac_address _mac { };
struct stat
{
Genode::uint64_t size;
unsigned long count;
} _stat { 0, 0 }, _drop { 0, 0 };
Genode::addr_t _timestamp;
enum status {
FOR_US,
IS_MAGIC,
UNKNOWN
};
enum status _check(Net::Ethernet_frame *, Genode::size_t);
public:
Measurement(Timer::Connection &timer)
:
_timer(timer), _timestamp(0)
{ }
void set_mac(void * mac)
{
Genode::memcpy(_mac.addr, mac, 6);
}
void data(Net::Ethernet_frame *, Genode::size_t);
};
#endif /* _INCLUDE__NIC__STAT_H_ */

View File

@ -1,46 +0,0 @@
/*
* \brief NIC driver mode regarding the session used for packet transmission
* \author Martin Stein
* \date 2020-12-07
*/
/*
* Copyright (C) 2020 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _DRIVERS__NIC__MODE_H_
#define _DRIVERS__NIC__MODE_H_
/* Genode includes */
#include <util/xml_node.h>
namespace Genode
{
enum class Nic_driver_mode { NIC_SERVER, UPLINK_CLIENT };
inline Nic_driver_mode read_nic_driver_mode(Xml_node const &driver_cfg)
{
String<16> const mode_str {
driver_cfg.attribute_value("mode", String<16>("default")) };
if (mode_str == "nic_server") {
return Nic_driver_mode::NIC_SERVER;
}
if (mode_str == "uplink_client") {
return Nic_driver_mode::UPLINK_CLIENT;
}
if (mode_str == "default") {
return Nic_driver_mode::NIC_SERVER;
}
class Bad_mode { };
throw Bad_mode { };
}
}
#endif /* _DRIVERS__NIC__MODE_H_ */

View File

@ -1,4 +1,4 @@
The VFS TAP plugin offers access to Genode's Uplink or Nic session by providing The VFS TAP plugin offers access to Genode's Uplink by providing
a special file system. It exposes a data file that reflects a _/dev/tap0_ a special file system. It exposes a data file that reflects a _/dev/tap0_
file. The support of I/O control operations is provided in form of a structured file. The support of I/O control operations is provided in form of a structured
'info' file located in the directory named after the data file, e.g. 'info' file located in the directory named after the data file, e.g.
@ -18,11 +18,9 @@ presents all files:
When mounting the tap file system, the following optional attributes may When mounting the tap file system, the following optional attributes may
be provided: be provided:
* :mode: If set to "uplink_client", the plugin will open an Uplink session
instead of a Nic session.
* :label: Sets the session label of the Uplink/Nic session. If not provided, * :label: Sets the session label of the Uplink/Nic session. If not provided,
an empty label is used. an empty label is used.
* :mac: Sets the default mac address when mode="uplink_client". * :mac: Sets the default mac address.
The following config snippet illustrates its configuration: The following config snippet illustrates its configuration:

View File

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:simpleType name="Nic_driver_mode">
<xs:restriction base="xs:string">
<xs:enumeration value="nic_server" />
<xs:enumeration value="uplink_client" />
</xs:restriction>
</xs:simpleType><!-- Nic_driver_mode -->
</xs:schema>