iPXE
|
Remote Network Driver Interface Specification. More...
Go to the source code of this file.
Data Structures | |
struct | rndis_header |
RNDIS message header. More... | |
struct | rndis_initialise_message |
RNDIS initialise message. More... | |
struct | rndis_initialise_completion |
RNDIS initialise completion. More... | |
struct | rndis_halt_message |
RNDIS halt message. More... | |
struct | rndis_oid_message |
RNDIS query or set OID message. More... | |
struct | rndis_query_completion |
RNDIS query OID completion. More... | |
struct | rndis_set_completion |
RNDIS set OID completion. More... | |
struct | rndis_reset_message |
RNDIS reset message. More... | |
struct | rndis_reset_completion |
RNDIS reset completion. More... | |
struct | rndis_diagnostic_info |
RNDIS diagnostic information. More... | |
struct | rndis_indicate_status_message |
RNDIS indicate status message. More... | |
struct | rndis_keepalive_message |
RNDIS keepalive message. More... | |
struct | rndis_keepalive_completion |
RNDIS keepalive completion. More... | |
struct | rndis_packet_field |
RNDIS packet field. More... | |
struct | rndis_packet_message |
RNDIS packet message. More... | |
struct | rndis_packet_record |
RNDIS packet record. More... | |
struct | rndis_operations |
RNDIS device operations. More... | |
struct | rndis_device |
An RNDIS device. More... | |
Macros | |
#define | RNDIS_MAX_WAIT_MS 1000 |
Maximum time to wait for a transaction to complete. More... | |
#define | RNDIS_INITIALISE_MSG 0x00000002UL |
RNDIS initialise message. More... | |
#define | RNDIS_INIT_ID 0xe110e110UL |
Request ID used for initialisation. More... | |
#define | RNDIS_VERSION_MAJOR 1 |
RNDIS major version. More... | |
#define | RNDIS_VERSION_MINOR 0 |
RNDIS minor version. More... | |
#define | RNDIS_MTU 2048 |
RNDIS maximum transfer size. More... | |
#define | RNDIS_INITIALISE_CMPLT 0x80000002UL |
RNDIS initialise completion. More... | |
#define | RNDIS_HALT_MSG 0x00000003UL |
RNDIS halt message. More... | |
#define | RNDIS_QUERY_MSG 0x00000004UL |
RNDIS query OID message. More... | |
#define | RNDIS_SET_MSG 0x00000005UL |
RNDIS set OID message. More... | |
#define | RNDIS_QUERY_CMPLT 0x80000004UL |
RNDIS query OID completion. More... | |
#define | RNDIS_SET_CMPLT 0x80000005UL |
RNDIS set OID completion. More... | |
#define | RNDIS_RESET_MSG 0x00000006UL |
RNDIS reset message. More... | |
#define | RNDIS_RESET_CMPLT 0x80000006UL |
RNDIS reset completion. More... | |
#define | RNDIS_INDICATE_STATUS_MSG 0x00000007UL |
RNDIS indicate status message. More... | |
#define | RNDIS_KEEPALIVE_MSG 0x00000008UL |
RNDIS keepalive message. More... | |
#define | RNDIS_KEEPALIVE_CMPLT 0x80000008UL |
RNDIS keepalive completion. More... | |
#define | RNDIS_PACKET_MSG 0x00000001UL |
RNDIS packet message. More... | |
#define | RNDIS_OID_GEN_CURRENT_PACKET_FILTER 0x0001010eUL |
OID for packet filter. More... | |
#define | RNDIS_OID_GEN_MEDIA_CONNECT_STATUS 0x00010114UL |
OID for media status. More... | |
#define | RNDIS_OID_802_3_PERMANENT_ADDRESS 0x01010101UL |
OID for permanent MAC address. More... | |
#define | RNDIS_OID_802_3_CURRENT_ADDRESS 0x01010102UL |
OID for current MAC address. More... | |
Enumerations | |
enum | rndis_status { RNDIS_STATUS_MEDIA_CONNECT = 0x4001000bUL, RNDIS_STATUS_MEDIA_DISCONNECT = 0x4001000cUL, RNDIS_STATUS_WTF_WORLD = 0x40020006UL } |
RNDIS status codes. More... | |
enum | rndis_packet_filter { RNDIS_FILTER_UNICAST = 0x00000001UL, RNDIS_FILTER_MULTICAST = 0x00000002UL, RNDIS_FILTER_ALL_MULTICAST = 0x00000004UL, RNDIS_FILTER_BROADCAST = 0x00000008UL, RNDIS_FILTER_PROMISCUOUS = 0x00000020UL } |
Packet filter bits. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static void | rndis_init (struct rndis_device *rndis, struct rndis_operations *op) |
Initialise an RNDIS device. More... | |
void | rndis_tx_complete_err (struct rndis_device *rndis, struct io_buffer *iobuf, int rc) |
Complete message transmission. More... | |
int | rndis_tx_defer (struct rndis_device *rndis, struct io_buffer *iobuf) |
Defer transmitted packet. More... | |
void | rndis_rx (struct rndis_device *rndis, struct io_buffer *iobuf) |
Receive packet from underlying transport layer. More... | |
void | rndis_rx_err (struct rndis_device *rndis, struct io_buffer *iobuf, int rc) |
Discard packet from underlying transport layer. More... | |
struct rndis_device * | alloc_rndis (size_t priv_len) |
Allocate RNDIS device. More... | |
int | register_rndis (struct rndis_device *rndis) |
Register RNDIS device. More... | |
void | unregister_rndis (struct rndis_device *rndis) |
Unregister RNDIS device. More... | |
void | free_rndis (struct rndis_device *rndis) |
Free RNDIS device. More... | |
static void | rndis_tx_complete (struct rndis_device *rndis, struct io_buffer *iobuf) |
Complete message transmission. More... | |
Remote Network Driver Interface Specification.
Definition in file rndis.h.
#define RNDIS_MAX_WAIT_MS 1000 |
#define RNDIS_INITIALISE_MSG 0x00000002UL |
#define RNDIS_INIT_ID 0xe110e110UL |
#define RNDIS_MTU 2048 |
#define RNDIS_INITIALISE_CMPLT 0x80000002UL |
#define RNDIS_QUERY_MSG 0x00000004UL |
#define RNDIS_QUERY_CMPLT 0x80000004UL |
#define RNDIS_SET_CMPLT 0x80000005UL |
#define RNDIS_RESET_CMPLT 0x80000006UL |
#define RNDIS_INDICATE_STATUS_MSG 0x00000007UL |
#define RNDIS_KEEPALIVE_MSG 0x00000008UL |
#define RNDIS_KEEPALIVE_CMPLT 0x80000008UL |
#define RNDIS_OID_GEN_CURRENT_PACKET_FILTER 0x0001010eUL |
#define RNDIS_OID_GEN_MEDIA_CONNECT_STATUS 0x00010114UL |
#define RNDIS_OID_802_3_PERMANENT_ADDRESS 0x01010101UL |
#define RNDIS_OID_802_3_CURRENT_ADDRESS 0x01010102UL |
enum rndis_status |
enum rndis_packet_filter |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
inlinestatic |
Initialise an RNDIS device.
rndis | RNDIS device |
op | RNDIS device operations |
Definition at line 339 of file rndis.h.
References rndis_device::op, and op.
Referenced by acm_probe(), and netvsc_probe().
void rndis_tx_complete_err | ( | struct rndis_device * | rndis, |
struct io_buffer * | iobuf, | ||
int | rc | ||
) |
Complete message transmission.
rndis | RNDIS device |
iobuf | I/O buffer |
rc | Packet status code |
Definition at line 127 of file rndis.c.
References cpu_to_le32, io_buffer::data, DBGC, DBGC_HDA, EINVAL, free_iob(), header, iob_len(), len, rndis_device::name, netdev, rndis_device::netdev, netdev_tx_complete_err(), netdev_tx_err(), NULL, rc, and RNDIS_PACKET_MSG.
Referenced by acm_out_complete(), netvsc_cancel_transmit(), and rndis_tx_complete().
int rndis_tx_defer | ( | struct rndis_device * | rndis, |
struct io_buffer * | iobuf | ||
) |
Defer transmitted packet.
rndis | RNDIS device |
iobuf | I/O buffer |
rc | Return status code |
As with netdev_tx_defer(), the caller must ensure that space in the transmit descriptor ring is freed up before calling rndis_tx_complete().
Unlike netdev_tx_defer(), this call may fail.
Definition at line 190 of file rndis.c.
References assert(), cpu_to_le32, io_buffer::data, ENOTSUP, header, iob_len(), iob_pull, msg(), netdev, rndis_device::netdev, netdev_tx_defer(), and RNDIS_PACKET_MSG.
Referenced by netvsc_transmit().
void rndis_rx | ( | struct rndis_device * | rndis, |
struct io_buffer * | iobuf | ||
) |
Receive packet from underlying transport layer.
rndis | RNDIS device |
iobuf | I/O buffer |
Definition at line 829 of file rndis.c.
References io_buffer::data, DBGC, DBGC_HDA, EINVAL, header, iob_disown, iob_len(), iob_pull, le32_to_cpu, rndis_device::name, netdev, rndis_device::netdev, netdev_rx_err(), rc, rndis_rx_message(), and type.
Referenced by acm_control_receive(), acm_in_complete(), and netvsc_recv_data().
void rndis_rx_err | ( | struct rndis_device * | rndis, |
struct io_buffer * | iobuf, | ||
int | rc | ||
) |
Discard packet from underlying transport layer.
rndis | RNDIS device |
iobuf | I/O buffer |
rc | Packet status code |
Definition at line 866 of file rndis.c.
References iob_disown, netdev, rndis_device::netdev, netdev_rx_err(), and rc.
Referenced by acm_in_complete(), acm_intr_complete(), and acm_poll().
struct rndis_device* alloc_rndis | ( | size_t | priv_len | ) |
Allocate RNDIS device.
priv_len | Length of private data |
rndis | RNDIS device, or NULL on allocation failure |
Definition at line 1000 of file rndis.c.
References alloc_etherdev(), netdev, rndis_device::netdev, netdev_init(), NULL, rndis_device::priv, and net_device::priv.
Referenced by acm_probe(), and netvsc_probe().
int register_rndis | ( | struct rndis_device * | rndis | ) |
Register RNDIS device.
rndis | RNDIS device |
rc | Return status code |
Note that this routine will open and use the RNDIS device in order to query the MAC address. The device must be immediately ready for use prior to registration.
Definition at line 1026 of file rndis.c.
References DBGC, rndis_device::name, netdev, rndis_device::netdev, rc, register_netdev(), rndis_describe(), strerror(), and unregister_netdev().
Referenced by acm_probe(), and netvsc_probe().
void unregister_rndis | ( | struct rndis_device * | rndis | ) |
Unregister RNDIS device.
rndis | RNDIS device |
Definition at line 1054 of file rndis.c.
References netdev, rndis_device::netdev, and unregister_netdev().
Referenced by acm_probe(), acm_remove(), netvsc_probe(), and netvsc_remove().
void free_rndis | ( | struct rndis_device * | rndis | ) |
Free RNDIS device.
rndis | RNDIS device |
Definition at line 1066 of file rndis.c.
References netdev, rndis_device::netdev, netdev_nullify(), and netdev_put().
Referenced by acm_probe(), acm_remove(), netvsc_probe(), and netvsc_remove().
|
inlinestatic |
Complete message transmission.
rndis | RNDIS device |
iobuf | I/O buffer |
Definition at line 364 of file rndis.h.
References rndis_tx_complete_err().
Referenced by acm_control_transmit(), and netvsc_recv_completion().