Difference between revisions of "Unit SMSC95XX"
(21 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | The SMSC LAN95xx has an integrated USB Hub and is technically a compound device. Here we instead use the vendor | + | '''SMSC LAN95xx USB Ethernet Driver unit''' |
+ | |||
+ | The SMSC LAN95xx has an integrated USB Hub and is technically a compound device. Here we instead use the vendor Id and product Id of the vendor specific class device attached to the hub that is the device we actually need to communicate with. The hub will be detected and bound by the default USB Hub driver when it is enumerated by the USB core. | ||
=== Constants === | === Constants === | ||
---- | ---- | ||
− | ''To be | + | |
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX specific constants''' <code> SMSC95XX_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code> SMSC95XX_NETWORK_DESCRIPTION = 'SMSC LAN95XX USB Ethernet Adapter';</code> | ||
+ | | Description of SMSC95XX device | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_DRIVER_NAME = 'SMSC LAN95XX USB Ethernet Adapter Driver';</code> | ||
+ | | Name of SMSC95XX driver | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAX_SINGLE_PACKET_SIZE = 2048;</code> | ||
+ | | Maximum size of a bulk IN receive when burst cap and multiple frames is not in use | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_DEFAULT_BULK_IN_DELAY = $2000;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAX_TX_REQUESTS = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAX_RX_REQUESTS = 1;</code> | ||
+ | | ((60 * 1518) div SMSC95XX_DEFAULT_HS_BURST_CAP_SIZE) + 1; SMSC95XX_MAX_RX_REQUESTS (DIV_ROUND_UP(60 * 1518, SMSC95XX_DEFAULT_HS_BURST_CAP_SIZE)) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAX_EEPROM_SIZE = 512;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERNAL_PHY_ID = 1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_ID_MASK = $1F;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_REG_INDEX_MASK = $1F;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX device Id''' <code> MSC95XX_DEVICE_ID_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_DEVICE_ID_COUNT = 5;</code> | ||
+ | | Number of supported Device Ids | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|<code>SMSC95XX_DEVICE_ID:array[0..SMSC95XX_DEVICE_ID_COUNT - 1] of TUSBDeviceId = (</code> | ||
+ | |- | ||
+ | | <code>(idVendor:$0424;idProduct:$ec00),</code> | ||
+ | | LAN9512/LAN9514 Ethernet | ||
+ | |- | ||
+ | | <code>(idVendor:$0424;idProduct:$9500),</code> | ||
+ | | LAN9500 Ethernet | ||
+ | |- | ||
+ | | <code>(idVendor:$0424;idProduct:$9730),</code> | ||
+ | | LAN9730 Ethernet (HSIC) | ||
+ | |- | ||
+ | | <code>(idVendor:$0424;idProduct:$9900),</code> | ||
+ | | SMSC9500 USB Ethernet Device (SAL10) | ||
+ | |- | ||
+ | | <code>(idVendor:$0424;idProduct:$9e00));</code> | ||
+ | | LAN9500A Ethernet | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX transmit and receive''' <code> SMSC95XX_TX_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_OVERHEAD = 8;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_OVERHEAD = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX USB packet size''' <code> SMSC95XX_*_USB_PKT_SIZE </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_HS_USB_PKT_SIZE = 512;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_FS_USB_PKT_SIZE = 64;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX burst size''' <code> SMSC95XX_DEFAULT_*_BURST_CAP_SIZE </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_DEFAULT_HS_BURST_CAP_SIZE = (16 * 1024) + (5 * SMSC95XX_HS_USB_PKT_SIZE);</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_DEFAULT_FS_BURST_CAP_SIZE = (6 * 1024) + (33 * SMSC95XX_FS_USB_PKT_SIZE);</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX transmit command''' <code> SMSC95XX_TX_COMMAND_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Transmitted Ethernet frames (To the Bulk OUT endpoint) must be prefixed with an 8-byte header containing the "Tx command word A" followed by the "Tx command word B". | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''TX Command word A'' | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COMMAND_A_DATA_OFFSET = $001F0000;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COMMAND_A_FIRST_SEG = $00002000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COMMAND_A_LAST_SEG = $00001000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COMMAND_A_BUF_SIZE = $000007FF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''TX Command word B'' | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COMMAND_B_CSUM_ENABLE = $00004000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COMMAND_B_ADD_CRC_DISABLE = $00002000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COMMAND_B_DISABLE_PADDING = $00001000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COMMAND_B_PKT_BYTE_LENGTH = $000007FF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX receive status''' <code> SMSC95XX_RX_STATUS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Received Ethernet frames (From the Bulk IN endpoint) are prefixed with a 4-byte Rx Status word containing the flags below. A single USB Bulk IN transfer may contain multiple Ethernet frames (provided that HW_CONFIG_MEF is set in HW_CONFIG), each of which is prepended by a Rx Status word and padded to a 4-byte boundary. | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_FF = $40000000;</code> | ||
+ | | Filter Fail | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_FL = $3FFF0000;</code> | ||
+ | | Frame Length | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_ES = $00008000;</code> | ||
+ | | Error Summary | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_BF = $00002000;</code> | ||
+ | | Broadcast Frame | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_LE = $00001000;</code> | ||
+ | | Length Error | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_RF = $00000800;</code> | ||
+ | | Runt Frame | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_MF = $00000400;</code> | ||
+ | | Multicast Frame | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_TL = $00000080;</code> | ||
+ | | Frame too long | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_CS = $00000040;</code> | ||
+ | | Collision Seen | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_FT = $00000020;</code> | ||
+ | | Frame Type | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_RW = $00000010;</code> | ||
+ | | Receive Watchdog | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_ME = $00000008;</code> | ||
+ | | Mii Error | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_DB = $00000004;</code> | ||
+ | | Dribbling | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_STATUS_CRC = $00000002;</code> | ||
+ | | CRC Error | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX Id revision''' <code> SMSC95XX_ID_REVISION_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Read/Write Register Definitions | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION = $00;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION_CHIP_ID_MASK = $FFFF0000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION_CHIP_REV_MASK = $0000FFFF;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION_CHIP_ID_9500 = $9500;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION_CHIP_ID_9500A = $9E00;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION_CHIP_ID_9512 = $EC00;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION_CHIP_ID_9530 = $9530;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION_CHIP_ID_89530 = $9E08;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_ID_REVISION_CHIP_ID_9730 = $9730;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX interrupt status''' <code> SMSC95XX_INTERRUPT_STATUS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS = $08;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_TX_STOP = $00020000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_RX_STOP = $00010000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_PHY_INT = $00008000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_TXE = $00004000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_TDFU = $00002000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_TDFO = $00001000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_RXDF = $00000800;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_GPIOS = $000007FF;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INTERRUPT_STATUS_CLEAR_ALL = $FFFFFFFF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX receive configuration''' <code> SMSC95XX_RX_CONFIG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_CONFIG = $0C;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_CONFIG_FIFO_FLUSH = $00000001;</code> | ||
+ | | Most likely, software can write 1 to this flag discard all the Rx packets currently buffered by the device. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX transmit configuration''' <code> SMSC95XX_TX_CONFIG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_CONFIG = $10;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_CONFIG_ON = $00000004;</code> | ||
+ | | Transmit On flag. Software can write 1 here to enable transmit functionality (at the PHY layer). Writing 0 is ignored. Reads as current on (1)/off (0) state. However, to actually allow packets to be transmitted, software also must set the MAC_CONTROL_TXEN flag in the MAC_CONTROL register. | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_CONFIG_STOP = $00000002;</code> | ||
+ | | Transmit Stop flag. Software can write 1 here to turn transmit functionality off. Writing 0 is ignored. Always reads as 0. | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_CONFIG_FIFO_FLUSH = $00000001;</code> | ||
+ | | Most likely, software can write 1 to this flag to discard all the Tx packets currently buffered by the device. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX hardware configuration''' <code> SMSC95XX_HW_CONFIG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|This contains a number of flags that software can modify to configure the Ethernet Adapter (Default 0). | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG = $14;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_BIR = $00001000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_LEDB = $00000800;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_RXDOFF = $00000600;</code> | ||
+ | | Rx packet offset: Software can modify this 2-bit field to cause Rx packets to be offset by the specified number of bytes. This is apparently intended to allow software to align the IP header on a 4 byte boundary. | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_DRP = $00000040;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_MEF = $00000020;</code> | ||
+ | | Multiple Ethernet Frames: Software can set this flag in HW_CONFIG to allow multiple Ethernet frames to be received in a single USB Bulk In transfer. The default value after reset is 0, meaning that the hardware will by default provide each received Ethernet frame in a separate USB Bulk In transfer. | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_LRST = $00000008;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_PSEL = $00000004;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_BCE = $00000002;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_HW_CONFIG_SRST = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX RX FIFO''' <code> SMSC95XX_RX_FIFO_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_FIFO_INF = $18;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX power management control''' <code> SMSC95XX_PM_CONTROL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL = $20;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_RES_CLR_WKP_STS = $00000200;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_DEV_RDY = $00000080;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_SUS_MODE = $00000060;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_SUS_MODE_0 = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_SUS_MODE_1 = $00000020;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_SUS_MODE_2 = $00000040;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_SUS_MODE_3 = $00000060;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_PHY_RST = $00000010;</code> | ||
+ | | PHY Reset flag: Write 1 to start a PHY reset on the device. Automatically cleared when the PHY has reset (less than 1 second). | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_WOL_EN = $00000008;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_ED_EN = $00000004;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_WUPS = $00000003;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_WUPS_NO = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_WUPS_ED = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_WUPS_WOL = $00000002;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PM_CONTROL_WUPS_MULTI = $00000003;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX LED GPIO configuration''' <code> SMSC95XX_LED_GPIO_CONFIG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_LED_GPIO_CONFIG = $24;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_LED_GPIO_CONFIG_SPD_LED = $01000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_LED_GPIO_CONFIG_LNK_LED = $00100000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_LED_GPIO_CONFIG_FDX_LED = $00010000;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX GPIO configuration''' <code> SMSC95XX_GPIO_CONFIG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_GPIO_CONFIG = $28;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX advanced flow control configuration''' <code> SMSC95XX_AFC_CONFIG_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Default 0 | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_AFC_CONFIG = $2C;</code> | ||
+ | | Value written to AFC_CFG by the Linux driver, with the following explanation: | ||
+ | Hi watermark = 15.5Kb (~10 mtu pkts) | ||
+ | <br />low watermark = 3k (~2 mtu pkts) | ||
+ | <br />backpressure duration = ~ 350us | ||
+ | <br />Apply FC on any frame | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_AFC_CONFIG_DEFAULT = $00F830A1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX EEPROM command''' <code> SMSC95XX_E2P_COMMAND_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Unknown Register | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND = $30;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_BUSY= $80000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_MASK= $70000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_READ = $00000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_EWDS= $10000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_EWEN = $20000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_WRITE = $30000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_WRAL = $40000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_ERASE = $50000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_ERAL = $60000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_RELOAD = $70000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_TIMEOUT = $00000400;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_LOADED = $00000200;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_COMMAND_ADDR = $000001FF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX EEPROM data''' <code> SMSC95XX_E2P_DATA_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Unknown Register | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_DATA = $34;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_E2P_DATA_MASK = $000000FF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX burst cap''' <code> SMSC95XX_BURST_CAP_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|When multiple Ethernet frames per USB bulk transfer are enabled, this register must be set by software to specify the maximum number of USB (not networking!) packets the hardware will provide in a single Bulk In transfer. | ||
+ | |- | ||
+ | |colspan="2"|This register is ignored if HW_CONFIG_MEF is not set. Otherwise, this must be set to at least 5, which represents a maximum of 5 * 512 = 2560 bytes of data per transfer from the high speed Bulk In endpoint. | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_BURST_CAP = $38;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX GPIO wake''' <code> SMSC95XX_GPIO_WAKE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_GPIO_WAKE = $64;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX interrupt endpoint control''' <code> SMSC95XX_INT_EP_CONTROL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL = $68;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_INTEP = $80000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_MACRTO = $00080000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_TX_STOP = $00020000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_RX_STOP = $00010000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_PHY_INT = $00008000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_TXE = $00004000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_TDFU = $00002000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_TDFO = $00001000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_RXDF = $00000800;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_EP_CONTROL_GPIOS = $000007FF;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX bulk in delay''' <code> SMSC95XX_BULK_IN_DELAY_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|The low 16 bits of this register contain a value that indicates the maximum amount of time the hardware waits for additional packets before responding to a Bulk In request once a packet has been received. From experiment, the time is specified on a linear scale where each unit is approximately 17 nanoseconds. The default value in this register after reset is 0x800 which indicates a delay of about 34.8 microseconds, assuming that the scale is 0-based. SMSC's Linux driver changes this to 0x2000, or a delay of about 139 microseconds. | ||
+ | |- | ||
+ | |colspan="2"|The value in this register no effect if HW_CONFIG_MEF is not set in the HW_CONFIG register. | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_BULK_IN_DELAY = $6C;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX media access control''' <code> SMSC95XX_MAC_CONTROL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL = $100;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_RXALL = $80000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_RCVOWN = $00800000;</code> | ||
+ | | Half duplex mode | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_LOOPBK = $00200000;</code> | ||
+ | | Loopback mode | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_FDPX = $00100000;</code> | ||
+ | | Full duplex mode | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_MCPAS = $00080000;</code> | ||
+ | | Multicast pass: receive all multicast packets | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_PRMS = $00040000;</code> | ||
+ | | Promiscuous mode | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_INVFILT = $00020000;</code> | ||
+ | | Inverse filtering | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_PASSBAD = $00010000;</code> | ||
+ | | Pass on bad frames | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_HFILT = $00008000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_HPFILT = $00002000;</code> | ||
+ | | Filter received multicast packets by the set of addresses specified by HASH_HIGH and HASH_LOW | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_LCOLL = $00001000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_BCAST = $00000800;</code> | ||
+ | | Receive broadcast packets | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_DISRTY = $00000400;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_PADSTR = $00000100;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_BOLMT_MASK = $000000C0;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_DFCHK = $00000020;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_TX_ENABLE = $00000008;</code> | ||
+ | | Transmit enabled (MAC layer). 1 to enable/0 to disable (Must also set the SMSC95XX_TX_CONFIG_ON flag in the SMSC95XX_TX_CONFIG register). | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_CONTROL_RX_ENABLE = $00000004;</code> | ||
+ | | Receive enabled. 1 to enable/0 to disable. | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX MAC address''' <code> SMSC95XX_MAC_ADDRESS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|This contains the high 2 bytes of the MAC address used by the device, stored in little endian order. | ||
+ | As they are not part of the MAC address, the hardware ignores the values written to the upper 2 bytes of this register and always reads them as 0. | ||
+ | |- | ||
+ | |colspan="2"|Software can change the MAC address used by the device by writing to the MAC_ADDRESS_HIGH and MAC_ADDRESS_LOW registers, and it can retrieve the current MAC address by reading them. On reset, the device will read its MAC address from the EEPROM if one is attached; otherwise it will set its MAC address to 0xFFFFFFFFFFFF. | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_ADDRESS_HIGH = $104;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"|''This contains the low 4 bytes of the MAC address used by the device, stored in little endian order. See MAC_ADDRESS_HIGH.'' | ||
+ | |- | ||
+ | | <code>SMSC95XX_MAC_ADDRESS_LOW = $108;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX hash''' <code> SMSC95XX_HASH_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Used together with HASH_LOW to filter specific multicast packets'' | ||
+ | |- | ||
+ | | <code>SMSC95XX_HASH_HIGH = $10C;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"|''Used together with HASH_HIGH to filter specific multicast packets'' | ||
+ | |- | ||
+ | | <code>SMSC95XX_HASH_LOW = $110;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX MII data''' <code> SMSC95XX_MII_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Unknown Register | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_MII_ADDR = $114;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MII_WRITE = $02;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MII_BUSY = $01;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MII_READ = $00;</code> | ||
+ | | ~of MII Write bit | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_MII_DATA = $118;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX flow''' <code> SMSC95XX_FLOW_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Unknown Register,(Default 0) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_FLOW = $11C;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_FLOW_FCPT = $FFFF0000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_FLOW_FCPASS = $00000004;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_FLOW_FCEN = $00000002;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_FLOW_FCBSY = $00000001;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX VLAN''' <code> SMSC95XX_VLAN* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Unknown Register | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_VLAN1 = $120;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_VLAN2 = $124;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX WUFF''' <code> SMSC95XX_WUFF_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Unknown Register | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_WUFF = $128;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_LAN9500_WUFF_NUM = 4;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_LAN9500A_WUFF_NUM = 8;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX wakeup control and status''' <code> SMSC95XX_WUCSR_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|Unknown Register | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_WUCSR = $12C;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_WUCSR_WFF_PTR_RST = $80000000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_WUCSR_GUE = $00000200;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_WUCSR_WUFR = $00000040;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_WUCSR_WAKE_EN = $00000004;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_WUCSR_MPEN = $00000002;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX checksum offload engine/enable control''' <code> SMSC95XX_COE_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_COE_CONTROL = $130;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_TX_COE_ENABLE = $00010000;</code> | ||
+ | | Transmit checksum offload enabled. 1 to enable/0 to disable (Default 0). | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_COE_MODE = $00000002;</code> | ||
+ | | Unknown (Default 0) | ||
+ | |- | ||
+ | | <code>SMSC95XX_RX_COE_ENABLE = $00000001;</code> | ||
+ | | Receive checksum offload enabled. 1 to enable/0 to disable (Default 0). | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX vendor-specific physical''' <code> SMSC95XX_PHY_EDPD_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|EDPD NLP/crossover time configuration (LAN9500A only) | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG = 16;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_EN = $8000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_1000 = $0000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_768 = $2000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_512 = $4000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_256 = $6000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_RX_1_NLP = $1000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_RX_NLP_64 = $0000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_RX_NLP_256 = $0400;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_RX_NLP_512 = $0800;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_RX_NLP_1000 = $0C00;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_EXT_CROSSOVER = $0001;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_EDPD_CONFIG_DEFAULT = (SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_EN or SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_768 or SMSC95XX_PHY_EDPD_CONFIG_RX_1_NLP);</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX mode control and status''' <code> SMSC95XX_MODE_CTRL_STS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_MODE_CTRL_STS = 17;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_MODE_CTRL_STS_EDPWRDOWN = $2000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_MODE_CTRL_STS_ENERGYON = $0002;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX special control and status''' <code> SMSC95XX_SPECIAL_CTRL_STS_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code> SMSC95XX_SPECIAL_CTRL_STS = 27;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_SPECIAL_CTRL_STS_OVRRD_AMDIX = $8000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_SPECIAL_CTRL_STS_AMDIX_ENABLE = $4000;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_SPECIAL_CTRL_STS_AMDIX_STATE = $2000;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX physical interrupt source''' <code> SMSC95XX_PHY_INT_SRC_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_SRC = 29;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_SRC_ENERGY_ON = $0080;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_SRC_ANEG_COMP = $0040;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_SRC_REMOTE_FAULT = $0020;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_SRC_LINK_DOWN = $0010;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX physical interrupt mask''' <code> SMSC95XX_PHY_INT_MASK_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_MASK = 30;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_MASK_ENERGY_ON = $0080;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_MASK_ANEG_COMP = $0040;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_MASK_REMOTE_FAULT = $0020;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_MASK_LINK_DOWN = $0010;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_INT_MASK_DEFAULT = (SMSC95XX_PHY_INT_MASK_ANEG_COMP or SMSC95XX_PHY_INT_MASK_LINK_DOWN);</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX physical special''' <code> SMSC95XX_PHY_SPECIAL_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_SPECIAL = 31;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_SPECIAL_SPD = $001C;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_SPECIAL_SPD_10HALF = $0004;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_SPECIAL_SPD_10FULL = $0014;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_SPECIAL_SPD_100HALF = $0008;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_PHY_SPECIAL_SPD_100FULL = $0018;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX USB vendor request''' <code> SMSC95XX_VENDOR_REQUEST_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Write Register: Specify as bRequest of a USB control message to write a register on the SMSC LAN95XX. bmRequestType must specify a vendor-specific request in the host-to-device direction, wIndex must specify the register, and the transfer data must be 4 bytes containing the value to write.'' | ||
+ | |- | ||
+ | | <code>SMSC95XX_VENDOR_REQUEST_WRITE_REGISTER = $A0;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Read Register: Specify as bRequest of a USB control message to read a register from the SMSC LAN95XX. bmRequestType must specify a vendor-specific request in the device-to-host direction, wIndex must specify the register, and the transfer data must be a 4 byte location to read the value.'' | ||
+ | |- | ||
+ | | <code>SMSC95XX_VENDOR_REQUEST_READ_REGISTER = $A1;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"| | ||
+ | |- | ||
+ | |colspan="2"|''Get Statistics'' | ||
+ | |- | ||
+ | | <code>SMSC95XX_VENDOR_REQUEST_GET_STATS = $A2;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 20px; padding-bottom: 15px;"> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''SMSC95XX interrupt endpoint status word''' <code> SMSC95XX_INT_ENP_* </code></div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_ENP_TX_STOP = $00000001 shl 17;</code> | ||
+ | | style="width: 50%;"| | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_ENP_RX_STOP = $00000001 shl 16;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_ENP_PHY_INT = $00000001 shl 15;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_ENP_TXE = $00000001 shl 14;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_ENP_TDFU = $00000001 shl 13;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_ENP_TDFO = $00000001 shl 12;</code> | ||
+ | | | ||
+ | |- | ||
+ | | <code>SMSC95XX_INT_ENP_RXDF = $00000001 shl 11;</code> | ||
+ | | | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | |
+ | '''SMSC95XX network''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;"> | ||
+ | <code>PSMSC95XXNetwork = ^TSMSC95XXNetwork;</code> | ||
+ | |||
+ | <code>TSMSC95XXNetwork = record</code> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | |colspan="2"|''Network Properties'' | ||
+ | |- | ||
+ | | <code>Network:TNetworkDevice;</code> | ||
+ | | | ||
+ | |- | ||
+ | |colspan="2"|''USB Properties'' | ||
+ | |- | ||
+ | | <code>ReceiveRequests:array[0..SMSC95XX_MAX_RX_REQUESTS - 1] of PUSBRequest;</code> | ||
+ | | USB requests for packet receive data | ||
+ | |- | ||
+ | | <code>TransmitRequests:array[0..SMSC95XX_MAX_TX_REQUESTS - 1] of PUSBRequest;</code> | ||
+ | | USB requests for packet transmit data | ||
+ | |- | ||
+ | | <code>InterruptRequest:PUSBRequest;</code> | ||
+ | | USB request for interrupt data | ||
+ | |- | ||
+ | | <code>ReceiveEndpoint:PUSBEndpointDescriptor;</code> | ||
+ | | Bulk IN Endpoint | ||
+ | |- | ||
+ | | <code>TransmitEndpoint:PUSBEndpointDescriptor;</code> | ||
+ | | Bulk OUT Endpoint | ||
+ | |- | ||
+ | | <code>InterruptEndpoint:PUSBEndpointDescriptor;</code> | ||
+ | | Interrupt IN Endpoint | ||
+ | |- | ||
+ | | <code>PendingCount:LongWord;</code> | ||
+ | | Number of USB requests pending for this network | ||
+ | |- | ||
+ | | <code>WaiterThread:TThreadId;</code> | ||
+ | | Thread waiting for pending requests to complete (for network close) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Function declarations === | === Function declarations === | ||
Line 30: | Line 1,206: | ||
<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;">procedure SMSC95XXInit;</pre> | <pre style="border: 0; padding-bottom:0px;">procedure SMSC95XXInit;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the SMSC95XX unit, create and register the driver</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;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Called only during system startup |
|- | |- | ||
|} | |} | ||
Line 44: | Line 1,220: | ||
<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 | + | <pre style="border: 0; padding-bottom:0px;">function SMSC95XXNetworkOpen(Network:PNetworkDevice):LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceOpen for the SMSC95XX device</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceOpen for the SMSC95XX device</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;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Not intended to be called directly by applications, use NetworkDeviceOpen instead. |
|- | |- | ||
|} | |} | ||
Line 56: | Line 1,232: | ||
<br /> | <br /> | ||
<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 | + | <pre style="border: 0; padding-bottom:0px;">function SMSC95XXNetworkClose(Network:PNetworkDevice):LongWord;</pre> |
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceClose for the SMSC95XX device</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceClose for the SMSC95XX device</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;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Not intended to be called directly by applications, use NetworkDeviceClose instead. |
|- | |- | ||
|} | |} | ||
Line 68: | Line 1,244: | ||
<br /> | <br /> | ||
<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 | + | <pre style="border: 0; padding-bottom:0px;">function SMSC95XXNetworkControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;</pre> |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceControl for the SMSC95XX device</div> | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Implementation of NetworkDeviceControl for the SMSC95XX device</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;" | ||
|- | |- | ||
− | ! | + | ! Note |
− | | | + | | Not intended to be called directly by applications, use NetworkDeviceControl instead. |
|- | |- | ||
|} | |} | ||
Line 109: | Line 1,261: | ||
{| 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. |
|- | |- | ||
|} | |} | ||
Line 121: | Line 1,273: | ||
{| 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. |
|- | |- | ||
|} | |} | ||
Line 133: | Line 1,285: | ||
{| 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. |
|- | |- | ||
|} | |} | ||
Line 145: | Line 1,297: | ||
{| 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. |
+ | |- | ||
+ | |} | ||
+ | </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 SMSC95XXTransmitStart(Network:PSMSC95XXNetwork);</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Transmit start function for the SMSC95XX 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 | ||
|- | |- | ||
|} | |} | ||
Line 160: | Line 1,325: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| The USB device to attempt to bind to | | The USB device to attempt to bind to | ||
|- | |- | ||
− | ! | + | ! Interrface |
| The USB interface to attempt to bind to (or nil for whole device) | | The USB interface to attempt to bind to (or nil for whole device) | ||
|- | |- | ||
− | ! | + | ! Return |
− | | USB_STATUS_SUCCESS if completed, USB_STATUS_DEVICE_UNSUPPORTED if unsupported or another error code on failure | + | | USB_STATUS_SUCCESS if completed, USB_STATUS_DEVICE_UNSUPPORTED if unsupported or another error code on failure. |
|- | |- | ||
|} | |} | ||
Line 178: | Line 1,343: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| The USB device to unbind from | | The USB device to unbind from | ||
|- | |- | ||
− | ! | + | ! Interrface |
| The USB interface to unbind from (or nil for whole device) | | The USB interface to unbind from (or nil for whole device) | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 196: | Line 1,361: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
Line 208: | Line 1,373: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
− | ! | + | ! Note |
| Request is passed to worker thread for processing to prevent blocking the USB completion | | Request is passed to worker thread for processing to prevent blocking the USB completion | ||
|- | |- | ||
Line 223: | Line 1,388: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
Line 235: | Line 1,400: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
− | ! | + | ! Note |
| Request is passed to worker thread for processing to prevent blocking the USB completion | | Request is passed to worker thread for processing to prevent blocking the USB completion | ||
|- | |- | ||
Line 250: | Line 1,415: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
Line 262: | Line 1,427: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Request |
| The USB request which has completed | | The USB request which has completed | ||
|- | |- | ||
− | ! | + | ! Note |
| Request is passed to worker thread for processing to prevent blocking the USB completion | | Request is passed to worker thread for processing to prevent blocking the USB completion | ||
|- | |- | ||
Line 276: | Line 1,441: | ||
<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 SMSC95XXCheckDevice(Device:PUSBDevice):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function SMSC95XXCheckDevice(Device:PUSBDevice):LongWord;</pre> | ||
− | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the Vendor and Device | + | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check the Vendor and Device Id against the supported devices</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;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to check | | USB device to check | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 295: | Line 1,460: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to read from | | USB device to read from | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to read | | Index of the register to read | ||
|- | |- | ||
− | ! | + | ! Data |
| Value to return to registers contents | | Value to return to registers contents | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 316: | Line 1,481: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to write to | | USB device to write to | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to write | | Index of the register to write | ||
|- | |- | ||
− | ! | + | ! Data |
| Value to write to the register | | Value to write to the register | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 337: | Line 1,502: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to modify | | USB device to modify | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to modify | | Index of the register to modify | ||
|- | |- | ||
− | ! | + | ! Mask |
− | | Mask that contains 1 for the bits where the old value in the register will be kept rather than cleared (unless those bits also appear in Value, in which case they will still be set) | + | | Mask that contains 1 for the bits where the old value in the register will be kept rather than cleared (unless those bits also appear in Value, in which case they will still be set). |
|- | |- | ||
− | ! | + | ! Value |
| Mask of bits to set in the register | | Mask of bits to set in the register | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 361: | Line 1,526: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to write to | | USB device to write to | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to modify | | Index of the register to modify | ||
|- | |- | ||
− | ! | + | ! Value |
− | | Bits to set in the register. | + | | Bits to set in the register. At positions where there is a 0, the old value in the register will be written. |
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 382: | Line 1,547: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to write to | | USB device to write to | ||
|- | |- | ||
− | ! | + | ! Index |
| Index of the register to modify | | Index of the register to modify | ||
|- | |- | ||
− | ! | + | ! Value |
− | | Bits to clear in the register. | + | | Bits to clear in the register. At positions where there is a 0, the old value in the register will be written. |
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 397: | Line 1,562: | ||
</div></div> | </div></div> | ||
<br /> | <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 SMSC95XXPHYRead(Device:PUSBDevice; Index:LongWord; var Value:Word):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Read a register from the MII Management serial interface on a SMSC95XX USB Ethernet Adapter</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Device | ||
+ | | USB device to read from | ||
+ | |- | ||
+ | ! Index | ||
+ | | Index of the register to read | ||
+ | |- | ||
+ | ! Value | ||
+ | | Value to return the register contents | ||
+ | |- | ||
+ | ! Return | ||
+ | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </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 SMSC95XXPHYWrite(Device:PUSBDevice; Index:LongWord; Value:Word):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write a register to the MII Management serial interface on a SMSC95XX USB Ethernet Adapter</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Device | ||
+ | | USB device to write to | ||
+ | |- | ||
+ | ! Index | ||
+ | | Index of the register to write | ||
+ | |- | ||
+ | ! Value | ||
+ | | Value to write to the register | ||
+ | |- | ||
+ | ! Return | ||
+ | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </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 SMSC95XXPHYInitialize(Device:PUSBDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize default MII Management serial interface options on a SMSC95XX USB Ethernet Adapter</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Device | ||
+ | | USB device to initialize | ||
+ | |- | ||
+ | ! Return | ||
+ | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </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 SMSC95XXPHYWaitNotBusy(Device:PUSBDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait for the MII Management serial interface to be not busy on a SMSC95XX USB Ethernet Adapter</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Device | ||
+ | | USB device to wait for | ||
+ | |- | ||
+ | ! Return | ||
+ | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | ! Note | ||
+ | | Caller must hold the PHY 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 SMSC95XXWaitEEPROM(Device:PUSBDevice):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Wait for the EEPROM (if present) to be not busy on a SMSC95XX USB Ethernet Adapter</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Device | ||
+ | | USB device to wait for | ||
+ | |- | ||
+ | ! Return | ||
+ | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </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 SMSC95XXReadEEPROM(Device:PUSBDevice; Offset,Length:LongWord; Data:PByte):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Read from the EEPROM (if present) on a SMSC95XX USB Ethernet Adapter</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Device | ||
+ | | USB device to read from | ||
+ | |- | ||
+ | ! Offset | ||
+ | | The byte offset to start reading | ||
+ | |- | ||
+ | ! Length | ||
+ | | The number of bytes to read | ||
+ | |- | ||
+ | ! Data | ||
+ | | Pointer to a buffer to receive the data | ||
+ | |- | ||
+ | ! Return | ||
+ | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </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 SMSC95XXWriteEEPROM(Device:PUSBDevice; Offset,Length:LongWord; Data:PByte):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Write to the EEPROM (if present) on a SMSC95XX USB Ethernet Adapter</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Device | ||
+ | | USB device to write to | ||
+ | |- | ||
+ | ! Offset | ||
+ | | The byte offset to start writing | ||
+ | |- | ||
+ | ! Length | ||
+ | | The number of bytes to write | ||
+ | |- | ||
+ | ! Data | ||
+ | | Pointer to a buffer containing the data | ||
+ | |- | ||
+ | ! Return | ||
+ | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
<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 SMSC95XXSetMacAddress(Device:PUSBDevice; Address:PHardwareAddress):LongWord;</pre> | <pre style="border: 0; padding-bottom:0px;">function SMSC95XXSetMacAddress(Device:PUSBDevice; Address:PHardwareAddress):LongWord;</pre> | ||
Line 403: | Line 1,706: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device to write to | | USB device to write to | ||
|- | |- | ||
− | ! | + | ! Address |
| MAC address value to set | | MAC address value to set | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- | ||
Line 421: | Line 1,724: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Device |
| USB device read from | | USB device read from | ||
|- | |- | ||
− | ! | + | ! Address |
| Value to read the MAC address into | | Value to read the MAC address into | ||
|- | |- | ||
− | ! | + | ! Return |
| USB_STATUS_SUCCESS if completed or another error code on failure | | USB_STATUS_SUCCESS if completed or another error code on failure | ||
|- | |- |
Latest revision as of 05:31, 17 June 2021
Return to Unit Reference
Description
SMSC LAN95xx USB Ethernet Driver unit
The SMSC LAN95xx has an integrated USB Hub and is technically a compound device. Here we instead use the vendor Id and product Id of the vendor specific class device attached to the hub that is the device we actually need to communicate with. The hub will be detected and bound by the default USB Hub driver when it is enumerated by the USB core.
Constants
SMSC95XX_*
SMSC95XX_NETWORK_DESCRIPTION = 'SMSC LAN95XX USB Ethernet Adapter';
|
Description of SMSC95XX device |
SMSC95XX_DRIVER_NAME = 'SMSC LAN95XX USB Ethernet Adapter Driver';
|
Name of SMSC95XX driver |
SMSC95XX_MAX_SINGLE_PACKET_SIZE = 2048;
|
Maximum size of a bulk IN receive when burst cap and multiple frames is not in use |
SMSC95XX_DEFAULT_BULK_IN_DELAY = $2000;
|
|
SMSC95XX_MAX_TX_REQUESTS = 1;
|
|
SMSC95XX_MAX_RX_REQUESTS = 1;
|
((60 * 1518) div SMSC95XX_DEFAULT_HS_BURST_CAP_SIZE) + 1; SMSC95XX_MAX_RX_REQUESTS (DIV_ROUND_UP(60 * 1518, SMSC95XX_DEFAULT_HS_BURST_CAP_SIZE)) |
SMSC95XX_MAX_EEPROM_SIZE = 512;
|
|
SMSC95XX_INTERNAL_PHY_ID = 1;
|
|
SMSC95XX_PHY_ID_MASK = $1F;
|
|
SMSC95XX_REG_INDEX_MASK = $1F;
|
MSC95XX_DEVICE_ID_*
SMSC95XX_DEVICE_ID_COUNT = 5;
|
Number of supported Device Ids |
SMSC95XX_DEVICE_ID:array[0..SMSC95XX_DEVICE_ID_COUNT - 1] of TUSBDeviceId = (
| |
(idVendor:$0424;idProduct:$ec00),
|
LAN9512/LAN9514 Ethernet |
(idVendor:$0424;idProduct:$9500),
|
LAN9500 Ethernet |
(idVendor:$0424;idProduct:$9730),
|
LAN9730 Ethernet (HSIC) |
(idVendor:$0424;idProduct:$9900),
|
SMSC9500 USB Ethernet Device (SAL10) |
(idVendor:$0424;idProduct:$9e00));
|
LAN9500A Ethernet |
SMSC95XX_TX_*
SMSC95XX_TX_OVERHEAD = 8;
|
|
SMSC95XX_RX_OVERHEAD = 4;
|
SMSC95XX_*_USB_PKT_SIZE
SMSC95XX_HS_USB_PKT_SIZE = 512;
|
|
SMSC95XX_FS_USB_PKT_SIZE = 64;
|
SMSC95XX_DEFAULT_*_BURST_CAP_SIZE
SMSC95XX_DEFAULT_HS_BURST_CAP_SIZE = (16 * 1024) + (5 * SMSC95XX_HS_USB_PKT_SIZE);
|
|
SMSC95XX_DEFAULT_FS_BURST_CAP_SIZE = (6 * 1024) + (33 * SMSC95XX_FS_USB_PKT_SIZE);
|
SMSC95XX_TX_COMMAND_*
Transmitted Ethernet frames (To the Bulk OUT endpoint) must be prefixed with an 8-byte header containing the "Tx command word A" followed by the "Tx command word B". | |
TX Command word A | |
SMSC95XX_TX_COMMAND_A_DATA_OFFSET = $001F0000;
|
|
SMSC95XX_TX_COMMAND_A_FIRST_SEG = $00002000;
|
|
SMSC95XX_TX_COMMAND_A_LAST_SEG = $00001000;
|
|
SMSC95XX_TX_COMMAND_A_BUF_SIZE = $000007FF;
|
|
TX Command word B | |
SMSC95XX_TX_COMMAND_B_CSUM_ENABLE = $00004000;
|
|
SMSC95XX_TX_COMMAND_B_ADD_CRC_DISABLE = $00002000;
|
|
SMSC95XX_TX_COMMAND_B_DISABLE_PADDING = $00001000;
|
|
SMSC95XX_TX_COMMAND_B_PKT_BYTE_LENGTH = $000007FF;
|
SMSC95XX_RX_STATUS_*
Received Ethernet frames (From the Bulk IN endpoint) are prefixed with a 4-byte Rx Status word containing the flags below. A single USB Bulk IN transfer may contain multiple Ethernet frames (provided that HW_CONFIG_MEF is set in HW_CONFIG), each of which is prepended by a Rx Status word and padded to a 4-byte boundary. | |
SMSC95XX_RX_STATUS_FF = $40000000;
|
Filter Fail |
SMSC95XX_RX_STATUS_FL = $3FFF0000;
|
Frame Length |
SMSC95XX_RX_STATUS_ES = $00008000;
|
Error Summary |
SMSC95XX_RX_STATUS_BF = $00002000;
|
Broadcast Frame |
SMSC95XX_RX_STATUS_LE = $00001000;
|
Length Error |
SMSC95XX_RX_STATUS_RF = $00000800;
|
Runt Frame |
SMSC95XX_RX_STATUS_MF = $00000400;
|
Multicast Frame |
SMSC95XX_RX_STATUS_TL = $00000080;
|
Frame too long |
SMSC95XX_RX_STATUS_CS = $00000040;
|
Collision Seen |
SMSC95XX_RX_STATUS_FT = $00000020;
|
Frame Type |
SMSC95XX_RX_STATUS_RW = $00000010;
|
Receive Watchdog |
SMSC95XX_RX_STATUS_ME = $00000008;
|
Mii Error |
SMSC95XX_RX_STATUS_DB = $00000004;
|
Dribbling |
SMSC95XX_RX_STATUS_CRC = $00000002;
|
CRC Error |
SMSC95XX_ID_REVISION_*
Read/Write Register Definitions | |
SMSC95XX_ID_REVISION = $00;
|
|
SMSC95XX_ID_REVISION_CHIP_ID_MASK = $FFFF0000;
|
|
SMSC95XX_ID_REVISION_CHIP_REV_MASK = $0000FFFF;
|
|
SMSC95XX_ID_REVISION_CHIP_ID_9500 = $9500;
|
|
SMSC95XX_ID_REVISION_CHIP_ID_9500A = $9E00;
|
|
SMSC95XX_ID_REVISION_CHIP_ID_9512 = $EC00;
|
|
SMSC95XX_ID_REVISION_CHIP_ID_9530 = $9530;
|
|
SMSC95XX_ID_REVISION_CHIP_ID_89530 = $9E08;
|
|
SMSC95XX_ID_REVISION_CHIP_ID_9730 = $9730;
|
SMSC95XX_INTERRUPT_STATUS_*
SMSC95XX_INTERRUPT_STATUS = $08;
|
|
SMSC95XX_INTERRUPT_STATUS_TX_STOP = $00020000;
|
|
SMSC95XX_INTERRUPT_STATUS_RX_STOP = $00010000;
|
|
SMSC95XX_INTERRUPT_STATUS_PHY_INT = $00008000;
|
|
SMSC95XX_INTERRUPT_STATUS_TXE = $00004000;
|
|
SMSC95XX_INTERRUPT_STATUS_TDFU = $00002000;
|
|
SMSC95XX_INTERRUPT_STATUS_TDFO = $00001000;
|
|
SMSC95XX_INTERRUPT_STATUS_RXDF = $00000800;
|
|
SMSC95XX_INTERRUPT_STATUS_GPIOS = $000007FF;
|
|
SMSC95XX_INTERRUPT_STATUS_CLEAR_ALL = $FFFFFFFF;
|
SMSC95XX_RX_CONFIG_*
SMSC95XX_RX_CONFIG = $0C;
|
|
SMSC95XX_RX_CONFIG_FIFO_FLUSH = $00000001;
|
Most likely, software can write 1 to this flag discard all the Rx packets currently buffered by the device. |
SMSC95XX_TX_CONFIG_*
SMSC95XX_TX_CONFIG = $10;
|
|
SMSC95XX_TX_CONFIG_ON = $00000004;
|
Transmit On flag. Software can write 1 here to enable transmit functionality (at the PHY layer). Writing 0 is ignored. Reads as current on (1)/off (0) state. However, to actually allow packets to be transmitted, software also must set the MAC_CONTROL_TXEN flag in the MAC_CONTROL register. |
SMSC95XX_TX_CONFIG_STOP = $00000002;
|
Transmit Stop flag. Software can write 1 here to turn transmit functionality off. Writing 0 is ignored. Always reads as 0. |
SMSC95XX_TX_CONFIG_FIFO_FLUSH = $00000001;
|
Most likely, software can write 1 to this flag to discard all the Tx packets currently buffered by the device. |
SMSC95XX_HW_CONFIG_*
This contains a number of flags that software can modify to configure the Ethernet Adapter (Default 0). | |
SMSC95XX_HW_CONFIG = $14;
|
|
SMSC95XX_HW_CONFIG_BIR = $00001000;
|
|
SMSC95XX_HW_CONFIG_LEDB = $00000800;
|
|
SMSC95XX_HW_CONFIG_RXDOFF = $00000600;
|
Rx packet offset: Software can modify this 2-bit field to cause Rx packets to be offset by the specified number of bytes. This is apparently intended to allow software to align the IP header on a 4 byte boundary. |
SMSC95XX_HW_CONFIG_DRP = $00000040;
|
|
SMSC95XX_HW_CONFIG_MEF = $00000020;
|
Multiple Ethernet Frames: Software can set this flag in HW_CONFIG to allow multiple Ethernet frames to be received in a single USB Bulk In transfer. The default value after reset is 0, meaning that the hardware will by default provide each received Ethernet frame in a separate USB Bulk In transfer. |
SMSC95XX_HW_CONFIG_LRST = $00000008;
|
|
SMSC95XX_HW_CONFIG_PSEL = $00000004;
|
|
SMSC95XX_HW_CONFIG_BCE = $00000002;
|
|
SMSC95XX_HW_CONFIG_SRST = $00000001;
|
SMSC95XX_RX_FIFO_*
SMSC95XX_RX_FIFO_INF = $18;
|
SMSC95XX_PM_CONTROL_*
SMSC95XX_PM_CONTROL = $20;
|
|
SMSC95XX_PM_CONTROL_RES_CLR_WKP_STS = $00000200;
|
|
SMSC95XX_PM_CONTROL_DEV_RDY = $00000080;
|
|
SMSC95XX_PM_CONTROL_SUS_MODE = $00000060;
|
|
SMSC95XX_PM_CONTROL_SUS_MODE_0 = $00000000;
|
|
SMSC95XX_PM_CONTROL_SUS_MODE_1 = $00000020;
|
|
SMSC95XX_PM_CONTROL_SUS_MODE_2 = $00000040;
|
|
SMSC95XX_PM_CONTROL_SUS_MODE_3 = $00000060;
|
|
SMSC95XX_PM_CONTROL_PHY_RST = $00000010;
|
PHY Reset flag: Write 1 to start a PHY reset on the device. Automatically cleared when the PHY has reset (less than 1 second). |
SMSC95XX_PM_CONTROL_WOL_EN = $00000008;
|
|
SMSC95XX_PM_CONTROL_ED_EN = $00000004;
|
|
SMSC95XX_PM_CONTROL_WUPS = $00000003;
|
|
SMSC95XX_PM_CONTROL_WUPS_NO = $00000000;
|
|
SMSC95XX_PM_CONTROL_WUPS_ED = $00000001;
|
|
SMSC95XX_PM_CONTROL_WUPS_WOL = $00000002;
|
|
SMSC95XX_PM_CONTROL_WUPS_MULTI = $00000003;
|
SMSC95XX_LED_GPIO_CONFIG_*
SMSC95XX_LED_GPIO_CONFIG = $24;
|
|
SMSC95XX_LED_GPIO_CONFIG_SPD_LED = $01000000;
|
|
SMSC95XX_LED_GPIO_CONFIG_LNK_LED = $00100000;
|
|
SMSC95XX_LED_GPIO_CONFIG_FDX_LED = $00010000;
|
SMSC95XX_GPIO_CONFIG_*
SMSC95XX_GPIO_CONFIG = $28;
|
SMSC95XX_AFC_CONFIG_*
Default 0 | |
SMSC95XX_AFC_CONFIG = $2C;
|
Value written to AFC_CFG by the Linux driver, with the following explanation:
Hi watermark = 15.5Kb (~10 mtu pkts)
|
SMSC95XX_AFC_CONFIG_DEFAULT = $00F830A1;
|
SMSC95XX_E2P_COMMAND_*
Unknown Register | |
SMSC95XX_E2P_COMMAND = $30;
|
|
SMSC95XX_E2P_COMMAND_BUSY= $80000000;
|
|
SMSC95XX_E2P_COMMAND_MASK= $70000000;
|
|
SMSC95XX_E2P_COMMAND_READ = $00000000;
|
|
SMSC95XX_E2P_COMMAND_EWDS= $10000000;
|
|
SMSC95XX_E2P_COMMAND_EWEN = $20000000;
|
|
SMSC95XX_E2P_COMMAND_WRITE = $30000000;
|
|
SMSC95XX_E2P_COMMAND_WRAL = $40000000;
|
|
SMSC95XX_E2P_COMMAND_ERASE = $50000000;
|
|
SMSC95XX_E2P_COMMAND_ERAL = $60000000;
|
|
SMSC95XX_E2P_COMMAND_RELOAD = $70000000;
|
|
SMSC95XX_E2P_COMMAND_TIMEOUT = $00000400;
|
|
SMSC95XX_E2P_COMMAND_LOADED = $00000200;
|
|
SMSC95XX_E2P_COMMAND_ADDR = $000001FF;
|
SMSC95XX_E2P_DATA_*
Unknown Register | |
SMSC95XX_E2P_DATA = $34;
|
|
SMSC95XX_E2P_DATA_MASK = $000000FF;
|
SMSC95XX_BURST_CAP_*
When multiple Ethernet frames per USB bulk transfer are enabled, this register must be set by software to specify the maximum number of USB (not networking!) packets the hardware will provide in a single Bulk In transfer. | |
This register is ignored if HW_CONFIG_MEF is not set. Otherwise, this must be set to at least 5, which represents a maximum of 5 * 512 = 2560 bytes of data per transfer from the high speed Bulk In endpoint. | |
SMSC95XX_BURST_CAP = $38;
|
SMSC95XX_GPIO_WAKE_*
SMSC95XX_GPIO_WAKE = $64;
|
SMSC95XX_INT_EP_CONTROL_*
SMSC95XX_INT_EP_CONTROL = $68;
|
|
SMSC95XX_INT_EP_CONTROL_INTEP = $80000000;
|
|
SMSC95XX_INT_EP_CONTROL_MACRTO = $00080000;
|
|
SMSC95XX_INT_EP_CONTROL_TX_STOP = $00020000;
|
|
SMSC95XX_INT_EP_CONTROL_RX_STOP = $00010000;
|
|
SMSC95XX_INT_EP_CONTROL_PHY_INT = $00008000;
|
|
SMSC95XX_INT_EP_CONTROL_TXE = $00004000;
|
|
SMSC95XX_INT_EP_CONTROL_TDFU = $00002000;
|
|
SMSC95XX_INT_EP_CONTROL_TDFO = $00001000;
|
|
SMSC95XX_INT_EP_CONTROL_RXDF = $00000800;
|
|
SMSC95XX_INT_EP_CONTROL_GPIOS = $000007FF;
|
SMSC95XX_BULK_IN_DELAY_*
The low 16 bits of this register contain a value that indicates the maximum amount of time the hardware waits for additional packets before responding to a Bulk In request once a packet has been received. From experiment, the time is specified on a linear scale where each unit is approximately 17 nanoseconds. The default value in this register after reset is 0x800 which indicates a delay of about 34.8 microseconds, assuming that the scale is 0-based. SMSC's Linux driver changes this to 0x2000, or a delay of about 139 microseconds. | |
The value in this register no effect if HW_CONFIG_MEF is not set in the HW_CONFIG register. | |
SMSC95XX_BULK_IN_DELAY = $6C;
|
SMSC95XX_MAC_CONTROL_*
SMSC95XX_MAC_CONTROL = $100;
|
|
SMSC95XX_MAC_CONTROL_RXALL = $80000000;
|
|
SMSC95XX_MAC_CONTROL_RCVOWN = $00800000;
|
Half duplex mode |
SMSC95XX_MAC_CONTROL_LOOPBK = $00200000;
|
Loopback mode |
SMSC95XX_MAC_CONTROL_FDPX = $00100000;
|
Full duplex mode |
SMSC95XX_MAC_CONTROL_MCPAS = $00080000;
|
Multicast pass: receive all multicast packets |
SMSC95XX_MAC_CONTROL_PRMS = $00040000;
|
Promiscuous mode |
SMSC95XX_MAC_CONTROL_INVFILT = $00020000;
|
Inverse filtering |
SMSC95XX_MAC_CONTROL_PASSBAD = $00010000;
|
Pass on bad frames |
SMSC95XX_MAC_CONTROL_HFILT = $00008000;
|
|
SMSC95XX_MAC_CONTROL_HPFILT = $00002000;
|
Filter received multicast packets by the set of addresses specified by HASH_HIGH and HASH_LOW |
SMSC95XX_MAC_CONTROL_LCOLL = $00001000;
|
|
SMSC95XX_MAC_CONTROL_BCAST = $00000800;
|
Receive broadcast packets |
SMSC95XX_MAC_CONTROL_DISRTY = $00000400;
|
|
SMSC95XX_MAC_CONTROL_PADSTR = $00000100;
|
|
SMSC95XX_MAC_CONTROL_BOLMT_MASK = $000000C0;
|
|
SMSC95XX_MAC_CONTROL_DFCHK = $00000020;
|
|
SMSC95XX_MAC_CONTROL_TX_ENABLE = $00000008;
|
Transmit enabled (MAC layer). 1 to enable/0 to disable (Must also set the SMSC95XX_TX_CONFIG_ON flag in the SMSC95XX_TX_CONFIG register). |
SMSC95XX_MAC_CONTROL_RX_ENABLE = $00000004;
|
Receive enabled. 1 to enable/0 to disable. |
SMSC95XX_MAC_ADDRESS_*
This contains the high 2 bytes of the MAC address used by the device, stored in little endian order.
As they are not part of the MAC address, the hardware ignores the values written to the upper 2 bytes of this register and always reads them as 0. | |
Software can change the MAC address used by the device by writing to the MAC_ADDRESS_HIGH and MAC_ADDRESS_LOW registers, and it can retrieve the current MAC address by reading them. On reset, the device will read its MAC address from the EEPROM if one is attached; otherwise it will set its MAC address to 0xFFFFFFFFFFFF. | |
SMSC95XX_MAC_ADDRESS_HIGH = $104;
|
|
This contains the low 4 bytes of the MAC address used by the device, stored in little endian order. See MAC_ADDRESS_HIGH. | |
SMSC95XX_MAC_ADDRESS_LOW = $108;
|
SMSC95XX_HASH_*
Used together with HASH_LOW to filter specific multicast packets | |
SMSC95XX_HASH_HIGH = $10C;
|
|
Used together with HASH_HIGH to filter specific multicast packets | |
SMSC95XX_HASH_LOW = $110;
|
SMSC95XX_MII_*
Unknown Register | |
SMSC95XX_MII_ADDR = $114;
|
|
SMSC95XX_MII_WRITE = $02;
|
|
SMSC95XX_MII_BUSY = $01;
|
|
SMSC95XX_MII_READ = $00;
|
~of MII Write bit |
SMSC95XX_MII_DATA = $118;
|
SMSC95XX_FLOW_*
Unknown Register,(Default 0) | |
SMSC95XX_FLOW = $11C;
|
|
SMSC95XX_FLOW_FCPT = $FFFF0000;
|
|
SMSC95XX_FLOW_FCPASS = $00000004;
|
|
SMSC95XX_FLOW_FCEN = $00000002;
|
|
SMSC95XX_FLOW_FCBSY = $00000001;
|
SMSC95XX_VLAN*
Unknown Register | |
SMSC95XX_VLAN1 = $120;
|
|
SMSC95XX_VLAN2 = $124;
|
SMSC95XX_WUFF_*
Unknown Register | |
SMSC95XX_WUFF = $128;
|
|
SMSC95XX_LAN9500_WUFF_NUM = 4;
|
|
SMSC95XX_LAN9500A_WUFF_NUM = 8;
|
SMSC95XX_WUCSR_*
Unknown Register | |
SMSC95XX_WUCSR = $12C;
|
|
SMSC95XX_WUCSR_WFF_PTR_RST = $80000000;
|
|
SMSC95XX_WUCSR_GUE = $00000200;
|
|
SMSC95XX_WUCSR_WUFR = $00000040;
|
|
SMSC95XX_WUCSR_WAKE_EN = $00000004;
|
|
SMSC95XX_WUCSR_MPEN = $00000002;
|
SMSC95XX_COE_*
SMSC95XX_COE_CONTROL = $130;
|
|
SMSC95XX_TX_COE_ENABLE = $00010000;
|
Transmit checksum offload enabled. 1 to enable/0 to disable (Default 0). |
SMSC95XX_RX_COE_MODE = $00000002;
|
Unknown (Default 0) |
SMSC95XX_RX_COE_ENABLE = $00000001;
|
Receive checksum offload enabled. 1 to enable/0 to disable (Default 0). |
SMSC95XX_PHY_EDPD_*
EDPD NLP/crossover time configuration (LAN9500A only) | |
SMSC95XX_PHY_EDPD_CONFIG = 16;
|
|
SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_EN = $8000;
|
|
SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_1000 = $0000;
|
|
SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_768 = $2000;
|
|
SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_512 = $4000;
|
|
SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_256 = $6000;
|
|
SMSC95XX_PHY_EDPD_CONFIG_RX_1_NLP = $1000;
|
|
SMSC95XX_PHY_EDPD_CONFIG_RX_NLP_64 = $0000;
|
|
SMSC95XX_PHY_EDPD_CONFIG_RX_NLP_256 = $0400;
|
|
SMSC95XX_PHY_EDPD_CONFIG_RX_NLP_512 = $0800;
|
|
SMSC95XX_PHY_EDPD_CONFIG_RX_NLP_1000 = $0C00;
|
|
SMSC95XX_PHY_EDPD_CONFIG_EXT_CROSSOVER = $0001;
|
|
SMSC95XX_PHY_EDPD_CONFIG_DEFAULT = (SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_EN or SMSC95XX_PHY_EDPD_CONFIG_TX_NLP_768 or SMSC95XX_PHY_EDPD_CONFIG_RX_1_NLP);
|
SMSC95XX_MODE_CTRL_STS_*
SMSC95XX_PHY_MODE_CTRL_STS = 17;
|
|
SMSC95XX_MODE_CTRL_STS_EDPWRDOWN = $2000;
|
|
SMSC95XX_MODE_CTRL_STS_ENERGYON = $0002;
|
SMSC95XX_SPECIAL_CTRL_STS_*
SMSC95XX_SPECIAL_CTRL_STS = 27;
|
|
SMSC95XX_SPECIAL_CTRL_STS_OVRRD_AMDIX = $8000;
|
|
SMSC95XX_SPECIAL_CTRL_STS_AMDIX_ENABLE = $4000;
|
|
SMSC95XX_SPECIAL_CTRL_STS_AMDIX_STATE = $2000;
|
SMSC95XX_PHY_INT_SRC_*
SMSC95XX_PHY_INT_SRC = 29;
|
|
SMSC95XX_PHY_INT_SRC_ENERGY_ON = $0080;
|
|
SMSC95XX_PHY_INT_SRC_ANEG_COMP = $0040;
|
|
SMSC95XX_PHY_INT_SRC_REMOTE_FAULT = $0020;
|
|
SMSC95XX_PHY_INT_SRC_LINK_DOWN = $0010;
|
SMSC95XX_PHY_INT_MASK_*
SMSC95XX_PHY_INT_MASK = 30;
|
|
SMSC95XX_PHY_INT_MASK_ENERGY_ON = $0080;
|
|
SMSC95XX_PHY_INT_MASK_ANEG_COMP = $0040;
|
|
SMSC95XX_PHY_INT_MASK_REMOTE_FAULT = $0020;
|
|
SMSC95XX_PHY_INT_MASK_LINK_DOWN = $0010;
|
|
SMSC95XX_PHY_INT_MASK_DEFAULT = (SMSC95XX_PHY_INT_MASK_ANEG_COMP or SMSC95XX_PHY_INT_MASK_LINK_DOWN);
|
SMSC95XX_PHY_SPECIAL_*
SMSC95XX_PHY_SPECIAL = 31;
|
|
SMSC95XX_PHY_SPECIAL_SPD = $001C;
|
|
SMSC95XX_PHY_SPECIAL_SPD_10HALF = $0004;
|
|
SMSC95XX_PHY_SPECIAL_SPD_10FULL = $0014;
|
|
SMSC95XX_PHY_SPECIAL_SPD_100HALF = $0008;
|
|
SMSC95XX_PHY_SPECIAL_SPD_100FULL = $0018;
|
SMSC95XX_VENDOR_REQUEST_*
Write Register: Specify as bRequest of a USB control message to write a register on the SMSC LAN95XX. bmRequestType must specify a vendor-specific request in the host-to-device direction, wIndex must specify the register, and the transfer data must be 4 bytes containing the value to write. | |
SMSC95XX_VENDOR_REQUEST_WRITE_REGISTER = $A0;
|
|
Read Register: Specify as bRequest of a USB control message to read a register from the SMSC LAN95XX. bmRequestType must specify a vendor-specific request in the device-to-host direction, wIndex must specify the register, and the transfer data must be a 4 byte location to read the value. | |
SMSC95XX_VENDOR_REQUEST_READ_REGISTER = $A1;
|
|
Get Statistics | |
SMSC95XX_VENDOR_REQUEST_GET_STATS = $A2;
|
SMSC95XX_INT_ENP_*
SMSC95XX_INT_ENP_TX_STOP = $00000001 shl 17;
|
|
SMSC95XX_INT_ENP_RX_STOP = $00000001 shl 16;
|
|
SMSC95XX_INT_ENP_PHY_INT = $00000001 shl 15;
|
|
SMSC95XX_INT_ENP_TXE = $00000001 shl 14;
|
|
SMSC95XX_INT_ENP_TDFU = $00000001 shl 13;
|
|
SMSC95XX_INT_ENP_TDFO = $00000001 shl 12;
|
|
SMSC95XX_INT_ENP_RXDF = $00000001 shl 11;
|
Type definitions
SMSC95XX network
PSMSC95XXNetwork = ^TSMSC95XXNetwork;
TSMSC95XXNetwork = record
Network Properties | |
Network:TNetworkDevice;
|
|
USB Properties | |
ReceiveRequests:array[0..SMSC95XX_MAX_RX_REQUESTS - 1] of PUSBRequest;
|
USB requests for packet receive data |
TransmitRequests:array[0..SMSC95XX_MAX_TX_REQUESTS - 1] of PUSBRequest;
|
USB requests for packet transmit data |
InterruptRequest:PUSBRequest;
|
USB request for interrupt data |
ReceiveEndpoint:PUSBEndpointDescriptor;
|
Bulk IN Endpoint |
TransmitEndpoint:PUSBEndpointDescriptor;
|
Bulk OUT Endpoint |
InterruptEndpoint:PUSBEndpointDescriptor;
|
Interrupt IN Endpoint |
PendingCount:LongWord;
|
Number of USB requests pending for this network |
WaiterThread:TThreadId;
|
Thread waiting for pending requests to complete (for network close) |
Public variables
None defined
Function declarations
Initialization functions
procedure SMSC95XXInit;
Note | Called only during system startup |
---|
SMSC95XX network functions
function SMSC95XXNetworkOpen(Network:PNetworkDevice):LongWord;
Note | Not intended to be called directly by applications, use NetworkDeviceOpen instead. |
---|
function SMSC95XXNetworkClose(Network:PNetworkDevice):LongWord;
Note | Not intended to be called directly by applications, use NetworkDeviceClose instead. |
---|
function SMSC95XXNetworkControl(Network:PNetworkDevice; Request:Integer; Argument1:PtrUInt; var Argument2:PtrUInt):LongWord;
Note | Not intended to be called directly by applications, use NetworkDeviceControl instead. |
---|
function SMSC95XXBufferAllocate(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Note | Not intended to be called directly by applications, use NetworkBufferAllocate instead. |
---|
function SMSC95XXBufferRelease(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Note | Not intended to be called directly by applications, use NetworkBufferRelease instead. |
---|
function SMSC95XXBufferReceive(Network:PNetworkDevice; var Entry:PNetworkEntry):LongWord;
Note | Not intended to be called directly by applications, use NetworkBufferReceive instead. |
---|
function SMSC95XXBufferTransmit(Network:PNetworkDevice; Entry:PNetworkEntry):LongWord;
Note | Not intended to be called directly by applications, use NetworkBufferTransmit instead. |
---|
procedure SMSC95XXTransmitStart(Network:PSMSC95XXNetwork);
Note | Not intended to be called directly by applications
Caller must hold the network lock |
---|
SMSC95XX USB functions
function SMSC95XXDriverBind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Device | The USB device to attempt to bind to |
---|---|
Interrface | The USB interface to attempt to bind to (or nil for whole device) |
Return | USB_STATUS_SUCCESS if completed, USB_STATUS_DEVICE_UNSUPPORTED if unsupported or another error code on failure. |
function SMSC95XXDriverUnbind(Device:PUSBDevice; Interrface:PUSBInterface):LongWord;
Device | The USB device to unbind from |
---|---|
Interrface | The USB interface to unbind from (or nil for whole device) |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
procedure SMSC95XXReceiveWorker(Request:PUSBRequest);
Request | The USB request which has completed |
---|
procedure SMSC95XXReceiveComplete(Request:PUSBRequest);
Request | The USB request which has completed |
---|---|
Note | Request is passed to worker thread for processing to prevent blocking the USB completion |
procedure SMSC95XXTransmitWorker(Request:PUSBRequest);
Request | The USB request which has completed |
---|
procedure SMSC95XXTransmitComplete(Request:PUSBRequest);
Request | The USB request which has completed |
---|---|
Note | Request is passed to worker thread for processing to prevent blocking the USB completion |
procedure SMSC95XXInterruptWorker(Request:PUSBRequest);
Request | The USB request which has completed |
---|
procedure SMSC95XXInterruptComplete(Request:PUSBRequest);
Request | The USB request which has completed |
---|---|
Note | Request is passed to worker thread for processing to prevent blocking the USB completion |
SMSC95XX helper functions
function SMSC95XXCheckDevice(Device:PUSBDevice):LongWord;
Device | USB device to check |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXReadRegister(Device:PUSBDevice; Index:LongWord; var Data:LongWord):LongWord;
Device | USB device to read from |
---|---|
Index | Index of the register to read |
Data | Value to return to registers contents |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXWriteRegister(Device:PUSBDevice; Index,Data:LongWord):LongWord;
Device | USB device to write to |
---|---|
Index | Index of the register to write |
Data | Value to write to the register |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXModifyRegister(Device:PUSBDevice; Index,Mask,Value:LongWord):LongWord;
Device | USB device to modify |
---|---|
Index | Index of the register to modify |
Mask | Mask that contains 1 for the bits where the old value in the register will be kept rather than cleared (unless those bits also appear in Value, in which case they will still be set). |
Value | Mask of bits to set in the register |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXSetRegisterBits(Device:PUSBDevice; Index,Value:LongWord):LongWord;
Device | USB device to write to |
---|---|
Index | Index of the register to modify |
Value | Bits to set in the register. At positions where there is a 0, the old value in the register will be written. |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXClearRegisterBits(Device:PUSBDevice; Index,Value:LongWord):LongWord;
Device | USB device to write to |
---|---|
Index | Index of the register to modify |
Value | Bits to clear in the register. At positions where there is a 0, the old value in the register will be written. |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXPHYRead(Device:PUSBDevice; Index:LongWord; var Value:Word):LongWord;
Device | USB device to read from |
---|---|
Index | Index of the register to read |
Value | Value to return the register contents |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXPHYWrite(Device:PUSBDevice; Index:LongWord; Value:Word):LongWord;
Device | USB device to write to |
---|---|
Index | Index of the register to write |
Value | Value to write to the register |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXPHYInitialize(Device:PUSBDevice):LongWord;
Device | USB device to initialize |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXPHYWaitNotBusy(Device:PUSBDevice):LongWord;
Device | USB device to wait for |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
Note | Caller must hold the PHY Lock |
function SMSC95XXWaitEEPROM(Device:PUSBDevice):LongWord;
Device | USB device to wait for |
---|---|
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXReadEEPROM(Device:PUSBDevice; Offset,Length:LongWord; Data:PByte):LongWord;
Device | USB device to read from |
---|---|
Offset | The byte offset to start reading |
Length | The number of bytes to read |
Data | Pointer to a buffer to receive the data |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXWriteEEPROM(Device:PUSBDevice; Offset,Length:LongWord; Data:PByte):LongWord;
Device | USB device to write to |
---|---|
Offset | The byte offset to start writing |
Length | The number of bytes to write |
Data | Pointer to a buffer containing the data |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXSetMacAddress(Device:PUSBDevice; Address:PHardwareAddress):LongWord;
Device | USB device to write to |
---|---|
Address | MAC address value to set |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
function SMSC95XXGetMacAddress(Device:PUSBDevice; Address:PHardwareAddress):LongWord;
Device | USB device read from |
---|---|
Address | Value to read the MAC address into |
Return | USB_STATUS_SUCCESS if completed or another error code on failure |
Return to Unit Reference