NAME | SYNOPSIS | FEATURES | DESCRIPTION | EXTENDED DESCRIPTION | ATTRIBUTES | SEE ALSO
drv/src/net/ether/epic100/epic100.h - EPIC100 hardware constants drv/src/net/ether/epic100/epic100.c - driver code drv/src/net/ether/epic100/epic100Prop.h - driver specific properties
DRV
Implements SMC epic100 Ethernet controller.
The epic100 Ethernet driver implements the ether device driver interface.
The driver uses the pci bus driver interface provided by a parent bus driver. Thus, the driver may be applied to any pci bus interface.
The epic100 driver does not provide the drv_probe() routine. In other words, the epic100 driver does not enumerate the pci bus, nor does it detect an epic100 device or create an associated device node. When the epic100 driver is used, associated device nodes should be created either statically by a boot program or dynamically by a separate pci bus enumerator driver.
The epic100 driver provides the drv_bind() routine. This routine examines the device node properties and thus, identifies an epic100 compatible device. The routine checks for the pci vendor and device identifiers matching an epic100 compatible device. If the check is positive, the drv_bind() routine binds the driver to the device node, attaching a PROP_DRIVER property to the device node. The property value specifies the epic100 driver name. The parent bus driver uses such a property to determine the name of drivers servicing the device. Via the PROP_DRIVER property, the driver gives its name to the parent bus driver, asking it to invoke the drv_int() routine on that device. The drv_bind() routing does nothing if the PROP_DRIVER property is already present in the device node. In other words, the drv_bind routine will not override existing driver-to-device binding.
The driver provides the drv_unload() entry and supports the driver component unloading. This allows the driver component to be unloaded if it is no longer being used and if it has been dynamically loaded at run time.
The table below summarizes characteristics of the epic100 Ethernet driver:
driver name: | sun:pci-epic100-ether" |
hardware: | EPIC100 Ethernet controller |
exported interface: | "ether" (ETHER_CLASS) |
exported interface version: | 0 (ETHER_VERSION_INITIAL) |
imported parent interface: | "pci" (PCI_CLASS) |
minimal parent interface version: | 0 (PCI_VERSION_INITIAL) |
device probing (auto-detection): | not supported |
driver unloading: | supported |
system (emergency) shut-down: | supported |
normal device shut-down: | supported |
hot-plug (surprise) device removal: | supported |
The table below lists device node properties used by the epic100 driver. Note that the column "m/o" specifies whether a given property is mandatory or optional. For optional properties, the "default value" column shows the default value which is used by the driver when a given property is not specified.
Name | Alias | Type | m/o | Default value |
"vend-id" | PCI_PROP_VEND_ID | PciPropVendId | m | |
"dev-id" | PCI_PROP_DEV_ID | PciPropDevId | m | |
"bus-num" | PCI_PROP_BUS_NUM | PciPropBusNum | m | |
"dev-num" | PCI_PROP_DEV_NUM | PciPropDevNum | m | |
"func-num" | PCI_PROP_FUNC_NUM | PciPropFuncNum | m | |
"intr" | PCI_PROP_INTR | PciPropIntr | m | |
"tx-desc-nb" | EPIC100_PROP_TX_DESC_NB | uint32_f | o | 4 |
"rx-desc-nb" | EPIC100_PROP_RX_DESC_NB | uint32_f | o | 4 |
"tx-buf-size" | EPIC100_PROP_TX_BUF_SIZE | uint32_f | o | 1514 bytes |
"rx-buf-size" | EPIC100_PROP_RX_BUF_SIZE | uint32_f | o | 1514 bytes |
The PCI_PROP_VEND_ID property specifies the SMC PCI vendor identifier (must be 0x10B8).
The PCI_PROP_DEV_ID property specifies the EPIC100 device identifier (must be 0x0005).
The PCI_PROP_BUS_NUM, PCI_PROP_DEV_NUM, and PCI_PROP_FUNC_NUM properties specify the configuration space address of the device. That is the PCI bus, device and function numbers to which the device is connected.
The PCI_PROP_INTR property specifies the PCI interrupt used by the device.
The PCI_PROP_IO_REGS property specifies the EPIC100 I/O registers range.
The EPIC100_PROP_TX_DESC_NB specifies the number of descriptors to allocate in the transmit DMA ring. By default, 4 descriptors are used.
The EPIC100_PROP_RX_DESC_NB specifies the number of descriptors to allocate in the receive DMA ring. By default, 4 descriptors are used.
The EPIC100_PROP_TX_BUF_SIZE specifies the size of the DMA buffers to allocate and bind to each descriptor in the transmit ring. By default, each buffer has a size of 1514 bytes, which is the maximum size of an Ethernet frame.
The EPIC100_PROP_RX_BUF_SIZE specifies the size of the DMA buffers to allocate and bind to each descriptor in the receive ring. By default, each buffer has a size of 1514 bytes, which is the maximum size of an Ethernet frame.
Thus, the total size of DMA memory allocated by the driver will be:
EPIC100_PROP_TX_DESC_NB * EPIC100_PROP_TX_BUF_SIZE for transmission, and
EPIC100_PROP_RX_DESC_NB * EPIC100_PROP_RX_BUF_SIZE for reception.
Note that the driver is able to send and receive an Ethernet frame using multiple descriptors in a ring. It is not able to share the memory buffer bounded to one descriptor between multiple Ethernet frames. In other words, configuring buffer sizes with big values will lead to poor memory usage, with small Ethernet frames.
The table below lists device node properties added by the Epic100 driver, which may be used by the driver clients.
Name | Alias | Type |
link-throughput" | ETHER_PROP_THROUGHPUT | EtherPropThroughput |
"ether-addr" | ETHER_PROP_ADDR | EtherPropAddr |
The ETHER_PROP_THROUGHPUT specifies the throughput of the Ethernet link. The Epic100 driver adds this property to the device and initializes it with the throughput of the Ethernet link to which the device is connected.
The ETHER_PROP_ADDR property specifies the device Ethernet address. The Epic100 driver adds this property to the device and initializes it with the Ethernet address which is in the controller ROM.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | EXTENDED DESCRIPTION | ATTRIBUTES | SEE ALSO