LIBTCPIP:implementing IP offloading

This commit is contained in:
Rémy GIBERT 2016-04-18 22:16:54 +02:00
parent ebb4ef0618
commit 4a47d307c7

View File

@ -82,6 +82,10 @@ NEW.IP.FRAME >PUSHWI K.ETH.FRAME.LEN
bcs .9 bcs .9
>STYA ZPFrameBase1 >STYA ZPFrameBase1
lda DevFlags
and #S.DEVINFO.NET.FLAGS.IPOFFLOAD
bne .9
ldy #S.ETH.ETHERTYPE ldy #S.ETH.ETHERTYPE
lda /S.ETH.ETHERTYPE.IP lda /S.ETH.ETHERTYPE.IP
sta (ZPFrameBase1),y sta (ZPFrameBase1),y
@ -111,7 +115,6 @@ NEW.IP.FRAME >PUSHWI K.ETH.FRAME.LEN
lda #K.IP.TTL lda #K.IP.TTL
sta (ZPFrameBase1),y sta (ZPFrameBase1),y
>LDYA ZPFrameBase1 >LDYA ZPFrameBase1
clc
.9 rts .9 rts
*-------------------------------------- *--------------------------------------
SEND.ICMP.FRAME >PULLW ZPFrameBase1 SEND.ICMP.FRAME >PULLW ZPFrameBase1
@ -163,8 +166,9 @@ SEND.UDP.FRAME.I
SEND.IP.FRAME >PULLW ZPFrameBase1 SEND.IP.FRAME >PULLW ZPFrameBase1
jsr FRM.GetLen1 jsr FRM.GetLen1
stz hFrame1 stz hFrame1
SEND.IP.FRAME.I ldx #3
ldy #S.IP.SRC+3 SEND.IP.FRAME.I ldx #3 Copy SRC.IP even if IP offload
ldy #S.IP.SRC+3 for proper UDP/TCP CRC calculation
.1 lda IPCFG+S.IPCFG.IP,x .1 lda IPCFG+S.IPCFG.IP,x
sta (ZPFrameBase1),y sta (ZPFrameBase1),y
@ -172,6 +176,10 @@ SEND.IP.FRAME.I ldx #3
dex dex
bpl .1 bpl .1
lda DevFlags
and #S.DEVINFO.NET.FLAGS.IPOFFLOAD
bne .21
ldy #S.IP.TOTAL.LENGTH+1 ldy #S.IP.TOTAL.LENGTH+1
lda ZPFrameLen1 lda ZPFrameLen1
sec sec
@ -219,7 +227,7 @@ SEND.IP.FRAME.I ldx #3
eor #$FF eor #$FF
sta (ZPFrameBase1),y sta (ZPFrameBase1),y
ldy #S.IP.PROTOCOL .21 ldy #S.IP.PROTOCOL
lda (ZPFrameBase1),y lda (ZPFrameBase1),y
cmp #S.IP.PROTOCOL.TCP cmp #S.IP.PROTOCOL.TCP
bne .3 bne .3