Hardware abstraction layer
[Network interface]


Detailed Description

This compile-time configuration module links the network protocol stack with the driver of the hardware chipset.


Files

file  hal.h
 Hardware abstraction (license: GPLv2).

Defines

#define hal_init(mac)
 Initializes the network hardware and assigns the given hardware address.
#define hal_receive_packet(buffer, buffer_len)
 Fetches the next ethernet packet from the device.
#define hal_send_packet(buffer, buffer_len)
 Sends an ethernet packet to the device.
#define hal_link_up()
 Checks wether the network link is up and has been continuously up since the last call.


Define Documentation

#define hal_init ( mac   ) 

Initializes the network hardware and assigns the given hardware address.

Parameters:
[in] mac A pointer to a 6-byte buffer containing the network mac address.
Returns:
TRUE on success, FALSE on failure.

#define hal_receive_packet ( buffer,
buffer_len   ) 

Fetches the next ethernet packet from the device.

The packet has to be written into the given buffer and the size of the packet (ethernet header plus payload, exclusive the CRC) must be returned.

Zero must be returned in the following cases:

  • There is no packet pending.
  • The packet is too large to completely fit into the buffer and must be discarded.
  • Some error occured.

Parameters:
[out] buffer The pointer to the buffer which receives the packet.
[in] buffer_len The length of the buffer.
Returns:
The packet size in bytes on success, 0 in the cases noted above.

#define hal_send_packet ( buffer,
buffer_len   ) 

Sends an ethernet packet to the device.

The packet buffer contains the ethernet header and the payload without CRC. If the CRC cannot be generated by the network hardware, it has to be calculated by the driver.

Parameters:
[in] buffer A pointer to the buffer containing the packet to be sent.
[in] buffer_len The length of the ethernet packet header plus payload.
Returns:
TRUE if the packet was sent, FALSE otherwise.

 
#define hal_link_up (  ) 

Checks wether the network link is up and has been continuously up since the last call.

Returns:
TRUE if the network link is and has been up, FALSE otherwise.


Generated on Thu May 22 18:12:37 2008 for mega-eth by  doxygen 1.5.5