Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# Network Interface Card (NIC) software definition (nic.h)
[Network Library]

## Detailed Description

     #include "net/nic.h"

Description
  This is the software interface standard for network interface hardware as used by AVRlib. Drivers for network hardware must implement these functions to allow upper network layers to initialize the interface, and send and receive net traffic.

## Functions
void | nicInit (void)
void | nicSend (unsigned int len, unsigned char *packet)
unsigned int | nicPoll (unsigned int maxlen, unsigned char *packet)
void | nicGetMacAddress (uint8_t *macaddr)
void | nicSetMacAddress (uint8_t *macaddr)
void | nicRegDump (void)

## Function Documentation

void nicGetMacAddress | ( | uint8_t * | macaddr | ) |

| Return the 48-bit hardware node (MAC) address of this network interface. This function can return a MAC address read from the NIC hardware, if available. If the hardware does not provide a MAC address, a software-defined address may be returned. It may be acceptable to return an address that is less than 48-bits.

void nicInit | ( | void |  | ) |

| Initialize network interface hardware. Reset and bring up network interface hardware. This function should leave the network interface ready to handle `nicSend()` and `nicPoll()` requests. Note: For some hardware, this command will take a non-negligible amount of time (1-2 seconds). Definition at line 36 of file ax88796.c.

unsigned int nicPoll | ( | unsigned int | maxlen,
|  | unsigned char * | packet
| ) |

| Check network interface; return next received packet if avaialable. Function accepts the maximum allowable packet length (in bytes), and a pointer to the received packet buffer. Return value is the length (in bytes) of the packet recevied, or zero if no packet is available. Upper network layers may assume that an ethernet-like 802.3 header is at the beginning of the packet, and contains the packet addressing information. See net.h documentation for ethernet header format. Definition at line 48 of file ax88796.c.

void nicRegDump | ( | void |  | ) | `[inline]`

| Print network interface hardware registers. Prints a formatted list of names and values of NIC registers for debugging purposes. Definition at line 106 of file ax88796.c.

void nicSend | ( | unsigned int | len,
|  | unsigned char * | packet
| ) |

| Send packet on network interface. Function accepts the length (in bytes) of the data to be sent, and a pointer to the data. This send command may assume an ethernet-like 802.3 header is at the beginning of the packet, and contains the packet addressing information. See net.h documentation for ethernet header format. Definition at line 41 of file ax88796.c.

void nicSetMacAddress | ( | uint8_t * | macaddr | ) |

| Set the 48-bit hardware node (MAC) address of this network interface. This function may not be supported on all hardware.