diff options
author | se <se@FreeBSD.org> | 1996-12-18 01:20:32 +0000 |
---|---|---|
committer | se <se@FreeBSD.org> | 1996-12-18 01:20:32 +0000 |
commit | 01c190132fd4c2cd31fe87c3edea44a822e83c65 (patch) | |
tree | 78b4198e1bd1180d906f128d13ab9b9d93e94dbe /sys | |
parent | 6011895ddf0de35451f224393395e006da6a334f (diff) | |
download | FreeBSD-src-01c190132fd4c2cd31fe87c3edea44a822e83c65.zip FreeBSD-src-01c190132fd4c2cd31fe87c3edea44a822e83c65.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/pci/tek390.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/pci/tek390.c b/sys/pci/tek390.c index 5139a0f..54dfaac 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 ); @@ -1492,6 +1493,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 ) { USHORT wval, rc, *ptr; @@ -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 ); } |