[ISAPNP] Correctly calculate checksum

See appendix B.2 of "Plug and Play ISA Specification 1.0a"
This commit is contained in:
Hervé Poussineau 2020-02-07 23:48:22 +01:00
parent 645c77335c
commit 40b2f65f0c

View file

@ -178,10 +178,10 @@ HwDelay(VOID)
static static
inline inline
USHORT UCHAR
NextLFSR(USHORT Lfsr, USHORT InputBit) NextLFSR(UCHAR Lfsr, UCHAR InputBit)
{ {
ULONG NextLfsr = Lfsr >> 1; UCHAR NextLfsr = Lfsr >> 1;
NextLfsr |= (((Lfsr ^ NextLfsr) ^ InputBit)) << 7; NextLfsr |= (((Lfsr ^ NextLfsr) ^ InputBit)) << 7;
@ -192,7 +192,7 @@ static
VOID VOID
SendKey(VOID) SendKey(VOID)
{ {
USHORT i, Lfsr; UCHAR i, Lfsr;
HwDelay(); HwDelay();
WriteAddress(0x00); WriteAddress(0x00);
@ -241,7 +241,7 @@ static
USHORT USHORT
IsaPnpChecksum(PISAPNP_IDENTIFIER Identifier) IsaPnpChecksum(PISAPNP_IDENTIFIER Identifier)
{ {
USHORT i,j, Lfsr, Byte; UCHAR i, j, Lfsr, Byte;
Lfsr = ISAPNP_LFSR_SEED; Lfsr = ISAPNP_LFSR_SEED;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)