--- nono/vm/ethernet.h 2026/04/29 17:05:10 1.1.1.8 +++ nono/vm/ethernet.h 2026/04/29 17:05:46 1.1.1.14 @@ -15,8 +15,8 @@ // | // +--------+-------+ // v v -// LanceDevice RTL8019Device -// (LUNA, AM7990) (X68000, RTL8019) +// LanceDevice RTL8019ASDevice +// (LUNA, AM7990) (X68000, RTL8019AS) #pragma once @@ -29,29 +29,23 @@ class EthernetDevice : public IODevice { using inherited = IODevice; protected: - EthernetDevice(const std::string& objname_); + explicit EthernetDevice(uint objid_); public: - virtual ~EthernetDevice() override; + ~EthernetDevice() override; bool Create() override; - // MAC アドレスを取得 - macaddr_t GetMacAddr() const { - return macaddr; - } - - // ホストデバイスを取得する。Create() 完了後から使用可能。 - // (ステータスパネルが呼び出す) - HostNetDevice *GetHostNet() const { return hostnet.get(); } + // 設定から MAC アドレスを取得するヘルパー関数。 + // (MAC アドレスを保持するデバイスが呼ぶ) + static bool GetConfigMacAddr(uint n, MacAddr *dst, bool accept_rom); + + // CRC32 を計算する。 + static uint32 CRC32(const uint8 *buf, size_t buflen); + static uint32 CRC32(const MacAddr& mac); protected: // ホストスレッドからの受信通知 - void HostRxCallback(); - - // MAC アドレス - macaddr_t macaddr {}; + void HostRxCallback(uint32); std::unique_ptr hostnet /*{}*/; }; - -extern EthernetDevice *gEthernet;