@CHIP-RTOS C Library V2.06 - Packet Driver API
Set_Access_Type
Installs an access Handler for Ethernet Packets. unsigned int Set_Access_Type ( Driver_Info *drv_info,
void far * Receiver,
int *pkt_type,
int *handle ); Parameters
drv_info
- Pointer to struct returned from Get_Driver_Info
Receiver
- Pointer to receiver handler function
pkt_type
- Pointer to packet type (e.g. 0x0008 for IP)
handle
- Pointer where handle should be stored (required for release type)
Return Value
- 0 on Success
else error code:
0x00 NO_ERROR
0x01 BAD_HANDLE // invalid handle number
0x05 BAD_TYPE // Bad packet type specified
0x09 NO_SPACE // operation failed because of insufficient space
0x0A TYPE_INUSE // the type had previously been accessed and not released
0x0B BAD_COMMAND // the command was out of range, or not implemented
0x0C CANT_SEND // the packet couldn't be sent (usually a hardware error)
Comments
- We support the following Ethernet V2.0 frame format:
48 Bits (6 Bytes) Destination address
48 Bits (6 Bytes) Source address
16 Bits (2 Bytes) Type field e.g 0x0608 for ARP, 0x0008 for IP or user defined types
46 to 1500 Bytes of user data.
The maximum number of installed handlers is limited to five.
In all RTOS variants except the TINY version, setting of ARP
or IP handlers is not allowed here.
When an Ethernet packet of the type specified here at [DS:SI] is received by the
the SC12's network device driver, this driver will perform callbacks to the
receiver handler function specified here in ES:DI. This callback will be
done twice:
- First call:
Input parameters to your handler: AX = 0, CX = received packet length
Return Value from your handler: ES:DI - Pointer to buffer where driver can load
the CX received bytes.
- Second call:
Input parameters to your handler: AX = 1, data ready in your buffer now
Return Value from your handler: -- none --
On the first call, your handler produces a buffer into which the driver can transfer
the received packet. This byte transfer occurs between the two calls to your
handler function.
Important: Because of our Little Endian processor you must exchange the bytes for the
packet type e.g. use 0x0008 for the IP type instead of 0x0800.
See Also
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
Supported since or modified in @CHIP-RTOS version-
SC12 | SC13 | SC11 | SC1x3 |
-
V1.00 | V1.00 | n/a | V0.90 |
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|