From f1a0cd859f47c11a1a634e30dba0d9cfc9d120bf Mon Sep 17 00:00:00 2001 From: Grant Mackey Date: Mon, 22 Apr 2024 19:14:56 -0700 Subject: [PATCH] qemu support code added --- Makefile | 2 +- fmapi_handler.c | 22 +++++++++++----------- main.c | 4 ++-- options.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index dae3ee0..c617cdd 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ LOCAL_INCLUDE_DIR?=./include LOCAL_LIB_DIR?=./lib INCLUDE_PATH=-I $(LOCAL_INCLUDE_DIR) -I $(INCLUDE_DIR) -I /usr/include/glib-2.0 -I /usr/lib/`uname -m`-linux-gnu/glib-2.0/include/ -I /usr/lib64/glib-2.0/include LIB_PATH=-L $(LOCAL_LIB_DIR) -L $(LIB_DIR) -LIBS=-l mctp -l fmapi -l emapi -l ptrqueue -l arrayutils -l uuid -l timeutils -l cxlstate -l pciutils +LIBS=-l mctp -l fmapi -l emapi -l ptrqueue -l arrayutils -l uuid -l timeutils -l cxlstate -l pciutils -l pci TARGET=jack all: $(TARGET) diff --git a/fmapi_handler.c b/fmapi_handler.c index 0e27a9e..ab7f42b 100644 --- a/fmapi_handler.c +++ b/fmapi_handler.c @@ -231,10 +231,10 @@ void print_ports(struct fmapi_psc_port_rsp *o) sprintf(&buf[i], "-"); else { - if ((p->nlw >> 0) == 0) + if (p->nlw == 0) sprintf(&buf[i], "%d", p->mlw); else - sprintf(&buf[i], "%d", p->nlw >> 4); + sprintf(&buf[i], "%d", p->nlw); } i += (cols[k++].width + 2); @@ -254,7 +254,7 @@ void print_ports(struct fmapi_psc_port_rsp *o) sprintf(&buf[i], "-"); else { - char c = '0'; + char c = '1'; for ( int v = 0 ; v < 8 ; v++ ) { if ((p->speeds >> v) & 0x01) @@ -701,11 +701,11 @@ int fmapi_handler(struct mctp *m, struct mctp_msg *mr, struct mctp_msg *mm) struct fmapi_isc_id_rsp *o = &rsp.obj.isc_id_rsp; printf("Show Identity:\n"); - printf("PCIe Vendor ID: 0x%x\n", o->vid); - printf("PCIe Device ID: 0x%x\n", o->did); - printf("PCIe Subsystem Vendor ID: 0x%x\n", o->svid); - printf("PCIe Subsystem ID: 0x%x\n", o->ssid); - printf("SN: 0x%llx\n", o->sn); + printf("PCIe Vendor ID: 0x%04x\n", o->vid); + printf("PCIe Device ID: 0x%04x\n", o->did); + printf("PCIe Subsystem Vendor ID: 0x%04x\n", o->svid); + printf("PCIe Subsystem ID: 0x%04x\n", o->ssid); + printf("SN: 0x%016llx\n", o->sn); printf("Max Msg Size n of 2^n: %d - %d B\n", o->size, 1 << o->size); } break; @@ -766,7 +766,7 @@ int fmapi_handler(struct mctp *m, struct mctp_msg *mr, struct mctp_msg *mm) case FMOP_PSC_CFG: { struct fmapi_psc_cfg_rsp *o = &rsp.obj.psc_cfg_rsp; - printf("Data: 0x%02x%02x%02x%02x\n", o->data[0], o->data[1], o->data[2], o->data[3]); + printf("Data: 0x%02x%02x%02x%02x\n", o->data[3], o->data[2], o->data[1], o->data[0]); } break; @@ -836,7 +836,7 @@ int fmapi_handler(struct mctp *m, struct mctp_msg *mr, struct mctp_msg *mm) { if (rsp.hdr.return_code == FMRC_BACKGROUND_OP_STARTED) { - printf("Bind operation started in the background\n"); + //printf("Bind operation started in the background\n"); } } break; @@ -845,7 +845,7 @@ int fmapi_handler(struct mctp *m, struct mctp_msg *mr, struct mctp_msg *mm) { if (rsp.hdr.return_code == FMRC_BACKGROUND_OP_STARTED) { - printf("Unbind operation started in the background\n"); + //printf("Unbind operation started in the background\n"); } } break; diff --git a/main.c b/main.c index 95c7972..450e47b 100644 --- a/main.c +++ b/main.c @@ -272,8 +272,8 @@ void run(struct mctp *m) goto end; // Initialize cached copy of remote switch state - if (opts[CLOP_NO_INIT].set == 0) - init_switch(m); + //if (opts[CLOP_NO_INIT].set == 0) + // init_switch(m); if (opts[CLOP_CMD].val == CLCM_LIST) list(m); diff --git a/options.c b/options.c index 4c02b8f..9daf11c 100644 --- a/options.c +++ b/options.c @@ -108,7 +108,7 @@ static int pr_set_qos_limit(int key, char *arg, struct argp_state *state); */ struct opt *opts; -const char *argp_program_version = "version 0.1"; +const char *argp_program_version = "version 0.2"; const char *argp_program_bug_address = "code@jrlabs.io"; /**