Skip to content

Commit

Permalink
This is version 116 of the Crynwr Packet Driver.
Browse files Browse the repository at this point in the history
Still for 16-bit ISA, not 8-bit.
  • Loading branch information
hackerb9 committed Dec 16, 2019
1 parent 8588673 commit 1cc1ae2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 15 deletions.
48 changes: 35 additions & 13 deletions 3C509.ASM
@@ -1,5 +1,6 @@
version equ 5
;History:1,18
version equ 6
;History:1,1
;Fri Mar 08 14:48:42 2002 Merge in Peter Tattum's 3c509b changes.
;Mon Jan 22 15:09:36 1996 we were rejecting frames with dribble set and accepting other errored frames.

.286
Expand Down Expand Up @@ -405,6 +406,26 @@ xmit:
assume ds:nothing
ret

tx_reset:
push ax
push dx
loadport
setport PORT_CmdStatus
pushf
cli
mov ax,CMD_TXRESET
out dx,ax
tx_reset_1:
in ax,dx ;wait for the command to finish.
test ax,ST_BUSY
jne tx_reset_1
popf

mov ax,CMD_TXENABLE ;yes, re-enable the transmitter.
out dx,ax
pop dx
pop ax
ret

public send_pkt
send_pkt:
Expand All @@ -420,18 +441,15 @@ send_pkt:
loadport
setport PORT_TxStatus ;get the previous transmit status.
in al,dx
or al, al ; Is there anything on the stack
jz nothing_on_stack
out dx, al ; A write clears the entry for the stack
nothing_on_stack:
setport PORT_CmdStatus
test al,TXS_UNDERRUN or TXS_JABBERERROR ;do we need to reset transmitter?
je send_pkt_0
push ax
mov ax,CMD_TXRESET
out dx,ax
pop ax
call tx_reset
send_pkt_0:
; test al,TXS_COMPLETE
; je send_pkt_0_1
; out dx,al
;send_pkt_0_1:

test al,TXS_ERRTYPE ;any errors?
je send_pkt_3 ;no.
Expand All @@ -453,6 +471,7 @@ send_pkt_1:
jae send_pkt_2
call do_timeout
jne send_pkt_1
call tx_reset
mov dh,CANT_SEND ;timed out, can't send.
stc
ret
Expand Down Expand Up @@ -667,7 +686,7 @@ recv_early:
jmp recv_discard ;it isn't.

recv_early_1:
jmp recv_exit
jmp recv_another

;yes, this is dead code. It's only in here to ensure that the setport macro
;has the right value.
Expand Down Expand Up @@ -798,13 +817,15 @@ io_input_done:
recv_discard:
loadport
setport PORT_CmdStatus
pushf
cli
mov ax,CMD_RXDISCARD
out dx,ax

recv_discard_1:
in ax,dx ;wait for the command to finish.
test ax,ST_BUSY
jne recv_discard_1
popf

mov early_bytes,0

Expand Down Expand Up @@ -1081,7 +1102,8 @@ not_10baseT:
out dx,ax

;Enable RX Complete interrupts
mov ax,CMD_SETINTMASK + INT_RXCOMPLETE + INT_RXEARLY
mov ax,CMD_SETINTMASK + INT_RXCOMPLETE
;mov ax,CMD_SETINTMASK + INT_RXCOMPLETE + INT_RXEARLY
out dx,ax

mov ax,CMD_SETRZMASK + 0feh ;Enable all the status bits.
Expand Down
Binary file modified 3C509.COM
Binary file not shown.
1 change: 1 addition & 0 deletions DEFS.ASM
Expand Up @@ -204,4 +204,5 @@ D_OPTION equ 2 ; delayed initialization
N_OPTION equ 4 ; Novell protocol conversion
W_OPTION equ 8 ; Windows upcall checking.
U_OPTION equ 10h ; Terminate the driver.
M_OPTION equ 20h ; Micronetics M

14 changes: 12 additions & 2 deletions TAIL.ASM
@@ -1,6 +1,6 @@
; PC/FTP Packet Driver source, conforming to version 1.05 of the spec
; Updated to version 1.08 Feb. 17, 1989.
; Copyright 1988-1993 Russell Nelson
; Copyright 1988-1996 Russell Nelson

; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -84,6 +84,9 @@ db" -d -- Delayed initialization. Used for diskless booting",CR,LF
db" -n -- NetWare conversion. Converts 802.3 packets into 8137 packets",CR,LF
db" -w -- Windows hack, obsoleted by winpkt",CR,LF
db" -p -- Promiscuous mode disable",CR,LF
if M_OPTION
db" -m -- Micronetics MSM compatibility",CR,LF
endif
db" -u -- Uninstall",CR,LF
db '$'

Expand All @@ -93,7 +96,7 @@ db '$'
extrn copyright_msg: byte

copyleft_msg label byte
db "Packet driver skeleton copyright 1988-95, Crynwr Software.",CR,LF
db "Packet driver skeleton copyright 1988-96, Crynwr Software.",CR,LF
db "This program is freely copyable; source must be available; NO WARRANTY.",CR,LF
db "See the file COPYING.DOC for details; send FAX to +1-315-268-9201 for a copy.",CR,LF
db CR,LF,'$'
Expand Down Expand Up @@ -333,6 +336,13 @@ not_p_opt:
or flagbyte,U_OPTION
jmp chk_options
not_u_opt:
if M_OPTION
cmp al,'m'
jne not_m_opt
or flagbyte,M_OPTION
jmp chk_options
not_m_opt:
endif
cmp al,'i'
jne not_i_opt
cmp word ptr driver_class,BLUEBOOK + IEEE8023*256 ;both present?
Expand Down

0 comments on commit 1cc1ae2

Please sign in to comment.