From 18dcf8af687bbedcc1224b6646e555fcec1d9629 Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Tue, 26 Apr 2022 13:03:33 +0200 Subject: [PATCH] Remove NIC server role from drivers * Remove "mode" attribute utility and XML description * Remove unused nic/stat.h header Fix genodelabs/genode#3961 --- .../recipes/pkg/usb_modem_drv/runtime | 2 +- repos/dde_linux/src/lib/legacy/wifi/lx.h | 3 - repos/libports/run/libc_vfs_tap.run | 2 +- repos/os/include/nic/stat.h | 64 ------------------- .../drivers/nic/include/drivers/nic/mode.h | 46 ------------- repos/os/src/lib/vfs/tap/README | 6 +- repos/os/xsd/nic_driver_types.xsd | 11 ---- 7 files changed, 4 insertions(+), 130 deletions(-) delete mode 100644 repos/os/include/nic/stat.h delete mode 100644 repos/os/src/drivers/nic/include/drivers/nic/mode.h delete mode 100644 repos/os/xsd/nic_driver_types.xsd diff --git a/repos/dde_linux/recipes/pkg/usb_modem_drv/runtime b/repos/dde_linux/recipes/pkg/usb_modem_drv/runtime index b21bb5c4f6..6af5aa884d 100644 --- a/repos/dde_linux/recipes/pkg/usb_modem_drv/runtime +++ b/repos/dde_linux/recipes/pkg/usb_modem_drv/runtime @@ -3,7 +3,7 @@ - + diff --git a/repos/dde_linux/src/lib/legacy/wifi/lx.h b/repos/dde_linux/src/lib/legacy/wifi/lx.h index ab2cc72eab..b86a92106b 100644 --- a/repos/dde_linux/src/lib/legacy/wifi/lx.h +++ b/repos/dde_linux/src/lib/legacy/wifi/lx.h @@ -17,9 +17,6 @@ /* Genode includes */ #include -/* NIC driver includes */ -#include - /* local includes */ #include diff --git a/repos/libports/run/libc_vfs_tap.run b/repos/libports/run/libc_vfs_tap.run index 54a8134694..acdf52707f 100644 --- a/repos/libports/run/libc_vfs_tap.run +++ b/repos/libports/run/libc_vfs_tap.run @@ -65,7 +65,7 @@ append config { - + diff --git a/repos/os/include/nic/stat.h b/repos/os/include/nic/stat.h deleted file mode 100644 index b0bec4c03d..0000000000 --- a/repos/os/include/nic/stat.h +++ /dev/null @@ -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 -#include - -#include - -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_ */ diff --git a/repos/os/src/drivers/nic/include/drivers/nic/mode.h b/repos/os/src/drivers/nic/include/drivers/nic/mode.h deleted file mode 100644 index 6d971cfacf..0000000000 --- a/repos/os/src/drivers/nic/include/drivers/nic/mode.h +++ /dev/null @@ -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 - -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_ */ diff --git a/repos/os/src/lib/vfs/tap/README b/repos/os/src/lib/vfs/tap/README index a712247c60..0f4d8d340a 100644 --- a/repos/os/src/lib/vfs/tap/README +++ b/repos/os/src/lib/vfs/tap/README @@ -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_ 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. @@ -18,11 +18,9 @@ presents all files: When mounting the tap file system, the following optional attributes may 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, 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: diff --git a/repos/os/xsd/nic_driver_types.xsd b/repos/os/xsd/nic_driver_types.xsd deleted file mode 100644 index 24ab807827..0000000000 --- a/repos/os/xsd/nic_driver_types.xsd +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - -