rndis_driver.h File Reference

RNDIS driver. More...

#include "core/nic.h"

Go to the source code of this file.

Data Structures

struct  RndisTxBufferDesc
 TX buffer descriptor. More...
 
struct  RndisRxBufferDesc
 RX buffer descriptor. More...
 

Macros

#define RNDIS_TX_BUFFER_COUNT   2
 
#define RNDIS_TX_BUFFER_SIZE   2048
 
#define RNDIS_RX_BUFFER_COUNT   1
 
#define RNDIS_RX_BUFFER_SIZE   2048
 

Functions

error_t rndisDriverInit (NetInterface *interface)
 RNDIS driver initialization. More...
 
void rndisDriverTick (NetInterface *interface)
 RNDIS driver timer handler. More...
 
void rndisDriverEnableIrq (NetInterface *interface)
 Enable interrupts. More...
 
void rndisDriverDisableIrq (NetInterface *interface)
 Disable interrupts. More...
 
void rndisDriverEventHandler (NetInterface *interface)
 RNDIS driver event handler. More...
 
error_t rndisDriverSendPacket (NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
 Send a packet. More...
 
error_t rndisDriverReceivePacket (NetInterface *interface, uint8_t *buffer, size_t size, size_t *length)
 Receive a packet. More...
 
error_t rndisDriverSetMulticastFilter (NetInterface *interface)
 Configure multicast MAC address filtering. More...
 

Variables

const NicDriver rndisDriver
 RNDIS driver. More...
 
NetInterfacerndisDriverInterface
 
RndisTxBufferDesc rndisTxBuffer [RNDIS_TX_BUFFER_COUNT]
 
RndisRxBufferDesc rndisRxBuffer [RNDIS_RX_BUFFER_COUNT]
 
uint_t rndisTxWriteIndex
 
uint_t rndisTxReadIndex
 
uint_t rndisRxWriteIndex
 
uint_t rndisRxReadIndex
 

Detailed Description

RNDIS driver.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.4

Definition in file rndis_driver.h.

Macro Definition Documentation

◆ RNDIS_RX_BUFFER_COUNT

#define RNDIS_RX_BUFFER_COUNT   1

Definition at line 53 of file rndis_driver.h.

◆ RNDIS_RX_BUFFER_SIZE

#define RNDIS_RX_BUFFER_SIZE   2048

Definition at line 60 of file rndis_driver.h.

◆ RNDIS_TX_BUFFER_COUNT

#define RNDIS_TX_BUFFER_COUNT   2

Definition at line 39 of file rndis_driver.h.

◆ RNDIS_TX_BUFFER_SIZE

#define RNDIS_TX_BUFFER_SIZE   2048

Definition at line 46 of file rndis_driver.h.

Function Documentation

◆ rndisDriverDisableIrq()

void rndisDriverDisableIrq ( NetInterface interface)

Disable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 151 of file rndis_driver.c.

◆ rndisDriverEnableIrq()

void rndisDriverEnableIrq ( NetInterface interface)

Enable interrupts.

Parameters
[in]interfaceUnderlying network interface

Definition at line 139 of file rndis_driver.c.

◆ rndisDriverEventHandler()

void rndisDriverEventHandler ( NetInterface interface)

RNDIS driver event handler.

Parameters
[in]interfaceUnderlying network interface

Definition at line 163 of file rndis_driver.c.

◆ rndisDriverInit()

error_t rndisDriverInit ( NetInterface interface)

RNDIS driver initialization.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 88 of file rndis_driver.c.

◆ rndisDriverReceivePacket()

error_t rndisDriverReceivePacket ( NetInterface interface,
uint8_t *  buffer,
size_t  size,
size_t *  length 
)

Receive a packet.

Parameters
[in]interfaceUnderlying network interface
[out]bufferBuffer where to store the incoming data
[in]sizeMaximum number of bytes that can be received
[out]lengthNumber of bytes that have been received
Returns
Error code

Definition at line 329 of file rndis_driver.c.

◆ rndisDriverSendPacket()

error_t rndisDriverSendPacket ( NetInterface interface,
const NetBuffer buffer,
size_t  offset,
NetTxAncillary ancillary 
)

Send a packet.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
[in]ancillaryAdditional options passed to the stack along with the packet
Returns
Error code

Definition at line 227 of file rndis_driver.c.

◆ rndisDriverSetMulticastFilter()

error_t rndisDriverSetMulticastFilter ( NetInterface interface)

Configure multicast MAC address filtering.

Parameters
[in]interfaceUnderlying network interface
Returns
Error code

Definition at line 413 of file rndis_driver.c.

◆ rndisDriverTick()

void rndisDriverTick ( NetInterface interface)

RNDIS driver timer handler.

This routine is periodically called by the TCP/IP stack to handle periodic operations such as polling the link state

Parameters
[in]interfaceUnderlying network interface

Definition at line 128 of file rndis_driver.c.

Variable Documentation

◆ rndisDriver

const NicDriver rndisDriver
extern

RNDIS driver.

Definition at line 61 of file rndis_driver.c.

◆ rndisDriverInterface

NetInterface* rndisDriverInterface
extern

Definition at line 44 of file rndis_driver.c.

◆ rndisRxBuffer

Definition at line 48 of file rndis_driver.c.

◆ rndisRxReadIndex

uint_t rndisRxReadIndex
extern

Definition at line 54 of file rndis_driver.c.

◆ rndisRxWriteIndex

uint_t rndisRxWriteIndex
extern

Definition at line 53 of file rndis_driver.c.

◆ rndisTxBuffer

Definition at line 47 of file rndis_driver.c.

◆ rndisTxReadIndex

uint_t rndisTxReadIndex
extern

Definition at line 52 of file rndis_driver.c.

◆ rndisTxWriteIndex

uint_t rndisTxWriteIndex
extern

Definition at line 51 of file rndis_driver.c.