aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Delevoryas <pdel@fb.com>2021-12-02 21:20:56 -0800
committerPeter Delevoryas <pdel@fb.com>2022-05-11 16:01:06 -0700
commita3efc04dbeee57a6857adf7597bdb7f1c44fb288 (patch)
tree121f6566ef89e23c64243f9d391bfd52f799d83f
parent5025b871c36fd5b9daf3085f0a8c73d7d34c692d (diff)
downloadslirp-a3efc04dbeee57a6857adf7597bdb7f1c44fb288.zip
slirp-a3efc04dbeee57a6857adf7597bdb7f1c44fb288.tar.gz
slirp-a3efc04dbeee57a6857adf7597bdb7f1c44fb288.tar.bz2
ncsi: Add Get Version ID command
Get Version ID is one of the first commands used in NC-SI, because BMC's use a lot of OEM NC-SI extensions, and you need to query the device's manufacturer through Get Version ID before you can decide which OEM NC-SI extensions to use. The response format is documented in the NC-SI spec[1]. We're just setting the NC-SI version supported to 1.0.0 (BCD-encoded[2]) and returning the manufacturer's ID in network byte-order. [1] https://www.dmtf.org/sites/default/files/standards/documents/DSP0222_1.0.0.pdf [2] https://en.wikipedia.org/wiki/Binary-coded_decimal Signed-off-by: Peter Delevoryas <pdel@fb.com>
-rw-r--r--src/ncsi.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/ncsi.c b/src/ncsi.c
index e556193..5bf731b 100644
--- a/src/ncsi.c
+++ b/src/ncsi.c
@@ -55,6 +55,17 @@ static uint32_t ncsi_calculate_checksum(uint8_t *data, int len)
return checksum;
}
+/* Get Version ID */
+static int ncsi_rsp_handler_gvi(Slirp *slirp, struct ncsi_rsp_pkt_hdr *rnh)
+{
+ struct ncsi_rsp_gvi_pkt *rsp = (struct ncsi_rsp_gvi_pkt *)rnh;
+
+ rsp->ncsi_version = htonl(0xF1F0F000);
+ rsp->mf_id = htonl(slirp->mfr_id);
+
+ return 0;
+}
+
/* Get Capabilities */
static int ncsi_rsp_handler_gc(Slirp *slirp, struct ncsi_rsp_pkt_hdr *rnh)
{
@@ -117,7 +128,7 @@ static const struct ncsi_rsp_handler {
{ NCSI_PKT_RSP_EGMF, 4, NULL },
{ NCSI_PKT_RSP_DGMF, 4, NULL },
{ NCSI_PKT_RSP_SNFC, 4, NULL },
- { NCSI_PKT_RSP_GVI, 40, NULL },
+ { NCSI_PKT_RSP_GVI, 40, ncsi_rsp_handler_gvi },
{ NCSI_PKT_RSP_GC, 32, ncsi_rsp_handler_gc },
{ NCSI_PKT_RSP_GP, 40, ncsi_rsp_handler_gp },
{ NCSI_PKT_RSP_GCPS, 172, NULL },