iPXE
Data Structures | Defines | Enumerations | Functions | Variables
netvsc.h File Reference

Hyper-V network virtual service client. More...

Go to the source code of this file.

Data Structures

struct  netvsc_header
 NetVSC message header. More...
struct  netvsc_init_message
 NetVSC initialisation message. More...
struct  netvsc_init_completion
 NetVSC initialisation completion. More...
struct  netvsc_ndis_version_message
 NetVSC NDIS version message. More...
struct  netvsc_establish_buffer_message
 NetVSC establish data buffer message. More...
struct  netvsc_rx_buffer_section
 NetVSC receive data buffer section. More...
struct  netvsc_rx_establish_buffer_completion
 NetVSC establish receive data buffer completion. More...
struct  netvsc_tx_establish_buffer_completion
 NetVSC establish transmit data buffer completion. More...
struct  netvsc_revoke_buffer_message
 NetVSC revoke data buffer message. More...
struct  netvsc_rndis_message
 NetVSC RNDIS message. More...
struct  netvsc_ring
 A NetVSC descriptor ring. More...

Defines

#define NETVSC_MTU   512
 Maximum supported NetVSC message length.
#define NETVSC_MAX_WAIT_MS   1000
 Maximum time to wait for a transaction to complete.
#define NETVSC_TX_NUM_DESC   32
 Number of transmit ring entries.
#define NETVSC_RX_BUF_PAGESET   0xbead
 RX data buffer page set ID.
#define NETVSC_RX_BUF_LEN   ( 16 * PAGE_SIZE )
 RX data buffer length.
#define NETVSC_BASE_XID   0x18ae0000UL
 Base transaction ID.
#define NETVSC_INIT_MSG   1
 NetVSC initialisation message.
#define NETVSC_VERSION_1   2 /* sic */
 Oldest known NetVSC protocol version.
#define NETVSC_INIT_CMPLT   2
 NetVSC initialisation completion.
#define NETVSC_NDIS_VERSION_MSG   100
 NetVSC NDIS version message.
#define NETVSC_NDIS_MAJOR   6
 NetVSC NDIS major version.
#define NETVSC_NDIS_MINOR   1
 NetVSC NDIS minor version.
#define NETVSC_RX_ESTABLISH_MSG   101
 NetVSC establish receive data buffer message.
#define NETVSC_RX_ESTABLISH_CMPLT   102
 NetVSC establish receive data buffer completion.
#define NETVSC_RX_REVOKE_MSG   103
 NetVSC revoke receive data buffer message.
#define NETVSC_TX_ESTABLISH_MSG   104
 NetVSC establish transmit data buffer message.
#define NETVSC_TX_ESTABLISH_CMPLT   105
 NetVSC establish transmit data buffer completion.
#define NETVSC_TX_REVOKE_MSG   106
 NetVSC revoke transmit data buffer message.
#define NETVSC_RNDIS_MSG   107
 NetVSC RNDIS message.
#define NETVSC_RNDIS_DATA   0
 RNDIS data channel (for RNDIS_PACKET_MSG only)
#define NETVSC_RNDIS_CONTROL   1
 RNDIS control channel (for all other RNDIS messages)
#define NETVSC_RNDIS_NO_BUFFER   0xffffffffUL
 "No buffer used" index

Enumerations

enum  netvsc_xrid {
  NETVSC_TX_BASE_XRID = 0, NETVSC_INIT_XRID = ( NETVSC_TX_BASE_XRID + NETVSC_TX_NUM_DESC ), NETVSC_NDIS_VERSION_XRID, NETVSC_RX_ESTABLISH_XRID,
  NETVSC_RX_REVOKE_XRID
}
 Relative transaction IDs. More...
enum  netvsc_status {
  NETVSC_NONE = 0, NETVSC_OK = 1, NETVSC_FAIL = 2, NETVSC_TOO_NEW = 3,
  NETVSC_TOO_OLD = 4, NETVSC_BAD_PACKET = 5, NETVSC_BUSY = 6, NETVSC_UNSUPPORTED = 7
}
 NetVSC status codes. More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
struct netvsc_header __attribute__ ((packed))
static __attribute__ ((always_inline)) void netvsc_init_ring(struct netvsc_ring *ring
 Initialise descriptor ring.

Variables

uint32_t type
 Type.
struct netvsc_header header
 Message header.
uint32_t min
 Minimum supported protocol version.
uint32_t max
 Maximum supported protocol version.
uint8_t reserved [20]
 Reserved.
uint32_t version
 Protocol version.
uint32_t max_mdl_len
 Maximum memory descriptor list length.
uint32_t status
 Status.
uint32_t major
 Major version.
uint32_t minor
 Minor version.
uint32_t gpadl
 GPADL ID.
uint16_t pageset
 Page set ID.
uint32_t start
 Starting offset.
uint32_t len
 Subsection length.
uint32_t count
 Number of subsections.
uint32_t end
 Ending offset.
struct netvsc_rx_buffer_section section [1]
 Section descriptors.
uint32_t channel
 RNDIS channel.
uint32_t buffer
 Buffer index (or NETVSC_RNDIS_NO_BUFFER)
struct netvsc_ring __attribute__
static unsigned int struct
io_buffer ** 
iobufs
static uint16_t struct
vmbus_xfer_pages_operations
op
static uint16_t struct
vmbus_xfer_pages_operations
uint8_t 
establish_type
static uint16_t struct
vmbus_xfer_pages_operations
uint8_t uint8_t 
establish_xrid
static uint16_t struct
vmbus_xfer_pages_operations
uint8_t uint8_t uint8_t 
revoke_type
static uint16_t struct
vmbus_xfer_pages_operations
uint8_t uint8_t uint8_t
uint8_t 
revoke_xrid

Detailed Description

Hyper-V network virtual service client.

Definition in file netvsc.h.


Define Documentation

#define NETVSC_MTU   512

Maximum supported NetVSC message length.

Definition at line 13 of file netvsc.h.

Referenced by netvsc_open().

#define NETVSC_MAX_WAIT_MS   1000

Maximum time to wait for a transaction to complete.

This is a policy decision.

Definition at line 19 of file netvsc.h.

Referenced by netvsc_control().

#define NETVSC_TX_NUM_DESC   32

Number of transmit ring entries.

Must be a power of two. This is a policy decision. This value must be sufficiently small to guarantee that we never run out of space in the VMBus outbound ring buffer.

Definition at line 27 of file netvsc.h.

Referenced by netvsc_probe(), and netvsc_recv_completion().

#define NETVSC_RX_BUF_PAGESET   0xbead

RX data buffer page set ID.

This is a policy decision.

Definition at line 33 of file netvsc.h.

Referenced by netvsc_probe().

#define NETVSC_RX_BUF_LEN   ( 16 * PAGE_SIZE )

RX data buffer length.

This is a policy decision.

Definition at line 39 of file netvsc.h.

Referenced by netvsc_probe().

#define NETVSC_BASE_XID   0x18ae0000UL

Base transaction ID.

This is a policy decision.

Definition at line 45 of file netvsc.h.

Referenced by netvsc_cancel_transmit(), netvsc_control(), netvsc_recv_completion(), and netvsc_transmit().

#define NETVSC_INIT_MSG   1

NetVSC initialisation message.

Definition at line 80 of file netvsc.h.

Referenced by netvsc_initialise().

#define NETVSC_VERSION_1   2 /* sic */

Oldest known NetVSC protocol version.

Definition at line 95 of file netvsc.h.

Referenced by netvsc_initialise().

#define NETVSC_INIT_CMPLT   2

NetVSC initialisation completion.

Definition at line 98 of file netvsc.h.

Referenced by netvsc_initialised().

#define NETVSC_NDIS_VERSION_MSG   100

NetVSC NDIS version message.

Definition at line 115 of file netvsc.h.

Referenced by netvsc_ndis_version().

#define NETVSC_NDIS_MAJOR   6

NetVSC NDIS major version.

Definition at line 130 of file netvsc.h.

Referenced by netvsc_ndis_version().

#define NETVSC_NDIS_MINOR   1

NetVSC NDIS minor version.

Definition at line 133 of file netvsc.h.

Referenced by netvsc_ndis_version().

#define NETVSC_RX_ESTABLISH_MSG   101

NetVSC establish receive data buffer message.

Definition at line 136 of file netvsc.h.

Referenced by netvsc_probe().

#define NETVSC_RX_ESTABLISH_CMPLT   102

NetVSC establish receive data buffer completion.

Definition at line 139 of file netvsc.h.

Referenced by netvsc_rx_established_buffer().

#define NETVSC_RX_REVOKE_MSG   103

NetVSC revoke receive data buffer message.

Definition at line 142 of file netvsc.h.

Referenced by netvsc_probe().

#define NETVSC_TX_ESTABLISH_MSG   104

NetVSC establish transmit data buffer message.

Definition at line 145 of file netvsc.h.

#define NETVSC_TX_ESTABLISH_CMPLT   105

NetVSC establish transmit data buffer completion.

Definition at line 148 of file netvsc.h.

#define NETVSC_TX_REVOKE_MSG   106

NetVSC revoke transmit data buffer message.

Definition at line 151 of file netvsc.h.

#define NETVSC_RNDIS_MSG   107

NetVSC RNDIS message.

Definition at line 210 of file netvsc.h.

Referenced by netvsc_recv_data(), and netvsc_transmit().

#define NETVSC_RNDIS_DATA   0

RNDIS data channel (for RNDIS_PACKET_MSG only)

Definition at line 227 of file netvsc.h.

Referenced by netvsc_transmit().

#define NETVSC_RNDIS_CONTROL   1

RNDIS control channel (for all other RNDIS messages)

Definition at line 230 of file netvsc.h.

Referenced by netvsc_transmit().

#define NETVSC_RNDIS_NO_BUFFER   0xffffffffUL

"No buffer used" index

Definition at line 233 of file netvsc.h.

Referenced by netvsc_transmit().


Enumeration Type Documentation

Relative transaction IDs.

Enumerator:
NETVSC_TX_BASE_XRID 

Transmit descriptors (one per transmit buffer ID)

NETVSC_INIT_XRID 

Initialisation.

NETVSC_NDIS_VERSION_XRID 

NDIS version.

NETVSC_RX_ESTABLISH_XRID 

Establish receive buffer.

NETVSC_RX_REVOKE_XRID 

Revoke receive buffer.

Definition at line 48 of file netvsc.h.

                 {
        /** Transmit descriptors (one per transmit buffer ID) */
        NETVSC_TX_BASE_XRID = 0,
        /** Initialisation */
        NETVSC_INIT_XRID = ( NETVSC_TX_BASE_XRID + NETVSC_TX_NUM_DESC ),
        /** NDIS version */
        NETVSC_NDIS_VERSION_XRID,
        /** Establish receive buffer */
        NETVSC_RX_ESTABLISH_XRID,
        /** Revoke receive buffer */
        NETVSC_RX_REVOKE_XRID,
};

NetVSC status codes.

Enumerator:
NETVSC_NONE 
NETVSC_OK 
NETVSC_FAIL 
NETVSC_TOO_NEW 
NETVSC_TOO_OLD 
NETVSC_BAD_PACKET 
NETVSC_BUSY 
NETVSC_UNSUPPORTED 

Definition at line 62 of file netvsc.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
struct netvsc_header __attribute__ ( (packed)  )
static __attribute__ ( (always_inline)  ) [inline, static]

Initialise descriptor ring.

Check if NetVSC device is obsolete.

Initialise data buffer.

Parameters:
ringDescriptor ring
countMaximum number of used descriptors
iobufsI/O buffers
idsBuffer IDs
bufferData buffer
pagesetPage set ID
opPage set operations
establish_typeEstablish data buffer message type
establish_xridEstablish data buffer relative transaction ID
revoke_typeRevoke data buffer message type
revoke_typeRevoke data buffer relative transaction ID
lenRequired length
netvscNetVSC device
is_obsoleteNetVSC device is obsolete

Check if NetVSC device is obsolete (i.e. was opened before the most recent Hyper-V reset).


Variable Documentation

Type.

Definition at line 79 of file netvsc.h.

Message header.

Definition at line 94 of file netvsc.h.

Minimum supported protocol version.

Definition at line 96 of file netvsc.h.

Maximum supported protocol version.

Definition at line 98 of file netvsc.h.

Reserved.

Definition at line 100 of file netvsc.h.

Protocol version.

Definition at line 116 of file netvsc.h.

Maximum memory descriptor list length.

Definition at line 118 of file netvsc.h.

Status.

Definition at line 120 of file netvsc.h.

Major version.

Major version number.

Definition at line 131 of file netvsc.h.

Referenced by aoe_open(), aoedev_open(), and ar9300_eeprom_restore_internal().

Minor version.

Minor version number.

Definition at line 133 of file netvsc.h.

Referenced by aoe_open(), aoedev_open(), ar9300_eeprom_restore_internal(), and falcon_probe_nic_variant().

GPADL ID.

Definition at line 167 of file netvsc.h.

Referenced by netvsc_create_buffer(), vmbus_establish_gpadl(), and vmbus_open().

static uint16_t pageset

Page set ID.

Definition at line 169 of file netvsc.h.

Subsection length.

Buffer length.

Section length.

Definition at line 179 of file netvsc.h.

unsigned int count

Number of subsections.

Number of sections (must be 1)

Definition at line 181 of file netvsc.h.

Section descriptors.

Definition at line 195 of file netvsc.h.

unsigned int struct io_buffer** iobufs

Definition at line 259 of file netvsc.h.

Definition at line 327 of file netvsc.h.

Definition at line 327 of file netvsc.h.

Definition at line 327 of file netvsc.h.

Definition at line 327 of file netvsc.h.