Loopback Service
[Network interface drivers]

Collaboration diagram for Loopback Service:

Files

file  lo.c
 

Loopback network interface implementation.


Defines

#define DEFAULT_ADDR   "\0\0\0\0\0\0"
 Default hardware address.
#define DEFAULT_ADDR_LEN   (sizeof(DEFAULT_ADDR) / sizeof(char))
 Default address length.
#define NAME   "lo - loopback interface"
 Loopback module name.

Functions

int change_state_message (device_ref device, device_state_t state)
 Changes the loopback state.
int create (device_id_t device_id, device_ref *device)
 Creates and returns the loopback network interface structure.
void module_print_name (void)
 Prints the module name.
int netif_specific_message (ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, int *answer_count)
 Processes the netif driver specific message.
int netif_get_addr_message (device_id_t device_id, measured_string_ref address)
 Returns the device local hardware address.
int netif_get_device_stats (device_id_t device_id, device_stats_ref stats)
 Returns the device usage statistics.
int netif_initialize (void)
 Initializes the specific module.
int netif_probe_message (device_id_t device_id, int irq, uintptr_t io)
 Probes the existence of the device.
int netif_send_message (device_id_t device_id, packet_t packet, services_t sender)
 Sends the packet queue.
int netif_start_message (device_ref device)
 Starts the device.
int netif_stop_message (device_ref device)
 Stops the device.

Variables

netif_globals_t netif_globals
 Network interface global data.

Define Documentation

#define DEFAULT_ADDR   "\0\0\0\0\0\0"

Default hardware address.

Referenced by netif_get_addr_message().

#define DEFAULT_ADDR_LEN   (sizeof(DEFAULT_ADDR) / sizeof(char))

Default address length.

Referenced by netif_get_addr_message(), and packet_get_1().

#define NAME   "lo - loopback interface"

Loopback module name.


Function Documentation

int change_state_message ( device_ref  device,
device_state_t  state 
)

Changes the loopback state.

Parameters:
[in] device The device structure.
[in] state The new device state.
Returns:
The new state if changed.
EOK otherwise.

References NETIF_ACTIVE, and netif_device::state.

Referenced by netif_start_message(), and netif_stop_message().

Here is the caller graph for this function:

int create ( device_id_t  device_id,
device_ref device 
)

Creates and returns the loopback network interface structure.

Parameters:
[in] device_id The new devce identifier.
[out] device The device structure.
Returns:
EOK on success.
EXDEV if one loopback network interface already exists.
ENOMEM if there is not enough memory left.

References netif_globals::device_map, free, NETIF_STOPPED, null_device_stats(), and netif_device::specific.

Referenced by netif_probe_message().

Here is the call graph for this function:

Here is the caller graph for this function:

void module_print_name ( void   ) 

Prints the module name.

See also:
NAME

References NAME.

int netif_get_addr_message ( device_id_t  device_id,
measured_string_ref  address 
)

Returns the device local hardware address.

Parameters:
[in] device_id The device identifier.
[out] address The device local hardware address.
Returns:
EOK on success.
EBADMEM if the address parameter is NULL.
ENOENT if there no such device.
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.

References CONVERT_SIZE, DEFAULT_ADDR, DEFAULT_ADDR_LEN, ERROR_DECLARE, ERROR_PROPAGATE, find_device(), measured_string::length, netif_device::specific, and measured_string::value.

Here is the call graph for this function:

int netif_get_device_stats ( device_id_t  device_id,
device_stats_ref  stats 
)
int netif_initialize ( void   ) 

Initializes the specific module.

References irq_handler(), and REGISTER_ME.

Here is the call graph for this function:

int netif_probe_message ( device_id_t  device_id,
int  irq,
uintptr_t  io 
)

Probes the existence of the device.

Parameters:
[in] device_id The device identifier.
[in] irq The device interrupt number.
[in] io The device input/output address.
Returns:
EOK on success.
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.

References create(), dpeth::de_base_port, dpeth::de_irq, dpeth::de_mode, DEM_DISABLED, netif_device::device_id, netif_globals::device_map, do_probe(), DP8390_IO_SIZE, ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, ERROR_PROPAGATE, free, NETIF_STOPPED, netif_device::nil_phone, netif_device::specific, and netif_device::state.

Here is the call graph for this function:

int netif_send_message ( device_id_t  device_id,
packet_t  packet,
services_t  sender 
)

Sends the packet queue.

Parameters:
[in] device_id The device identifier.
[in] packet The packet queue.
[in] sender The sending module service.
Returns:
EOK on success.
EFORWARD if the device is not active (in the NETIF_ACTIVE state).
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.

References do_pwrite(), ERROR_DECLARE, ERROR_PROPAGATE, FALSE, find_device(), netif_globals::lock, NETIF_ACTIVE, netif_pq_release(), netif_device::nil_phone, nil_received_msg(), packet_get_data(), packet_get_data_length(), packet_get_id(), pq_detach(), pq_next(), netif_device::specific, and netif_device::state.

Here is the call graph for this function:

int netif_specific_message ( ipc_callid_t  callid,
ipc_call_t *  call,
ipc_call_t *  answer,
int *  answer_count 
)

Processes the netif driver specific message.

This function is called for uncommon messages received by the netif skeleton.

Parameters:
[in] callid The message identifier.
[in] call The message parameters.
[out] answer The message answer parameters.
[out] answer_count The last parameter for the actual answer in the answer parameter.
Returns:
EOK on success.
ENOTSUP if the message is not known.
Other error codes as defined for the specific module message implementation.
int netif_start_message ( device_ref  device  ) 

Starts the device.

Parameters:
[in] device The device structure.
Returns:
EOK on success.
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.

References change_state(), change_state_message(), dpeth::de_dp8390_port, dpeth::de_irq, netif_device::device_id, DL_BROAD_REQ, do_init(), dp8390_cmds, dp8390_code, DP_ISR, ERROR_CODE, ERROR_DECLARE, ERROR_OCCURRED, ERROR_PROPAGATE, NETIF_ACTIVE, netif_device::specific, and netif_device::state.

Here is the call graph for this function:

int netif_stop_message ( device_ref  device  ) 

Stops the device.

Parameters:
[in] device The device structure.
Returns:
EOK on success.
Other error codes as defined for the find_device() function.
Other error codes as defined for the specific module message implementation.

References change_state(), change_state_message(), dpeth::de_irq, netif_device::device_id, do_stop(), NETIF_STOPPED, netif_device::specific, and netif_device::state.

Here is the call graph for this function:


Variable Documentation

Network interface global data.

Network interface module global data.


Generated on Thu Mar 11 20:46:33 2010 for Networking and TCP/IP stack for HelenOS system by  doxygen 1.6.1