--- nono/vm/rtl8019as.h 2026/04/29 17:05:29 1.1.1.3 +++ nono/vm/rtl8019as.h 2026/04/29 17:06:01 1.1.1.7 @@ -11,10 +11,8 @@ #pragma once #include "ethernet.h" -#include "event.h" #include "hostnet.h" #include "message.h" -#include "monitor.h" class InterruptDevice; @@ -238,7 +236,7 @@ struct RTL8019 }; }; -class RTL8019ASDevice : public EthernetDevice +class RTL8019ASDevice : public EthernetDevice, public IHWAddrFilter { using inherited = EthernetDevice; @@ -271,6 +269,8 @@ class RTL8019ASDevice : public EthernetD busdata InterruptAcknowledge(); + int HWAddrFilter(const MacAddr& dstaddr) const override; + private: static inline uint32 Decoder(uint32 addr); @@ -339,7 +339,7 @@ class RTL8019ASDevice : public EthernetD uint32 PeekINTR() const; uint32 PeekDMA(uint32 a0) const; - DECLARE_MONITOR_CALLBACK(MonitorUpdate); + DECLARE_MONITOR_SCREEN(MonitorScreen); void MonitorReg(TextScreen&, int, int, uint32, const char * const *names); void Reset(); @@ -360,16 +360,16 @@ class RTL8019ASDevice : public EthernetD // 送信 void Transmit(); - void TXEvent(Event&); + void TXEvent(Event *); // 受信 void RxMessage(MessageID msgid, uint32 arg); - void RXEvent(Event&); + void RXEvent(Event *); void RXHead(); - void RXCopy(Event&, uint remain); - void RXDone(Event&); + void RXCopy(Event *, uint remain); + void RXDone(Event *); - void TXLedEvent(Event&); - void RXLedEvent(Event&); + void TXLedEvent(Event *); + void RXLedEvent(Event *); void IncCounter(int n); @@ -440,8 +440,8 @@ class RTL8019ASDevice : public EthernetD uint16 local_addr {}; // CLDA: 書き込み位置 uint16 next_page_addr {}; // 次パケットの受信開始位置 - macaddr_t par {}; - std::array mar {}; + MacAddr par {}; + uint64 mar {}; std::array error_counter {}; // 9346CR @@ -467,18 +467,18 @@ class RTL8019ASDevice : public EthernetD bool tx_led {}; bool rx_led {}; - Monitor monitor { this }; + Monitor *monitor {}; - Event tx_event { this }; - Event rx_event { this }; - Event txled_event { this }; - Event rxled_event { this }; + Event *tx_event {}; + Event *rx_event {}; + Event *txled_event {}; + Event *rxled_event {}; InterruptDevice *interrupt {}; static const char * const regnames[]; }; -static inline RTL8019ASDevice *GetRTL8019ASDevice(int n) { +inline RTL8019ASDevice *GetRTL8019ASDevice(int n) { return Object::GetObject(OBJ_ETHERNET(n)); }