Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2014 20:16:56 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r274724 - in head/sys/dev/cxgbe: . common
Message-ID:  <201411192016.sAJKGuQd087036@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Wed Nov 19 20:16:56 2014
New Revision: 274724
URL: https://svnweb.freebsd.org/changeset/base/274724

Log:
  cxgbe(4): figure out the max payload size and save it for later.
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/common/common.h
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/common/common.h
==============================================================================
--- head/sys/dev/cxgbe/common/common.h	Wed Nov 19 19:46:58 2014	(r274723)
+++ head/sys/dev/cxgbe/common/common.h	Wed Nov 19 20:16:56 2014	(r274724)
@@ -238,6 +238,7 @@ struct vpd_params {
 
 struct pci_params {
 	unsigned int vpd_cap_addr;
+	unsigned int mps;
 	unsigned short speed;
 	unsigned short width;
 };

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Wed Nov 19 19:46:58 2014	(r274723)
+++ head/sys/dev/cxgbe/t4_main.c	Wed Nov 19 20:16:56 2014	(r274724)
@@ -594,6 +594,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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411192016.sAJKGuQd087036>