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.
void(* close )(struct net_device *netdev)
 Close network device.
int(* transmit )(struct net_device *netdev, struct io_buffer *iobuf)
 Transmit packet.
void(* poll )(struct net_device *netdev)
 Poll for completed and received packets.
void(* irq )(struct net_device *netdev, int enable)
 Enable or disable interrupts.

Detailed Description

Network device operations.

Definition at line 213 of file netdevice.h.


Field Documentation

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 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 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.

Definition at line 250 of file netdevice.h.

Referenced by netdev_tx().

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 263 of file netdevice.h.

Referenced by netdev_poll().

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 272 of file netdevice.h.

Referenced by flexboot_nodnic_probe(), and netdev_irq().


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