From: Toni Wilen Date: Sun, 14 Nov 2021 11:31:32 +0000 (+0200) Subject: Don't accept new ethernet frames when A2065 is getting closed. X-Git-Tag: 4900~20 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=342b27ca57330dbe2efad673076654139f9a728a;p=francis%2Fwinuae.git Don't accept new ethernet frames when A2065 is getting closed. --- diff --git a/a2065.cpp b/a2065.cpp index be76b75f..2757fa11 100644 --- 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;