nip_phy_if_t Struct Reference

Physical layer driver interface. More...

#include <net_if.h>

Collaboration diagram for nip_phy_if_t:

Collaboration graph
[legend]

Data Fields

nip_phy_if_type_t type
 Interface type which will be used by ARP for address resolution.
nip_net_if_stats_t stats
 Physical Interface statistics (packet loss, etc).
nip_phy_if_flags_t flags
 Physical Interface Flags.
uint8_t hw_addr [NIP_MAX_HW_ADDR_SIZE]
 Hardware address.
uint8_t hw_brdcst_addr [NIP_MAX_HW_ADDR_SIZE]
 Hardware broadcast address.
uint8_t hw_addr_size
uint16_t rx_bytes
 Size of hardware address.
uint16_t rx_pos
 bytes pending to be read from phy memory.
uint16_t tx_bytes
 position in receive packet buffer
uint16_t tx_pos
 bytes still to be sent in current transmission
nip_success_t(* open )(nip_net_if_id_t net_if_id)
 position in transmit packet buffer
nip_success_t(* close )(nip_net_if_id_t net_if_id)
 Stops network interface.
nip_error_t(* hard_send_init )(nip_net_if_id_t net_if_id, void *ll_target_addr, uint16_t type, void *daddr, void *saddr, uint16_t len)
 Builds hardware header and initializes packet transmission.
uint16_t(* hard_send )(nip_net_if_id_t net_if_id, uint8_t *buffer, uint16_t count)
 Transmit count bytes from given buffer.
uint16_t(* hard_read )(nip_net_if_id_t net_if_id, uint8_t *buffer, uint16_t count)
 Read data from interface and copy it into recv_buf.
nip_success_t(* hard_read_init )(nip_net_if_id_t net_if_id)
 Initialize Reading packet from interface.
void(* hard_disp_recv )(void)
 Function to be called by dispatcher to initiate reception of data.

Detailed Description

Physical layer driver interface.

Some of the properties are in the style of Linux device driver attributes and methods.

Todo:
add interface functions

Definition at line 292 of file net_if.h.


Field Documentation

Interface type which will be used by ARP for address resolution.

Definition at line 294 of file net_if.h.

Referenced by nip_dhcp_disp_check().

Physical Interface statistics (packet loss, etc).

Definition at line 295 of file net_if.h.

Physical Interface Flags.

Definition at line 296 of file net_if.h.

Referenced by init_networking().

uint8_t nip_phy_if_t::hw_addr[NIP_MAX_HW_ADDR_SIZE]

Hardware address.

Definition at line 297 of file net_if.h.

Referenced by nip_dhcp_disp_check().

uint8_t nip_phy_if_t::hw_brdcst_addr[NIP_MAX_HW_ADDR_SIZE]

Hardware broadcast address.

Definition at line 298 of file net_if.h.

Definition at line 299 of file net_if.h.

Referenced by nip_dhcp_disp_check().

Size of hardware address.

Definition at line 300 of file net_if.h.

bytes pending to be read from phy memory.

After read-initialization this will be the packet length.

Definition at line 301 of file net_if.h.

position in receive packet buffer

Definition at line 302 of file net_if.h.

bytes still to be sent in current transmission

Definition at line 303 of file net_if.h.

position in transmit packet buffer

Opens network interface. The open method should register any system resource it needs (I/O ports, IRQ, etc)

Returns:
  • NIP_SUCCESS if network interface has been opened, or
  • NIP_ERROR if opening network interface failed.

Referenced by init_networking().

Stops network interface.

Reverses anything that's been done at open.

Returns:
  • NIP_SUCCESS if network interface has been closed, or
  • NIP_ERROR if closing network interface failed.

Referenced by init_networking().

nip_error_t(* nip_phy_if_t::hard_send_init)(nip_net_if_id_t net_if_id, void *ll_target_addr, uint16_t type, void *daddr, void *saddr, uint16_t len)

Builds hardware header and initializes packet transmission.

If daddr is NULL, the destination address should be resolved using the given ll_target_addr. For ethernet devices ARP is being used. Ethernet device drivers can rely on nip_arp_lookup( uint8_t* addr) to be available. If the Address cannot be resolved locally the hardware specific address resolution mechanism should be initiated and the return value set to NIP_RESOLVING_ADDR. It's up to the caller to handle the return value correctly and retry transmission after a reasonable timeout.

Returns:
  • NIP_E_OK transmission initialized successfully
  • NIP_E_RESOLVING_ADDR address resolution started, or
  • NIP_E_PARAM_FAILED source or destination address was invalid
  • NIP_E_HARD_ERROR error connecting to network hardware

Referenced by init_networking().

uint16_t(* nip_phy_if_t::hard_send)(nip_net_if_id_t net_if_id, uint8_t *buffer, uint16_t count)

Transmit count bytes from given buffer.

Returns:
  • number of bytes transmitted, or
  • 0 if error occured

Referenced by init_networking().

uint16_t(* nip_phy_if_t::hard_read)(nip_net_if_id_t net_if_id, uint8_t *buffer, uint16_t count)

Read data from interface and copy it into recv_buf.

If size is 0 the current reception will be terminated, all pending bytes discarded and network interface reset to read next packet.

Returns:
number of bytes copied.

Referenced by init_networking().

Initialize Reading packet from interface.

Returns:
packet length or 0 if packet buffer is empty.

Referenced by init_networking().

Function to be called by dispatcher to initiate reception of data.


The documentation for this struct was generated from the following file:

Generated on Thu Jul 10 01:10:10 2008 for NIP by  doxygen 1.5.5