This is a multi-part message in MIME format.
------=_NextPart_000_000A_01C6109E.D9BB8460
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
In my opinion, there is a bug in the CPCCardBusBridge::InitCardBusBridge =
routine in PCC_TIPCCARD.LIB =
(Public\Common\Oak\Drivers\Pccard\Tipccard\PDSOCKET.CPP):
BOOL CPCCardBusBridge::InitCardBusBridge( void )
{
.
.
DWORD dwCmd =3D ReadCfgDword( 4 );
m_dwDeviceNumber =3D dpi.dwDeviceNumber;
m_dwFunctionNumber =3D dpi.dwFunctionNumber;
.
.
WriteCfgDword( 4, dwCmd | 0x7 );
return TRUE;
}
The problem is that ReadCfgDword uses m_dwDeviceNumber and =
m_dwFunctionNumber, which are not initialized yet, and reads a bad value =
for dwCmd (hopefully 0xFFFFFFFF). Switching lines fixes the problem:
m_dwDeviceNumber =3D dpi.dwDeviceNumber;
m_dwFunctionNumber =3D dpi.dwFunctionNumber;
=20
DWORD dwCmd =3D ReadCfgDword( 4 );
The bug seems to be quite harmless (setting more bits than needed in the =
PCI Command Register), but just adds a little more confusion to this =
code, which really don't need it!
Remi
------=_NextPart_000_000A_01C6109E.D9BB8460
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2802" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>In my opinion, there is a bug in the =
<FONT=20
face=3D"Courier New">CPCCardBusBridge::InitCardBusBridge</FONT> =
routine in=20
PCC_TIPCCARD.LIB=20
(Public\Common\Oak\Drivers\Pccard\Tipccard\PDSOCKET.CPP):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>BOOL =
CPCCardBusBridge::InitCardBusBridge(=20
void )<BR>{<BR> .</FONT></DIV>
<DIV><FONT size=3D2>
<DIV><FONT size=3D2><FONT face=3D"Courier New"> =20
.</FONT></FONT></DIV>
<DIV></FONT><FONT face=3D"Courier New" size=3D2> DWORD =
dwCmd =3D=20
ReadCfgDword( 4 );</FONT></DIV></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT size=3D2><FONT face=3D"Courier New"> =
m_dwDeviceNumber =3D=20
dpi.dwDeviceNumber;<BR> m_dwFunctionNumber =3D=20
dpi.dwFunctionNumber;<BR> .</FONT>
<DIV><FONT size=3D2>
<DIV><FONT face=3D"Courier New" size=3D2> =
.</FONT></DIV>
<DIV><FONT face=3D"Courier New"> WriteCfgDword( 4, =
dwCmd | 0x7=20
);</FONT></DIV>
<DIV><FONT face=3D"Courier New"></FONT> </DIV>
<DIV><FONT face=3D"Courier New"> return=20
TRUE;<BR>}<BR></FONT></DIV></FONT></DIV></FONT></DIV>
<DIV><FONT size=3D2><FONT face=3D"Courier New" size=3D2><FONT =
face=3DArial>The problem=20
is that <FONT face=3D"Courier New">ReadCfgDword</FONT> =
uses <FONT=20
face=3D"Courier New">m_dwDeviceNumber</FONT> and <FONT=20
face=3D"Courier New">m_dwFunctionNumber</FONT>, which are not =
initialized yet, and=20
reads a bad value for <FONT face=3D"Courier =
New">dwCmd</FONT></FONT><FONT=20
face=3DArial> (hopefully 0xFFFFFFFF). Switching lines fixes =
the=20
problem:</FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3D"Courier New" size=3D2> =
m_dwDeviceNumber =3D=20
dpi.dwDeviceNumber;<BR> m_dwFunctionNumber =3D=20
dpi.dwFunctionNumber;<BR><FONT face=3DArial> </FONT>
<DIV><FONT face=3D"Courier New" size=3D2> DWORD dwCmd =
=3D=20
ReadCfgDword( 4 );</FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2></FONT> </DIV></FONT></DIV></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The bug seems to be quite harmless =
(setting more=20
bits than needed in the PCI Command Register), but just adds a =
little more=20
confusion to this code, which really don't need it!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Remi</FONT></DIV>
<DIV><FONT size=3D2><FONT face=3D"Courier New" size=3D2><FONT=20
face=3DArial></FONT></FONT> </DIV></FONT></BODY></HTML>
------=_NextPart_000_000A_01C6109E.D9BB8460--