From dd0f5b33a34400fc1f7ffa67988f63c2ee1c14f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20E=C3=9Fer?= Date: Wed, 18 Dec 1996 01:20:32 +0000 Subject: [PATCH] Add code to fill the EEPROM buffer with default values, if no EEPROM was found, or if there was a checksum mismatch. This patch should allow the driver to be used with any AMD 53c974 based SCSI card, or with the AMD SCSI+Ethernet Combo Chip found on some motherboards. --- sys/pci/tek390.c | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/sys/pci/tek390.c b/sys/pci/tek390.c index 5139a0fc12d2..54dfaac00067 100644 --- a/sys/pci/tek390.c +++ b/sys/pci/tek390.c @@ -150,6 +150,7 @@ UCHAR DC390_EEpromInDO( USHORT mechnum ); USHORT EEpromGetData1( USHORT mechnum ); void DC390_Prepare( USHORT mechnum, PUCHAR regval, UCHAR EEpromCmd ); void DC390_ReadEEprom( USHORT mechnum, USHORT index ); +USHORT DC390_DefaultEEprom( USHORT mechnum, USHORT index ); USHORT DC390_CheckEEpromCheckSum( USHORT MechNum, USHORT index ); USHORT DC390_ToMech( USHORT Mechnum, pcici_t config_id ); @@ -1491,6 +1492,26 @@ DC390_ReadEEprom( USHORT mechnum, USHORT index ) } +USHORT +DC390_DefaultEEprom( USHORT mechnum, USHORT index ) +{ + PUCHAR ptr; + USHORT i; + + ptr = (PUCHAR) &eepromBuf[index][0]; + bzero (ptr, sizeof eepromBuf[index]); + for(i=0; i<0x40; i++) + { + *ptr = (TAG_QUEUING_|EN_DISCONNECT_|SYNC_NEGO_|PARITY_CHK_); + ptr += 4; + } + ptr[EE_ADAPT_SCSI_ID] = 7; + ptr[EE_MODE2] = (LUN_CHECK|ACTIVE_NEGATION); + ptr[EE_TAG_CMD_NUM] = 4; + return 0; +} + + USHORT DC390_CheckEEpromCheckSum( USHORT MechNum, USHORT index ) { @@ -1505,7 +1526,7 @@ DC390_CheckEEpromCheckSum( USHORT MechNum, USHORT index ) if( wval == 0x1234 ) rc = 0; else - rc = -1; + rc = DC390_DefaultEEprom( MechNum, index); return( rc ); }