Difference between revisions of "Unit SMC91X"
(One intermediate revision by the same user not shown) | |||
Line 1,070: | Line 1,070: | ||
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
− | <pre style="border: 0; padding-bottom:0px;">function SMC91XNetworkCreate(Address: | + | <pre style="border: 0; padding-bottom:0px;">function SMC91XNetworkCreate(Address:PtrUInt; const Name:String; IRQ:LongWord):PNetworkDevice;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and register a new SMC91X Network device which can be accessed using the Network API</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Create and register a new SMC91X Network device which can be accessed using the Network API</div> | ||
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Address |
| The address of the SMC91X registers | | The address of the SMC91X registers | ||
|- | |- | ||
− | ! | + | ! Name |
| The text description of this device which will show in the device list (Optional) | | The text description of this device which will show in the device list (Optional) | ||
|- | |- | ||
− | ! | + | ! IRQ |
| The interrupt number for the SMC91X | | The interrupt number for the SMC91X | ||
|- | |- | ||
− | ! | + | ! Return |
| Pointer to the new Network device or nil if the Network device could not be created | | Pointer to the new Network device or nil if the Network device could not be created | ||
|- | |- | ||
Line 1,096: | Line 1,096: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The Network device to destroy | | The Network device to destroy | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 1,114: | Line 1,114: | ||
{| 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,126: | Line 1,126: | ||
{| 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,138: | Line 1,138: | ||
{| 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,150: | Line 1,150: | ||
{| 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,162: | Line 1,162: | ||
{| 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,174: | Line 1,174: | ||
{| 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,186: | Line 1,186: | ||
{| 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,198: | Line 1,198: | ||
{| 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 | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 1,210: | Line 1,210: | ||
{| 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 | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 1,222: | Line 1,222: | ||
{| 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 | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 1,234: | Line 1,234: | ||
{| 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 | | Not intended to be called directly by applications | ||
|- | |- | ||
Line 1,246: | Line 1,246: | ||
{| 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 | + | | Not intended to be called directly by applications |
Caller must hold the network lock. | Caller must hold the network lock. | ||
|- | |- | ||
Line 1,259: | Line 1,259: | ||
{| 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 | + | | Not intended to be called directly by applications |
− | Caller must hold the network lock | + | Caller must hold the network lock |
|- | |- | ||
|} | |} | ||
Line 1,275: | Line 1,275: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to get the bank from | | The SMC91X Network device to get the bank from | ||
|- | |- | ||
− | ! | + | ! Return |
| The currently selected bank (The high byte must be $33 to be valid) | | The currently selected bank (The high byte must be $33 to be valid) | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,293: | Line 1,293: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to set the bank for | | The SMC91X Network device to set the bank for | ||
|- | |- | ||
− | ! | + | ! Bank |
| The bank to select | | The bank to select | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,311: | Line 1,311: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to get from | | The SMC91X Network device to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| The base addres register value | | The base addres register value | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,329: | Line 1,329: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to get from | | The SMC91X Network device to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| The revision register value | | The revision register value | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,347: | Line 1,347: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to wait for | | The SMC91X Network device to wait for | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,362: | Line 1,362: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to set for | | The SMC91X Network device to set for | ||
|- | |- | ||
− | ! | + | ! Command |
| The command to set | | The command to set | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,380: | Line 1,380: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 1,392: | Line 1,392: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to enable the interrupt for | | The SMC91X Network device to enable the interrupt for | ||
|- | |- | ||
− | ! | + | ! Interrupt |
| The interrupt to enable | | The interrupt to enable | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,410: | Line 1,410: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to disable the interrupt for | | The SMC91X Network device to disable the interrupt for | ||
|- | |- | ||
− | ! | + | ! Interrupt |
| The interrupt to disable | | The interrupt to disable | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,428: | Line 1,428: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to reset | | The SMC91X Network device to reset | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,446: | Line 1,446: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to enable | | The SMC91X Network device to enable | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,464: | Line 1,464: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to shutdown | | The SMC91X Network device to shutdown | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,482: | Line 1,482: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Address |
| Pointer to a buffer to return the hardware address | | Pointer to a buffer to return the hardware address | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to get from | | The SMC91X Network device to get from | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,503: | Line 1,503: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Address |
| Pointer to the hardware address to set | | Pointer to the hardware address to set | ||
|- | |- | ||
− | ! | + | ! Network |
| The SMC91X Network device to set for | | The SMC91X Network device to set for | ||
|- | |- | ||
− | ! | + | ! Return |
| ERROR_SUCCESS if completed or another error code on failure | | ERROR_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,524: | Line 1,524: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,536: | Line 1,536: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,548: | Line 1,548: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,560: | Line 1,560: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,572: | Line 1,572: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,584: | Line 1,584: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,596: | Line 1,596: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,608: | Line 1,608: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,620: | Line 1,620: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- | ||
Line 1,632: | Line 1,632: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must hold the network lock | | Caller must hold the network lock | ||
|- | |- |
Latest revision as of 05:22, 17 June 2021
Return to Unit Reference
Contents
[hide]Description
SMSC 91C9x/91C1xx Ethernet Driver unit
The SMSC 91C9x/91C1xx are a family of Non-PCI 10/100 Ethernet Single Chip MAC + PHY devices.
This driver is primarily intended to support the LAN91C111 Ethernet device included in the QEMU Versatile PB emulation however the driver is based on the equivalent Linux driver and as such includes (untested) support for a number of chip variants (see SMC91X_CHIP_* constants below).
The QEMU emulation does not include support for a number of the features provided in the real chip so they are either currently not supported or are untested without access to a physical chip implementation for testing.
Constants
SMC91X_*
SMC91X_TCR_*
SMC91X_EPH_STATUS_*
SMC91X_RCR_*
SMC91X_RPC_*
SMC91X_CONFIG_*
SMC91X_CTL_*
SMC91X_MMU_CMD_*
SMC91X_AR_*
SMC91X_TXFIFO_*
SMC91X_RXFIFO_*
SMC91X_PTR_*
SMC91X_IM_*
SMC91X_MII_*
SMC91X_RCV_THRESHOLD*
SMC91X_RCV_*
SMC91X_BANK_SELECT_*
SMC91X_CHIP_*
SMC91X_PHY_*
Type definitions
SMC91X bank 0 registers
TSMC91XBank0Registers = packed record
SMC91X bank 1 registers
TSMC91XBank1Registers = packed record
SMC91X FIFO registers
TSMC91XFIFORegisters = packed record
SMC91X DATA registers
TSMC91XDATARegisters = packed record
SMC91X bank 2 registers
TSMC91XBank2Registers = packed record
SMC91X bank 3 registers
TSMC91XBank3Registers = packed record
SMC91X registers
SMC91X network
Public variables
SMC91X specific variables
SMC91X_ALLOCATE_WAIT_COUNT:LongWord = 16;
|
How long to wait for the SMC91X to allocate memory before deferring a packet |
SMC91X_MAX_IRQ_COUNT:LongWord = 8;
|
How many iterations of the interrupt handler are allowed on each interrupt |
SMC91X_THROTTLE_TRANSMIT:Boolean = False;
|
Determines if TX packets are sent one at a time or queued into SMC91X internal memory |
Function declarations
SMC91X functions
function SMC91XNetworkCreate(Address:PtrUInt; const Name:String; IRQ:LongWord):PNetworkDevice;
function SMC91XNetworkDestroy(Network:PNetworkDevice):LongWord;
SMC91X network functions
function SMC91XNetworkOpen(Network:PNetworkDevice):LongWord;
function SMC91XNetworkClose(Network:PNetworkDevice):LongWord;
function SMC91XNetworkControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
function SMC91XBufferAllocate(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
function SMC91XBufferRelease(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
function SMC91XBufferReceive(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
function SMC91XBufferTransmit(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
procedure SMC91XInterruptHandler(Network:PSMC91XNetwork);
procedure SMC91XInterruptReceive(Network:PSMC91XNetwork);
procedure SMC91XInterruptTransmit(Network:PSMC91XNetwork);
function SMC91XCompletionExecute(Network:PSMC91XNetwork):PtrInt;
procedure SMC91XTransmitStart(Network:PSMC91XNetwork);
procedure SMC91XTransmitPacket(Network:PSMC91XNetwork; Entry:PNetworkEntry; Packet:PNetworkPacket);
SMC91X helper functions
function SMC91XCurrentBank(Network:PSMC91XNetwork):Word; inline;
procedure SMC91XSelectBank(Network:PSMC91XNetwork; Bank:Byte); inline;
function SMC91XGetBase(Network:PSMC91XNetwork):Word; inline;
function SMC91XGetRevision(Network:PSMC91XNetwork):Word; inline;
procedure SMC91XWaitMMUBusy(Network:PSMC91XNetwork); inline;
procedure SMC91XSetMMUCommand(Network:PSMC91XNetwork; Command:Word); inline;
procedure SMC91XSetInterruptMask(Network:PSMC91XNetwork; Mask:Byte); inline;
procedure SMC91XEnableInterrupt(Network:PSMC91XNetwork; Interrupt:Byte);
procedure SMC91XDisableInterrupt(Network:PSMC91XNetwork; Interrupt:Byte);
function SMC91XReset(Network:PSMC91XNetwork):LongWord;
function SMC91XEnable(Network:PSMC91XNetwork):LongWord;
function SMC91XShutdown(Network:PSMC91XNetwork):LongWord;
function SMC91XGetMACAddress(Network:PSMC91XNetwork; Address:PHardwareAddress):LongWord;
function SMC91XSetMACAddress(Network:PSMC91XNetwork; Address:PHardwareAddress):LongWord;
function SMC91XMIIIn(Network:PSMC91XNetwork; Bits:LongWord):LongWord;
procedure SMC91XMIIOut(Network:PSMC91XNetwork; Value,Bits:LongWord);
function SMC91XPHYRead(Network:PSMC91XNetwork; Addr,Reg:LongWord):LongWord;
procedure SMC91XPHYWrite(Network:PSMC91XNetwork; Addr,Reg,Data:LongWord);
function SMC91XPHYDetect(Network:PSMC91XNetwork):LongWord;
function SMC91XPHYReset(Network:PSMC91XNetwork):LongWord;
function SMC91XPHYFixed(Network:PSMC91XNetwork):LongWord;
function SMC91XPHYConfigure(Network:PSMC91XNetwork):LongWord;
function SMC91XPHYPowerdown(Network:PSMC91XNetwork):LongWord;
function SMC91XPHYCheckMedia(Network:PSMC91XNetwork):LongWord;
Return to Unit Reference