iPXE
|
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... | |
Network device operations.
Definition at line 213 of file netdevice.h.
int( * net_device_operations::open) (struct net_device *netdev) |
Open network device.
netdev | Network device |
rc | Return 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().
void( * net_device_operations::close) (struct net_device *netdev) |
Close network device.
netdev | Network 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().
int( * net_device_operations::transmit) (struct net_device *netdev, struct io_buffer *iobuf) |
Transmit packet.
netdev | Network device |
iobuf | I/O buffer |
rc | Return 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().
void( * net_device_operations::poll) (struct net_device *netdev) |
Poll for completed and received packets.
netdev | Network 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().
void( * net_device_operations::irq) (struct net_device *netdev, int enable) |
Enable or disable interrupts.
netdev | Network device |
enable | Interrupts 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().