kernels/linux-2.4.0/drivers/scsi/ips.c
/****************************************************************************/
/*                                                                          */
/* Routine Name: ips_verify_bios_memio                                      */
/*                                                                          */
/* Routine Description:                                                     */
/*   Verify the BIOS on the adapter                                         */
/*                                                                          */
/****************************************************************************/


Routine Description:
Verify the BIOS on the adapter
Routine Description : Verify the BIOS on the adapter
static int
ips_verify_bios_memio(ips_ha_t *ha, char *buffer, int buffersize) {
   u8    checksum;
   int   i;
   METHOD_TRACE("ips_verify_bios_memio", 1);
   writel(0, ha->mem_ptr + IPS_REG_FLAP);
   if (ha->revision_id == IPS_REVID_TROMBONE64)
      UDELAY(5); 
   if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0x55)
      return (1);
   writel(1, ha->mem_ptr + IPS_REG_FLAP);
   if (ha->revision_id == IPS_REVID_TROMBONE64)
      UDELAY(5); 
   if (readb(ha->mem_ptr + IPS_REG_FLDP) != 0xAA)
      return (1);
   checksum = 0xff;
   for (i = 2; i < buffersize; i++) {
      writel(i, ha->mem_ptr + IPS_REG_FLAP);
      if (ha->revision_id == IPS_REVID_TROMBONE64)
         UDELAY(5); 
      checksum = (u8) checksum + readb(ha->mem_ptr + IPS_REG_FLDP);
   }
   if (checksum != 0)
      return (1);
   else
      return (0);
}
static int ips_verify_bios_memio ( ips_ha_t * ha , char * buffer , int buffersize ) { u8 checksum ; int i ; METHOD_TRACE ( " " , 1 ) ; writel ( 0 , ha -> mem_ptr + IPS_REG_FLAP ) ; if ( ha -> revision_id == IPS_REVID_TROMBONE64 ) UDELAY ( 5 ) ; if ( readb ( ha -> mem_ptr + IPS_REG_FLDP ) != 0x55 ) return ( 1 ) ; writel ( 1 , ha -> mem_ptr + IPS_REG_FLAP ) ; if ( ha -> revision_id == IPS_REVID_TROMBONE64 ) UDELAY ( 5 ) ; if ( readb ( ha -> mem_ptr + IPS_REG_FLDP ) != 0xAA ) return ( 1 ) ; checksum = 0xff ; for ( i = 2 ; i < buffersize ; i ++ ) { writel ( i , ha -> mem_ptr + IPS_REG_FLAP ) ; if ( ha -> revision_id == IPS_REVID_TROMBONE64 ) UDELAY ( 5 ) ; checksum = ( u8 ) checksum + readb ( ha -> mem_ptr + IPS_REG_FLDP ) ; } if ( checksum != 0 ) return ( 1 ) ; else return ( 0 ) ; }
Routine Name: ips_verify_bios_memio
Routine Name : ips_verify_bios_memio
/* test 1st byte */ /* 5 us */ /* 5 us */ /* 5 us */ /* failure */ /* success */