aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2016-09-22 18:47:07 +0000
committerNavdeep Parhar <np@FreeBSD.org>2016-09-22 18:47:07 +0000
commitd4759c89e5e7872a75d2706406ca4a8aeec300db (patch)
tree1d1cf6349f1b6b8c0056cafa41f0c25e66f62958 /sys/dev
parent38d1af45cd51989e971b7e530a895fb82665ed11 (diff)
downloadsrc-d4759c89e5e7872a75d2706406ca4a8aeec300db.tar.gz
src-d4759c89e5e7872a75d2706406ca4a8aeec300db.zip
cxgbe(4): Catch up with the different layout of WHOAMI in T6.
Note that the code moved below t4_prep_adapter() as part of this change because now it needs a working chip_id().
Notes
Notes: svn path=/head/; revision=306206
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cxgbe/t4_main.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 76fa716c192f..0d80b2b7a836 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -812,15 +812,6 @@ t4_attach(device_t dev)
if (rc != 0)
goto done; /* error message displayed already */
- /*
- * This is the real PF# to which we're attaching. Works from within PCI
- * passthrough environments too, where pci_get_function() could return a
- * different PF# depending on the passthrough configuration. We need to
- * use the real PF# in all our communication with the firmware.
- */
- sc->pf = G_SOURCEPF(t4_read_reg(sc, A_PL_WHOAMI));
- sc->mbox = sc->pf;
-
memset(sc->chan_map, 0xff, sizeof(sc->chan_map));
/* Prepare the adapter for operation. */
@@ -832,6 +823,16 @@ t4_attach(device_t dev)
goto done;
}
+ /*
+ * This is the real PF# to which we're attaching. Works from within PCI
+ * passthrough environments too, where pci_get_function() could return a
+ * different PF# depending on the passthrough configuration. We need to
+ * use the real PF# in all our communication with the firmware.
+ */
+ j = t4_read_reg(sc, A_PL_WHOAMI);
+ sc->pf = chip_id(sc) <= CHELSIO_T5 ? G_SOURCEPF(j) : G_T6_SOURCEPF(j);
+ sc->mbox = sc->pf;
+
t4_init_devnames(sc);
if (sc->names == NULL) {
rc = ENOTSUP;