Adding KITL Initialization Code (Windows Embedded CE 6.0)
1/5/2010
The kernel independent transport layer (KITL) consists of several components, which compile to form Kitl.dll. The following illustration shows how the KITL components call each other through various methods and function pointers:
The kernel debugger contains a KITLTRANSPORT structure with function pointers to either OAL_KITL_ETH_DRIVER for the Ethernet KITL driver interface (as shown in the illustration) or OAL_KITL_SERIAL_DRIVER for the serial KITL driver interface. For some function pointers such as pfnEncode and pfnSend, Oal_kitl.lib will contain an implementation. For other functions such as pfnSend_Frame and pfnGet_Frame, OAL_KITL_ETH_DRIVER points to implementations in the KITL driver. The KITL driver is named Driver.c in the illustration, but it could be any name, for example Ne2000.c or Dec21140.c.
The common KITL library (OAL_kitl.lib) is provided to make it easier for you to implement KITL. You can use the code in %_WINCEROOT\Platform\Common\Src\Common\Kitl to implement your own Kitl.dll. An implementation consists of two components:
- The driver library (shown in the illustration as Driver.c) that implements the functions in the OAL_KITL_ETH_DRIVER or OAL_KITL_SERIAL_DRIVER structure
- The KITL/kernel interface code (shown in the illustration as Kitl.c) that implements the kernel interface and initializes the OAL_KITL_ETH_DRIVER structure and other structures that OAL_kitl.lib uses
KITL Load Sequence
The following illustration shows how KITL is loaded by functions in the board support package OAL (OAL.lib), the kernel (Kitlcore.lib), the common KITL library (OAL_kitl.lib), the BSP (Kitl.c), and the BSP KITL driver.
Implementing the OEMKitlStartup Function
When you use the common KITL library (OAL_kitl.lib), you only need to implement the OEMKitlStartup function. For more information, see OEMKitlStartup.
Implementing the BSP KITL Driver
The common KITL library provides functions for the OAL_KITL_ETH_DRIVER and OAL_KITL_SERIAL_DRIVER structures that are specific to the Ethernet, serial, or USB transport but not specific to the BSP. You must implement the following functions in your driver:
- pfnInit (implements OAL_KITLETH_INIT or OAL_KITLSERIAL_INIT)
- pfnSendFrame or pfnSend (implements OAL_KITLETH_SEND_FRAME or OAL_KITLSERIAL_SEND)
- pfnGetFrame or pfnRecv (implements OAL_KITLETH_GET_FRAME or OAL_KITLSERIAL_RECV)
You may also implement the following optional functions in your driver:
- pfnDeinit (implements OAL_KITLETH_DEINIT or OAL_KITLSERIAL_DEINIT)
- pfnEnableInts (implements OAL_KITLETH_ENABLE_INTS or OAL_KITLSERIAL_ENABLE_INTS)
- pfnDisableInts (implements OAL_KITLETH_DISABLE_INTS or OAL_KITLSERIAL_DISABLE_INTS)
- pfnPowerOff (implements OAL_KITLETH_POWER_OFF or OAL_KITLSERIAL_POWER_OFF)
- pfnPowerOn (implements OAL_KITLETH_POWER_ON or OAL_KITLSERIAL_POWER_OFF)
- pfnInitDmaBuffer (implements OAL_KITLETH_INIT_DMABUFFER)
- pfnMulticastList (implements OAL_KITLETH_MULTICAST_LIST)
- pfnFlowControl (implements OAL_KITLSERIAL_FLOW_CONTROL)
- pfnSendComplete (implements OAL_KITLSERIAL_SENDCOMPLETE)
Sample implementations are available at the following locations:
- %_WINCEROOT%\Platform\Common\Src\Common\Ethdrv\
- %_WINCEROOT%\Platform\Common\Src\x86\Common\Kitl\Kitlser_x86.c
- %_WINCEROOT%\Platform\MainstoneIII\Src\Common\Usbfn\Rndiskitl\Rndis_pdd.c