Difference between revisions of "Unit SMC91X"
(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 | + | 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> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
| | | | ||
|- | |- | ||
Line 1,119: | Line 1,066: | ||
---- | ---- | ||
− | |||
+ | '''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
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