pdr: Sensor/Effecter support for fan fault leds

This is to support sensor/effecter pdrs for fan fault leds.

Testing Result:
Note: sensor/effecter ids may change in the testing result as
testing was done with reduced pdrs for simplicity. Also test
result only mentioned below for corner scenarios that is for
fan0 and fan5.

SENSORS:

pldmtool platform GetPDR -d 25 (fan0)
{
    "nextRecordHandle": 26,
    "responseCount": 27,
    "recordHandle": 25,
    "PDRHeaderVersion": 1,
    "PDRType": "State Sensor PDR",
    "recordChangeNumber": 0,
    "dataLength": 17,
    "PLDMTerminusHandle": 0,
    "sensorID": 6,
    "entityType": "0(OEM)",
    "entityInstanceNumber": 0,
    "containerID": 0,
    "sensorInit": "noInit",
    "sensorAuxiliaryNamesPDR": false,
    "compositeSensorCount": 1,
    "stateSetID[0]": "10",
    "possibleStatesSize[0]": 1,
    "possibleStates[0]": " 1 2"
}

fsn 0 Set On:
busctl set-property xyz.openbmc_project.LED.GroupManager
/xyz/openbmc_project/led/groups/fan0_fault
xyz.openbmc_project.Led.Group Asserted b true

pldmtool raw --data 0x80 0x02 0x21 0x06 0x00 0x01 0x00
Request Message:
08 01 80 02 21 06 00 01 00
Response Message:
08 01 00 02 21 00 01 00 01 00 01

fan0 Set Off:
busctl set-property xyz.openbmc_project.LED.GroupManager
/xyz/openbmc_project/led/groups/fan0_fault
xyz.openbmc_project.Led.Group Asserted b false

pldmtool raw --data 0x80 0x02 0x21 0x06 0x00 0x01 0x00
Request Message:
08 01 80 02 21 06 00 01 00
Response Message:
08 01 00 02 21 00 01 00 01 00 02

pldmtool platform GetPDR -d 30 (fan5)
{
    "nextRecordHandle": 31,
    "responseCount": 27,
    "recordHandle": 30,
    "PDRHeaderVersion": 1,
    "PDRType": "State Sensor PDR",
    "recordChangeNumber": 0,
    "dataLength": 17,
    "PLDMTerminusHandle": 0,
    "sensorID": 11,
    "entityType": "0(OEM)",
    "entityInstanceNumber": 0,
    "containerID": 0,
    "sensorInit": "noInit",
    "sensorAuxiliaryNamesPDR": false,
    "compositeSensorCount": 1,
    "stateSetID[0]": "10",
    "possibleStatesSize[0]": 1,
    "possibleStates[0]": " 1 2"
}

fan 5 Set On:
busctl set-property xyz.openbmc_project.LED.GroupManager
/xyz/openbmc_project/led/groups/fan5_fault
xyz.openbmc_project.Led.Group Asserted b true

pldmtool raw --data 0x80 0x02 0x21 0x0B 0x00 0x01 0x00
Request Message:
08 01 80 02 21 0b 00 01 00
Response Message:
08 01 00 02 21 00 01 00 01 00 01

fan5 Set Off:
busctl set-property xyz.openbmc_project.LED.GroupManager
/xyz/openbmc_project/led/groups/fan5_fault
xyz.openbmc_project.Led.Group Asserted b false

pldmtool raw --data 0x80 0x02 0x21 0x0B 0x00 0x01 0x00
Request Message:
08 01 80 02 21 0b 00 01 00
Response Message:
08 01 00 02 21 00 01 00 01 00 02

EFFECTER:

pldmtool platform GetPDR -d 34 (fan0)
{
    "nextRecordHandle": 35,
    "responseCount": 29,
    "recordHandle": 34,
    "PDRHeaderVersion": 1,
    "PDRType": "State Effecter PDR",
    "recordChangeNumber": 0,
    "dataLength": 19,
    "PLDMTerminusHandle": 1,
    "effecterID": 4,
    "entityType": "0(OEM)",
    "entityInstanceNumber": 0,
    "containerID": 0,
    "effecterSemanticID": 0,
    "effecterInit": "noInit",
    "effecterDescriptionPDR": false,
    "compositeEffecterCount": 1,
    "stateSetID[0]": "10",
    "possibleStatesSize[0]": 1,
    "possibleStates[0]": " 1 2"
}

fan0 Set On:
pldmtool raw -d 0x80 0x02 0x39 0x04 0x00 0x01 0x01 0x01
Request Message:
08 01 80 02 39 04 00 01 01 01
Response Message:
08 01 00 02 39 00

busctl get-property xyz.openbmc_project.Inventory.Manager
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
xyz.openbmc_project.State.Decorator.OperationalStatus Functional
b true

fan0 Set Off:
pldmtool raw -d 0x80 0x02 0x39 0x04 0x00 0x01 0x01 0x02
Request Message:
08 01 80 02 39 04 00 01 01 02
Response Message:
08 01 00 02 39 00

busctl get-property xyz.openbmc_project.Inventory.Manager
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0
xyz.openbmc_project.State.Decorator.OperationalStatus Functional
b false

pldmtool platform GetPDR -d 39 (fan5)
{
    "nextRecordHandle": 40,
    "responseCount": 29,
    "recordHandle": 39,
    "PDRHeaderVersion": 1,
    "PDRType": "State Effecter PDR",
    "recordChangeNumber": 0,
    "dataLength": 19,
    "PLDMTerminusHandle": 1,
    "effecterID": 9,
    "entityType": "0(OEM)",
    "entityInstanceNumber": 0,
    "containerID": 0,
    "effecterSemanticID": 0,
    "effecterInit": "noInit",
    "effecterDescriptionPDR": false,
    "compositeEffecterCount": 1,
    "stateSetID[0]": "10",
    "possibleStatesSize[0]": 1,
    "possibleStates[0]": " 1 2"
}

fan5 Set Off:
pldmtool raw -d 0x80 0x02 0x39 0x09 0x00 0x01 0x01 0x02
Request Message:
08 01 80 02 39 09 00 01 01 02
Response Message:
08 01 00 02 39 00

busctl get-property xyz.openbmc_project.Inventory.Manager
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5
xyz.openbmc_project.State.Decorator.OperationalStatus Functional
b false

fan5 Set On:
pldmtool raw -d 0x80 0x02 0x39 0x09 0x00 0x01 0x01 0x01
Request Message:
08 01 80 02 39 09 00 01 01 01
Response Message:
08 01 00 02 39 00

busctl get-property xyz.openbmc_project.Inventory.Manager
/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5
xyz.openbmc_project.State.Decorator.OperationalStatus Functional
b true

Signed-off-by: Jayashankar Padath <jayashankar.padath@in.ibm.com>
Change-Id: Id92230f55d788b008a80701a6108e41981b95aea
diff --git a/configurations/pdr/11.json b/configurations/pdr/11.json
index 753e23e..7ec51a6 100644
--- a/configurations/pdr/11.json
+++ b/configurations/pdr/11.json
@@ -375,6 +375,108 @@
         }]
     },
     {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0",
+        "effecters" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0",
+                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+                "property_name": "Functional",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan1",
+        "effecters" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan1",
+                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+                "property_name": "Functional",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan2",
+        "effecters" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan2",
+                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+                "property_name": "Functional",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan3",
+        "effecters" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan3",
+                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+                "property_name": "Functional",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan4",
+        "effecters" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan4",
+                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+                "property_name": "Functional",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5",
+        "effecters" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5",
+                "interface": "xyz.openbmc_project.State.Decorator.OperationalStatus",
+                "property_name": "Functional",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
        "type" : 45,
        "instance" : 0,
        "container" : 0,
@@ -391,7 +493,7 @@
                 "property_type": "string",
                 "property_values":[
                         "xyz.openbmc_project.State.Chassis.Transition.Off"
-  ]
+                ]
            }
        }]
     },
diff --git a/configurations/pdr/4.json b/configurations/pdr/4.json
index 9cba985..018b3cf 100644
--- a/configurations/pdr/4.json
+++ b/configurations/pdr/4.json
@@ -408,6 +408,108 @@
                 ]
              }
         }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan0",
+        "sensors" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/led/groups/fan0_fault",
+                "interface": "xyz.openbmc_project.Led.Group",
+                "property_name": "Asserted",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan1",
+        "sensors" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/led/groups/fan1_fault",
+                "interface": "xyz.openbmc_project.Led.Group",
+                "property_name": "Asserted",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan2",
+        "sensors" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/led/groups/fan2_fault",
+                "interface": "xyz.openbmc_project.Led.Group",
+                "property_name": "Asserted",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan3",
+        "sensors" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/led/groups/fan3_fault",
+                "interface": "xyz.openbmc_project.Led.Group",
+                "property_name": "Asserted",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan4",
+        "sensors" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/led/groups/fan4_fault",
+                "interface": "xyz.openbmc_project.Led.Group",
+                "property_name": "Asserted",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
+    },
+    {
+        "entity_path" : "/xyz/openbmc_project/inventory/system/chassis/motherboard/fan5",
+        "sensors" : [{
+            "set" : {
+                "id" : 10,
+                "size" : 1,
+                "states" : [1,2]
+            },
+            "dbus" : {
+                "path": "/xyz/openbmc_project/led/groups/fan5_fault",
+                "interface": "xyz.openbmc_project.Led.Group",
+                "property_name": "Asserted",
+                "property_type": "bool",
+                "property_values" : [true, false]
+             }
+        }]
     }]
   }]
 }