diff options
author | kmacy <kmacy@FreeBSD.org> | 2007-09-10 00:59:51 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2007-09-10 00:59:51 +0000 |
commit | 495285abf0a922aa3f28157a917bd105f1b70cc3 (patch) | |
tree | 4afd6d8917e0c34ee77ce94f5aca89f411ca6bf1 | |
parent | 16614f83a02ff04ff50789782e884d690ccbb78b (diff) | |
download | FreeBSD-src-495285abf0a922aa3f28157a917bd105f1b70cc3.zip FreeBSD-src-495285abf0a922aa3f28157a917bd105f1b70cc3.tar.gz |
pull in changes made to RELENG_6 version in the process of doing the MFC
Supported by: Chelsio
Approved by: re (blanket)
-rw-r--r-- | sys/dev/cxgb/cxgb_adapter.h | 3 | ||||
-rw-r--r-- | sys/dev/cxgb/cxgb_include.h | 4 | ||||
-rw-r--r-- | sys/dev/cxgb/cxgb_main.c | 40 | ||||
-rw-r--r-- | sys/dev/cxgb/cxgb_offload.h | 15 | ||||
-rw-r--r-- | sys/dev/cxgb/cxgb_osdep.h | 3 |
5 files changed, 36 insertions, 29 deletions
diff --git a/sys/dev/cxgb/cxgb_adapter.h b/sys/dev/cxgb/cxgb_adapter.h index 6f33527..90a5e74 100644 --- a/sys/dev/cxgb/cxgb_adapter.h +++ b/sys/dev/cxgb/cxgb_adapter.h @@ -35,9 +35,6 @@ $FreeBSD$ #ifndef _CXGB_ADAPTER_H_ #define _CXGB_ADAPTER_H_ -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - #include <sys/lock.h> #include <sys/mutex.h> #include <sys/sx.h> diff --git a/sys/dev/cxgb/cxgb_include.h b/sys/dev/cxgb/cxgb_include.h index c4eb5ad..bbb0f7a 100644 --- a/sys/dev/cxgb/cxgb_include.h +++ b/sys/dev/cxgb/cxgb_include.h @@ -10,8 +10,8 @@ #include <cxgb_offload.h> #include <common/cxgb_regs.h> #include <common/cxgb_t3_cpl.h> -#include <dev/cxgb/common/cxgb_ctl_defs.h> -#include <dev/cxgb/common/cxgb_sge_defs.h> +#include <common/cxgb_ctl_defs.h> +#include <common/cxgb_sge_defs.h> #include <common/cxgb_firmware_exports.h> #include <sys/mvec.h> #include <ulp/toecore/toedev.h> diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 4394ff7..adf0d03 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -387,16 +387,21 @@ cxgb_controller_attach(device_t dev) device_t child; const struct adapter_info *ai; struct adapter *sc; - int i, reg, error = 0; + int i, error = 0; uint32_t vers; int port_qsets = 1; #ifdef MSI_SUPPORTED - int msi_needed; + int msi_needed, reg; #endif sc = device_get_softc(dev); sc->dev = dev; sc->msi_count = 0; - + ai = cxgb_get_adapter_info(dev); + + /* + * XXX not really related but a recent addition + */ +#ifdef MSI_SUPPORTED /* find the PCIe link width and set max read request to 4KB*/ if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { uint16_t lnk, pectl; @@ -408,14 +413,13 @@ cxgb_controller_attach(device_t dev) pci_write_config(dev, reg + 0x8, pectl, 2); } - ai = cxgb_get_adapter_info(dev); if (sc->link_width != 0 && sc->link_width <= 4 && (ai->nports0 + ai->nports1) <= 2) { device_printf(sc->dev, "PCIe x%d Link, expect reduced performance\n", sc->link_width); } - +#endif touch_bars(dev); pci_enable_busmaster(dev); /* @@ -1331,7 +1335,12 @@ bind_qsets(adapter_t *sc) static void update_tpeeprom(struct adapter *adap) { +#ifdef FIRMWARE_LATEST const struct firmware *tpeeprom; +#else + struct firmware *tpeeprom; +#endif + char buf[64]; uint32_t version; unsigned int major, minor; @@ -1387,7 +1396,11 @@ release_tpeeprom: static int update_tpsram(struct adapter *adap) { +#ifdef FIRMWARE_LATEST const struct firmware *tpsram; +#else + struct firmware *tpsram; +#endif char buf[64]; int ret; char rev; @@ -1827,7 +1840,7 @@ cxgb_start_tx(struct ifnet *ifp, uint32_t txmax) struct sge_qset *qs; struct sge_txq *txq; struct port_info *p = ifp->if_softc; - struct mbuf *m0, *m = NULL; + struct mbuf *m = NULL; int err, in_use_init, free; if (!p->link_config.link_ok) @@ -1856,20 +1869,8 @@ cxgb_start_tx(struct ifnet *ifp, uint32_t txmax) * Convert chain to M_IOVEC */ KASSERT((m->m_flags & M_IOVEC) == 0, ("IOVEC set too early")); +#ifdef notyet m0 = m; -#ifdef INVARIANTS - /* - * Clean up after net stack sloppiness - * before calling m_sanity - */ - m0 = m->m_next; - while (m0) { - m0->m_flags &= ~M_PKTHDR; - m0 = m0->m_next; - } - m_sanity(m0, 0); - m0 = m; -#endif if (collapse_mbufs && m->m_pkthdr.len > MCLBYTES && m_collapse(m, TX_MAX_SEGS, &m0) == EFBIG) { if ((m0 = m_defrag(m, M_NOWAIT)) != NULL) { @@ -1879,6 +1880,7 @@ cxgb_start_tx(struct ifnet *ifp, uint32_t txmax) break; } m = m0; +#endif if ((err = t3_encap(p, &m, &free)) != 0) break; BPF_MTAP(ifp, m); diff --git a/sys/dev/cxgb/cxgb_offload.h b/sys/dev/cxgb/cxgb_offload.h index 62ecfa8..adfffa6 100644 --- a/sys/dev/cxgb/cxgb_offload.h +++ b/sys/dev/cxgb/cxgb_offload.h @@ -33,12 +33,17 @@ $FreeBSD$ #ifndef _CXGB_OFFLOAD_H #define _CXGB_OFFLOAD_H - -#include <dev/cxgb/common/cxgb_tcb.h> +#ifdef CONFIG_DEFINED +#include <common/cxgb_version.h> +#include <cxgb_config.h> +#include <cxgb_l2t.h> +#include <common/cxgb_tcb.h> +#else +#include <dev/cxgb/common/cxgb_version.h> +#include <dev/cxgb/cxgb_config.h> #include <dev/cxgb/cxgb_l2t.h> - -#include <dev/cxgb/ulp/toecore/toedev.h> -#include <dev/cxgb/common/cxgb_t3_cpl.h> +#include <dev/cxgb/common/cxgb_tcb.h> +#endif struct adapter; struct cxgb_client; diff --git a/sys/dev/cxgb/cxgb_osdep.h b/sys/dev/cxgb/cxgb_osdep.h index b866656..c2d41c0 100644 --- a/sys/dev/cxgb/cxgb_osdep.h +++ b/sys/dev/cxgb/cxgb_osdep.h @@ -81,6 +81,9 @@ struct t3_mbuf_hdr { #define TSO_SUPPORTED #define VLAN_SUPPORTED #define TASKQUEUE_CURRENT +#else +#define if_name(ifp) (ifp)->if_xname +#define M_SANITY(m, n) #endif #define __read_mostly __attribute__((__section__(".data.read_mostly"))) |