qemu support code added

This commit is contained in:
Grant Mackey 2024-04-22 19:14:56 -07:00
parent feed7a2137
commit f1a0cd859f
4 changed files with 15 additions and 15 deletions

View File

@ -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)

View File

@ -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;

4
main.c
View File

@ -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);

View File

@ -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";
/**