Difference between revisions of "Unit SMC91X"

From Ultibo.org
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
The SMSC 91C9x/91C1xx are a family of Non-PCI 10/100 Ethernet Single Chip MAC + PHY devices.
 
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 Verstile 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).
+
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.
 
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.
Line 575: Line 575:
 
|-
 
|-
 
| <code>SMC91X_CHIP_91111FD = 9;</code>
 
| <code>SMC91X_CHIP_91111FD = 9;</code>
| &nbsp;
 
|-
 
|colspan="2"|&nbsp;
 
|-
 
| <code>SMC91X_CHIP_NAMES:array[0..SMC91X_CHIP_COUNT - 1] of String = (</code>
 
| &nbsp;
 
|-
 
| <code>' ',</code>
 
| &nbsp;
 
|-
 
| <code>' ',</code>
 
| &nbsp;
 
|-
 
| <code>' ',</code>
 
| &nbsp;
 
|-
 
| <code>'SMC91C90/91C92',</code>
 
| 3
 
|-
 
| <code>'SMC91C94',</code>
 
| 4
 
|-
 
| <code>'SMC91C95',</code>
 
| 5
 
|-
 
| <code>'SMC91C96',</code>
 
| 6
 
|-
 
| <code>'SMC91C100',</code>
 
| 7
 
|-
 
| <code>'SMC91C100FD',</code>
 
| 8
 
|-
 
| <code>'SMC91C11xFD',</code>
 
| 9
 
|-
 
| <code>' ',</code>
 
| &nbsp;
 
|-
 
| <code>' ',</code>
 
| &nbsp;
 
|-
 
| <code>' ',</code>
 
| &nbsp;
 
|-
 
| <code>' ',</code>
 
| &nbsp;
 
|-
 
| <code>' ',</code>
 
| &nbsp;
 
|-
 
| <code>' ');</code>
 
 
| &nbsp;
 
| &nbsp;
 
|-
 
|-
Line 1,119: Line 1,066:
 
----
 
----
  
''To be documented''
 
  
 +
'''SMC91X functions'''
 +
 +
<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: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 class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Address
 +
| The address of the SMC91X registers
 +
|-
 +
! Name
 +
| The text description of this device which will show in the device list (Optional)
 +
|-
 +
! IRQ
 +
| The interrupt number for the SMC91X
 +
|-
 +
! Return
 +
| Pointer to the new Network device or nil if the Network device could not be created
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XNetworkDestroy(Network:PNetworkDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Close, deregister and destroy an SMC91X Network device created by this driver</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The Network device to destroy
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''SMC91X network functions'''
 +
 +
<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 SMC91XNetworkOpen(Network:PNetworkDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceOpen API for SMC91X Network</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use NetworkDeviceOpen instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XNetworkClose(Network:PNetworkDevice):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceClose API for SMC91X Network</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use NetworkDeviceClose instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XNetworkControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceControl API for SMC91X Network</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use NetworkDeviceControl instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XBufferAllocate(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkBufferAllocate API for SMC91X Network</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use NetworkBufferAllocate instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XBufferRelease(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkBufferRelease API for SMC91X Network</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use NetworkBufferRelease instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XBufferReceive(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkBufferReceive API for SMC91X Network</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use NetworkBufferReceive instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XBufferTransmit(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkBufferTransmit API for SMC91X Network</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications, use NetworkBufferTransmit instead.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XInterruptHandler(Network:PSMC91XNetwork);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Interrupt handler for the SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XInterruptReceive(Network:PSMC91XNetwork);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Interrupt receive handler for the SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XInterruptTransmit(Network:PSMC91XNetwork);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Interrupt transmit handler for the SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XCompletionExecute(Network:PSMC91XNetwork):PtrInt;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Completion handler thread for the SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XTransmitStart(Network:PSMC91XNetwork);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Transmit start function for the SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
Caller must hold the network lock.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XTransmitPacket(Network:PSMC91XNetwork; Entry:PNetworkEntry; Packet:PNetworkPacket);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Transmit packet function for the SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Not intended to be called directly by applications
 +
Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 +
'''SMC91X helper functions'''
 +
 +
<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 SMC91XCurrentBank(Network:PSMC91XNetwork):Word; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the currently selected bank from the bank select register</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to get the bank from
 +
|-
 +
! Return
 +
| The currently selected bank (The high byte must be $33 to be valid)
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XSelectBank(Network:PSMC91XNetwork; Bank:Byte); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the currently selected bank in the bank select register</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to set the bank for
 +
|-
 +
! Bank
 +
| The bank to select
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XGetBase(Network:PSMC91XNetwork):Word; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the base address register from a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to get from
 +
|-
 +
! Return
 +
| The base addres register value
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XGetRevision(Network:PSMC91XNetwork):Word; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the revision register from a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to get from
 +
|-
 +
! Return
 +
| The revision register value
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XWaitMMUBusy(Network:PSMC91XNetwork); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait for the MMU command register BUSY bit to be cleared for a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to wait for
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XSetMMUCommand(Network:PSMC91XNetwork; Command:Word); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the MMU command register of a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to set for
 +
|-
 +
! Command
 +
| The command to set
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XSetInterruptMask(Network:PSMC91XNetwork; Mask:Byte); inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable the specified mask in the interrupt mask register of a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| None documented
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XEnableInterrupt(Network:PSMC91XNetwork; Interrupt:Byte);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable the specified interrupt in the interrupt mask register of a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to enable the interrupt for
 +
|-
 +
! Interrupt
 +
| The interrupt to enable
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XDisableInterrupt(Network:PSMC91XNetwork; Interrupt:Byte); </pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable the specified interrupt in the interrupt mask register of a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to disable the interrupt for
 +
|-
 +
! Interrupt
 +
| The interrupt to disable
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XReset(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reset a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to reset
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XEnable(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable a SMC91X Network device and start sending and receiving</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to enable
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XShutdown(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Shutdown a SMC91X Network device and stop sending and receiving</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Network
 +
| The SMC91X Network device to shutdown
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XGetMACAddress(Network:PSMC91XNetwork; Address:PHardwareAddress):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current MAC address from a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Address
 +
| Pointer to a buffer to return the hardware address
 +
|-
 +
! Network
 +
| The SMC91X Network device to get from
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XSetMACAddress(Network:PSMC91XNetwork; Address:PHardwareAddress):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current MAC address for a SMC91X Network device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Address
 +
| Pointer to the hardware address to set
 +
|-
 +
! Network
 +
| The SMC91X Network device to set for
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XMIIIn(Network:PSMC91XNetwork; Bits:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Input data from the MII Management serial interface</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XMIIOut(Network:PSMC91XNetwork; Value,Bits:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Output data to the MII Management serial interface</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XPHYRead(Network:PSMC91XNetwork; Addr,Reg:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reads a register from the MII Management serial interface</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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;">procedure SMC91XPHYWrite(Network:PSMC91XNetwork; Addr,Reg,Data:LongWord);</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Writes a register to the MII Management serial interface</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XPHYDetect(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Detect the PHY type used in a SMC91X device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XPHYReset(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Perform a software reset on the PHY in a SMC91X device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XPHYFixed(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Configure the PHY with a fixed configuration on a SMC91x device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XPHYConfigure(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Configure the PHY using auto-negotiation on a SMC91x device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XPHYPowerdown(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Power down a PHY on a SMC91X device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<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 SMC91XPHYCheckMedia(Network:PSMC91XNetwork):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the media status of a PHY on a SMC91X device</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Note
 +
| Caller must hold the network lock
 +
|-
 +
|}
 +
</div></div>
 +
<br />
  
 
Return to [[Unit_Reference|Unit Reference]]
 
Return to [[Unit_Reference|Unit Reference]]

Latest revision as of 05:22, 17 June 2021

Return to Unit Reference


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



[Expand]
SMC91X specific constants SMC91X_*


[Expand]
SMC91X transmit control register SMC91X_TCR_*


[Expand]
SMC91X EPH status (Ethernet Protocol Handler) SMC91X_EPH_STATUS_*


[Expand]
SMC91X receive control register SMC91X_RCR_*


[Expand]
SMC91X receive/PHY control SMC91X_RPC_*


[Expand]
SMC91X configuration SMC91X_CONFIG_*


[Expand]
SMC91X control SMC91X_CTL_*


[Expand]
SMC91X MMU command SMC91X_MMU_CMD_*


[Expand]
SMC91X allocation result SMC91X_AR_*


[Expand]
SMC91X TX FIFO ports SMC91X_TXFIFO_*


[Expand]
SMC91X RX FIFO ports SMC91X_RXFIFO_*


[Expand]
SMC91X pointer SMC91X_PTR_*


[Expand]
SMC91X interrupt mask SMC91X_IM_*


[Expand]
SMC91X management interface SMC91X_MII_*


[Expand]
SMC91X receive SMC91X_RCV_THRESHOLD*


[Expand]
SMC91X receive status SMC91X_RCV_*


[Expand]
SMC91X bank select SMC91X_BANK_SELECT_*


[Expand]
SMC91X chip SMC91X_CHIP_*


[Expand]
SMC91X PHY Ids SMC91X_PHY_*


Type definitions



SMC91X bank 0 registers

[Expand]

TSMC91XBank0Registers = packed record

SMC91X bank 1 registers

[Expand]

TSMC91XBank1Registers = packed record

SMC91X FIFO registers

[Expand]

TSMC91XFIFORegisters = packed record

SMC91X DATA registers

[Expand]

TSMC91XDATARegisters = packed record

SMC91X bank 2 registers

[Expand]

TSMC91XBank2Registers = packed record

SMC91X bank 3 registers

[Expand]

TSMC91XBank3Registers = packed record

SMC91X registers

[Expand]

PSMC91XRegisters = ^TSMC91XRegisters;

TSMC91XRegisters = packed record

SMC91X network

[Expand]

PSMC91XNetwork = ^TSMC91XNetwork;

TSMC91XNetwork = record


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

[Expand]
function SMC91XNetworkCreate(Address:PtrUInt; const Name:String; IRQ:LongWord):PNetworkDevice;
Description: Create and register a new SMC91X Network device which can be accessed using the Network API


[Expand]
function SMC91XNetworkDestroy(Network:PNetworkDevice):LongWord;
Description: Close, deregister and destroy an SMC91X Network device created by this driver


SMC91X network functions

[Expand]
function SMC91XNetworkOpen(Network:PNetworkDevice):LongWord;
Description: Implementation of NetworkDeviceOpen API for SMC91X Network


[Expand]
function SMC91XNetworkClose(Network:PNetworkDevice):LongWord;
Description: Implementation of NetworkDeviceClose API for SMC91X Network


[Expand]
function SMC91XNetworkControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
Description: Implementation of NetworkDeviceControl API for SMC91X Network


[Expand]
function SMC91XBufferAllocate(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferAllocate API for SMC91X Network


[Expand]
function SMC91XBufferRelease(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferRelease API for SMC91X Network


[Expand]
function SMC91XBufferReceive(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferReceive API for SMC91X Network


[Expand]
function SMC91XBufferTransmit(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Description: Implementation of NetworkBufferTransmit API for SMC91X Network


[Expand]
procedure SMC91XInterruptHandler(Network:PSMC91XNetwork);
Description: Interrupt handler for the SMC91X Network device


[Expand]
procedure SMC91XInterruptReceive(Network:PSMC91XNetwork);
Description: Interrupt receive handler for the SMC91X Network device


[Expand]
procedure SMC91XInterruptTransmit(Network:PSMC91XNetwork);
Description: Interrupt transmit handler for the SMC91X Network device


[Expand]
function SMC91XCompletionExecute(Network:PSMC91XNetwork):PtrInt;
Description: Completion handler thread for the SMC91X Network device


[Expand]
procedure SMC91XTransmitStart(Network:PSMC91XNetwork);
Description: Transmit start function for the SMC91X Network device


[Expand]
procedure SMC91XTransmitPacket(Network:PSMC91XNetwork; Entry:PNetworkEntry; Packet:PNetworkPacket);
Description: Transmit packet function for the SMC91X Network device


SMC91X helper functions

[Expand]
function SMC91XCurrentBank(Network:PSMC91XNetwork):Word; inline;
Description: Get the currently selected bank from the bank select register


[Expand]
procedure SMC91XSelectBank(Network:PSMC91XNetwork; Bank:Byte); inline;
Description: Set the currently selected bank in the bank select register


[Expand]
function SMC91XGetBase(Network:PSMC91XNetwork):Word; inline;
Description: Get the base address register from a SMC91X Network device


[Expand]
function SMC91XGetRevision(Network:PSMC91XNetwork):Word; inline;
Description: Get the revision register from a SMC91X Network device


[Expand]
procedure SMC91XWaitMMUBusy(Network:PSMC91XNetwork); inline;
Description: Wait for the MMU command register BUSY bit to be cleared for a SMC91X Network device


[Expand]
procedure SMC91XSetMMUCommand(Network:PSMC91XNetwork; Command:Word); inline;
Description: Set the MMU command register of a SMC91X Network device


[Expand]
procedure SMC91XSetInterruptMask(Network:PSMC91XNetwork; Mask:Byte); inline;
Description: Enable the specified mask in the interrupt mask register of a SMC91X Network device


[Expand]
procedure SMC91XEnableInterrupt(Network:PSMC91XNetwork; Interrupt:Byte);
Description: Enable the specified interrupt in the interrupt mask register of a SMC91X Network device


[Expand]
procedure SMC91XDisableInterrupt(Network:PSMC91XNetwork; Interrupt:Byte); 
Description: Disable the specified interrupt in the interrupt mask register of a SMC91X Network device


[Expand]
function SMC91XReset(Network:PSMC91XNetwork):LongWord;
Description: Reset a SMC91X Network device


[Expand]
function SMC91XEnable(Network:PSMC91XNetwork):LongWord;
Description: Enable a SMC91X Network device and start sending and receiving


[Expand]
function SMC91XShutdown(Network:PSMC91XNetwork):LongWord;
Description: Shutdown a SMC91X Network device and stop sending and receiving


[Expand]
function SMC91XGetMACAddress(Network:PSMC91XNetwork; Address:PHardwareAddress):LongWord;
Description: Get the current MAC address from a SMC91X Network device


[Expand]
function SMC91XSetMACAddress(Network:PSMC91XNetwork; Address:PHardwareAddress):LongWord;
Description: Set the current MAC address for a SMC91X Network device


[Expand]
function SMC91XMIIIn(Network:PSMC91XNetwork; Bits:LongWord):LongWord;
Description: Input data from the MII Management serial interface


[Expand]
procedure SMC91XMIIOut(Network:PSMC91XNetwork; Value,Bits:LongWord);
Description: Output data to the MII Management serial interface


[Expand]
function SMC91XPHYRead(Network:PSMC91XNetwork; Addr,Reg:LongWord):LongWord;
Description: Reads a register from the MII Management serial interface


[Expand]
procedure SMC91XPHYWrite(Network:PSMC91XNetwork; Addr,Reg,Data:LongWord);
Description: Writes a register to the MII Management serial interface


[Expand]
function SMC91XPHYDetect(Network:PSMC91XNetwork):LongWord;
Description: Detect the PHY type used in a SMC91X device


[Expand]
function SMC91XPHYReset(Network:PSMC91XNetwork):LongWord;
Description: Perform a software reset on the PHY in a SMC91X device


[Expand]
function SMC91XPHYFixed(Network:PSMC91XNetwork):LongWord;
Description: Configure the PHY with a fixed configuration on a SMC91x device


[Expand]
function SMC91XPHYConfigure(Network:PSMC91XNetwork):LongWord;
Description: Configure the PHY using auto-negotiation on a SMC91x device


[Expand]
function SMC91XPHYPowerdown(Network:PSMC91XNetwork):LongWord;
Description: Power down a PHY on a SMC91X device


[Expand]
function SMC91XPHYCheckMedia(Network:PSMC91XNetwork):LongWord;
Description: Check the media status of a PHY on a SMC91X device


Return to Unit Reference