iPXE
Data Structures | Macros | Functions | Variables
ncm.h File Reference

CDC-NCM USB Ethernet driver. More...

#include <stdint.h>
#include <ipxe/usb.h>
#include <ipxe/cdc.h>
#include <byteswap.h>
#include "ecm.h"

Go to the source code of this file.

Data Structures

struct  ncm_ntb_datagram_parameters
 NTB datagram parameters. More...
 
struct  ncm_ntb_parameters
 NTB parameters. More...
 
struct  ncm_set_ntb_input_size
 Set NTB input size. More...
 
struct  ncm_transfer_header
 CDC-NCM transfer header (16-bit) More...
 
struct  ncm_datagram_descriptor
 CDC-NCM datagram descriptor (16-bit) More...
 
struct  ncm_datagram_pointer
 CDC-NCM datagram pointer (16-bit) More...
 
struct  ncm_ntb_header
 NTB constructed for transmitted packets (excluding padding) More...
 
struct  ncm_device
 A CDC-NCM network device. More...
 

Macros

#define USB_SUBCLASS_CDC_NCM   0x0d
 CDC-NCM subclass. More...
 
#define NCM_GET_NTB_PARAMETERS
 Get NTB parameters. More...
 
#define NCM_SET_NET_ADDRESS
 Set MAC address. More...
 
#define NCM_SET_NTB_INPUT_SIZE
 Set NTB input size. More...
 
#define NCM_MIN_NTB_INPUT_SIZE   2048
 Minimum allowed NTB input size. More...
 
#define NCM_MAX_NTB_INPUT_SIZE   65536
 Maximum allowed NTB input size (16-bit) More...
 
#define NCM_TRANSFER_HEADER_MAGIC   0x484d434eUL
 CDC-NCM transfer header magic. More...
 
#define NCM_DATAGRAM_POINTER_MAGIC   0x304d434eUL
 CDC-NCM datagram pointer magic. More...
 
#define NCM_DATAGRAM_POINTER_MAGIC_CRC   0x01000000UL
 CDC-NCM datagram pointer CRC present flag. More...
 
#define NCM_IN_MIN_COUNT   3
 Bulk IN ring minimum buffer count. More...
 
#define NCM_IN_MIN_SIZE   16384
 Bulk IN ring minimum total buffer size. More...
 
#define NCM_IN_MAX_SIZE   131072
 Bulk IN ring maximum total buffer size. More...
 
#define NCM_INTR_COUNT   2
 Interrupt ring buffer count. More...
 

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 

Variables

struct ncm_ntb_datagram_parameters __attribute__
 

Detailed Description

CDC-NCM USB Ethernet driver.

Definition in file ncm.h.

Macro Definition Documentation

◆ USB_SUBCLASS_CDC_NCM

#define USB_SUBCLASS_CDC_NCM   0x0d

CDC-NCM subclass.

Definition at line 19 of file ncm.h.

◆ NCM_GET_NTB_PARAMETERS

#define NCM_GET_NTB_PARAMETERS
Value:
USB_REQUEST_TYPE ( 0x80 ) )
#define USB_RECIP_INTERFACE
Request recipient is an interface.
Definition: usb.h:101
#define USB_TYPE_CLASS
Class-specific request type.
Definition: usb.h:89
#define USB_DIR_IN
Data transfer is from device to host.
Definition: usb.h:83

Get NTB parameters.

Definition at line 22 of file ncm.h.

◆ NCM_SET_NET_ADDRESS

#define NCM_SET_NET_ADDRESS
Value:
USB_REQUEST_TYPE ( 0x82 ) )
#define USB_RECIP_INTERFACE
Request recipient is an interface.
Definition: usb.h:101
#define USB_DIR_OUT
Data transfer is from host to device.
Definition: usb.h:80
#define USB_TYPE_CLASS
Class-specific request type.
Definition: usb.h:89

Set MAC address.

Definition at line 55 of file ncm.h.

◆ NCM_SET_NTB_INPUT_SIZE

#define NCM_SET_NTB_INPUT_SIZE
Value:
USB_REQUEST_TYPE ( 0x86 ) )
#define USB_RECIP_INTERFACE
Request recipient is an interface.
Definition: usb.h:101
#define USB_DIR_OUT
Data transfer is from host to device.
Definition: usb.h:80
#define USB_TYPE_CLASS
Class-specific request type.
Definition: usb.h:89

Set NTB input size.

Definition at line 60 of file ncm.h.

◆ NCM_MIN_NTB_INPUT_SIZE

#define NCM_MIN_NTB_INPUT_SIZE   2048

Minimum allowed NTB input size.

Definition at line 71 of file ncm.h.

◆ NCM_MAX_NTB_INPUT_SIZE

#define NCM_MAX_NTB_INPUT_SIZE   65536

Maximum allowed NTB input size (16-bit)

Definition at line 74 of file ncm.h.

◆ NCM_TRANSFER_HEADER_MAGIC

#define NCM_TRANSFER_HEADER_MAGIC   0x484d434eUL

CDC-NCM transfer header magic.

Definition at line 91 of file ncm.h.

◆ NCM_DATAGRAM_POINTER_MAGIC

#define NCM_DATAGRAM_POINTER_MAGIC   0x304d434eUL

CDC-NCM datagram pointer magic.

Definition at line 117 of file ncm.h.

◆ NCM_DATAGRAM_POINTER_MAGIC_CRC

#define NCM_DATAGRAM_POINTER_MAGIC_CRC   0x01000000UL

CDC-NCM datagram pointer CRC present flag.

Definition at line 120 of file ncm.h.

◆ NCM_IN_MIN_COUNT

#define NCM_IN_MIN_COUNT   3

Bulk IN ring minimum buffer count.

This is a policy decision.

Definition at line 158 of file ncm.h.

◆ NCM_IN_MIN_SIZE

#define NCM_IN_MIN_SIZE   16384

Bulk IN ring minimum total buffer size.

This is a policy decision.

Definition at line 164 of file ncm.h.

◆ NCM_IN_MAX_SIZE

#define NCM_IN_MAX_SIZE   131072

Bulk IN ring maximum total buffer size.

This is a policy decision.

Definition at line 170 of file ncm.h.

◆ NCM_INTR_COUNT

#define NCM_INTR_COUNT   2

Interrupt ring buffer count.

This is a policy decision.

Definition at line 176 of file ncm.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

Variable Documentation

◆ __attribute__