www.ti.com
2.5.5.3BufferOffset
PeripheralArchitecture
Example2.ReceiveBufferDescriptorinCStructureFormat
/*
//EMACDescriptor
//
//Thefollowingistheformatofasinglebufferdescriptor
//ontheEMAC.
*/
typedefstruct_EMAC_Desc{
struct_EMAC_Desc*pNext;/*Pointertonextdescriptorinchain*/
Uint8*pBuffer;/*Pointertodatabuffer*/
Uint32BufOffLen;/*BufferOffset(MSW)andLength(LSW)*/
Uint32
PktFlgLen;/*PacketFlags(MSW)andLength(LSW)*/
}EMAC_Desc;
/*PacketFlags*/
#defineEMAC_DSC_FLAG_SOP0x80000000u
#defineEMAC_DSC_FLAG_EOP0x40000000u
#defineEMAC_DSC_FLAG_OWNER0x20000000u
#defineEMAC_DSC_FLAG_EOQ0x10000000u
#defineEMAC_DSC_FLAG_TDOWNCMPLT0x08000000u
#defineEMAC_DSC_FLAG_PASSCRC0x04000000u
#defineEMAC_DSC_FLAG_JABBER0x02000000u
#defineEMAC_DSC_FLAG_OVERSIZE0x01000000u
#defineEMAC_DSC_FLAG_FRAGMENT0x00800000u
#defineEMAC_DSC_FLAG_UNDERSIZED0x00400000u
#defineEMAC_DSC_FLAG_CONTROL0x00200000u
#defineEMAC_DSC_FLAG_OVERRUN0x00100000u
#defineEMAC_DSC_FLAG_CODEERROR0x00080000u
#defineEMAC_DSC_FLAG_ALIGNERROR0x00040000u
#defineEMAC_DSC_FLAG_CRCERROR0x00020000u
#defineEMAC_DSC_FLAG_NOMATCH0x00010000u
This16-bitfieldmustbeinitializedtozerobythesoftwareapplicationbeforeaddingthedescriptortoa
receivequeue.
WhetherornotthisfieldisupdateddependsonthesettingoftheRXBUFFEROFFSETregister.Whenthe
offsetregisterissettoanon-zerovalue,thereceivedpacketiswrittentothepacketbufferatanoffset
givenbythevalueoftheregister,andthisvalueisalsowrittentothebufferoffsetfieldofthedescriptor.
Whenapacketisfragmentedovermultiplebuffersbecauseitdoesnotfitinthefirstbuffersupplied,the
bufferoffsetonlyappliestothefirstbufferinthelist,whichiswherethestartofpacket(SOP)flagissetin
thecorrespondingbufferdescriptor.Inotherwords,thebufferoffsetfieldisonlyupdatedbytheEMACon
SOPdescriptors.
TherangeoflegalvaluesfortheBUFFEROFFSETregisteris0to(BufferLength–1)forthesmallest
valueofbufferlengthforalldescriptorsinthelist.
24EthernetMediaAccessController(EMAC)/SPRU941A–April2007
ManagementDataInput/Output(MDIO)
SubmitDocumentationFeedback