diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 219bab460309..55cfa52cc2e0 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -577,7 +577,8 @@ struct adapter { int flags; char fw_version[32]; - unsigned int cfcsum; + char cfg_file[32]; + u_int cfcsum; struct adapter_params params; struct t4_virt_res vres; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index a2fd014a936e..c28b75f27d91 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -1604,21 +1604,28 @@ prep_firmware(struct adapter *sc) /* Partition adapter resources as specified in the config file. */ if (sc->flags & MASTER_PF) { - if (strncmp(t4_cfg_file, "default", sizeof(t4_cfg_file))) { + snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", + pci_get_device(sc->dev) == 0x440a ? "uwire" : t4_cfg_file); + if (strncmp(sc->cfg_file, "default", sizeof(sc->cfg_file))) { char s[32]; - snprintf(s, sizeof(s), "t4fw_cfg_%s", t4_cfg_file); + snprintf(s, sizeof(s), "t4fw_cfg_%s", sc->cfg_file); cfg = firmware_get(s); if (cfg == NULL) { device_printf(sc->dev, "unable to locate %s module, " "will use default config file.\n", s); + snprintf(sc->cfg_file, sizeof(sc->cfg_file), + "%s", "default"); } } rc = partition_resources(sc, cfg ? cfg : default_cfg); if (rc != 0) goto done; /* error message displayed already */ + } else { + snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", "notme"); + sc->cfcsum = (u_int)-1; } sc->flags |= FW_OK; @@ -3109,7 +3116,7 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RD, &sc->fw_version, 0, "firmware version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "cf", - CTLFLAG_RD, &t4_cfg_file, 0, "configuration file"); + CTLFLAG_RD, &sc->cfg_file, 0, "configuration file"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cfcsum", CTLFLAG_RD, &sc->cfcsum, 0, "config file checksum");