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


Field Documentation

Open network device.

Parameters:
netdev Network device
Return values:
rc Return status code
This method should allocate RX I/O buffers and enable the hardware to start transmitting and receiving packets.

Referenced by myri10ge_pci_probe(), and netdev_open().

Close network device.

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

Referenced by netdev_close().

Transmit packet.

Parameters:
netdev Network device
iobuf I/O buffer
Return values:
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.

Referenced by netdev_tx().

Poll for completed and received packets.

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

Referenced by netdev_poll().

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

Enable or disable interrupts.

Parameters:
netdev Network device
enable Interrupts should be enabled

Referenced by netdev_irq().


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

Generated on Tue Apr 6 20:02:07 2010 for gPXE by  doxygen 1.5.7.1