1#!/usr/bin/env python
2
3r"""
4IPMI raw commands table:
5
6   - Define IPMI interface index, commands and expected output.
7
8"""
9
10# The currently supported cipher list.
11# Refer:
12# openbmc/meta-openbmc-machines/meta-openpower/meta-ibm/meta-witherspoon/recipe
13# s-phosphor/ipmi/phosphor-ipmi-host/cipher_list.json
14valid_ciphers = ['17']
15unsupported_ciphers = ['1', '2', '15', '16']
16
17IPMI_RAW_CMD = {
18    # Interface name
19    'power_supply_redundancy':
20    {
21        # Command action type
22        'Get':
23        [
24            # raw command, expected output(s), comment
25            "0x04 0x2d 0x0b",
26            "00 00 01 00",
27            "Byte position 3rd LSB e.g. 01 indicates disabled",
28            "00 00 02 00",
29            "Byte position 3rd LSB e.g. 02 indicates enabled",
30            "00 40 02 00",
31            "40 is scanning enabled and 02 indicates redundancy enabled",
32        ],
33        'Enabled':
34        [
35            # raw command, expected output, comment
36            "0x04 0x30 0x0b 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00",
37            "none",
38            "Enabled nibble position 6th LSB e.g. 0x2",
39        ],
40        'Disabled':
41        [
42            # raw command, expected output, comment
43            "0x04 0x30 0x0b 0x00 0x00 0x01 0x00 0x00 0x00 0x00 0x00 0x00",
44            "none",
45            "Enabled nibble position 6th LSB e.g. 0x1",
46        ],
47    },
48    'power_reading':
49    {
50        'Get':
51        [
52            # raw command, expected output(s), comment
53            "0x2c 0x02 0xdc 0x01 0x01 0x00",
54            "dc d5 00 d5 00 d5 00 d5 00 00 00 00 00 00 00 00 00 00",
55            "Byte position 2nd LSB e.g. d5 Instantaneous power readings",
56        ],
57    },
58    'conf_param':
59    {
60        'Enabled':
61        [
62            # raw command, expected output, comment
63            "0x2c 0x12 0xdc 0x02 0x00 0x01",
64            "dc",
65            "Enabled nibble position 6th LSB e.g. 0x01",
66        ],
67        'Disabled':
68        [
69            # raw command, expected output, comment
70            "0x2c 0x12 0xdc 0x02 0x00 0x00",
71            "dc",
72            "Disable nibble position 6th LSB e.g. 0x00",
73        ]
74    },
75    'SEL_entry':
76    {
77        'Add':
78        [
79            # raw command, expected output, comment
80            "0x0a 0x44 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00 0x00 0x04 0x01 0x17 0x00 0xa0 0x04 0x07",
81            "02 00",
82            "02 00 is Record ID for added record, LS Byte first",
83        ],
84        'Reserve':
85        [
86            # raw command, expected output, comment
87            "0x0a 0x42",
88            "27 00",
89            "27 is Reservation ID, LSB, 00 Reservation ID, MSB ",
90        ]
91    },
92    'Self_Test_Results':
93    {
94        'Get':
95        [
96            # raw command, expected output(s), comment
97            "0x06 0x04",
98            "56 00",
99            "56h = Self Test function not implemented in this controller.",
100        ]
101    },
102    'Device GUID':
103    {
104        'Get':
105        [
106            # raw command, expected output(s), comment
107            "0x06 0x08",
108            "01 70 9b ae da 6f dd 9c b4 4c 36 be 66 c8 49 28",
109            "Get GUID bytes 1 through 16.",
110
111        ]
112    },
113    'LAN_Config_Params':
114    {
115        'Get':
116        [
117            # raw command, expected output, comment
118            "0x0c 0x02",
119            "11 02",
120            "11 is Parameter revision, 02 is Configuration parameter data e.g. Cipher Suite Entry count",
121        ]
122    }
123}
124