This chapter summarizes the IRIS ATM application interface calls that communicate with IRIS ATM boards. These calls are device-specific and are not supported on devices other than the one for which they are created.
Table 5-1 provides a summary of hardware calls for the IRIS ATM-OC3c HIO mezzanine board.
Table 5-1. Summary of Hardware Calls for the IRIS ATM-OC3c HIO Mezzanine Board
Type of Operation | Command (or function) | Usage | Board State | Description | More Info |
---|---|---|---|---|---|
Retrieving board status and information |
|
|
|
|
|
| ATMIOC_GETIOSTAT |
| all | Retrieves internal driver statistics. | |
| ATMIOC_GETSTAT |
| all | Retrieves current status information from hardware. | |
| ATMIOC_GETCONF |
| up/dn | Reads configuration information from board. | |
| ATMIOC_GETOPT | root only | up/dn | Retrieves settings for board's operating modes or options. | |
| ATMIOC_GETRATEQ |
| up | Retrieves the setting for one of the board's eight transmission rates. | |
| ATMIOC_GETMACADDR |
| up/dn | Retrieves the medium access control (MAC) address from the board. | |
Configuring the board |
|
|
|
|
|
| ATMIOC_SETCONF | root only | up/dn | Configures the board. | |
| ATMIOC_SETOPT | root only | up/dn | Sets (configures) the board's operating modes or options: loopback and clock recovery. | |
| ATMIOC_SETRATEQ | root only | up | Sets the transmission rate on one of the eight queues. | |
Controlling the board |
|
|
|
|
|
| ATMIOC_CONTROL | root only | all | Transitions the board to a different state: UP: to up state, INIT: to down state, RESET: to pre-init state |
Table 5-2 provides a summary of hardware calls for the IRIS ATM-OC3c 4Port XIO board.
Table 5-2. Summary of Hardware Calls for the IRIS ATM-OC3c 4Port XIO Board
Type of Operation | Command (or function) | Usage | Port's State | Description | More Info |
---|---|---|---|---|---|
Retrieving port status and information |
|
|
|
|
|
| ATMIOC_GETIOSTAT |
|
| Retrieves internal driver statistics. | |
| ATMIOC_GETSTAT |
| all | Retrieves current status information from hardware. | |
| ATMIOC_GETCONF |
| up/dn | Reads configuration information from port. | |
| ATMIOC_GETOPT | root only | up/dn | Retrieves settings for port's operating modes/options. | |
| ATMIOC_GETMACADDR |
| up/dn | Retrieves the medium access control (MAC) address from port. | |
Configuring the port |
|
|
|
|
|
| ATMIOC_SETCONF | root only | dn | Configures the ATM-OC3c port. | |
| ATMIOC_SETOPT | root only | up/dn | Sets (configures) the port's operating modes/options: loopback and clock recovery. | |
Controlling the port |
|
|
|
|
|
| ATMIOC_CONTROL | root only | all | Transitions the hardware to a different state: UP: to up state, INIT: to down state, RESET: to pre-init state |
The following file must be included in any program using the ATM-specific ioctl() calls for controlling the hardware:
“sys/atm_user.h”
The following sections describe each ATM hardware control ioctl() command in detail. The commands are organized alphabetically.
The ATMIOC_CONTROL ioctl() command changes the state of the ATM-OC3 port. This command is available only to the super user.
Before power-on, the state of the ATM-OC3c port is dead. Once powered on, the ATM-OC3 port has the following three possible states:
Pre-initialized (pre-init): The port is ready to be initialized. This state exists after each reset of the port. The only commands available in this state are ATMIOC_CONTROL with the INIT argument and ATMIOC_GETSTAT.
Down: The port is initialized, active, and ready to respond to the driver; however, the port is not receiving or transmitting over its network connection. In this state, the port's on-board memory can be configured and written, and firmware can be downloaded into the programmable read-only memory (PROM).
Up: The port is receiving and transmitting over its network connection.
Use the following format:
ioctl (fd_atm, ATMIOC_CONTROL, int); |
int is one of the values from Table 5-3.
The int argument's values are described in Table 5-3.
Table 5-3. Values for the Argument of the ATMIOC_CONTROL Command
int | Port State | Description |
---|---|---|
ATM_CONTROL_RESET | Any | Allowed under all conditions. Shuts down port, throws away all in-progress data and host-to-port commands, and puts port into pre-initialized state. Wakes up processes that are awaiting completion of host-to-port commands and returns ENODEV to them. With an XIO board, a reset of port 1 or 2 causes both ports to be reset, and a reset of port 3 or 4 causes both to be reset. |
ATM_CONTROL_INIT | Pre-init | Initializes port and brings it to down state. Not allowed when there are open file descriptors for the device. |
ATM_CONTROL_UP | Down | Brings port to up state. Only allowed when port is in down state. |
If successful, ATMIOC_CONTROL returns zero.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
Possible errors include:
EBUSY | When trying to initialize (bring to the down state) the port, the driver found that there are file descriptors open for this device. These must be closed before initializing the port. | |
EINVAL | When trying to initialize or bring the port to the up state, the driver found that the port was not in the required state. | |
EIO | When trying to initialize the port, the driver could not successfully bring the port into the down state. | |
EPERM | The calling application does not have super user access privileges. | |
ETIME | When trying to bring the port to the up state, the driver's call to the device timed out. |
The ATMIOC_GETCONF ioctl() command retrieves the ATM-OC3c port's current configuration.
Use the following format:
ioctl (fd_atm, ATMIOC_GETCONF, &conf); |
conf is an atm_conf_t structure.
The argument is a pointer to an atm_conf_t structure, described in Table 5-4, or Table 5-5 (depending on the specific hardware).
If successful, ATMIOC_GETCONF returns zero. The out values should be read.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
The retrieved configuration values are written into the argument as described in Table 5-4 (for the IRIS ATM-OC3c HIO mezzanine hardware) or Table 5-5 (for the IRIS ATM-OC3c 4Port XIO hardware).
Table 5-4. Values Retrieved by ATMIOC_GETCONF for the HIO Mezzanine Board
Field | Default Value | Comments |
---|---|---|
sign | ATM_MAGIC | ATM-OC3c board's signature. |
vers | varies | ATM-OC3c board's EPROM version |
flags | 0x0608 | Hardware and firmware capabilities. See Table 5-6. |
xtype | 2 | Transmission type: 1 =XT_UNKNOWN 2 =XT_STS3C, SONET STS-3c PHY at 155.52 Mbps 3 =XT_DS3=3, DS3 PHY at 44.736 Mbps 4 =XT_4B5B=4, 4B/5B encoding PHY at 100 Mbps 5 =XT_8B10B, 8B/10B encoding PHY at 155.52 Mbps |
mtype | 4 | Media type: 1 =MT_UNKNOWN 2 =MT_COAX, coaxial cable 3 =MT_SMF, single mode fiber 4 =MT_MMF, multimode fiber 5 =MT_STP, shielded twisted pair 6 =MT_UTP, unshielded twisted pair |
maxvpibits | 8 | Maximum number of bits that can be used for a VPI. Range of possible values is 0 to 8. |
maxvcibits | 16 | Maximum number of bits that can be used by a VCI. Range of possible values is 0 to 16. |
hi_pri_qs | 4 | Number of transmission rate queues on the board that are treated as high-priority queues. For further explanation, see “IRIS ATM-OC3c HIO Board for CHALLENGE and Onyx Platforms” in Chapter 1. |
lo_pri_qs | 4 | Number of transmission rate queues on the board that are treated as low-priority queues. For further explanation, see “IRIS ATM-OC3c HIO Board for CHALLENGE and Onyx Platforms” in Chapter 1. |
xmt_large_size | 12K | Size (in bytes) of large-sized transmit buffers. |
xmt_large_bufs | 78 | Number of large-sized transmit buffers. |
xmt_small_size | 2K | Size (in bytes) of small-sized transmit buffers. |
xmt_small_bufs | 78 | Number of small-sized transmit buffers. |
rcv_large_size | 12K | Size (in bytes) of large-sized receive buffers. |
rcv_large_bufs | 69 | Number of large-sized receive buffers. |
rcv_small_size | 0 | Size (in bytes) of small-sized receive buffers. |
rcv_small_bufs | 0 | Number of small-sized receive buffers. This size buffer is used only for AAL3/4. |
reserved | 0 | Do not use. |
Table 5-5. Values Retrieved by ATMIOC_GETCONF for an XIO Port
Field | Default Value | Comments |
---|---|---|
maxvpibits | 0 | Maximum number of bits that can be used for a VPI. Range of possible values is 0 to 8. |
maxvcibits | 12 | Maximum number of bits that can be used by a VCI. Range of possible values is 0 to 16. |
xmt_large_size | 4032 | Size (in bytes) of large-sized transmit buffers. |
xmt_large_bufs | 384 | Number of large-sized transmit buffers. |
xmt_small_size | 384 | Size (in bytes) of small-sized transmit buffers. |
xmt_small_bufs | 512 | Number of small-sized transmit buffers. |
rcv_large_size | 4096 | Size (in bytes) of large-sized receive buffers. |
rcv_large_bufs | 384 | Number of large-sized receive buffers. |
rcv_small_size | 96 | Size (in bytes) of small-sized receive buffers. |
rcv_small_bufs | 512 | Number of small-sized receive buffers. This size buffer is only used for AAL3/4. |
tst_size | 8660 | Size of port's cell-slot table. For further explanation, see “IRIS ATM-OC3c XIO Board for Origin2000 and Onyx2 Platforms” in Chapter 1. |
reserved | 0 | Do not use. |
Table 5-4, and Table 5-6, describe the atm_conf_t structure for HIO hardware, as defined in the atm_b2h.h file. Table 5-5, describes the atm_conf_t structure for XIO hardware, as defined in the quadoc3_b2h.h file. (These files are automatically included in the atm_user.h file.)
Table 5-6. Capability Flags for atm_conf_t
Flag | Mask | Description |
---|---|---|
ATM_CAP_AAL_1 | 0x0001 | AAL1 supported. |
ATM_CAP_AAL_2 | 0x0002 | AAL2 supported. |
ATM_CAP_AAL_34 | 0x0004 | AAL3/4 supported. |
ATM_CAP_AAL_5 | 0x0008 | AAL5 supported. |
ATM_CAP_AAL_0 | 0x0010 | AAL0 (raw) supported. |
ATM_CAP_AAL_5_NOTRAILER | 0x0020 | AAL5 without trailer supported. |
ATM_CAP_AAL_MASK | 0x003f | AAL mask. |
ATM_CAP_BARANGE | 0x0100 | Firmware supports variable size buffers (malloc). |
ATM_CAP_IN_CKSUM | 0x0200 | Port's firmware does IP checksums. |
ATM_CAP_LOOP_TIMING | 0x0400 | Port does loop timing. Set with ATMIOC_SETOPT. |
ATM_CAP_DIAG_LOOPBACK | 0x0800 | Port receives what it sends. Set with ATMIOC_SETOPT. |
ATM_CAP_LINE_LOOPBACK | 0x1000 | Port sends what it receives. Set with ATMIOC_SETOPT. |
The ATMIOC_GETIOSTAT ioctl() command retrieves driver-internal I/O statistics. This command does not cause any interaction between the hardware and the IRIS ATM driver.
Use the following format:
ioctl (fd_atm, ATMIOC_GETIOSTAT, &iostat); |
iostat is an atm_iostat_t structure.
If successful, ATMIOC_GETIOSTAT returns zero. The out values should be read.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
The retrieved values are written to the argument, summarized in Table 5-7.
The atm_iostat_t structure (described in Table 5-7) is embedded in the hardware driver for each type of hardware. The structure is slightly different for each type of hardware (see notes within Table 5-7).
Table 5-7. Values Retrieved by the ATMIOC_GETIOSTAT Command
Field | Description |
---|---|
ipkts | Count of total incoming packets over character device (CDEV) interfaces using the port. |
ibytes | Count of total incoming bytes over CDEV interfaces using the port. |
ierrs | Count of total incoming errors over CDEV interfaces using the port. |
opkts | Count of total outgoing packets over CDEV interfaces using the port. |
obytes | Count of total outgoing bytes over CDEV interfaces using the port. |
oerrs | Count of total outgoing errors over CDEV interfaces using the port. |
xcmd_dly | HIO board only: Count of commands that were delayed (not immediately placed on the command queue) due to heavy use of the driver-to-board command interface. |
xmit_dly | HIO board only: Count of transmit commands that were delayed (not immediately placed on the command queue) due to heavy use of the driver-to-board command interface. |
intrs | Count of host-to-port interrupts. |
b2hs | Count of port-to-host interrupts. |
xmit_reqs | Count of transmit requests. |
h2b_kicks | HIO board only: Number of times host has reset the board. |
xmit_intrs | Count of transmit interrupts indicating that the port's download (direct memory access (DMA)) of the host's packet has been completed. |
odone_intrs | Count of transmit packet done messages sent by port to host. When this count equals the xmit_reqs count, all data on the transmit queues has been processed completely. |
recv_intrs | Count of receive interrupts indicating that a packet arrived. |
fet_stat | Number of times board has responded to host requests for this port's status. |
The ATMIOC_ GETMACADDR ioctl() command reads the media access control (MAC) address from the ATM-OC3c port.
Use the following format:
ioctl (fd_atm, ATMIOC_GETMACADDR, &addr); |
The addr variable is an array of atm_macaddr_t structures.
The argument is a pointer to an atm_macaddr_t[6], an array of 6 unsigned characters.
If successful, ATMIOC_GETMACADDR returns zero. The out values should be read.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
Possible errors include:
EADDRNOTAVAIL | The checksum on the retrieved address is not correct. | |
EFAULT | An error occurred when the driver was copying the retrieved data to the area specified by the pointer. | |
ENODEV | The port was not in the up or down state. | |
ETIME | The driver's command to the port timed out. |
The ATMIOC_GETOPT ioctl() command retrieves the current settings for the ATM-OC3c port's loopback and clock recover options. Requires super user access.
If successful, ATMIOC_GETOPT returns zero. The out values should be read.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
The retrieved option setting (mask) is written to the location provided in the argument. Table 5-14, summarizes the values and masks that are meaningful. The options are described in Table 5-15. The value that indicates normal operation, which is also the default, is ATM_OPT_LOOP_TIMING (for the HIO mezzanine board) or ATM_PHYOPTS_LOOPT (for an XIO port), which is mask 0x0001.
Possible errors include:
EPERM | The invoker does not have super user access privileges. | |
EFAULT | An error occurred when the driver was copying the retrieved data to the area specified by the pointer. | |
ENODEV | The port was not in the up or down state. | |
ETIME | The driver's command to the port timed out. |
The ATMIOC_GETRATEQ ioctl() command retrieves information about one rate queue from the IRIS ATM-OC3c HIO mezzanine board. The board must be in the up state.
![]() | Note: This call does not work with other hardware. |
Use the following format:
ioctl (fd_atm, ATMIOC_GETRATEQ, &rateq); |
rateq is an atm_rate_q_t structure.
The argument is a pointer to an atm_rate_q_t structure, set up as described in Table 5-8. The rate_queue_number field of the argument must be set to one of the values described in Table 5-9.
Table 5-8. Recommended Values for the Argument of the ATMIOC_GETRATEQ Command
Fields | Value | Description |
---|---|---|
rate_queue_number | From Table 5-9. | The queue whose rate is to be retrieved. |
rate_value | Zero | Upon return, the out value equals the rate_value, an 11-bit code from Table A-1. |
The following table lists values for the rate_queue_number field.
Table 5-9. Rate Queue Identification Values
Name | int | Description |
---|---|---|
RQ_A0 | 0 | High priority Bank A, queue 0 |
RQ_A1 | 1 | High priority Bank A, queue 1 |
RQ_A2 | 2 | High priority Bank A, queue 2 |
RQ_A3 | 3 | High priority Bank A, queue 3 |
RQ_B0 | 4 | Low priority Bank B, queue 0 |
RQ_B1 | 5 | Low priority Bank B, queue 1 |
RQ_B2 | 6 | Low priority Bank B, queue 2 |
RQ_B3 | 7 | Low priority Bank B, queue 3 |
If successful, ATMIOC_GETRATEQ returns zero. The out value should be read.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
The retrieved value is written to the least significant word (the rate_value field) of the atm_rate_q_t structure that is identified by the argument. The rate value is one of the rate codes summarized in Table A-1.
Table 5-8, describes the atm_rate_q_t structure, and its definition is included in the following code, as it is in the atm_b2h.h file (included in the atm_user.h file):
typedef struct atm_rate_q { u_int rate_queue_number; u_int rate_value; } atm_rate_q_t; |
The ATMIOC_GETSTAT ioctl() command reads and returns the ATM-OC3c port's operational status and monitored performance data. Unless specified differently, all statistics are accumulated since the last time the port was reset.
Use the following format:
ioctl (fd_atm, ATMIOC_GETSTAT, &stat); |
stat is an atm_stat_t structure.
The argument is a pointer to an empty atm_stat_t structure (described in Table 5-10).
If successful, ATMIOC_GETSTAT returns zero. The out values should be read.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
The retrieved statistical data are written to the argument, described in Table 5-10. Figure 5-1, illustrates individual bits within the SONET_status field of the atm_stat_t structure.
Table 5-10. Values Retrieved by the ATMIOC_GETSTAT Command
Field | Description |
---|---|
hwstate | The current state of the port: 0 = ATM_HWSTATE_PREINIT 1 = ATM_HWSTATE_DEAD 2 = ATM_HWSTATE_DOWN 3 = ATM_HWSTATE_UP These states are described in “ATMIOC_CONTROL”. |
rx_pdu_ok | Total protocol data units (PDUs) received correctly. |
rx_pdu_timeout | Received PDU error: reassemblies that never completed. |
rx_pdu_bfr_oflo | Received PDU error: reassemblies that exceeded buffer size. |
rx_pdu_crc_error | Received PDU error: AAL5 CRC-32 error. |
rx_pdu_aal5len_err | Received PDU error: size violates AAL5 standard. |
rx_pkt_reserved[3] | Not used. |
rx_pdu_unknown_err | Received PDU error: none of the PDU errors previously listed. |
rx_cell_ok | Total ATM cells received correctly. |
rx_cell_invalid | Received ATM cell error: unrecognized or bad VPI/VCI. |
rx_cell_nobuf | Received ATM cell error: no receive buffers were available and cell was dropped. |
rx_cell_reserved[4] | Not used. |
rx_cell_unknown_err | Received ATM cell error: none of the ATM cell errors previously listed. |
tx_pdu_ok | Total PDUs transmitted correctly. |
tx_pdu_reserved[6] | Not used. |
tx_pdu_unknown_err | Transmitted PDU error: none of the PDU errors previously listed. |
tx_cell_ok | Total ATM cells transmitted correctly. |
tx_cell_reserved[7] | Not used. |
SONET_sbe | SONET section overhead BIP-8 errors (B1 byte). |
SONET_lbe | SONET line overhead BIP-24 errors (that is, the BIP-8 [B2 byte] from the line overhead of each STS-1). |
SONET_lfe | SONET line overhead far-end-block-errors (FEBE bits in Z2 byte). This information is contained within received SONET frames, but it describes the error rate on the transmit data stream. Reported errors could have occurred anywhere along the SONET line. |
SONET_pbe | SONET path overhead BIP-8 errors (B3 byte). |
SONET_pfe | SONET path overhead far-end-block-errors (FEBE bits in G1 byte). This information is contained within received SONET frames but it describes the error rate on the transmit data stream. Reported errors could have occurred anywhere along the SONET path. |
SONET_chcs | Correctable ATM header error check (HEC) errors. |
SONET_uhcs | Noncorrectable ATM HEC errors. |
SONET_reserved[5] | Not used. |
SONET_status | See Table 5-11. |
Table 5-11. Bits in SONET_status Field
Status Item | Mask within Field | Description |
---|---|---|
SONET_LOSV | 0x40000000 | Section layer: loss-of-signal error state currently exists in the receiving hardware. |
SONET_LOFV | 0x20000000 | Section layer: loss-of-frame error state currently exists in the receiving hardware. |
SONET_OOFV | 0x10000000 | Section layer: out-of-frame error state currently exists in the receiving hardware. |
SONET_FERF | 0x02000000 | Line layer: far-end-receive-failure state currently exists in the receiving hardware. |
SONET_LAIS | 0x01000000 | Line layer: alarm-indication-signal state currently exists in the receiving hardware. |
SONET_PLOP | 0x00200000 | Path layer: loss-of-pointer error state currently exists in the receiving hardware. |
SONET_PAIS | 0x00080000 | Path layer: alarm-indication-signal error state currently exists in the receiving hardware. |
SONET_PYEL | 0x00040000 | Path layer: yellow-signal error state currently exists in the receiving hardware. |
SONET_PSL_MASK | 0x0000ff00 | Path layer: contents of the Signal Label (C2 byte) on incoming frames. A new value is captured when 3 consecutive frames have the same value. For the IRIS ATM hardware, this value should be 0x13 (hex) at all times. The offset (value for shifting) to this field within the atm_stat_t structure is SONET_PSL_SHFT (value of 8). |
SONET_OOCD | 0x00000080 | Out-of-cell-delineation state currently exists. The IRIS ATM receiving hardware is trying to synchronize with the cell boundaries in the synchronous payload envelope (SPE) of the incoming SONET frame. |
SONET_TSOCI | 0x00000040 | Start-of-cell error has occurred on the IRIS ATM transmit hardware. |
SONET_TFOVR | 0x00000020 | First in/First out (FIFO) overrun has occurred on the IRIS ATM transmit hardware. |
SONET_RFOVR | 0x00000002 | FIFO overrun has occurred on the IRIS ATM receive hardware. |
SONET_RFUDR | 0x00000001 | FIFO underrun has occurred on the IRIS ATM receive hardware. |
SONET_UNUSED | 0x8cd3001c | Ignore these bits. |
The atm_stat_t structure is described in Table 5-10, and is defined in the atm_user.h file, as follows:
typedef struct atm_stat { u_int hwstate; #define ATM_HWSTATE_PREINIT 0 #define ATM_HWSTATE_DEAD 1 #define ATM_HWSTATE_DOWN 2 #define ATM_HWSTATE_UP 3 /* Receive counts */ u_int rx_pdu_ok; /* Receive PDU errors (pdu drops) */ u_int rx_pdu_timeout; /* pdu reassembly never completed */ u_int rx_pdu_bfr_oflo; /* pdu reassembly exceeded buf size */ u_int rx_pdu_crc_err; /* AAL5 CRC errors */ u_int rx_pdu_aal5len_err; /* AAL5 length errors */ u_int rx_pdu_reserved[3]; u_int rx_pdu_unknown_err; /* none of the above */ /* Receive cell counts */ u_int rx_cell_ok; /* cells received okay */ u_int rx_cell_invalid; /* cells received on bad VPI/VCI */ u_int rx_cell_nobuf; /* pdu dropped due to no buf avail */ u_int rx_cell_reserved[4]; u_int rx_cell_unknown_err;/* none of the above */ /* Transmit counts */ u_int tx_pdu_ok; u_int tx_pdu_reserved[6]; u_int tx_pdu_unknown_err; /* trouble transmitting */ /* Transmit cell counts */ u_int tx_cell_ok; u_int tx_cell_rserved[7]; /* SONET counts */ u_int SONET_sbe; /* SONET Section BIP-8 errors */ u_int SONET_lbe; /* SONET Line BIP-24 errors */ u_int SONET_lfe; /* SONET Line FEBEs */ u_int SONET_pbe; /* SONET Path BIP-8 errors */ u_int SONET_pfe; /* SONET Path FEBEs */ u_int SONET_chcs; /* Correctable ATM HEC errors */ u_int SONET_uhcs; /* Uncorrectable ATM HEC errors */ u_int SONET_reserved[5]; u_int SONET_status; } atm_stat_t; /* bit fields in SONET_status */ #define SONET_LOSV 0x40000000 /* loss-of-signal state */ #define SONET_LOFV 0x20000000 /* loss-of-frame state */ #define SONET_OOFV 0x10000000 /* out-of-frame state */ #define SONET_FERF 0x02000000 /* Far-end-receive-failure */ #define SONET_LAIS 0x01000000 /* Line Alarm Indication Signal */ #define SONET_PLOP 0x00200000 /* Loss of Path */ #define SONET_PAIS 0x00080000 /* Path Alarm Indication Signal */ #define SONET_PYEL 0x00040000 /* Path Yellow Condition */ #define SONET_PSL_MASK 0x0000ff00 /* Path Signal Label (C2) */ #define SONET_PSL_SHFT 8 #define SONET_OOCD 0x00000080 /* out-of-cell-delineation */ #define SONET_TSOCI 0x00000040 /* Xmit start-of-Cell error */ #define SONET_TFOVR 0x00000020 /* Xmit FIFO overrun */ #define SONET_RFOVR 0x00000002 /* Recv FIFO overrun */ #define SONET_RFUDR 0x00000001 /* Recv FIFO underrun */ #define SONET_UNUSED 0x8cd3001c /* ignore these bits */ |
The ATMIOC_SETCONF ioctl() command configures the ATM-OC3c port. The new configuration takes effect when the port is next brought into the up state. This command is available only to the super user.
Use the following format:
ioctl (fd_atm, ATMIOC_SETCONF, &conf); |
conf is an atm_conf_t structure.
The pointer to conf identifies an instance of an atm_conf_t structure. The desired configuration values must be in the atm_conf_t structure, as described in Table 5-12 (when the hardware is the IRIS ATM-OC3c HIO mezzanine board) or Table 5-13 (when the hardware is the IRIS ATM-OC3c 4Port XIO board).
Table 5-12. Recommended Values for the Argument of the ATMIOC_SETCONF Command for the HIO Board
Field | Recommended Setting | Comments |
---|---|---|
sign | ATM_MAGIC | ATM-OC3c board's signature. |
vers | varies | ATM_MIN_VERS, ATM_VERS_MASK, ATM_CKSUM_VERS as defined in sys/atm_b2h.h. ATM-OC3c board's / FLASH EPROMs version. |
flags | 0x1E28 | Flags indicating various functions for which the ATM-OC3c board and its firmware's are capable. For example: 0x0008 = ATM_CAP_AAL_5, board uses AAL5 0x0200 =ATM_CAP_IN_CKSUM, board does IP checksum (the full set of values are in sys/atm_b2h.h) |
xtype | 2 | Transmission type: 1 =XT_UNKNOWN 2 =XT_STS3C, SONET STS-3c PHY at 155.52 Mbps 3 =XT_DS3=3, DS3 PHY at 44.736 Mbps 4 =XT_4B5B=4, 4B/5B encoding PHY at 100 Mbps 5 =XT_8B10B, 8B/10B encoding PHY at 155.52 Mbps |
mtype | 4 | Media type: 1 =MT_UNKNOWN 2 =MT_COAX, coaxial cable 3 =MT_SMF, single-mode fiber 4 =MT_MMF, multi-mode fiber 5 =MT_STP, shielded twisted pair 6 =MT_UTP, unshielded twisted pair |
maxvpibits | 8 | Maximum number of bits that can be used for a VPI. Range of possible values is 0 to 8. |
maxvcibits | 16 | Maximum number of bits that can be used by a VCI. Range of possible values is 0 to 16. |
hi_pri_qs | 4 | Number of high priority rate queues supported by the board. For further explanation, see “IRIS ATM-OC3c HIO Board for CHALLENGE and Onyx Platforms” in Chapter 1. |
lo_pri_qs | 4 | Number of low priority rate queues supported by the board. For further explanation, see “IRIS ATM-OC3c HIO Board for CHALLENGE and Onyx Platforms” in Chapter 1. |
xmt_large_size | 12K | Size (in bytes) of large-sized transmit buffers. |
xmt_large_bufs | 78 | Number of large-sized transmit buffers. |
xmt_small_size | 2K | Size (in bytes) of small-sized transmit buffers. |
xmt_small_bufs | 78 | Number of small-sized transmit buffers. |
rcv_large_size | 12K | Size (in bytes) of large-sized receive buffers. |
rcv_large_bufs | 69 | Number of large-sized receive buffers (for AAL5). |
rcv_small_size | 0 | Size (in bytes) of small-sized receive buffers (for AAL3/4). |
rcv_small_bufs | 0 | Number of small-sized receive buffers (for AAL3/4). |
reserved | not valid | Reserved for future use. |
Table 5-13. Recommended Values for the Argument of the ATMIOC_SETCONF Command for an XIO Port
Field | Recommended Setting | Comments |
---|---|---|
maxvpibits | 0 | Maximum number of bits that can be used for a VPI. Range of possible values is 0 to 8. |
maxvcibits | 12 | Maximum number of bits that can be used by a VCI. Range of possible values is 0 to 16. |
xmt_large_size | 4032 | Size (in bytes) of large-sized transmit buffers. |
xmt_large_bufs | 384 | Number of large-sized transmit buffers. |
xmt_small_size | 384 | Size (in bytes) of small-sized transmit buffers. |
xmt_small_bufs | 512 | Number of small-sized transmit buffers. |
rcv_large_size | 4096 | Size (in bytes) of large-sized receive buffers. |
rcv_large_bufs | 384 | Number of large-sized receive buffers (for AAL5). |
rcv_small_size | 96 | Size (in bytes) of small-sized receive buffers (for AAL3/4). |
rcv_small_bufs | 512 | Number of small-sized receive buffers (for AAL3/4). |
tst_size | 8660 | Number of slots in the cell-slot table that controls VC transmission rates. Range of possible values is 8 to 8660. For further explanation, see “IRIS ATM-OC3c XIO Board for Origin2000 and Onyx2 Platforms” in Chapter 1. |
reserved | 0 | Reserved for future use. |
If successful, ATMIOC_SETCONF returns zero.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
The atm_conf_t structure is explained in Table 5-12, or Table 5-13, depending on the installed hardware.
The ATMIOC_SETOPT ioctl() command configures the ATM-OC3c port's loopback and clock recover options. If the port is in the up state, it starts functioning with the new options almost immediately. These options are useful for testing purposes or for operation without an ATM switch. This command is available only to the super user.
![]() | Caution: Altering the options to anything other than the default (which is the loop timing bit set to 1, and the other option bits set to 0) makes the port dysfunctional for operation with a switch. |
The opt argument is an unsigned integer that sets to 1 (enables) the bit or bits (illustrated in Figure 5-2) that control the hardware options. The normal and default setting is 0x1 (LOOP_TIMING=1, LINE_LOOPBACK=0, and DIAG_LOOPBACK=0). Table 5-14, summarizes other values and the masks that are available. The options are described in Table 5-15.
Table 5-14. Recommended Values for the Argument of the ATMIOC_SETOPT Command
Possible Values | Can Be Combined With | Do Not Combine With |
---|---|---|
LOOP_TIMING (opt=0x1) (This is the default.) | Normal operation or LINE_LOOPBACK (opt=0x5) | DIAG_LOOPBACK |
DIAG_LOOPBACK (opt=0x2) | Nothing | LOOP_TIMING or LINE_LOOPBACK |
LINE_LOOPBACK (opt=0x4) | LOOP_TIMING (opt=0x5) | Normal operation or DIAG_LOOPBACK |
Table 5-15. ATM-OC3c Hardware Options
Mask | Option | Description |
---|---|---|
0x1 | Loop Timing (ATM_OPT_LOOP_TIMING for HIO board, and ATM_PHYOPTS_LOOPT for XIO board) | When Loop Timing is enabled (bit 0 is set to 1), the port's logic obtains its SONET transmission clock from the clock signal recovered from the incoming fiber. Typically, this option is enabled when the port is attached to an ATM switch, such as normal operation or Line Loopback testing. When Loop Timing is disabled (bit 0 is set to 0), the port uses its own clock (from the on-board crystal). This bit must be set to 0 for Diagnostic Loopback testing. It is also appropriate to set this bit to 0 when the port's output line is attached to its own input line or when the port is attached to another ATM system that is not a switch. |
0x2 | Diagnostic Loopback (1 in Figure 5-3) (ATM_OPT_DIAG_LOOPBACK for HIO board, and ATM_PHYOPTS_DLE for XIO board) | When Diagnostic Loopback is enabled (bit 1 is set to 1), the SUNI chip's internal loopback path is enabled, so that the R-FRED receives from the F-FRED. This option must be disabled for normal operation and when Line Loopback is enabled. Refer to Figure 5-3. |
0x4 | Line Loopback (2 in Figure 5-3) (ATM_OPT_LINE_LOOPBACK for HIO board, and ATM_PHYOPTS_LLE for XIO board) | When Line Loopback is enabled (bit 2 is set to 1), the SUNI chip's external loopback path is enabled, so that the SUNI transmits to the outgoing ODL exactly what it receives from the incoming ODL. This option must be disabled for normal operation and when Diagnostic Loopback is enabled. Refer to Figure 5-3. |
If successful, ATMIOC_SETOPT returns zero.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
The ATMIOC_SETRATEQ ioctl() command sets the transmission rate for an individual rate queue on an IRIS ATM-OC3c HIO mezzanine board. The new setting starts operating immediately. The board must be in the up or down state and the rate queue must be free (that is, not currently associated with any open VC).
See “IRIS ATM-OC3c HIO Board for CHALLENGE and Onyx Platforms” in Chapter 1, for a description of the transmission rate queues and how they are managed by the IRIS ATM driver.
![]() | Note: This call works only with the IRIS ATM-OC3c HIO mezzanine board. |
Use the following format:
ioctl (fd_atm, ATMIOC_SETRATEQ, &rateq); |
rateq is an atm_rate_q_t structure.
The pointer identifies an atm_rate_q_t structure that should be set up as shown in Table 5-16. The rate code (rate_value) must be one of the codes from Table A-1.
Table 5-16. Recommended Values for the Argument of the ATMIOC_SETRATEQ Command
Field of atm_rate_q_t | Recommended Value | Comment |
---|---|---|
rate_queue_number | From Table 5-17. | The rate queue identification number. |
rate_value | 0 or a code from Table A-1. | A code from Table A-1. To unlock the rate queue, thus making it available to the driver for dynamic resetting, set the field to zero. |
Table 5-17. Rate Queue Identification Numbers
rate_queue_number | int | Description |
---|---|---|
RQ_A0 | 0 | High priority Bank A, queue 0 |
RQ_A1 | 1 | High priority Bank A, queue 1 |
RQ_A2 | 2 | High priority Bank A, queue 2 |
RQ_A3 | 3 | High priority Bank A, queue 3 |
RQ_B0 | 4 | Low priority Bank B, queue 0 |
RQ_B1 | 5 | Low priority Bank B, queue 1 |
RQ_B2 | 6 | Low priority Bank B, queue 2 |
RQ_B3 | 7 | Low priority Bank B, queue 3 |
If successful, ATMIOC_SETRATEQ returns zero.
On failure, the ioctl() returns -1 with an error stored in errno. For descriptions of individual errors, see “Errors”.
Possible errors include:
EBUSY | The specified rate queue currently is servicing one or more VCs. The queue must be freed (that is, torn down) before it can be reconfigured. | |
EFAULT | An error occurred when the driver was copying the data. | |
EINVAL | The specified rate queue identification number is invalid. | |
ENODEV | The board is not in the up state. | |
ENOMEM | The driver was unable to place the command on the host-to-board command queue due to lack of memory. | |
EPERM | The invoker does not have super user access privileges. |