Functions | |
void | NIMUSendPacket (HANDLE hIF, PBM_Pkt *pPkt) |
int | NIMUAddHeader (NETIF_DEVICE *ptr_device, HANDLE hPkt, UINT8 *dst_mac, UINT8 *src_mac, UINT16 protocol) |
void | NIMUPacketService (void) |
void | NIMUPacketServiceCheck (int fEvents) |
int | NIMUReceivePacket (PBM_Handle hPkt) |
PBM_Pkt * | NIMUCreatePacket (uint packet_size) |
int | NIMUAddEthernetHeader (NETIF_DEVICE *ptr_net_device, PBM_Handle hPkt, UINT8 *dst_mac, UINT8 *src_mac, UINT16 ether_type) |
NETIF_DEVICE * | NIMUFindByIndex (uint index) |
NETIF_DEVICE * | NIMUFindByName (char *name) |
int | NIMURegister (NETIF_DEVICE *ptr_netif_device) |
int | NIMUUnregister (NETIF_DEVICE *ptr_netif_device) |
int | NIMUIoctl (uint cmd, NIMU_IF_REQ *ptr_nimu_ifreq, void *pBuf, uint size) |
void | NIMUGetRsvdSizeInfo (int *header_size, int *trailer_size) |
void | NIMUSetRsvdSizeInfo (int header_size, int trailer_size) |
int | NIMUInit (STKEVENT_Handle hEvent) |
void | NIMUShutdown (void) |
int NIMUAddEthernetHeader | ( | NETIF_DEVICE * | ptr_net_device, | |
PBM_Handle | hPkt, | |||
UINT8 * | dst_mac, | |||
UINT8 * | src_mac, | |||
UINT16 | ether_type | |||
) |
Description
The function is a UTILITY function which is provided for use to driver authors if the driver is a simple Ethernet driver. Driver Authors should initialize the 'add_header' field of the NIMU Network Interface object to this function.
This will ensure that all packets passed to the driver are pre-pended with the correct layer2 ethernet header before they are transmitted. Failure to do will cause no Layer2 headers to be added.
[in] | ptr_net_device | The NIMU Network interface object on which the packet will be transmitted and which is used to tag the correct L2 header. |
[in] | hPkt | Handle to the packet which will be sent out and on which the L2 header is added. |
[in] | dst_mac | The Dst MAC Address to be added on the packet |
[in] | src_mac | The Src MAC Address to be added on the packet |
[in] | ether_type | The 'Protocol' tag which needs to be appended. |
0 | - Success | |
<0 | - Error |
int NIMUAddHeader | ( | NETIF_DEVICE * | ptr_device, | |
HANDLE | hPkt, | |||
UINT8 * | dst_mac, | |||
UINT8 * | src_mac, | |||
UINT16 | protocol | |||
) |
Description
The function is used to add an appropriate layer2 header as specified by the NIMU object. This function is called when the packet is passed down from layer3 to layer2 and is used to prep the packet by adding the correct layer2 header.
This is for *internal* NDK Stack Usage.
[in] | ptr_device | The NIMU Network interface object on which the packet will be transmitted and which is used to tag the correct L2 header. |
[in] | hPkt | Handle to the packet which will be sent out and on which the L2 header is added. |
[in] | dst_mac | The Dst MAC Address to be added on the packet |
[in] | src_mac | The Src MAC Address to be added on the packet |
[in] | protocol | The 'Protocol' tag which needs to be appended. |
0 | - Success | |
<0 | - Error |
PBM_Pkt* NIMUCreatePacket | ( | uint | packet_size | ) |
Description
The function is a generic utility function which creates a packet that is used for transmission on any network interface object which has been registered with the NIMU. The packet allocated has 'header' and 'trailer' padding added.
This is for *internal* NDK Stack Usage.
[in] | packet_size | Size of the packet which needs to be allocated. |
Handle | to the packet - Success | |
NULL | - Error |
NETIF_DEVICE* NIMUFindByIndex | ( | uint | index | ) |
Description
The function searches the NIMU database and finds an entry matching the device 'index'
This is for *internal* NDK Stack Usage.
[in] | index | The device index we are trying to locate. |
NIMU | Network Interface Object - Matching entry found. | |
NULL | - No Match |
NETIF_DEVICE* NIMUFindByName | ( | char * | name | ) |
Description
The function searches the NIMU database and finds an entry matching the device 'name'
This is for *internal* NDK Stack Usage.
[in] | name | The device name we are trying to locate. |
NIMU | Network Interface Object - Matching entry found. | |
NULL | - No Match |
void NIMUGetRsvdSizeInfo | ( | int * | header_size, | |
int * | trailer_size | |||
) |
Description
The function is to used to retrieve the header and trailer reserved size information. The Network Interface Management Unit keeps track of all devices present in the system and is also responsible for ensuring that there is suffient headroom and tailroom for various driver layers to be able to add headers or trailers as the need be. This ensures that there are no copies being done because of insufficient headroom.
The function is available for usage; but it should only be called from kernel mode (llEnter()/llExit())
[out] | header_size | The current header size which is reserved. |
[out] | trailer_size | The current trailer size which is reserved. |
Not | Applicable. |
int NIMUInit | ( | STKEVENT_Handle | hEvent | ) |
Description
The function initializes the NDK core stack Network Interface Management Unit
This is for *internal* NDK Stack Usage.
[in] | hEvent | The stack event handle which is used by the NDK Network Scheduler to indicate data is present on the drivers. This handle is required by the drivers for its operation. |
0 | - Success | |
<0 | - Error |
int NIMUIoctl | ( | uint | cmd, | |
NIMU_IF_REQ * | ptr_nimu_ifreq, | |||
void * | pBuf, | |||
uint | size | |||
) |
Description
The function is the standard IOCTL interface to the NIMU module and is used to get/set parameters to the NIMU. The API is available to use for applications outside the core NDK stack since it does the necessary llEnter/llExit.
[in] | cmd | One of the special commands mentioned above. |
[in] | ptr_nimu_ifreq | The NIMU Interface request structure which identifies the NIMU object to which the 'cmd' is directed upon. |
[in] | pBuf | The pointer to the buffer where the result of the command execution will be stored. |
[in] | size | The size of the result buffer i.e. pBuf. |
0 | - Success | |
<0 | - Error |
void NIMUPacketService | ( | void | ) |
Description
The function is called by the NDK Net Scheduler to service all NIMU Network Interface objects registered in the system. This is called when the NDK scheduler detects that a packet has been received by the lower HAL drivers and needs to be serviced.
This is for *internal* NDK Stack Usage.
Not | Applicable. |
void NIMUPacketServiceCheck | ( | int | fEvents | ) |
Description
The function is called by the NDK Net Scheduler to allow HAL drivers to be able to perform 'periodic' activities; such as Ethernet Link management. There also exists a mode in which the HAL drivers can execute in 'polled' mode. In this case this the HAL drivers do not use 'interrupts' and are polled by the NDK Net Scheduler to check for transmit/receive activity.
This is for *internal* NDK Stack Usage.
[in] | fEvents | This is set to 1 if the function is invoked by the NDK Net Scheduler because of a timer tick. Set to 0 otherwise. This flag is available to the HAL drivers to determine the source of the function invocation. |
Not | Applicable. |
int NIMUReceivePacket | ( | PBM_Handle | hPkt | ) |
Description
This routine is the API interface routine which needs to be invoked by the drivers to pass the packet up the NDK core stack The function takes the raw packet received from the MAC device, and validates the link level related data. Packets are passed up the stack on the basis of the 'protocol' field.
[in] | hPkt | Handle to the packet which is to be passed up the NDK stack. |
-1 | - Error | |
0 | - Success |
int NIMURegister | ( | NETIF_DEVICE * | ptr_netif_device | ) |
Description
This API is used by driver authors to register a network device with the NDK Network Interface Management Unit. The function verifies the arguments, checks for duplicates and adds the device to NIMU (Network Interface Management Unit)
[in] | ptr_netif_device | The NIMU Network Interface Object to be registered. |
0 | - Success | |
<0 | - Error |
void NIMUSendPacket | ( | HANDLE | hIF, | |
PBM_Pkt * | pPkt | |||
) |
Description
The function is the interface routine which is called to send a packet via the registered the NIMU Network Interface Object.
This is for *internal* NDK Stack Usage.
[in] | hIF | Handle of the NIMU Network interface object on which the packet will be transmitted. |
[in] | pPkt | Handle to the packet which needs to be sent |
Not | Applicable. |
void NIMUSetRsvdSizeInfo | ( | int | header_size, | |
int | trailer_size | |||
) |
Description
The function is to used to set the header and trailer reserved size information. This is typically used by driver authors if the driver needs a L2 header or trailer and the current size are not sufficient.
There is no validation done on the arguments.
The function is available for usage; but it should only be called from kernel mode (llEnter()/llExit())
[in] | header_size | The new header size which is to be reserved |
[in] | trailer_size | The new trailer size which is to be reserved |
Not | Applicable. |
void NIMUShutdown | ( | void | ) |
Description
The function closes the NDK core stack Network Interface Management Unit
This is for *internal* NDK Stack Usage.
Not | applicable. |
int NIMUUnregister | ( | NETIF_DEVICE * | ptr_netif_device | ) |
Description
This API is used by driver authors to unregister and stop the network device from the NIMU. The device should have been registered with the NIMU.
[in] | ptr_netif_device | The NIMU Network Interface Object to be unregistered. |
0 | - Success | |
<0 | - Error |