01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>IPC<strong>@CHIP</strong></strong> <strong>Documentation</strong> Index<br />

Ethernet: Packet Driver Interface<br />

Ethernet Packet Driver Interface - <strong>SC12</strong> <strong>@CHIP</strong>-<strong>RTOS</strong> <strong>V1.10</strong><br />

Packet driver interface definition for direct access to the <strong>IPC<strong>@CHIP</strong></strong> Ethernet device.<br />

Packet drivers provide a simple, common programming interface that allows multiple applications to share a network interface at<br />

the data link level. The packet driver demultiplex incoming packets among the applications by using the network media's standard<br />

packet type. The packet driver provides calls to initiate access to a specific packet type, to end access to it, to send a packet,and to<br />

get information about the interface. The implemented services are only a small subset of the common packet driver interface.<br />

The <strong>IPC<strong>@CHIP</strong></strong> <strong>RTOS</strong> uses interrupt 0xAE with a service number in the high order byte of the AX register (AH) to access the<br />

<strong>IPC<strong>@CHIP</strong></strong> Ethernet packet driver. All supported services are listed here.<br />

● Interrupt_0xAE_function_0x01:_DRIVER_INFO, Get Driver Information<br />

● Interrupt_0xAE_function_0x02:_ACCESS_TYPE, Install Access Handler<br />

● Interrupt_0xAE_function_0x03:_RELEASE_TYPE, Unload an Access Handler<br />

● Interrupt_0xAE_function_0x04:_SEND_PKT, Send an Ethernet packet<br />

● Interrupt_0xAE_function_0x06:_GET_ADDRESS, Get the <strong>IPC<strong>@CHIP</strong></strong> Ethernet address<br />

● Interrupt_0xAE_function_0x14:_SET_RCV_MODE, Set receive mode<br />

● Interrupt_0xAE_function_0x15:_GET_RCV_MODE, Get current receive mode<br />

● Interrupt_0xAE_function_0x16:_SET_MULTICAST, Set Ethernet multicast address<br />

● Interrupt_0xAE_function_0x27:_DEL_MULTICAST, Remove Ethernet multicast address<br />

● Interrupt_0xAE_function_0x28:_INSTALL_WILDCARD, Install wildcard access handler<br />

On return the CPU carry flag is set if an error has occurred. The DH register holds an error code:<br />

Important:<br />

0x00 NO_ERROR<br />

0x01 BAD_HANDLE // Invalid handle number<br />

0x05 BAD_TYPE // Bad packet type specified<br />

0x09 NO_SPACE // Insufficient space<br />

0x0A TYPE_INUSE // Type already in use<br />

0x0B BAD_COMMAND // Command not supported<br />

0x0C CANT_SEND // Packet couldn't be sent<br />

// (hardware error?).<br />

One important difference to other standard packet drivers is, that the software interrupt 0xAE does not have the typical<br />

PKTDRVR signature at offset 3 in the interrupt source code. So instead of looking for this signature, use BIOS interrupt<br />

0xA0 function0x16 to check if the packet driver interface is available in the <strong>IPC<strong>@CHIP</strong></strong> <strong>@CHIP</strong>-<strong>RTOS</strong>.<br />

The maximum number of installed packet handlers is five.<br />

Examples for the usage of the packet interface:<br />

1. PKTDRV.C: C-Source for the API calls<br />

2. PKTDRV.H: Defines, typedefs, prototypes, ... for the API calls<br />

3. REC.C : Example for a receiver handler function, installed with function ACCESS_TYPE<br />

4. SEND.EXE and RCV.EXE (with source): Simple program pair for sending and receiving of Ethernet packets<br />

Page 378 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!