]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Don't accept new ethernet frames when A2065 is getting closed.
authorToni Wilen <twilen@winuae.net>
Sun, 14 Nov 2021 11:31:32 +0000 (13:31 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 14 Nov 2021 11:31:32 +0000 (13:31 +0200)
a2065.cpp

index be76b75f353e23f28fd7f7655135859736c82313..2757fa11c7f6f9dfccc6af5cfee99648f29adbb5 100644 (file)
--- a/a2065.cpp
+++ b/a2065.cpp
@@ -293,6 +293,8 @@ static void gotfunc (void *devv, const uae_u8 *databuf, int len)
        const uae_u8 *dstmac, *srcmac;
        struct s2devstruct *dev = (struct s2devstruct*)devv;
 
+       if (!am_initialized)
+               return;
        if (!am_rdr_rlen)
                return;
 
@@ -455,6 +457,8 @@ static int getfunc (void *devv, uae_u8 *d, int *len)
 {
        struct s2devstruct *dev = (struct s2devstruct*)devv;
 
+       if (!am_initialized)
+               return 0;
        if (transmitlen <= 0)
                return 0;
        if (transmitlen > *len) {
@@ -1019,6 +1023,9 @@ static uae_u32 REGPARAM2 a2065_lgeti (uaecptr addr)
 static void a2065_reset(int hardreset)
 {
        am_initialized = 0;
+
+       ethernet_close(td, sysdata);
+
        for (int i = 0; i < RAP_SIZE; i++)
                csr[i] = 0;
        csr[0] = CSR0_STOP;
@@ -1029,7 +1036,6 @@ static void a2065_reset(int hardreset)
 
        free_expansion_bank(&a2065_bank);
        boardram = NULL;
-       ethernet_close(td, sysdata);
        xfree(sysdata);
        sysdata = NULL;
        td = NULL;