Книга: Microsoft Windows Embedded CE 6.0 Exam Preparation Kit

Downloading via Ethernet

Downloading via Ethernet

If the hardware platform includes a network controller, then the boot loader can download the run-time image over Ethernet. Table 5-3 lists the functions that you must implement to support Ethernet-based communication.

Table 5-3 Ethernet support functions

Function Description
OEMReadData Reads data from the transport for downloading.
OEMEthGetFrame Reads data from the NIC using function pointer pfnEDbgGetFrame.
OEMEthSendFrame Writes data to the NIC using function pointer pfnEDbfSendFrame.
OEMEthGetSecs Returns number of seconds passed relative to a fixed time.

The Ethernet support functions use callbacks into network controller-specific routines. This means that you must implement additional routines and set up appropriate function pointers in the OEMPlatformInit function if you want to support a different network controller, as demonstrated in the following sample code:

cAdaptType=pBootArgs->ucEdbgAdapterType;
// Set up EDBG driver callbacks based on
// Ethernet controller type.
switch (cAdaptType) {
case EDBG_ADAPTER_NE2000:
 pfnEDbgInit          = NE2000Init;
 pfnEDbgInitDMABuffer = NULL;
 pfnEDbgGetFrame      = NE2000GetFrame;
 pfnEDbgSendFrame     = NE2000SendFrame;
 break;
case EDBG_ADAPTER_DP83815:
 pfnEDbgInit          = DP83815Init;
 pfnEDbgInitDMABuffer = DP83815InitDMABuffer;
 pfnEDbgGetFrame      = DP83815GetFrame;
 ...
}

Оглавление книги


Генерация: 1.143. Запросов К БД/Cache: 3 / 1
поделиться
Вверх Вниз