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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

48 Bits (6 Bytes) Source address<br />

16 Bits (2 Bytes) Type field e.g 0x0608 for ARP, 0x0008 for IP or user defined types<br />

46 to 1500 Bytes of user data.<br />

The maximum number of installed handlers is limited to five. In all BIOS versions except the TINY version, setting of ARP<br />

or IP handlers is not allowed here.<br />

When an Ethernet packet of the type specified here at [DS:SI] is received by the <strong>IPC<strong>@CHIP</strong></strong>'s network device driver, this<br />

driver will perform callbacks to the receiver handler function specified here in [ES:DI]. This callback will be done twice per<br />

accepted packet:<br />

❍ First call:<br />

Input parameters to your handler: AX = 0, CX = received packet length<br />

Return Value from your handler: ES:DI - Pointer to buffer where driver can load the CX received bytes.<br />

❍ Second call:<br />

Input parameters to your handler: AX = 1, data is now ready in your buffer<br />

Return Value from your handler: -- none --<br />

On the first call, your handler produces a buffer into which the driver can transfer the received packet. This byte transfer<br />

occurs between the two calls to your handler function.<br />

Important:<br />

Because of our Little Endian processor you must exchange the bytes for the packet types e.g. use 0x0008 for the IP<br />

type instead of 0x0800.<br />

Simple example of an receiver callback function:<br />

void interrupt receiver (unsigned bp, unsigned di, unsigned si,<br />

unsigned ds, unsigned es, unsigned dx,<br />

unsigned cx, unsigned bx, unsigned ax,<br />

unsigned ip, unsigned cs, unsigned flags )<br />

{<br />

if (ax == 0) // ax==0 -> Packet driver asks for a buffer, give it at es:di<br />

{<br />

es = FP_SEG(&receivepacket);<br />

di = FP_OFF(&receivepacket);<br />

}<br />

}<br />

Related Topics<br />

Top of list<br />

Index page<br />

if (ax == 1) //Packet driver has filled our provided buffer<br />

{<br />

//Call our external c-function packet_receive to process the received data<br />

packet_received(cx);<br />

}<br />

RELEASE_TYPE Unload an Access Handler<br />

INSTALL_WILDCARD Install wildcard access handler<br />

Interrupt 0xAE service 0x03: RELEASE_TYPE, Unload an Access Handler<br />

Parameters<br />

AH<br />

BX<br />

The user installed Ethernet packet type access handler is removed.<br />

0x03<br />

Page 380 / 400

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

Saved successfully!

Ooh no, something went wrong!