My Kernel v0.1.0
Collaboration diagram for Network Device:

Data Structures

struct  ethernet_operations
 Operations that can be performed on an ethernet device. More...
 
struct  ethernet_device
 An ethernet device. More...
 

Macros

#define ETHERNET_DEVICE_PRIV_ALIGNMENT   sizeof(uint64_t)
 Boundary onto which the ethernet device's private data must be aligned.
 

Enumerations

enum  ethernet_capability { }
 Ethernet device capabilities. More...
 

Functions

struct ethernet_deviceethernet_device_alloc (size_t priv_size)
 Allocate a new ethernet device. More...
 
void ethernet_device_free (struct ethernet_device *)
 De-allocate an ethernet device.
 
error_t ethernet_device_register (struct ethernet_device *)
 Register a new ethernet device.
 
struct ethernet_deviceethernet_device_find_by_name (const char *)
 
struct ethernet_deviceethernet_device_find_by_mac (mac_address_t)
 
static void ethernet_device_set_name (struct ethernet_device *dev, const char *name)
 Set the name of the device.
 
static const char * ethernet_device_name (struct ethernet_device *dev)
 
void ethernet_device_receive_packet (struct ethernet_device *, struct packet *)
 Process a packet received by an ethernet network device.
 

Detailed Description

Network Device

Enumeration Type Documentation

◆ ethernet_capability

Enumerator
ETHERNET_CAP_MULTICAST 

Device supports broadcast packets.

Function Documentation

◆ ethernet_device_alloc()

struct ethernet_device * ethernet_device_alloc ( size_t  priv_size)
Parameters
priv_sizeThe size of the device's private data
Returns
The newly created device, or an pointed-encoded error

◆ ethernet_device_find_by_mac()

struct ethernet_device * ethernet_device_find_by_mac ( mac_address_t  mac)
Returns
The matching ethernet device, or NULL

◆ ethernet_device_find_by_name()

struct ethernet_device * ethernet_device_find_by_name ( const char *  name)
Returns
The matching ethernet device, or NULL

◆ ethernet_device_name()

static const char * ethernet_device_name ( struct ethernet_device dev)
inlinestatic
Returns
The name of the device