On PCNet nics enable FCS check and strip via ASTRP_RCV

This commit is contained in:
retu2libc 2024-03-06 02:47:04 -05:00 committed by Arsenic Blood
parent 80ce532072
commit 3809e15849

View file

@ -59,6 +59,7 @@
#define PCNET_INT_TINTM 9 // Transmit Interrupt Mask #define PCNET_INT_TINTM 9 // Transmit Interrupt Mask
#define PCNET_INT_RINTM 10 // Receive Interrupt Mask #define PCNET_INT_RINTM 10 // Receive Interrupt Mask
#define PCNET_FEATURE_ASTRPRCV 10
#define PCNET_FEATURE_APADXMT 11 #define PCNET_FEATURE_APADXMT 11
#define PCNET_BCR_MISC_CONFIG_ASEL 1 #define PCNET_BCR_MISC_CONFIG_ASEL 1
@ -455,7 +456,7 @@ U0 PCNetInterruptCSRSet()
U0 PCNetTXAutoPadEnable() U0 PCNetTXAutoPadEnable()
{/* AMD PCNet datasheet p.1-958 {/* AMD PCNet datasheet p.1-958
Setting bit 11 (Auto Pad Transmit) allows Setting bit 11 (Auto Pad Transmit) allows
shoft transmit frames to be automatically short transmit frames to be automatically
extended to 64 bytes. */ extended to 64 bytes. */
U32 csr = PCNetCSRRead(PCNET_CSR_FEATURECTRL); U32 csr = PCNetCSRRead(PCNET_CSR_FEATURECTRL);
@ -465,6 +466,19 @@ U0 PCNetTXAutoPadEnable()
PCNetCSRWrite(PCNET_CSR_FEATURECTRL, csr); PCNetCSRWrite(PCNET_CSR_FEATURECTRL, csr);
} }
U0 PCNetRXAutoStripEnable()
{/* AMD PCNet datasheet p.1-958
Setting bit 10 (Auto Strip Receive) allows
pad and FCS fields to be automatically
stripped. ONLY WORKS ON 802.3!!! */
U32 csr = PCNetCSRRead(PCNET_CSR_FEATURECTRL);
Bts(&csr, PCNET_FEATURE_ASTRPRCV);
PCNetCSRWrite(PCNET_CSR_FEATURECTRL, csr);
}
U0 PCNetConfigModeExit() U0 PCNetConfigModeExit()
{/* AMD PCNet datasheet p.1-954 {/* AMD PCNet datasheet p.1-954
PCNet controller can be started PCNet controller can be started
@ -749,6 +763,8 @@ U0 PCNetInit()
PCNetTXAutoPadEnable; PCNetTXAutoPadEnable;
PCNetRXAutoStripEnable;
PCNetAutoLinkSelect; PCNetAutoLinkSelect;
PCNetEnableFullDuplex; PCNetEnableFullDuplex;
@ -845,4 +861,4 @@ U0 NetStart()
PCNetCSRWrite(PCNET_CSR_CTRLSTATUS, csr); PCNetCSRWrite(PCNET_CSR_CTRLSTATUS, csr);
} }
PCNetInit; PCNetInit;