include/tpl_drv_network.h File Reference


Detailed Description

Network Interface Driver Interface Definitions.

VFS Layout

All network drivers must have the following basic VFS structure The root of the driver will only contain files that are named from zero upwards that represent the present network adapters that this driver controls. All VFS nodes must implement eTplDrv_IOCtl with DRV_IOCTL_TYPE returning DRV_TYPE_NETWORK. The adapter nodes must also implement eTplNetwork_IOCtl fully (unless it is noted in the eTplNetwork_IOCtl documentation that a call is optional)

Files

Reading

When an adapter file is read from, the driver will block the reading thread until a packet arrives (if there is not already an unhandled packet in the queue) this will then be read into the destination buffer. If the packet does not fit in the buffer, the end of it is discarded. Likewise, if the packet does not completely fill the buffer, the call will still read to the buffer and then return the size of the packet.

Writing

When an adapter is written to, the data written is encoded as a packet and sent, if the data is not the correct size to be sent (if the packet is too small, or if it is too large) -1 should be returned and the packet will not be sent.

Go to the source code of this file.

Defines

#define DRV_NETWORK_IOCTLNAMES   "get_mac_addr"
 IOCtl name strings for use with eTplDrv_IOCtl.DRV_IOCTL_LOOKUP.

Enumerations

enum  eTplNetwork_IOCtl { NET_IOCTL_GETMAC = 4 }
 

Common Network IOCtl Calls.

More...

Enumeration Type Documentation

Common Network IOCtl Calls.

Enumerator:
NET_IOCTL_GETMAC 

Get the MAC address of the interface.

ioctl(..., Uint8 *MAC[6])

Returns:
1 on success, 0 if the file is the root, -1 on error

Copies the six byte Media Access Control (MAC) address of the adapter to the MAC array.

Generated on Mon Feb 14 15:21:30 2011 for Acess2 by  doxygen 1.6.3