rndis_driver.c File Reference

RNDIS driver. More...

#include "usbd_def.h"
#include "usbd_rndis.h"
#include "core/net.h"
#include "rndis.h"
#include "rndis_driver.h"
#include "rndis_debug.h"
#include "debug.h"

Go to the source code of this file.

Macros

#define TRACE_LEVEL   NIC_TRACE_LEVEL
 

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)
 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

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
 
const NicDriver rndisDriver
 RNDIS driver. More...
 

Detailed Description

RNDIS driver.

License

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

Copyright (C) 2010-2019 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
1.9.6

Definition in file rndis_driver.c.

Macro Definition Documentation

◆ TRACE_LEVEL

#define TRACE_LEVEL   NIC_TRACE_LEVEL

Definition at line 32 of file rndis_driver.c.

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 322 of file rndis_driver.c.

◆ rndisDriverSendPacket()

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

Send a packet.

Parameters
[in]interfaceUnderlying network interface
[in]bufferMulti-part buffer containing the data to send
[in]offsetOffset to the first data byte
Returns
Error code

Definition at line 220 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 406 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

◆ rndisDriverInterface

NetInterface* rndisDriverInterface

Definition at line 44 of file rndis_driver.c.

◆ rndisRxBuffer

Definition at line 48 of file rndis_driver.c.

◆ rndisRxReadIndex

uint_t rndisRxReadIndex

Definition at line 54 of file rndis_driver.c.

◆ rndisRxWriteIndex

uint_t rndisRxWriteIndex

Definition at line 53 of file rndis_driver.c.

◆ rndisTxBuffer

Definition at line 47 of file rndis_driver.c.

◆ rndisTxReadIndex

uint_t rndisTxReadIndex

Definition at line 52 of file rndis_driver.c.

◆ rndisTxWriteIndex

uint_t rndisTxWriteIndex

Definition at line 51 of file rndis_driver.c.

error_t rndisDriverSetMulticastFilter(NetInterface *interface)
Configure multicast MAC address filtering.
Definition: rndis_driver.c:406
#define TRUE
Definition: os_port.h:50
error_t rndisDriverSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset)
Send a packet.
Definition: rndis_driver.c:220
error_t rndisDriverInit(NetInterface *interface)
RNDIS driver initialization.
Definition: rndis_driver.c:88
void rndisDriverDisableIrq(NetInterface *interface)
Disable interrupts.
Definition: rndis_driver.c:151
#define ETH_MTU
Definition: ethernet.h:91
void rndisDriverEventHandler(NetInterface *interface)
RNDIS driver event handler.
Definition: rndis_driver.c:163
void rndisDriverTick(NetInterface *interface)
RNDIS driver timer handler.
Definition: rndis_driver.c:128
void rndisDriverEnableIrq(NetInterface *interface)
Enable interrupts.
Definition: rndis_driver.c:139
@ NIC_TYPE_ETHERNET
Ethernet interface.
Definition: nic.h:79