--- arcether.asm	Wed Oct 25 17:23:26 1995
+++ arcether.asm.new	Wed Oct 25 17:23:15 1995
@@ -1,4 +1,11 @@
 ;History:180,18
+;Jan 11, 1995   Fix packet splitting bug
+;               -- from Avery Pennarun <apenwarr@foxnet.net>
+;Dec 23, 1994   Add patches to fix PC/TCP compatibility, etc
+;               -- from Vladimir Shergin <vsher@sao.stavropol.su>
+;Nov 23, 1994   Increase Increase RST_IVAL from 7 to 14 for PC110.
+;               Let address_len default to 6, not ARCADDR_LEN
+;               -- from Stephen A. Wood <saw@hallc1.cebaf.gov>
 ;Sun Jan 05 22:13:57 1992 increased RST_IVAL from 4 to 7.
 ;Tue Feb 27 10:56:15 1990 send_pkt wasn't timing out properly.
 version equ     1
@@ -46,7 +53,7 @@
 SW_RST          equ     8
 
 ; time needed to do various things (in clock ticks)
-RST_IVAL        equ     7               ;reset
+RST_IVAL        equ     15              ;reset
 SEND_IVAL       equ     4               ;send
 ACK_IVAL        equ     4               ;acknowledge
 
@@ -393,7 +400,7 @@
         mov    ah,al                    ;length in ah for stosw and long frame
         xor    al,al                    ;al=0 indicates non-normal frame
         stosw                           ;
-        mov     al,ah                   ;Move offset to back to al
+        mov     al,ah                   ;Move offset back to al
         xor     ah,ah                   ;
         sub     al,4                    ; -4 Byte for long frame
         add     di,ax                   ;jump over unused bytes
@@ -444,14 +451,17 @@
         cmp    protocol_ID,213          ;ARP and RARP packets differ between
         je     send_arp                 ;ARCnet and Ethernet, because the hardware
         cmp    protocol_ID,214          ;type is 7 for ARCnet and 1 for Ethernet and
-        je     send_ARP                 ;address length are 1 for ARCnet and 6 for Ethernet
+        je     send_arp                 ;address length are 1 for ARCnet and 6 for Ethernet
         cld
-        pop    si                       ;its and IP or IPX packet: just send it
+        pop    si                       ;it's an IP or IPX packet: just send it
         pop    ds                       ;ds:si for movsw
         assume ds:nothing
         push   cx
         call   movemem                  ;und nun noch cx bytes clientdata bertragen   ****
         pop    cx
+;
+        sub    si,4                     ; apenwarr - movemem added too many
+;
         push   ds                       ;the next fragment
         push   si
         mov    ax,cs
@@ -479,7 +489,7 @@
 Send_ARP_loop:                          ;check ARP destination for broadcast
         lodsw
         cmp    ax,0ffffh
-        je     Send_ARP_1
+        jne    Send_ARP_1           ; vsher - changed je to jne
         loop   Send_ARP_loop
         xor    al,al
         jmp    Send_ARP_2
@@ -736,13 +746,14 @@
         cmp     al,213
         jne     recv_new_6
         mov     recv_protocol,0608h     ;ARP Packet
-        mov     cx,42
+        mov     cx,60           ; vsher - changed 42 to 60
+                                            ; (minimum ethernet packet size)
         jmp     recv_new_10
 recv_new_6:
         cmp     al,214
         jne     recv_new_7
         mov     recv_protocol,3580h     ;RARP Packet
-        mov     cx,42
+        mov     cx,60           ; vsher - changed 42 to 60
         jmp     recv_new_10
 
 recv_new_7:
@@ -862,7 +873,8 @@
         stosb
         jmp     recv_client_2
 recv_hw_bcast:
-        mov    ax,0ffffh              ;Target was Broadcast
+;       mov    ax,0ffffh              ;Target was Broadcast
+        mov    ax,0                   ; vsher - proper ARP padding is 0
         mov    cx,3
         rep    stosw
 recv_client_2:
@@ -910,7 +922,8 @@
         public  copyright_msg
 copyright_msg   db      "Packet driver for Novell ARCnet TCP/IP and IPX version ",'0'+(majver / 10),'0'+(majver mod 10),".",'0'+version,CR,LF
                 db      "Portions Copyright 1988 Philip Prindeville",CR,LF
-                db      "Copyright 1991 Martin Wilmes",CR,LF,'$'
+                db      "Copyright 1991 Martin Wilmes",CR,LF
+                db      "Slight modifications by Stephen A. Wood, Vladimir Shergin, and Avery Pennarun",CR,LF,'$'
 
 no_arcnet_msg   db      "No ARCnet found at that address.",CR,LF,'$'
 failed_test_msg db      "Failed self test.",CR,LF,'$'
@@ -1014,9 +1027,15 @@
 etopen_3:
         mov     al,es:[1]
         mov     rom_address[5],al
+        
+; saw -- Removed this - defaulting to 6 makes ethernet emulation work better.
+; Put it back because defaulting to 6 confuses the special ARP transmitter.
+; --apenwarr
         mov     address_len,ARCADDR_LEN
+        
 etopen_2:
-
+        jmp     etopen_4                ; vsher - test flag is not
+                                ;  supported on all cards.
 ;another simple diagnostic:
 ;       force test flag on in RIM,
 ;       check to see that it is set,
