-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-403356-
xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Sunday, February 28, 2010 12:48 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] AHCI Bus driver interrupt issue?
Dear all:
When all interrupt enable bits are set , i find a “Interface
Non-fatal Error Status(INFS)” interrupt, and this interrupt will be
creeated continuously. The following is a DMA setup code segment. If
anybody known about this, plealse give me a advice, Thank you!
//allocate memory for command list structure
lowest.QuadPart = 0;
highest.LowPart = 0xffffffff;
highest.HighPart = 0;
alignment.QuadPart = ALIGN_VALUE_64K;//128;
pCommandTableBase =
MmAllocateContiguousMemorySpecifyCache(sizeof(COMMAND_TABLE)+sizeof(PRD
T), // number of bytes to allocate
lowest, // lowest acceptable address
highest, // highest acceptable address
alignment, // alignment requirement
MmWriteCombined); // caching type
if (pCommandTableBase==NULL)
{
ntStatus = STATUS_INSUFFICIENT_RESOURCES;
break;
}
//initial command header
pchCommandHead = pPdoDevExt->pVirutalClb;
pchCommandHead[1].dw0.bx.prdtl = 1;
pchCommandHead[1].dw0.bx.pmp = 0;
pchCommandHead[1].dw0.bx.c = 0;
pchCommandHead[1].dw0.bx.b = 0;
pchCommandHead[1].dw0.bx.r = 0;
pchCommandHead[1].dw0.bx.p = 1;
pchCommandHead[1].dw0.bx.w = 0;
pchCommandHead[1].dw0.bx.a = 0;
pchCommandHead[1].dw0.bx.cfl = 28; //???
pchCommandHead[1].prdbc = 1024;
pchCommandHead[1].ctba =
MmGetPhysicalAddress(pCommandTableBase);
// fill command FIS
pCommandTable = (PCOMMAND_TABLE)pCommandTableBase;
pCommandTable->cFis.Fis.DmaSetup.DW0.bx.FisType =
0x41;
pCommandTable->cFis.Fis.DmaSetup.DW0.bx.D =
0x1;
pCommandTable->cFis.Fis.DmaSetup.DW0.bx.PmPort = 0;
lbaAddress.QuadPart = 0xFFFFFFFF;
pCommandTable->cFis.Fis.DmaSetup.dwDmaBufAddr =
lbaAddress;
pCommandTable->cFis.Fis.DmaSetup.dwBufOffset =
0x0;
pCommandTable->cFis.Fis.DmaSetup.dwTransferCnt =
1024;
// Fill PRD
lowest.QuadPart = 0;
highest.LowPart = 0xffffffff;
highest.HighPart = 0;
/*alignment.QuadPart = 0;
pPRDTableBase =
MmAllocateContiguousMemorySpecifyCache(sizeof(PRDT), // number of
bytes to allocate
lowest, // lowest acceptable address
highest, // highest acceptable address
alignment, // alignment requirement
MmWriteCombined); // caching type
if (pPRDTableBase==NULL)
{
WdfRequestComplete(Request,
STATUS_INSUFFICIENT_RESOURCES);
ExFreePool(pCommandTableBase);
break;
}*/
alignment.QuadPart = ALIGN_VALUE_64K;
pDataBase =
MmAllocateContiguousMemorySpecifyCache(1024, // number of bytes to
allocate
lowest, // lowest acceptable address
highest, // highest acceptable address
alignment, // alignment requirement
MmWriteCombined); // caching type
if (pDataBase==NULL)
{
ntStatus =STATUS_INSUFFICIENT_RESOURCES;
ExFreePool(pCommandTableBase);
//ExFreePool(pPRDTableBase);
break;
}
// Test
/*pPRDTable = (PPRDT)pPRDTableBase;
// Save data buffer address.
pPRDTable->DBA = MmGetPhysicalAddress(pDataBase);
pPRDTable->DW3.bx.bit0 = 0x01;
pPRDTable->DW3.bx.bit1 = 0x01;
pPRDTable->DW3.bx.DBC = 1024;*/
// Test
//pCommandTable->pPrdTable = pPRDTable;
pCommandTable->PrdTable[0].DBA =
MmGetPhysicalAddress(pDataBase);
//pCommandTable->PrdTable[0].DW3.bx.bit0 = 0x01;
pCommandTable->PrdTable[0].DW3.bx.DBC = 513;
pCommandTable->PrdTable[0].DW3.bx.bit1 = 0x01;
// Allow HBA Send DMA setup FIS
pPdoDevExt->papdPortRegBase->ci |= 0x02;
pPdoDevExt->papdPortRegBase->sact |= 0x02;
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer