Force the 404-BT card (4 x 1G) to use the "uwire" configuration file.

MFC after:	3 days
This commit is contained in:
Navdeep Parhar 2013-01-26 03:10:28 +00:00
parent dfd1b3a02f
commit 1cdc889916
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245936
2 changed files with 12 additions and 4 deletions

View File

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

View File

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