From c370e9f71f605c24c523e7d39c6169e0585e4546 Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Thu, 20 Sep 2018 22:49:37 +0200 Subject: [PATCH] phy/model: remove creation/deletion of ethernet tap (now handled by the simulator) --- liteeth/phy/model.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/liteeth/phy/model.py b/liteeth/phy/model.py index 2880952..f2b7328 100644 --- a/liteeth/phy/model.py +++ b/liteeth/phy/model.py @@ -24,13 +24,11 @@ class LiteEthPHYModelCRG(Module, AutoCSR): class LiteEthPHYModel(Module, AutoCSR): - def __init__(self, pads, tap="tap0", ip_address="192.168.1.100"): + def __init__(self, pads): self.dw = 8 self.submodules.crg = LiteEthPHYModelCRG() self.sink = sink = stream.Endpoint(eth_phy_description(8)) self.source = source = stream.Endpoint(eth_phy_description(8)) - self.tap = tap - self.ip_address = ip_address self.comb += [ pads.source_valid.eq(self.sink.valid), @@ -45,13 +43,3 @@ class LiteEthPHYModel(Module, AutoCSR): self.comb += [ self.source.last.eq(~pads.sink_valid & self.source.valid), ] - - # TODO avoid use of os.system - os.system("openvpn --mktun --dev {}".format(self.tap)) - os.system("ifconfig {} {} up".format(self.tap, self.ip_address)) - os.system("mknod /dev/net/{} c 10 200".format(self.tap)) - - def do_exit(self, *args, **kwargs): - # TODO avoid use of os.system - os.system("rm -f /dev/net/{}".format(self.tap)) - os.system("openvpn --rmtun --dev {}".format(self.tap))