Hi al
I'm writing NDIS PCMCIA miniport driver on Platform builder 4.2
On my MiniportInitialize() function
I registered PCMCIA client using CardRegisterClient() function
and later, I access configuration registers in my device using CardAccessConfigurationRegister() function
However, when I try to write to configuration register using CardAccessConfigurationRegister function,
the function returns error 0x1E(CERR_IN_USE) - read configuration registers return successfully
I tested other PCMCIA service functions such as CardReleaseConfiguration(), CardResetFunction(), an
those functions were returned with error 0x1E
What's the problem?
Here's fraction of my code
-------------------------------------
NDIS_STATUS SwldInitialize(...
.................
NdisOpenConfiguration() .
..................
NdisMQueryAdapterResources(
..................
NdisMSetAttributeEx(
NdisMRegisterIoPortRange(
RegParms.fAttributes = CLEINT_ATTR_IO_DRIVER
CLIENT_ATTR_NOTIFY_EXCLUSIVE
CLIENT_ATTR_NOTIFY_SHARED
RegParms.fEventMask = EVENT_MASK_CARD_DETECT
EVENT_MASK_POWER_MGMT
RegParms.uClientData = NULL
g_hClient = CallCardServices(CardRegisterClient)( NotificationEvent, &RegParms ); <- Returns Client handl
....
NdisMMapIoSpace(...)
CallCardServices( CardAccessConfigurationRegisters )
g_hClient
g_hSocket
CARD_FCR_WRITE
0x00
&CorValue ); <- It returns error 0x1
...
/
// Callback function for CardRegisterClien
/
STATU
NotificationEvent ( CARD_EVENT CardEvent
CARD_SOCKET_HANDLE hSocket
PCARD_EVENT_PARMS pCardEventParms
CARD_WINDOW_HANDLE hWindow = NULL
CARD_WINDOW_PARMS CardWinParms
STATUS stResult
switch( CardEvent
case CE_CARD_INSERTION
DEBUGMSG( ZONE_INIT
(TEXT("SWLD60: NotificationEvent:CE_CARD_INSERTION\r\n") ) )
DEBUGMSG( ZONE_INIT
(TEXT("SWLD60: Card %d:%d - PNP ID = %s\r\n"),
hSocket.uSocket, hSocket.uFunction, pCardEventParms->Parm1) )
break
case CE_REGISTRATION_COMPLETE
DEBUGMSG( ZONE_INIT
(TEXT("SWLD60: NotificationEvent:CE_REGISTRATION_COMPLETE\r\n") ) )
/
// Save card socket handl
/
g_hSocket.uSocket = hSocket.uSocket
g_hSocket.uFunction = hSocket.uFunction
DEBUGMSG( ZONE_INIT
(TEXT("SWLD60: CARD_SOCKET_HANDLE Socket %d Function %d\r\n")
g_hSocket.uSocket, g_hSocket.uFunction) )
/
// Reset Card socke
/
stResult = CallCardServices(CardResetFunction)( (CARD_CLIENT_HANDLE
pCardEventParms->Parm1
hSocket ); <-- this function also return 0x1
DEBUGMSG( ZONE_DEBUG
(TEXT("SWLD60: CardResetFunction returns 0x%08X[%d]\r\n")
stResult, stResult ) );
break
} // switc
return CERR_SUCCESS
} // NotificationEven
Thanks.