This is a multi-part message in MIME format.
------=_NextPart_000_0024_01C61225.C1951260
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I run CE 5.0 on a CEPC equiped with a TI1410-based CardBus Bridge =
adapter. This adapter is mostly used to house a Cisco Aironet 350 PCMCIA =
card, but this is not the point.
As for any PC compliant with Microsoft's recommendation for PCI-to-PCI =
and CardBus bridges (see =
http://www.microsoft.com/whdc/archive/cardbus1.mspx and =
http://www.microsoft.com/whdc/system/bus/PCI/pcibridge-cardbus.mspx), =
the BIOS configures the CardBus Bridge (TI1410) with one 4KB memory =
window, one 64MB memory window and two 256B I/O windows.
I installed the "TI PC Card" feature in my OS Design and modified my =
Platform.reg to override default VendorID/DeviceID list coming from =
pcc_tipccard.reg:
IF BSP_PCCARD_TIPCCARD
#include "$(DRIVERS_DIR)\pccard\tipccard\pcc_tipccard.reg"
;+ATON: add support for TI1410 chip
[$(PCI_BUS_ROOT)\Template\PCC_TIPCCARD]
"VendorID"=3Dmulti_sz:"104C","104c","104c","104c","104c","1180"
"DeviceID"=3Dmulti_sz:"ac50","ac19","ac1c","ac55","ac56","0476"
;-ATON
ENDIF BSP_PCCARD_TIPCCARD
104C/ac50 stands for TI1410.
Then I built and ran a Debug image and stoped on a DEBUGCHK:
Loaded symbols for =
'C:\WINCE500\PBWORKSPACES\TEST\RELDIR\EBB615_X86_DEBUG\PCC_TIPCCARD.DLL'
4294776192 PID:afb73842 TID:ef977fae 0x8f977800: =
-CResourceMgr::AllocateResource(dwLen =3D 0x1000000, dwAlign =3D 0x1000) =
return Fails!!!
4294776192 PID:afb73842 TID:ef977fae 0x8f977800: =
CPcmciaWindows::CardMapWindowPhysical:PDCardSetWindow!!!
4294776192 PID:afb73842 TID:ef977fae 0x8f977800: PCCARD: DEBUGCHK failed =
in file =
E:\macallan\public\COMMON\oak\drivers\pccard\mdd\mdd_both\..\pcmciac.cpp =
at line 1493=20
So I started to debug and saw the following problem.
a) CPCCardBusBridge::SetupWindowResources correctly harvests the I/O and =
memory windows characteristics and store them in a DDKWINDOWINFO =
structure.
b) Its job done, CPCCardBusBridge::SetupWindowResources creates a =
CCardBusResource instance, giving the DDKWINDOWINFO structure to the =
contructor:
m_pCardBusResource =3D new CCardBusResource( dwi );
c) The code in CCardBusResource::CCardBusResource completely ignores the =
fact that 2 windows of each kind exist in the DDKWINDOWINFO structure =
and creates a couple of CResourceMgr instances, using only the first =
window of each type of resource:
if( dwi.dwNumMemWindows !=3D 0 && m_pMemResource =3D=3D NULL )
{
m_pMemResource =3D new CResourceMgr( dwi.memWindows[0].dwBase,
dwi.memWindows[0].dwLen );
}
if( dwi.dwNumIoWindows !=3D 0 && m_pIoResource =3D=3D NULL )
{
m_pIoResource =3D new CResourceMgr( dwi.ioWindows[0].dwBase,
dwi.ioWindows[0].dwLen );
}
CResourceMgr::CResourceMgr( DWORD dwAddr, DWORD dwLen )
{
m_pResourceList =3D new RESOURCE_LIST;
if( m_pResourceList )
{
m_pResourceList->dwAddr =3D dwAddr;
m_pResourceList->dwLen =3D dwLen;
m_pResourceList->pNext =3D NULL;
m_pResourceList->dwFlags =3D 0;
}
}
Afterwards, usable resources on the CardBus Bridge have been truncated =
to:
- one 4KB memory window,
- one 256B I/O window.
d) After card detection, the CIS has to be read and =
CResourceMgr::AllocateResource is called to allocate 0x1000000 bytes for =
the attribute window (ain't it excessive to ask for 16MB to read a few =
dozens of data ?) and of course fails by lack of resource.
If if skip the detection of the first memory windows in =
CPCCardBusBridge::SetupWindowResources, final resources are:
- one 64MB memory window,
- one 256B I/O window,
CResourceMgr::AllocateResource succeds and I can use my Cisco card =
without any trouble.
Once tested, I will suggest a convenient change in =
CCardBusResource::CCardBusResource to make m_pMemResource and =
m_pIoResource true resource *lists*.
--=20
Remi de Gravelaine
gravelaine at aton dash sys dot fr
------=_NextPart_000_0024_01C61225.C1951260
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>I run CE 5.0 on a CEPC equiped with a =
TI1410-based=20
CardBus Bridge adapter. This adapter is mostly used to house =
a Cisco=20
Aironet 350 PCMCIA card, but this is not the point.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>As for any PC compliant with =
Microsoft's=20
recommendation for PCI-to-PCI and CardBus bridges (see </FONT><A=20
href=3D"http://www.microsoft.com/whdc/archive/cardbus1.mspx"><FONT =
face=3DArial=20
size=3D2>http://www.microsoft.com/whdc/archive/cardbus1.mspx</FONT></A><F=
ONT=20
face=3DArial size=3D2> and </FONT><A=20
href=3D"http://www.microsoft.com/whdc/system/bus/PCI/pcibridge-cardbus.ms=
px"><FONT=20
face=3DArial=20
size=3D2>http://www.microsoft.com/whdc/system/bus/PCI/pcibridge-cardbus.m=
spx</FONT></A><FONT=20
face=3DArial size=3D2>), the BIOS configures the CardBus Bridge (TI1410) =
with one=20
4KB memory window, one 64MB memory window and two 256B I/O =
windows.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>I installed the "TI PC Card" feature in =
my OS=20
Design and modified my Platform.reg to override default =
VendorID/DeviceID list=20
coming from pcc_tipccard.reg:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>IF =
BSP_PCCARD_TIPCCARD<BR>#include=20
"$(DRIVERS_DIR)\pccard\tipccard\pcc_tipccard.reg"<BR>;+ATON: add support =
for=20
TI1410 chip<BR>[$(PCI_BUS_ROOT)\Template\PCC_TIPCCARD]<BR> =20
"VendorID"=3Dmulti_sz:"104C","104c","104c","104c","104c","1180"<BR> =
=20
"DeviceID"=3Dmulti_sz:"ac50","ac19","ac1c","ac55","ac56","0476"<BR>;-ATON=
<BR>ENDIF=20
BSP_PCCARD_TIPCCARD<BR></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>104C/ac50<FONT face=3DArial> =
stands for=20
TI1410.</FONT></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2><FONT =
face=3DArial></FONT> </DIV></FONT>
<DIV><FONT face=3DArial size=3D2>Then I built and ran a Debug image and =
stoped on a=20
DEBUGCHK:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Loaded symbols for=20
'C:\WINCE500\PBWORKSPACES\TEST\RELDIR\EBB615_X86_DEBUG\PCC_TIPCCARD.DLL'<=
BR>4294776192=20
PID:afb73842 TID:ef977fae 0x8f977800: =
-CResourceMgr::AllocateResource(dwLen =3D=20
0x1000000, dwAlign =3D 0x1000) return Fails!!!<BR>4294776192 =
PID:afb73842=20
TID:ef977fae 0x8f977800:=20
CPcmciaWindows::CardMapWindowPhysical:PDCardSetWindow!!!<BR>4294776192=20
PID:afb73842 TID:ef977fae 0x8f977800: PCCARD: DEBUGCHK failed in file=20
E:\macallan\public\COMMON\oak\drivers\pccard\mdd\mdd_both\..\pcmciac.cpp =
at line=20
1493 <BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>So I started to debug and saw the =
following=20
problem.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>a) =
CPCCardBusBridge::SetupWindowResources correctly=20
harvests the I/O and memory windows characteristics and store them in a=20
DDKWINDOWINFO structure.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>b) Its job done,=20
CPCCardBusBridge::SetupWindowResources creates a CCardBusResource =
instance,=20
giving the DDKWINDOWINFO structure to the contructor:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3D"Courier New" size=3D2> =
m_pCardBusResource =3D new=20
CCardBusResource( dwi );</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>c) The code=20
in CCardBusResource::CCardBusResource completely ignores the fact =
that 2=20
windows of each kind exist in the DDKWINDOWINFO structure and creates a =
couple=20
of CResourceMgr instances, <U>using only the first window of each type =
of=20
resource</U>:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT face=3D"Courier =
New"> if(=20
dwi.dwNumMemWindows !=3D 0 && m_pMemResource =3D=3D NULL=20
)<BR> {<BR> =20
m_pMemResource =3D new CResourceMgr(=20
dwi.memWindows[0].dwBase,<BR> &n=
bsp; &nb=
sp; &nbs=
p; =20
dwi.memWindows[0].dwLen );<BR> }<BR> =
if(=20
dwi.dwNumIoWindows !=3D 0 && m_pIoResource =3D=3D NULL =
)<BR> =20
{<BR> m_pIoResource =3D new=20
CResourceMgr(=20
dwi.ioWindows[0].dwBase,<BR> &nb=
sp; &nbs=
p;  =
; =20
dwi.ioWindows[0].dwLen );<BR> }</FONT></FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><FONT=20
face=3D"Courier New">CResourceMgr::CResourceMgr( DWORD dwAddr, DWORD =
dwLen=20
)<BR>{<BR> m_pResourceList =3D new=20
RESOURCE_LIST;<BR> if( m_pResourceList =
)<BR> =20
{<BR> =
m_pResourceList->dwAddr =3D=20
dwAddr;<BR> =
m_pResourceList->dwLen=20
=3D dwLen;<BR> =
m_pResourceList->pNext=20
=3D NULL;<BR> =20
m_pResourceList->dwFlags =3D 0;<BR> =20
}<BR>}<BR></FONT><BR></DIV></FONT>
<DIV><FONT face=3DArial size=3D2>Afterwards, usable resources on the =
CardBus Bridge=20
have been truncated to:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> - one 4KB memory=20
window,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> - one 256B I/O=20
window.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>d) After card detection, the CIS has to =
be read and=20
CResourceMgr::AllocateResource is called to allocate 0x1000000 bytes for =
the=20
attribute window (ain't it excessive to ask for 16MB to read a few =
dozens of=20
data ?) and of course fails by lack of resource.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>If if skip the detection of the first =
memory=20
windows in CPCCardBusBridge::SetupWindowResources, final resources=20
are:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2> - one 64MB memory=20
window,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> - one 256B I/O=20
window,</FONT></DIV>
<DIV>CResourceMgr::AllocateResource succeds and I can use my Cisco card =
without=20
any trouble.</DIV>
<DIV> </DIV>
<DIV>Once tested, I will suggest a convenient change=20
in CCardBusResource::CCardBusResource to make <FONT=20
face=3D"Courier New">m_pMemResource</FONT></FONT><FONT =
face=3DArial><FONT size=3D2>=20
and <FONT face=3D"Courier New">m_pIoResource</FONT></FONT></FONT><FONT=20
face=3DArial><FONT size=3D2> true resource =
*lists*.</DIV></FONT></FONT><FONT=20
face=3DArial size=3D2>
<DIV><BR>-- <BR>Remi de Gravelaine<BR>gravelaine at aton dash sys dot=20
fr</DIV></FONT></DIV></BODY></HTML>
------=_NextPart_000_0024_01C61225.C1951260--