/* Therefore we do two reads. The first time we write 0 to the (read-only) register before reading and the second time we write 0xff first. If the two reads do not match or they read back as 0xff or 0x00 then we have version 1 hardware.  */
static u8 viper_hw_version(void)
/* Therefore we do two reads. The first time we write 0 to the (read-only) register before reading and the second time we write 0xff first. If the two reads do not match or they read back as 0xff or 0x00 then we have version 1 hardware.  */
static u8 viper_hw_version(void)
{
	u8 v1, v2;
	unsigned long flags;
	local_irq_save(flags);
	VIPER_VERSION = 0;
	v1 = VIPER_VERSION;
	VIPER_VERSION = 0xff;
	v2 = VIPER_VERSION;
	v1 = (v1 != v2 || v1 == 0xff) ? 0 : v1;
	local_irq_restore(flags);
	return v1;
}