DEV9: Add adapter reset function

This commit is contained in:
TheLastRar 2021-10-25 19:39:02 +01:00 committed by refractionpcsx2
parent 284ec35699
commit b23873e0ed
3 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,12 @@ void tx_put(NetPacket* pkt)
//pkt must be copied if its not processed by here, since it can be allocated on the callers stack
}
void ad_reset()
{
if (nif != nullptr)
nif->reset();
}
NetAdapter* GetNetAdapter()
{
NetAdapter* na = nullptr;

View File

@ -117,6 +117,7 @@ public:
virtual bool isInitialised() = 0;
virtual bool recv(NetPacket* pkt); //gets a packet
virtual bool send(NetPacket* pkt); //sends the packet and deletes it when done
virtual void reset(){};
virtual void reloadSettings() = 0;
virtual void close(){};
virtual ~NetAdapter();
@ -145,6 +146,8 @@ private:
};
void tx_put(NetPacket* ptr);
void ad_reset();
void InitNet();
void ReconfigureLiveNet(const Pcsx2Config& old_config);
void TermNet();

View File

@ -267,6 +267,7 @@ void emac3_write(u32 addr)
if (value == 0x380f0000)
{
Console.WriteLn("DEV9: Adapter Detection Hack - Resetting RX/TX");
ad_reset();
_DEV9irq(SMAP_INTR_RXEND | SMAP_INTR_TXEND | SMAP_INTR_TXDNV, 5);
}
break;