Skip to content

Commit

Permalink
Added Ipmi Threshold sensor APIs and their NULL implementation (#564)
Browse files Browse the repository at this point in the history
# Preface

Please ensure you have read the [contribution
docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request
guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

Added Ipmi Threshold sensor APIs and their NULL implementation in a new
file IpmiCommandLibNetFnSensor.c under MdeModulePkg

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [x] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [ ] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Verified CI build is successful

## Integration Instructions

---------

Co-authored-by: Aaron <[email protected]>
  • Loading branch information
v-bhavanisu and apop5 authored Sep 14, 2023
1 parent b8d1786 commit 4a6dc60
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
36 changes: 36 additions & 0 deletions MdeModulePkg/Include/Library/IpmiCommandLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -680,4 +680,40 @@ IpmiGetSdr (
IN OUT UINT32 *GetSdrResponseSize
);

// MU_CHANGE [BEGIN]

/**
Send the Set Sensor Threshold command for a specified SensorNumber
@param[in] SetSensorThresholdRequestData The filled out Set Sensor Threshold command structure
@param[out] CompletionCode Pointer to a buffer for returning the completion code
@retval EFI_SUCCESS Setting Sensor Threshold command structure successful
@retval EFI_INVALID_PARAMETER Unable to set threshold command for this sensor
**/
EFI_STATUS
EFIAPI
IpmiSetSensorThreshold (
IN IPMI_SENSOR_SET_SENSOR_THRESHOLD_REQUEST_DATA *SetSensorThresholdRequestData,
OUT UINT8 *CompletionCode
);

/**
Query the threshold data of the specified SensorNumber.
@param[in] SensorNumber The unique identifier of the sensor being queried.
@param[out] GetSensorThresholdResponse Pointer to a buffer for returning the threshold response data.
@retval EFI_SUCCESS Getting Sensor Threshold response data successful
@retval EFI_INVALID_PARAMETER Unable to get threshold data for this sensor
**/
EFI_STATUS
EFIAPI
IpmiGetSensorThreshold (
IN UINT8 SensorNumber,
OUT IPMI_SENSOR_GET_SENSOR_THRESHOLD_RESPONSE_DATA *GetSensorThresholdResponse
);

// MU_CHANGE [END]

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
IpmiCommandLibNetFnTransport.c
IpmiCommandLibNetFnChassis.c
IpmiCommandLibNetFnStorage.c
IpmiCommandLibNetFnSensor.c # MU_CHANGE

[Packages]
MdePkg/MdePkg.dec
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/** @file
IPMI Command - NetFnSensor NULL instance library.
Copyright (c) Microsoft Corporation
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include <Uefi.h>
#include <IndustryStandard/Ipmi.h>

/**
* Send the Set Sensor Threshold command for a specified SensorNumber
*
* @param[in] SetSensorThresholdRequestData The filled out Set Sensor Threshold command structure
* @param[out] CompletionCode Pointer to a buffer for returning the completion code
*
* @retval EFI_UNSUPPORTED Unsupported in the NULL lib.
*/
EFI_STATUS
EFIAPI
IpmiSetSensorThreshold (
IN IPMI_SENSOR_SET_SENSOR_THRESHOLD_REQUEST_DATA *SetSensorThresholdRequestData,
OUT UINT8 *CompletionCode
)
{
return RETURN_UNSUPPORTED;
}

/**
* Query the threshold data of the specified SensorNumber.
*
* @param[in] SensorNumber The unique identifier of the sensor being queried.
* @param[out] GetSensorThresholdResponse Pointer to a buffer for returning the threshold response data.
*
* @retval EFI_UNSUPPORTED Unsupported in the NULL lib.
*/
EFI_STATUS
EFIAPI
IpmiGetSensorThreshold (
IN UINT8 SensorNumber,
OUT IPMI_SENSOR_GET_SENSOR_THRESHOLD_RESPONSE_DATA *GetSensorThresholdResponse
)
{
return RETURN_UNSUPPORTED;
}

0 comments on commit 4a6dc60

Please sign in to comment.