iPXE
Data Fields
net_device_operations Struct Reference

Network device operations. More...

#include <netdevice.h>

Data Fields

int(* open )(struct net_device *netdev)
 Open network device. More...
 
void(* close )(struct net_device *netdev)
 Close network device. More...
 
int(* transmit )(struct net_device *netdev, struct io_buffer *iobuf)
 Transmit packet. More...
 
void(* poll )(struct net_device *netdev)
 Poll for completed and received packets. More...
 
void(* irq )(struct net_device *netdev, int enable)
 Enable or disable interrupts. More...
 

Detailed Description

Network device operations.

Definition at line 213 of file netdevice.h.

Field Documentation

◆ open

int( * net_device_operations::open) (struct net_device *netdev)

Open network device.

Parameters
netdevNetwork device
Return values
rcReturn status code

This method should allocate RX I/O buffers and enable the hardware to start transmitting and receiving packets.

Definition at line 222 of file netdevice.h.

Referenced by myri10ge_pci_probe(), and netdev_open().

◆ close

void( * net_device_operations::close) (struct net_device *netdev)

Close network device.

Parameters
netdevNetwork device

This method should stop the flow of packets, and free up any packets that are currently in the device's TX queue.

Definition at line 230 of file netdevice.h.

Referenced by netdev_close().

◆ transmit

int( * net_device_operations::transmit) (struct net_device *netdev, struct io_buffer *iobuf)

Transmit packet.

Parameters
netdevNetwork device
iobufI/O buffer
Return values
rcReturn status code

This method should cause the hardware to initiate transmission of the I/O buffer.

If this method returns success, the I/O buffer remains owned by the net device's TX queue, and the net device must eventually call netdev_tx_complete() to free the buffer. If this method returns failure, the I/O buffer is immediately released; the failure is interpreted as "failure to enqueue buffer".

This method is guaranteed to be called only when the device is open.

If the network device has an associated DMA device, then the I/O buffer will be automatically mapped for transmit DMA.

Definition at line 254 of file netdevice.h.

Referenced by netdev_tx().

◆ poll

void( * net_device_operations::poll) (struct net_device *netdev)

Poll for completed and received packets.

Parameters
netdevNetwork device

This method should cause the hardware to check for completed transmissions and received packets. Any received packets should be delivered via netdev_rx().

This method is guaranteed to be called only when the device is open.

Definition at line 267 of file netdevice.h.

Referenced by netdev_poll().

◆ irq

void( * net_device_operations::irq) (struct net_device *netdev, int enable)

Enable or disable interrupts.

Parameters
netdevNetwork device
enableInterrupts should be enabled

This method may be NULL to indicate that interrupts are not supported.

Definition at line 276 of file netdevice.h.

Referenced by flexboot_nodnic_probe(), netdev_irq(), and netdev_irq_supported().


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