Note: I am currently engaged in the development of storage products, involving the SAS protocol family. I am not very familiar with the protocol. This is only for the convenience of future reference. With the deepening of understanding, we will change the mistakes in the future.
At the same time, the company uses the LSI chip, including SAS 2008 controler and 2*36 port expander. The SES-related code is implemented in expander.
1: What is SCSI enclosure services?
Enclosures may provide power, cooling, and protection for devices. in addition, enclosures may provide external indicators about the state of the enclosure and devices. the indicators may identify the enclosure, identify proper operation of the devices and
Enclosure elements, provide indications of the state of RAID devices in the enclosure, and provide failure and maintenance information. some of the individual elements of an enclosure may be removable and replaceable while the enclosure continues to operate.
An Enclosure
Services process typically manages all these enclosure elements and communicates with the SCSI application client. All those elements managed by the enclosure services process are in the enclosure domainof that process.
The application client has two mechanic ISMs for accessing the enclosure services process, both using the receive diagnostic results and send diagnostic commands (see SPC-4 ):
The application client uses the send diagnosticcommand and the SES control-type diagnostic pages (see 6.1) to set varous indicators and states within the enclosure domain, allowing the enclosure to provide
Most appropriate environment for the other SCSI devices contained within it. Similarly, the application client requests information from the enclosure services process using thereceive
Diagnostic resultscommand and the SES Status-type diagnostic pages (see 6.1) to examine various status and warning
Information available from the enclosure.
An application client uses the send diagnostic command to transmit control information to the enclosure services process. The control information may include internal and external state indicators as well as struinctions ctions to the enclosure to perform certain
Operations or to modify its operating mode
An application client uses the receive diagnostic results command with the PCV bit set to one to obtain unlock kinds of enclosure status information. the information shall indicate the actual state of the enclosure. the actual state is a Vendor Specific combination
Of the indications set by the instructions from application clients and the indications established by the enclosure services process.
The only difference is: control ---> send diagnostic, status ---> receive diagnostic. Sending control information uses send diagnostic, and receiving status information uses receive diagnostic.
It is mainly used to manage and control elements contained in enclosure or to obtain the status information of elements by sending diagnostic and receive diagnostic, it indicates that the information acquisition or control must communicate according to the command format defined in spc4.
Which elements are included in one of the enclosure statements? For elements, refer to Chapter 7th in ses3.
There are several types of elements:
A) control elements in the enclosure control diagnostic page (see 6.1.3); that is, control elements such as cooling
B) Status elements in the enclosure status diagnostic page (see 6.1.4); that is, status elements such as temperature sensor
C) threshold control elements in the threshold out diagnostic page (see 6.1.8); and
D) Threshold status elements in the threshold in diagnostic page (see 6.1.9). Threshold indicates that such elements have certain threshold values, such as voltage sensor and current sensor.
2: Diagnostic page codes for enclosure service devices contained in SES
2.1 these page codes are used to control or status elements in enclosure.
The above "control or status" column shows whether the Page code is of the operation type, whether it is of the control type or status type, and determines whether to use SEND diagnostic or receive diagnostic.
2.2: Page code configuration diagnostic page of SES
As shown in the preceding page code, status-based Page code only accepts information of elements and does not control elements if receive diagnostic does not send diagnostic.
The configuration diagnostic page returns information about the enclosure, including the list of elements in the enclosure. the element list shall include all elements with defined element status or controls and may list any other elements in the enclosure.
The configuration diagnostic page provides enclosure descriptor information and parameters. The configuration diagnostic page may provide descriptive text identifying element types in more detail
This page code is used to return information about enclosure, including elements contained in enclosure, which includes all defined status and control elements. Descriptor information and parameters are also provided for enclosure)
The configuration diagnostic page is read by the receive diagnostic results command with a PCV bit set to one and a page code field set to 01 H.
Set PCV in receive diagnostic results command to 1 and Page code to 01h to read configuration diagnostic page.
The format of the receive diagnostic command is as follows:
If the application now sends send diagnostic, where PCV = 1, page code = 01, Enclosure Management Service needs to return the data packet in the format defined by configuration diagnostic page to the application. The configuration diagnostic page data packet format is defined as follows:
Next we will focus on the following data packet format: enclosure descriptor, type descriptor header list... that is, the data information after 8th bytes.
The data packet format of enclosure descriptor is as follows:
In the preceding format, you can customize your own data.
Other command processing basic type, carefully read SCSI enclosure services-3 (SES-3) can basically understand, I personally think SES is the best understanding of the SAS protocol family.
3: Elements in SES
We have mentioned elements as follows:
There are four types of elements, so there are four types of elements packet formats.
See Chapter 7th in ses3
7.2.2 control element format
7.2.3 status element format
7.2.4 threshold control element format
7.2.5 threshold status element format
The following uses the cooling element in elements as an example to describe how application uses send diagnostic and receive diagnostic to control the cooling element and obtain the status information.
The cooling element manages a fan, blower, or other cooling mechanic.
Rqst ident in the data packet:
When rqst ident = 1: enclosure needs to identify itself in a certain way. The identify here indicates that cooling elements can be considered as a discovery through existing methods. For example, if an LED emits light, it indicates that it has identified itself. When rqst ident is set to 0: The operation is opposite to 1.
The meaning of parameters such as rqst fail and rqst on is mainly based on whether the value is 1 or 0. For example, enable or disable an LED.
Requested speed code: Set the Cool Speed in enclosure based on the value of speed code.
The status information of cooling elements is obtained through receive diagnostic. The cooling status element is defined as follows:
Status elements mainly returns the status information of this elements, such as the cooling speed. The operation is opposite to the control operation. One write, one read, one set, and one get.