引用: 引用 17 楼 luixing67 的回复:
楼主可不可以贴一下与IoAddress有关的log信息,我看dm9000与dm9000a基本是一样的
另个地方,一个是驱动里面,一个是注册表里面。驱动里面如下:
CONFIG_PARAMETER g_szDm9ConfigParams[] =
{
{ CID_CONNECTION_TYPE, -1, NDIS_STRING_CONST("ConnectionType") },
{ CID_SLOT_NUMBER, -1, NDIS_STRING_CONST("SlotNumber")},
{ CID_BUFFER_PHYSICAL_ADDRESS, 0, NDIS_STRING_CONST("BufferPhysicalAddress")},
{ CID_TXBUFFER_NUMBER, 0x20, NDIS_STRING_CONST("XmitBuffer")},
{ CID_RXBUFFER_NUMBER, 0x10, NDIS_STRING_CONST("RecvBuffer")},
{ CID_ADAPTER_NUMBER, 0, NDIS_STRING_CONST("AdapterNumber")},
{ CID_IO_BASE_ADDRESS, 0x20000300, NDIS_STRING_CONST("IoAddress")},
注册表如下:
[HKEY_LOCAL_MACHINE\Comm\DM9CE1\Parms]
"BusNumber"=dword:0
"BusType"=dword:1
"XmitBuffer"=dword:20
"RecvBuffer"=dword:20
"SysIntr"=dword:26
"IrqNumber"=dword:26
"IoAddress"=dword:20000300
你要看一下你的驱动是不是开始的时候读取注册表获得这个地址信息,我的是读取注册表信息的,驱动代码如下:
void NIC_DEVICE_OBJECT::DeviceRetriveConfigurations(
NDIS_HANDLE hConfig)
{
NDIS_STATUS status;
RETAILMSG(DM9000_DEBUG, (TEXT("DM9000 DeviceRetriveConfigurations\r\n")));
PCONFIG_PARAMETER pconfig;
PNDIS_CONFIGURATION_PARAMETER param;
for(pconfig=DeviceConfigureParameters();
(pconfig->uId != (U32)-1);
pconfig++)
{
NdisReadConfiguration(
&status,
¶m,
hConfig,
&(pconfig->szName),
NdisParameterHexInteger);
if(status == NDIS_STATUS_SUCCESS)
m_szConfigures[pconfig->uId] =
param->ParameterData.IntegerData;
else
m_szConfigures[pconfig->uId] = pconfig->uDefValue;
}
调试的时候,日志输出如下所示:
09:42:45.671 C_DM9000::EDeviceRegisterIoSpace
09:42:45.671 [dm9: Tries to map io space with 20000300
09:42:45.687 [dm9: The mapped address is 380300
09:42:45.687 DM9000ReadPort:Address=0x28,value=0x46
09:42:45.687 DM9000ReadPort:Address=0x29,value=0xa
09:42:45.687 DM9000ReadPort:Address=0x2a,value=0x0
09:42:45.687 DM9000ReadPort:Address=0x2b,value=0x90
09:42:45.703 [dm9000: Chip signature is 90000A46