From: Florent Kermarrec Date: Fri, 30 Jan 2015 11:06:56 +0000 (+0100) Subject: arp: little clean up X-Git-Tag: 24jan2021_ls180~2604^2~103 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=41ead49c7631fba18782e40894862348699273cc;p=litex.git arp: little clean up --- diff --git a/liteeth/arp/__init__.py b/liteeth/arp/__init__.py index 1fe170bf..4e5af42e 100644 --- a/liteeth/arp/__init__.py +++ b/liteeth/arp/__init__.py @@ -2,14 +2,12 @@ from liteeth.common import * from liteeth.generic.depacketizer import LiteEthDepacketizer from liteeth.generic.packetizer import LiteEthPacketizer -def _arp_table_description(): - layout = [ +_arp_table_layout = [ ("reply", 1), ("request", 1), ("ip_address", 32), ("mac_address", 48) ] - return EndpointDescription(layout, packetized=False) class LiteEthARPDepacketizer(LiteEthDepacketizer): def __init__(self): @@ -27,14 +25,9 @@ class LiteEthARPPacketizer(LiteEthPacketizer): arp_header, arp_header_len) -class LiteSATACommandTX(Module): - def __init__(self, transport): - self.sink = sink = Sink(command_tx_description(32)) - - class LiteEthARPTX(Module): def __init__(self, mac_address, ip_address): - self.sink = sink = Sink(_arp_table_description()) + self.sink = sink = Sink(_arp_table_layout) self.source = Source(eth_mac_description(8)) ### packetizer = LiteEthARPPacketizer() @@ -91,7 +84,7 @@ class LiteEthARPTX(Module): class LiteEthARPRX(Module): def __init__(self, mac_address, ip_address): self.sink = Sink(eth_mac_description(8)) - self.source = source = Source(_arp_table_description()) + self.source = source = Source(_arp_table_layout) ### depacketizer = LiteEthARPDepacketizer() self.submodules += depacketizer @@ -152,8 +145,8 @@ arp_table_response_layout = [ class LiteEthARPTable(Module): def __init__(self): - self.sink = sink = Sink(_arp_table_description()) # from arp_rx - self.source = source = Source(_arp_table_description()) # to arp_tx + self.sink = sink = Sink(_arp_table_layout) # from arp_rx + self.source = source = Source(_arp_table_layout) # to arp_tx # Request/Response interface self.request = request = Sink(arp_table_request_layout)