The 8fa2 Token-Ring device driver is a dynamically loadable device driver. The device driver is automatically loaded into the system at device configuration time as part of the configuration process.
The interface to the device is through the kernel services known as Network Services.
Interfacing to the device driver is achieved by calling the device driver's entry points for opening the device, closing the device, transmitting data, doing a remote dump, and issuing device control commands.
The Token-Ring device driver interfaces with the Token-Ring High-Performance Network Adapter (8fa2). It provides a Micro Channel-based connection to a Token-Ring network. The adapter is IEEE 802.5 compatible and supports both 4 and 16 megabit per second networks. The adapter supports only a RJ-45 connection.
The following lists the configuration parameters necessary to use the device driver.
The tok_config entry point performs configuration functions Token-Ring device driver.
The tok_open function is called to open the specified network device.
The Token Ring device driver does a synchronous open. The device will be initialized at this time. When the resources have been successfully allocated, the device will start the process of attaching the device to the network.
If the connection is successful, the NDD_RUNNING flag will be set in the ndd_flags field and a NDD_CONNECTED status block will be sent.
If the device connection fails, the NDD_LIMBO flag will be set in the ndd_flags field and a NDD_LIMBO_ENTRY status block will be sent.
If the device is eventually connected, the NDD_LIMBO flag will be turned off and the NDD_RUNNING flag will be set in the ndd_flags field. Both NDD_CONNECTED and NDD_LIMBO_EXIT status blocks will be set.
The tok_close function is called to close the specified network device. This function resets the device to a known state and frees system resources associated with the device.
The device will not be detached from the network until the device's transmit queue is allowed to drain.
The tok_output function transmits data using the network device.
The device driver does not support mbufs from user memory (which have the M_EXT flag set).
If the destination address in the packet is a broadcast address the M_BCAST flag in the p_mbuf->m_flags field should be set prior to entering this routine. A broadcast address is defined as 0xFFFF FFFF FFFF or 0xC000 FFFF FFFF. If the destination address in the packet is a multicast address the M_MCAST flag in the p_mbuf->m_flags field should be set prior to entering this routine. A multicast address is defined as a non-individual address other than a broadcast address. The device driver will keep statistics based upon the M_BCAST and M_MCAST flags.
If a packet is transmitted with a destination address which matches the adapter's address, the packet will be received. This is true for the adapter's physical address, broadcast addresses (0xC000 FFFF FFFF or 0xFFFF FFFF FFFF), enabled functional addresses, or an enabled group address.
When the Token-Ring device driver receives a valid packet from the network device, the Token-Ring device driver calls the nd_receive function that is specified in the ndd_t structure of the network device. The nd_receive function is part of a CDLI network demuxer. The packet is passed to the nd_receive function in mbufs.
The Token-Ring device driver will pass only one packet to the nd_receive function at a time.
The device driver will set the M_BCAST flag in the p_mbuf->m_flags field when a packet is received which has an all stations broadcast address. This address is defined as 0xFFFF FFFF FFFF or 0xC000 FFFF FFFF.
The device driver will set the M_MCAST flag in the p_mbuf->m_flags field when a packet is received which has a non-individual address which is different than the all-stations broadcast address.
The adapter will not pass invalid packets to the device driver.
When a status event occurs on the device, the Token-Ring device driver builds the appropriate status block and calls the nd_status function that is specified in the ndd_t structure of the network device. The nd_status function is part of a CDLI network demuxer.
The following status blocks are defined for the Token-Ring device driver.
When a hard failure has occurred on the Token-Ring device, the following status blocks can be returned by the Token-Ring device driver. One of these status blocks indicates that a fatal error occured.
code | Set to NDD_HARD_FAIL |
option[0] | Set to NDD_PIO_FAIL |
option[] | The remainder of the status block is used to return additional status information. |
code | Set to NDD_HARD_FAIL |
option[0] | Set to NDD_HARD_FAIL |
option[] | The remainder of the status block is used to return additional status information. |
code | Set to NDD_ADAP_CHECK |
option[] | The remainder of the status block is used to return additional status information. |
code | Set to NDD_DUP_ADDR |
option[] | The remainder of the status block is used to return additional status information. |
code | Set to NDD_CMD_FAIL |
option[0] | Set to the command code |
option[] | Set to error information from the command. |
code | Set to NDD_LIMBO_ENTER |
option[] | Set to error information. |
Indicates that when the device driver has detected an error which requires initiating recovery logic that will make the device temporarily unavailable, the following status block is returned by the device driver.
code | Set to NDD_LIMBO_ENTER |
option[0] | Set to one of the following: |
option[] | The remainder of the status block is used to return additional status information by the device driver. |
Indicates that when the device driver has successfully completed recovery logic from the error that made the device temporarily unavailable, the following status block is returned by the device driver. This status block indicates the device is now fully functional.
code | Set to NDD_LIMBO_EXIT |
option[] | N/A |
Indicates that when the device is successfully connected to the network the following status block is returned by the device driver:
code | Set to NDD_CONNECTED |
option[] | N/A |
The tok_ctl function is used to provide device control functions.
The structure must be in a kernel heap so that the device driver can copy the statistics into it; and it must be pinned.
The driver will maintain a counter of requests.
The device driver does not support any variables for read_write or write only. If the syntax of a member of the structure is some integer type, the level of support flag will be stored in the whole field, regardless of the size of the field. For those fields which are defined as character arrays, the value will be returned only in the first byte in the field.
The specified address is ORed with the currently specified functional addresses and the resultant address is set as the functional address for the device. Functional addresses are encoded in a bit-significant format, thereby allowing multiple individual groups to be designated by a single address.
The Token-Ring network architecture provides bit-specific functional addresses for widely used functions, such as configuration report server. Ring stations use functional address masks to identify these functions. For example, if function G is assigned a functional address of 0xC000 0008 0000, and function M is assigned a function address of 0xC000 0000 0040, then ring station Y, whose node contains function G and M, would have a mask of 0xC000 0008 0040. Ring station Y would receive packets addressed to either function G or M or to an address like 0xC000 0008 0048 because that address contains bits specified in the mask.
The NDD_ALTADDRS and TOK_RECEIVE_FUNC flags in the ndd_flags field are set.
Because functional addresses are encoded in a bit-significant format, reference counts are kept on each of the 31 least significant bits of the address.
The device support 256 general group addresses. The promiscuous mode will be turned on when the group addresses needed to be set are more than 256. The device driver will maintain a reference count on this operation.
The NDD_ALTADDRS and TOK_RECEIVE_GROUP flags in the ndd_flags field are set.
The reference counts are decremented for those bits in the functional address that are one (meaning on). If the reference count for a bit goes to zero, the bit will be "turned off" in the functional address for the device.
If no functional addresses are active after receipt of this command, the TOK_RECEIVE_FUNC flag in the ndd_flags field is reset. If no functional or group addresses are active after receipt of this command, the NDD_ALTADDRS flag in the ndd_flags field is reset.
If the number of group address enabled is less than 256, the driver sends a command to the device to disable the receipt of the packets with the specified group address. Otherwise, the driver just deletes the group address from the group address table.
If there are less than 256 group addresses enabled after the receipt of this command, the promiscuous mode is turned off.
If no group address is active after receipt of this command, the TOK_RECEIVE_GROUP flag in the ndd_flags field is reset. If no functional or group addresses are active after receipt of this command, the NDD_ALTADDRS flag in the ndd_flags field is reset.
The statistics returned include statistics obtained from the device. If the device is inoperable, the statistics returned do not contain the current device statistics. The copy of the ndd_flags field can be checked to determine the state of the device.
The Token-Ring device driver has four trace points. The IDs are defined in the /usr/include/sys/cdli_tokuser.h file.
The Token-Ring error log templates are :