Technical information

8-6
AIC-6915 Ethernet LAN Controller Programmer’s Manual
// Other fields in MacConfig1 may remain at the default value
AIC6915_WRITE_REG(Adapter->RegisterBaseVa->MacConfig1, MacConfig1Value);
// Read MacConfig1 again
AIC6915_READ_REG(MacConfig1, MacConfig1Value);
// Now do a soft reset to the MAC, separately from the programming step
MacConfig1Value.MacSoftRst = 1;
AIC6915_WRITE_REG(MacConfig1, MacConfig1Value);
// Read it again
AIC6915_READ_REG(MacConfig1, &MacConfig1Value);
// Clear MAC reset bit
MacConfig1Value.MacSoftRst = 0;
AIC6915_WRITE_REG(MacConfig1, MacConfig1Value);
// Initialize Bus Access Control
// Read current value
AIC6915_READ_REG(Adapter->RegisterBaseVa->BacControl, &BacControlValue);
BacControlValue.PreferRxDmaReq = 1;
// RX DMA has priority
// All other fields may remain at the default value.
AIC6915_WRITE_REG(Adapter->RegisterBaseVa->BacControl, BacControlValue);
// Clear all interrupts that are cleared on read. Other interrupts must be
// cleared at the source.
AIC6915_READ_REG(Adapter->RegisterBaseVa->InterruptStatus,
&InterruptStatusValue);
// Receive Initialization (see example below)
:
// Transmit Initialization (see example below)
// After all other pertinent AIC-6915 registers have been initialized, the
// controller must be enabled. The Receive and Transmit DMA operations must
// be enabled, as well as the Receive and Transmit engines. These bits are all
// contained in the GeneralEthernetCtrl register.
GeneralEthernetCtrlValue = 0;
GeneralEthernetCtrlValue.RxDmaEn = 1;
// enable RX DMA
GeneralEthernetCtrlValue.RxEn = 1;
// enable receiver
GeneralEthernetCtrlValue.TxDmaEn = 1;
// enable TX DMA
GeneralEthernetCtrlValue.TxEn = 1;
// enable transmitter
AIC6915_WRITE_REG(Adapter->RegisterBaseVa->GeneralEthernetCtrl,
GeneralEthernetCtrlValue);
// Enable the interrupts now
AIC6915_WRITE_REG(Adapter->RegisterBaseVa->InterruptEn, InterruptEnValue);