summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2014-11-26 00:44:48 +0000
committernp <np@FreeBSD.org>2014-11-26 00:44:48 +0000
commitbed3ddc44207cd1b879a8caff544720a11a21746 (patch)
tree508b735c7847b1aee64dc75534b7ccde3a8647bd /sys/dev
parent7230e71362ae2a3c943894b53dae6718344f1661 (diff)
downloadFreeBSD-src-bed3ddc44207cd1b879a8caff544720a11a21746.zip
FreeBSD-src-bed3ddc44207cd1b879a8caff544720a11a21746.tar.gz
MFC r274724:
cxgbe(4): figure out the max payload size and save it for later.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cxgbe/common/common.h1
-rw-r--r--sys/dev/cxgbe/t4_main.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h
index 7a88462..820354a 100644
--- a/sys/dev/cxgbe/common/common.h
+++ b/sys/dev/cxgbe/common/common.h
@@ -238,6 +238,7 @@ struct vpd_params {
struct pci_params {
unsigned int vpd_cap_addr;
+ unsigned int mps;
unsigned short speed;
unsigned short width;
};
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index c0c1d95..1d5b15d 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -590,6 +590,8 @@ t4_attach(device_t dev)
v = pci_read_config(dev, i + PCIER_DEVICE_CTL, 2);
v |= PCIEM_CTL_RELAXED_ORD_ENABLE;
pci_write_config(dev, i + PCIER_DEVICE_CTL, v, 2);
+
+ sc->params.pci.mps = 128 << ((v & PCIEM_CTL_MAX_PAYLOAD) >> 5);
}
sc->traceq = -1;
OpenPOWER on IntegriCloud