88 DBGC ( rndis,
"RNDIS %s timed out waiting for ID %#08x\n",
89 rndis->
name, wait_id );
112 if ( (
rc = rndis->
op->
transmit ( rndis, iobuf ) ) != 0 ) {
113 DBGC ( rndis,
"RNDIS %s could not transmit: %s\n",
136 DBGC ( rndis,
"RNDIS %s completed underlength transmission:\n",
232 if (
len <
sizeof ( *
msg ) ) {
233 DBGC ( rndis,
"RNDIS %s received underlength data packet:\n",
244 if ( ( data_offset >
len ) || (
data_len > (
len - data_offset ) ) ) {
245 DBGC ( rndis,
"RNDIS %s data packet data exceeds packet:\n",
321 if (
len <
sizeof ( *cmplt ) ) {
322 DBGC ( rndis,
"RNDIS %s received underlength initialisation "
323 "completion:\n", rndis->
name );
335 DBGC ( rndis,
"RNDIS %s received initialisation completion "
336 "failure %#08x\n", rndis->
name,
435 const void *
data,
size_t len ) {
489 if (
len <
sizeof ( *cmplt ) ) {
490 DBGC ( rndis,
"RNDIS %s received underlength query "
491 "completion:\n", rndis->
name );
503 DBGC ( rndis,
"RNDIS %s received query completion failure "
513 if ( ( info_offset >
len ) || (
info_len > (
len - info_offset ) ) ) {
514 DBGC ( rndis,
"RNDIS %s query completion information exceeds "
515 "packet:\n", rndis->
name );
520 info = ( ( (
void * ) cmplt ) + info_offset );
538 if (
info_len !=
sizeof ( *link_status ) ) {
539 DBGC ( rndis,
"RNDIS %s invalid link status:\n",
543 goto err_link_status;
546 if ( *link_status == 0 ) {
547 DBGC ( rndis,
"RNDIS %s link is up\n", rndis->
name );
550 DBGC ( rndis,
"RNDIS %s link is down: %#08x\n",
557 DBGC ( rndis,
"RNDIS %s unexpected query completion ID %#08x\n",
595 if (
len <
sizeof ( *cmplt ) ) {
596 DBGC ( rndis,
"RNDIS %s received underlength set completion:\n",
609 DBGC ( rndis,
"RNDIS %s received set completion failure "
640 const void *
data,
size_t len ) {
668 if ( (
rc = rndis->
op->
open ( rndis ) ) != 0 ) {
669 DBGC ( rndis,
"RNDIS %s could not open: %s\n",
681 goto err_query_permanent;
686 goto err_query_current;
726 if (
len <
sizeof ( *
msg ) ) {
727 DBGC ( rndis,
"RNDIS %s received underlength status message:\n",
739 switch (
msg->status ) {
742 DBGC ( rndis,
"RNDIS %s link is up\n", rndis->
name );
747 DBGC ( rndis,
"RNDIS %s link is down\n", rndis->
name );
756 DBGC ( rndis,
"RNDIS %s unexpected status %#08x:\n",
810 DBGC ( rndis,
"RNDIS %s received unexpected type %#08x\n",
838 DBGC ( rndis,
"RNDIS %s received underlength packet:\n",
889 DBGC ( rndis,
"RNDIS %s could not set receive filter to %#08x: "
908 if ( (
rc = rndis->
op->
open ( rndis ) ) != 0 ) {
909 DBGC ( rndis,
"RNDIS %s could not open: %s\n",
984 rndis->
op->
poll ( rndis );
1012 rndis->
priv = ( ( (
void * ) rndis ) +
sizeof ( *rndis ) );
1037 DBGC ( rndis,
"RNDIS %s could not register: %s\n",
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
pseudo_bit_t value[0x00020]
#define assert(condition)
Assert a condition at run-time.
uint8_t id
Request identifier.
uint32_t type
Operating system type.
uint8_t data[48]
Additional event data.
struct ena_llq_option header
Header locations.
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
static struct net_device * netdev
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define EINVAL
Invalid argument.
#define ETIMEDOUT
Connection timed out.
#define EPROTO
Protocol error.
#define ENOMEM
Not enough space.
#define EIO
Input/output error.
#define ENOTSUP
Operation not supported.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
uint8_t info_len
Reject information length.
#define le32_to_cpu(value)
#define cpu_to_le32(value)
void * memcpy(void *dest, const void *src, size_t len) __nonnull
void * memset(void *dest, int character, size_t len) __nonnull
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define iob_push(iobuf, len)
#define iob_put(iobuf, len)
#define iob_disown(iobuf)
Disown an I/O buffer.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define iob_reserve(iobuf, len)
#define iob_pull(iobuf, len)
#define iob_unput(iobuf, len)
void msg(unsigned int row, const char *fmt,...)
Print message centred on specified row.
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
void netdev_tx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard transmitted packet.
void unregister_netdev(struct net_device *netdev)
Unregister network device.
void netdev_tx_defer(struct net_device *netdev, struct io_buffer *iobuf)
Defer transmitted packet.
void netdev_tx_complete_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Complete network transmission.
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
int register_netdev(struct net_device *netdev)
Register network device.
Network device management.
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
UINT8_t filter
Receive packet filter.
static int rndis_tx_oid(struct rndis_device *rndis, unsigned int oid, const void *data, size_t len)
Transmit OID message.
int rndis_tx_defer(struct rndis_device *rndis, struct io_buffer *iobuf)
Defer transmitted packet.
static int rndis_tx_halt(struct rndis_device *rndis)
Transmit halt message.
int register_rndis(struct rndis_device *rndis)
Register RNDIS device.
void unregister_rndis(struct rndis_device *rndis)
Unregister RNDIS device.
static void rndis_rx_message(struct rndis_device *rndis, struct io_buffer *iobuf, unsigned int type)
Receive RNDIS message.
static int rndis_transmit(struct net_device *netdev, struct io_buffer *iobuf)
Transmit packet.
static int rndis_halt(struct rndis_device *rndis)
Halt RNDIS.
static int rndis_filter(struct rndis_device *rndis, unsigned int filter)
Set receive filter.
static int rndis_tx_data(struct rndis_device *rndis, struct io_buffer *iobuf)
Transmit data packet.
static struct io_buffer * rndis_alloc_iob(size_t len)
Allocate I/O buffer.
static int rndis_tx_message(struct rndis_device *rndis, struct io_buffer *iobuf, unsigned int type)
Transmit message.
void rndis_rx(struct rndis_device *rndis, struct io_buffer *iobuf)
Receive packet from underlying transport layer.
static void rndis_close(struct net_device *netdev)
Close network device.
static void rndis_rx_initialise(struct rndis_device *rndis, struct io_buffer *iobuf)
Receive initialisation completion.
void rndis_tx_complete_err(struct rndis_device *rndis, struct io_buffer *iobuf, int rc)
Complete message transmission.
void free_rndis(struct rndis_device *rndis)
Free RNDIS device.
static int rndis_open(struct net_device *netdev)
Open network device.
static void rndis_rx_status(struct rndis_device *rndis, struct io_buffer *iobuf)
Receive indicate status message.
static int rndis_oid(struct rndis_device *rndis, unsigned int oid, const void *data, size_t len)
Query or set OID.
void rndis_rx_err(struct rndis_device *rndis, struct io_buffer *iobuf, int rc)
Discard packet from underlying transport layer.
static int rndis_initialise(struct rndis_device *rndis)
Initialise RNDIS.
static void rndis_rx_data(struct rndis_device *rndis, struct io_buffer *iobuf)
Receive data packet.
struct rndis_device * alloc_rndis(size_t priv_len)
Allocate RNDIS device.
static void rndis_rx_query_oid(struct rndis_device *rndis, struct io_buffer *iobuf)
Receive query OID completion.
static void rndis_poll(struct net_device *netdev)
Poll for completed and received packets.
static int rndis_describe(struct rndis_device *rndis)
Describe RNDIS device.
static int rndis_wait(struct rndis_device *rndis, unsigned int wait_id)
Wait for completion.
static int rndis_tx_initialise(struct rndis_device *rndis, unsigned int id)
Transmit initialisation message.
static void rndis_rx_set_oid(struct rndis_device *rndis, struct io_buffer *iobuf)
Receive set OID completion.
Remote Network Driver Interface Specification.
@ RNDIS_FILTER_MULTICAST
Multicast packets.
@ RNDIS_FILTER_PROMISCUOUS
All packets.
@ RNDIS_FILTER_BROADCAST
Broadcast packets.
@ RNDIS_FILTER_ALL_MULTICAST
All multicast packets.
@ RNDIS_FILTER_UNICAST
Unicast packets.
#define RNDIS_MTU
RNDIS maximum transfer size.
#define RNDIS_INITIALISE_MSG
RNDIS initialise message.
#define RNDIS_SET_MSG
RNDIS set OID message.
#define RNDIS_INIT_ID
Request ID used for initialisation.
#define RNDIS_OID_GEN_MEDIA_CONNECT_STATUS
OID for media status.
#define RNDIS_SET_CMPLT
RNDIS set OID completion.
#define RNDIS_OID_802_3_CURRENT_ADDRESS
OID for current MAC address.
#define RNDIS_INDICATE_STATUS_MSG
RNDIS indicate status message.
#define RNDIS_VERSION_MINOR
RNDIS minor version.
#define RNDIS_HALT_MSG
RNDIS halt message.
#define RNDIS_VERSION_MAJOR
RNDIS major version.
#define RNDIS_PACKET_MSG
RNDIS packet message.
@ RNDIS_STATUS_WTF_WORLD
Unknown start-of-day status code.
@ RNDIS_STATUS_MEDIA_DISCONNECT
Device is disconnected from the medium.
@ RNDIS_STATUS_MEDIA_CONNECT
Device is connected to a network medium.
#define RNDIS_INITIALISE_CMPLT
RNDIS initialise completion.
#define RNDIS_OID_GEN_CURRENT_PACKET_FILTER
OID for packet filter.
#define RNDIS_QUERY_CMPLT
RNDIS query OID completion.
#define RNDIS_QUERY_MSG
RNDIS query OID message.
#define RNDIS_MAX_WAIT_MS
Maximum time to wait for a transaction to complete.
#define RNDIS_OID_802_3_PERMANENT_ADDRESS
OID for permanent MAC address.
char * strerror(int errno)
Retrieve string representation of error number.
void * data
Start of data.
Network device operations.
struct net_device * netdev
Network device.
struct rndis_operations * op
RNDIS operations.
const char * name
Device name.
int wait_rc
Return status code for current blocking request.
void * priv
Driver private data.
unsigned int wait_id
Request ID for current blocking request.
RNDIS indicate status message.
RNDIS initialise completion.
RNDIS initialise message.
RNDIS query or set OID message.
int(* open)(struct rndis_device *rndis)
Open RNDIS device.
void(* poll)(struct rndis_device *rndis)
Poll for completed and received packets.
void(* close)(struct rndis_device *rndis)
Close RNDIS device.
int(* transmit)(struct rndis_device *rndis, struct io_buffer *iobuf)
Transmit packet.
RNDIS query OID completion.
uint32_t offset
Information buffer offset.
uint32_t len
Information buffer length.
RNDIS set OID completion.
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
uint32_t data_len
Microcode data size (or 0 to indicate 2000 bytes)