Unit USBCDCETHERNET

From Ultibo.org
Jump to: navigation, search

Return to Unit Reference


Description


USB CDC Ethernet Driver unit

The Ethernet model is part of the USB Communications Device Class (CDC) standard which allows ethernet based networking devices to be supported by USB with a standardized protocol for data transfer and link status.

A CDC Ethernet device is defined by information in the interface descriptors and is not specific to any product and vendor ID. There are numerous devices that support the CDC Ethernet protocol including a number of external adapters and combination hubs.

This driver presents any device recognized as a CDC Ethernet as a standard network device that can be accessed using the API in the Network, Winsock, Winsock2 and Sockets units. It should not be necessary to directly call any of the functions in this unit from application code.

Note: The QEMU emulations of the Raspberry Pi Zero/A+/2B/3A+/3B use a USB CDC Ethernet device.

Constants



[Expand]
CDC ethernet specific CDCETHERNET_*


[Expand]
Driver info constants DRIVER_INFO_*


[Expand]
Vendor id *_VENDOR_ID


[Expand]
CDC ethernet device and interface id CDCETHERNET_DEVICE_ID_*


Type definitions



CDC ethernet device and interface id

[Expand]

PCDCEthernetDeviceId = ^TCDCEthernetDeviceId;

TCDCEthernetDeviceId = record

CDC ethernet network

[Expand]

PCDCEthernetNetwork = ^TCDCEthernetNetwork;

TCDCEthernetNetwork = record


Public variables


None defined

Function declarations



Initialization functions

[Expand]
procedure CDCEthernetInit;
Description: Initialize the CDC Ethernet unit, create and register the driver


CDCEthernet network functions

[Expand]
function CDCEthernetNetworkOpen(Network:PNetworkDevice):LongWord;
Description: Implementation of NetworkDeviceOpen for the CDC Ethernet device


[Expand]
function CDCEthernetNetworkClose(Network:PNetworkDevice):LongWord;
Description: Implementation of NetworkDeviceClose for the CDC Ethernet device


[Expand]
function CDCEthernetNetworkControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
Description: Implementation of NetworkDeviceControl for the CDC Ethernet device


[Expand]
function CDCEthernetBufferAllocate(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferAllocate for the CDC Ethernet device


[Expand]
function CDCEthernetBufferRelease(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferRelease for the CDC Ethernet device


[Expand]
function CDCEthernetBufferReceive(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferReceive for the CDC Ethernet device


[Expand]
function CDCEthernetBufferTransmit(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferTransmit for the CDC Ethernet device


CDC Ethernet USB functions

[Expand]
function CDCEthernetDriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Bind the CDC Ethernet driver to a USB device if it is suitable


[Expand]
function CDCEthernetDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Unbind the CDC Ethernet driver from a USB device


[Expand]
procedure CDCEthernetReceiveWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request from the CDC Ethernet bulk IN endpoint


[Expand]
procedure CDCEthernetReceiveComplete(Request:PUSBRequest);
Description: Called when a USB request from the CDC Ethernet bulk IN endpoint completes


[Expand]
procedure CDCEthernetTransmitWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request to the CDC Ethernet bulk OUT endpoint


[Expand]
procedure CDCEthernetTransmitComplete(Request:PUSBRequest);
Description: Called when a USB request to the CDC Ethernet bulk OUT endpoint completes


[Expand]
procedure CDCEthernetInterruptWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request from the CDC Ethernet interrupt IN endpoint


[Expand]
procedure CDCEthernetInterruptComplete(Request:PUSBRequest);
Description: Called when a USB request from the CDC Ethernet interrupt IN endpoint completes


CDC ethernet helper functions

[Expand]
function CDCEthernetCheckDeviceAndInterface(Device:PUSBDevice; Interrface:PUSBInterface; out DriverInfo:LongWord):LongWord;
Description: Check the Device and Interface against the supported and blacklisted devices


[Expand]
function CDCEthernetGetMacAddress(Device:PUSBDevice; Index:LongWord; Address:PHardwareAddress):LongWord;
Description: Get the MAC address of a CDC Ethernet device


[Expand]
function CDCEthernetUpdateFilter(Network:PCDCEthernetNetwork):LongWord;
Description: Update the packet filter of the CDC Ethernet device


Return to Unit Reference