Difference between revisions of "Unit SMSC95XX"
From Ultibo.org
Line 1,193: | Line 1,193: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Called only during system startup | | Called only during system startup | ||
|- | |- | ||
Line 1,208: | Line 1,208: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkDeviceOpen instead | + | | Not intended to be called directly by applications, use NetworkDeviceOpen instead. |
|- | |- | ||
|} | |} | ||
Line 1,220: | Line 1,220: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkDeviceClose instead | + | | Not intended to be called directly by applications, use NetworkDeviceClose instead. |
|- | |- | ||
|} | |} | ||
Line 1,232: | Line 1,232: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkDeviceRead instead | + | | Not intended to be called directly by applications, use NetworkDeviceRead instead. |
|- | |- | ||
|} | |} | ||
Line 1,244: | Line 1,244: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkDeviceWrite instead | + | | Not intended to be called directly by applications, use NetworkDeviceWrite instead. |
|- | |- | ||
|} | |} | ||
Line 1,256: | Line 1,256: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkDeviceControl instead | + | | Not intended to be called directly by applications, use NetworkDeviceControl instead. |
|- | |- | ||
|} | |} | ||
Line 1,268: | Line 1,268: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkBufferAllocate instead | + | | Not intended to be called directly by applications, use NetworkBufferAllocate instead. |
|- | |- | ||
|} | |} | ||
Line 1,280: | Line 1,280: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkBufferRelease instead | + | | Not intended to be called directly by applications, use NetworkBufferRelease instead. |
|- | |- | ||
|} | |} | ||
Line 1,292: | Line 1,292: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkBufferReceive instead | + | | Not intended to be called directly by applications, use NetworkBufferReceive instead. |
|- | |- | ||
|} | |} | ||
Line 1,304: | Line 1,304: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | Not intended to be called directly by applications, use NetworkBufferTransmit instead | + | | Not intended to be called directly by applications, use NetworkBufferTransmit instead. |
|- | |- | ||
|} | |} | ||
Line 1,319: | Line 1,319: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| The USB device to attempt to bind to | | The USB device to attempt to bind to | ||
|- | |- | ||
− | ! | + | ! Interrface |
| The USB interface to attempt to bind to (or nil for whole device) | | The USB interface to attempt to bind to (or nil for whole device) | ||
|- | |- | ||
− | ! | + | ! Return |
− | | USB_STATUS_SUCCESS if completed, USB_STATUS_DEVICE_UNSUPPORTED if unsupported or another error code on failure | + | | USB_STATUS_SUCCESS if completed, USB_STATUS_DEVICE_UNSUPPORTED if unsupported or another error code on failure. |
|- | |- | ||
|} | |} | ||
Line 1,337: | Line 1,337: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| The USB device to unbind from | | The USB device to unbind from | ||
|- | |- | ||
− | ! | + | ! Interrface |
| The USB interface to unbind from (or nil for whole device) | | The USB interface to unbind from (or nil for whole device) | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 1,355: | Line 1,355: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
Line 1,367: | Line 1,367: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
− | ! | + | ! Note |
| Request is passed to worker thread for processing to prevent blocking the USB completion | | Request is passed to worker thread for processing to prevent blocking the USB completion | ||
|- | |- | ||
Line 1,382: | Line 1,382: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
Line 1,394: | Line 1,394: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
− | ! | + | ! Note |
| Request is passed to worker thread for processing to prevent blocking the USB completion | | Request is passed to worker thread for processing to prevent blocking the USB completion | ||
|- | |- | ||
Line 1,409: | Line 1,409: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
Line 1,421: | Line 1,421: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
− | ! | + | ! Note |
| Request is passed to worker thread for processing to prevent blocking the USB completion | | Request is passed to worker thread for processing to prevent blocking the USB completion | ||
|- | |- | ||
Line 1,439: | Line 1,439: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to check | | USB device to check | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 1,454: | Line 1,454: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to read from | | USB device to read from | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to read | | Index of the register to read | ||
|- | |- | ||
− | ! | + | ! Data |
| Value to return to registers contents | | Value to return to registers contents | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 1,475: | Line 1,475: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to write to | | USB device to write to | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to write | | Index of the register to write | ||
|- | |- | ||
− | ! | + | ! Data |
| Value to write to the register | | Value to write to the register | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 1,496: | Line 1,496: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to modify | | USB device to modify | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to modify | | Index of the register to modify | ||
|- | |- | ||
− | ! | + | ! Mask |
− | | Mask that contains 1 for the bits where the old value in the register will be kept rather than cleared (unless those bits also appear in Value, in which case they will still be set) | + | | Mask that contains 1 for the bits where the old value in the register will be kept rather than cleared (unless those bits also appear in Value, in which case they will still be set). |
|- | |- | ||
− | ! | + | ! Value |
| Mask of bits to set in the register | | Mask of bits to set in the register | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 1,520: | Line 1,520: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to write to | | USB device to write to | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to modify | | Index of the register to modify | ||
|- | |- | ||
− | ! | + | ! Value |
− | | Bits to set in the register. | + | | Bits to set in the register. At positions where there is a 0, the old value in the register will be written. |
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 1,541: | Line 1,541: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to write to | | USB device to write to | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to modify | | Index of the register to modify | ||
|- | |- | ||
− | ! | + | ! Value |
− | | Bits to clear in the register. | + | | Bits to clear in the register. At positions where there is a 0, the old value in the register will be written. |
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 1,580: | Line 1,580: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device read from | | USB device read from | ||
|- | |- | ||
− | ! | + | ! Address |
| Value to read the MAC address into | | Value to read the MAC address into | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- |
Revision as of 00:38, 24 April 2018
Return to Unit Reference
Contents
[hide]Description
SMSC LAN95xx USB Ethernet Driver unit
The SMSC LAN95xx has an integrated USB Hub and is technically a compound device. Here we instead use the vendor Id and product Id of the vendor specific class device attached to the hub that is the device we actually need to communicate with. The hub will be detected and bound by the default USB Hub driver when it is enumerated by the USB core.
Constants
[Expand]
SMSC95XX specific constants
SMSC95XX_*
[Expand]
SMSC95XX device Id
MSC95XX_DEVICE_ID_*
[Expand]
SMSC95XX transmit and receive
SMSC95XX_TX_*
[Expand]
SMSC95XX USB packet size
SMSC95XX_*_USB_PKT_SIZE
[Expand]
SMSC95XX burst size
SMSC95XX_DEFAULT_*_BURST_CAP_SIZE
[Expand]
SMSC95XX transmit command
SMSC95XX_TX_COMMAND_*
[Expand]
SMSC95XX receive status
SMSC95XX_RX_STATUS_*
[Expand]
SMSC95XX Id revision
SMSC95XX_ID_REVISION_*
[Expand]
SMSC95XX interrupt status
SMSC95XX_INTERRUPT_STATUS_*
[Expand]
SMSC95XX receive configuration
SMSC95XX_RX_CONFIG_*
[Expand]
SMSC95XX transmit configuration
SMSC95XX_TX_CONFIG_*
[Expand]
SMSC95XX hardware configuration
SMSC95XX_HW_CONFIG_*
[Expand]
SMSC95XX RX FIFO
SMSC95XX_RX_FIFO_*
[Expand]
SMSC95XX power management control
SMSC95XX_PM_CONTROL_*
[Expand]
SMSC95XX LED GPIO configuration
SMSC95XX_LED_GPIO_CONFIG_*
[Expand]
SMSC95XX GPIO configuration
SMSC95XX_GPIO_CONFIG_*
[Expand]
SMSC95XX advanced flow control configuration
SMSC95XX_AFC_CONFIG_*
[Expand]
SMSC95XX EEPROM command
SMSC95XX_E2P_COMMAND_*
[Expand]
SMSC95XX EEPROM data
SMSC95XX_E2P_DATA_*
[Expand]
SMSC95XX burst cap
SMSC95XX_BURST_CAP_*
[Expand]
SMSC95XX GPIO wake
SMSC95XX_GPIO_WAKE_*
[Expand]
SMSC95XX interrupt endpoint control
SMSC95XX_INT_EP_CONTROL_*
[Expand]
SMSC95XX bulk in delay
SMSC95XX_BULK_IN_DELAY_*
[Expand]
SMSC95XX media access control
SMSC95XX_MAC_CONTROL_*
[Expand]
SMSC95XX MAC address
SMSC95XX_MAC_ADDRESS_*
[Expand]
SMSC95XX hash
SMSC95XX_HASH_*
[Expand]
SMSC95XX MII data
SMSC95XX_MII_*
[Expand]
SMSC95XX flow
SMSC95XX_FLOW_*
[Expand]
SMSC95XX VLAN
SMSC95XX_VLAN*
[Expand]
SMSC95XX WUFF
SMSC95XX_WUFF_*
[Expand]
SMSC95XX wakeup control and status
SMSC95XX_WUCSR_*
[Expand]
SMSC95XX checksum offload engine/enable control
SMSC95XX_COE_*
[Expand]
SMSC95XX vendor-specific physical
SMSC95XX_PHY_EDPD_*
[Expand]
SMSC95XX mode control and status
SMSC95XX_MODE_CTRL_STS_*
[Expand]
SMSC95XX special control and status
SMSC95XX_SPECIAL_CTRL_STS_*
[Expand]
SMSC95XX physical interrupt source
SMSC95XX_PHY_INT_SRC_*
[Expand]
SMSC95XX physical interrupt mask
SMSC95XX_PHY_INT_MASK_*
[Expand]
SMSC95XX physical special
SMSC95XX_PHY_SPECIAL_*
[Expand]
SMSC95XX USB vendor request
SMSC95XX_VENDOR_REQUEST_*
[Expand]
SMSC95XX interrupt endpoint status word
SMSC95XX_INT_ENP_*
Type definitions
SMSC95XX network device
Public variables
None defined
Function declarations
Initialization functions
[Expand]
procedure SMSC95XXInit;
Description: Initialize the SMSC95XX unit, create and register the driver
SMSC95XX network functions
[Expand]
function SMSC95XXDeviceOpen(Network:PNetworkDevice):LongWord;
Description: Implementation of NetworkDeviceOpen for the SMSC95XX device
[Expand]
function SMSC95XXDeviceClose(Network:PNetworkDevice):LongWord;
Description: Implementation of NetworkDeviceClose for the SMSC95XX device
[Expand]
function SMSC95XXDeviceRead(Network:PNetworkDevice; Buffer:Pointer; Size:LongWord; var Length:LongWord):LongWord;
Description: Implementation of NetworkDeviceRead for the SMSC95XX device
[Expand]
function SMSC95XXDeviceWrite(Network:PNetworkDevice; Buffer:Pointer; Size:LongWord; var Length:LongWord):LongWord;
Description: Implementation of NetworkDeviceWrite for the SMSC95XX device
[Expand]
function SMSC95XXDeviceControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
Description: Implementation of NetworkDeviceControl for the SMSC95XX device
[Expand]
function SMSC95XXBufferAllocate(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferAllocate for the SMSC95XX device
[Expand]
function SMSC95XXBufferRelease(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferRelease for the SMSC95XX device
[Expand]
function SMSC95XXBufferReceive(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferReceive for the SMSC95XX device
[Expand]
function SMSC95XXBufferTransmit(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferTransmit for the SMSC95XX device
SMSC95XX USB functions
[Expand]
function SMSC95XXDriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Bind the SMSC95XX driver to a USB device if it is suitable
[Expand]
function SMSC95XXDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Description: Unbind the SMSC95XX driver from a USB device
[Expand]
procedure SMSC95XXReceiveWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request from the SMSC95XX bulk IN endpoint
[Expand]
procedure SMSC95XXReceiveComplete(Request:PUSBRequest);
Description: Called when a USB request from the SMSC95XX bulk IN endpoint completes
[Expand]
procedure SMSC95XXTransmitWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request to the SMSC95XX bulk OUT endpoint
[Expand]
procedure SMSC95XXTransmitComplete(Request:PUSBRequest);
Description: Called when a USB request to the SMSC95XX bulk OUT endpoint completes
[Expand]
procedure SMSC95XXInterruptWorker(Request:PUSBRequest);
Description: Called (by a Worker thread) to process a completed USB request from the SMSC95XX interrupt IN endpoint
[Expand]
procedure SMSC95XXInterruptComplete(Request:PUSBRequest);
Description: Called when a USB request from the SMSC95XX interrupt IN endpoint completes
SMSC95XX helper functions
[Expand]
function SMSC95XXCheckDevice(Device:PUSBDevice):LongWord;
Description: Check the Vendor and Device Id against the supported devices
[Expand]
function SMSC95XXReadRegister(Device:PUSBDevice; Index:LongWord; var Data:LongWord):LongWord;
Description: Read from a register on the SMSC95XX USB Ethernet Adapter
[Expand]
function SMSC95XXWriteRegister(Device:PUSBDevice; Index,Data:LongWord):LongWord;
Description: Write to a register on the SMSC95XX USB Ethernet Adapter
[Expand]
function SMSC95XXModifyRegister(Device:PUSBDevice; Index,Mask,Value:LongWord):LongWord;
Description: Modify the value contained in a register on the SMSC LAN95XX USB Ethernet Adapter
[Expand]
function SMSC95XXSetRegisterBits(Device:PUSBDevice; Index,Value:LongWord):LongWord;
Description: Set bits in a register on the SMSC95XX USB Ethernet Adapter
[Expand]
function SMSC95XXClearRegisterBits(Device:PUSBDevice; Index,Value:LongWord):LongWord;
Description: Clear bits in a register on the SMSC95XX USB Ethernet Adapter
[Expand]
function SMSC95XXSetMacAddress(Device:PUSBDevice; Address:PHardwareAddress):LongWord;
Description: Set the MAC address of the SMSC95XX USB Ethernet Adapter
[Expand]
function SMSC95XXGetMacAddress(Device:PUSBDevice; Address:PHardwareAddress):LongWord;
Description: Get the MAC address of the SMSC95XX USB Ethernet Adapter
Return to Unit Reference