-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fby3.5: hd: Add get card type command (#442)
Summary: - Add IPMI get card type OEM command(Netfn:0x38, cmd:0xA1). Pull Request resolved: #442 Test Plan: - Build code: PASS Reviewed By: williamspatrick Differential Revision: D38376162 Pulled By: garnermic fbshipit-source-id: 61d0f0ee8b7d045ef760aa123631d099f8d0e76e
- Loading branch information
1 parent
572428d
commit 95cc8e8
Showing
4 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
#ifndef PLAT_IPMI_H | ||
#define PLAT_IPMI_H | ||
|
||
enum REQ_GET_CARD_TYPE { | ||
GET_1OU_CARD_TYPE = 0x0, | ||
GET_2OU_CARD_TYPE, | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include "ipmi.h" | ||
#include "plat_ipmi.h" | ||
#include "plat_class.h" | ||
|
||
void OEM_1S_GET_CARD_TYPE(ipmi_msg *msg) | ||
{ | ||
if (msg == NULL) { | ||
printf("[%s] Failed due to parameter *msg is NULL\n", __func__); | ||
return; | ||
} | ||
|
||
if (msg->data_len != 1) { | ||
msg->completion_code = CC_INVALID_LENGTH; | ||
return; | ||
} | ||
|
||
CARD_STATUS _1ou_status = get_1ou_status(); | ||
CARD_STATUS _2ou_status = get_2ou_status(); | ||
switch (msg->data[0]) { | ||
case GET_1OU_CARD_TYPE: | ||
msg->data_len = 2; | ||
msg->completion_code = CC_SUCCESS; | ||
msg->data[0] = GET_1OU_CARD_TYPE; | ||
if (_1ou_status.present) { | ||
msg->data[1] = _1ou_status.card_type; | ||
} else { | ||
msg->data[1] = TYPE_1OU_ABSENT; | ||
} | ||
break; | ||
case GET_2OU_CARD_TYPE: | ||
msg->data_len = 2; | ||
msg->completion_code = CC_SUCCESS; | ||
msg->data[0] = GET_2OU_CARD_TYPE; | ||
if (_2ou_status.present) { | ||
msg->data[1] = _2ou_status.card_type; | ||
} else { | ||
msg->data[1] = TYPE_2OU_ABSENT; | ||
} | ||
break; | ||
default: | ||
msg->data_len = 0; | ||
msg->completion_code = CC_INVALID_DATA_FIELD; | ||
break; | ||
} | ||
|
||
return; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters