Content-Type: multipart/mixed; boundary="===============5503154820606504438==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH v1 6/6] accel-config: Call new op_cap API in json implementation Date: Fri, 07 May 2021 15:31:26 -0400 Message-ID: <20210507193126.841998-7-ramesh.thomas@intel.com> In-Reply-To: 20210507193126.841998-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============5503154820606504438== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas Call the new op_cap API that supports 256 bits to populate json objects used in listing and saving the op_cap value. Signed-off-by: Ramesh Thomas --- util/json.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/util/json.c b/util/json.c index e6e12e4..4fb43d2 100644 --- a/util/json.c +++ b/util/json.c @@ -131,6 +131,7 @@ struct json_object *util_device_to_json(struct accfg_de= vice *device, struct json_object *jdevice =3D json_object_new_object(); struct json_object *jobj; struct accfg_error *error; + struct accfg_op_cap op_cap; enum accfg_device_state dev_state; int int_val; uint64_t ulong_val; @@ -228,6 +229,19 @@ struct json_object *util_device_to_json(struct accfg_d= evice *device, json_object_object_add(jdevice, "errors", jobj); } = + if (!accfg_device_get_op_cap(device, &op_cap)) { + jobj =3D json_object_new_array(); + if (!jobj) + goto err; + for (int i =3D 0; i < 4; i++) { + struct json_object *json_oc; + + json_oc =3D util_json_object_hex(op_cap.bits[i], flags); + json_object_array_add(jobj, json_oc); + } + json_object_object_add(jdevice, "op_cap", jobj); + } + jobj =3D util_json_object_hex(accfg_device_get_gen_cap(device), flags); if (!jobj) goto err; -- = 2.26.3 --===============5503154820606504438==--